Skip to content

suspended/javascript-sdk

 
 

Repository files navigation

bnc-web-lib

Binance Chain JavaScript API

Usage

yarn add @binance/bnc-web-lib -S --registry https://npm-registry.fdgahl.cn

API

crypto

generate privatekey, address, keystore, mneonic

const privateKey = crypto.generatePrivateKey();

const address = crypto.getAddressFromPrivateKey(privateKey);

const keyStore = crypto.generateKeyStore(privateKey, password);

const mneonic = crypto.getMnemonicFromPrivateKey(privateKey);
                crypto.generateMnemonic();//24

recover privatekey, address from keystore, mneonic

const privateKey = crypto.getPrivateKeyFromKeyStore(keystore, password);

const privateKey = crypto.getPrivateKeyFromMnemonic(mnemonic);

const address = crypto.getAddressFromPrivateKey(privateKey);

amino (js-amino)

Read go-amino

serialize object to hex string which compatible with go-amino

amino.marshalBinary(data)

amino.marshalBinaryBare(data);

BncClient

  • every tx has a specified type and encode prefix

  • supported type and prefix:

    type name prefix
    MsgSend transfer 2A2C87FA
    NewOrderMsg placeOrder CE6DC043
    CancelOrderMsg cancelOrder 166E681B

About

Javascript SDK to communicate with Binance Chain.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.2%
  • Other 0.8%