Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @namnh270/g8c-sdk-test with all npm packages installed. Try it out:

var g8cSdkTest = require("@namnh270/g8c-sdk-test")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@namnh270/g8c-sdk-test v0.1.0

SDK for G8C blockchain

SDK

SDK for G8C Blockchain

Documents

Installation

npm install G8C-sdk

Usage

const G8CSdk = require('G8C-sdk');

API

SDK

createSendTx (from, to, amount, privateKey)

Utils

validateAddress(address)
validateBlock(height)
validateTxHash(hash)
isInt(n)
isUint(n)
fromG8C(G8C)
toG8C(amount)
subtraction(a,b)
bigNumToString(val,base)
encodeUtf8(text)
decode(buf)

API

getBlock (height)
getTransaction (txHash)
getAccountDetail (address)
getGetHistoryTransaction ({address, page, limit})
sendTransaction (tx)

Wallet

generateWallet(walletName, password)
verifyTransaction(tx)
encryptWallet(privateKey, password)
decryptWallet(cipherText, password)
restoreWallet(mnemonic, walletName, password)
getAddressFromPublicKey(publicKey)
createTx(from, to, amount, sequence, CHAINID)

License

MIT

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free