Skip to content
Wallet for Binance chain powered by two-party ECDSA
TypeScript JavaScript
Branch: master
Clone or download
Latest commit c5e866f Jun 12, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
demo Websockets support (#4) Jun 12, 2019
src Websockets support (#4) Jun 12, 2019
test Websockets support (#4) Jun 12, 2019
.gitignore
.npmignore add asset as optional parameter in demo (#1) May 30, 2019
LICENSE initial commit May 16, 2019
README.md Update README.md Jun 6, 2019
package.json v0.2.1 Jun 12, 2019
tsconfig.json initial commit May 16, 2019

README.md

Binance chain threshold wallet

Binance chain wallet powered by two-party ECDSA.
Soon to be integrated into the ZenGo iOS wallet (www.zengo.com)

Installation:

$ npm install @kzen-networks/binance-thresh-wallet

Usage:

Server (acts as the co-signer in the two-party signing protocol):

const { BncThreshSigServer} = require('@kzen-networks/binance-thresh-wallet');
const server = new BncThreshSigServer();
server.launch();

Client:

const { BncThreshSigClient } = require('@kzen-networks/binance-thresh-wallet');

(async () => {
    const client = new BncThreshSigClient();
    
    // initialize
    await client.init();
    
    const address = client.getAddress();
    console.log(address);
    // tbnb1zaudxtp40f6w3vgjmxqpxjaxfa7mt09t5x0h2s
    
    /* Now you should deposit BNB into this address */

    console.log(await client.getBalance());
    // [{"free":"0.09244000","frozen":"0.00000000","locked":"0.00000000","symbol":"BNB"}]

    const toAddress = client.getAddress(1);  // new address
    console.log(toAddress);
    // tbnb1glzdlqt70uk7qw8e7jy7u708emfhe9qsdwxhc5

    console.log(await client.transfer(address, toAddress, 0.00123, 'BNB', 'demo!'));
    // {"result":[{"code":0,"hash":"DD505FB142B473471D969BA278E82548BEDD637FEC3A3ED6350408B34A74DB9E","height":"","log":"Msg 0: ","ok":true}],"status":200}
})();

Demo:

You can also use a demo using the command line.
Server:

$ demo/server

Client:

$ demo/client --help

Usage: client [options] [command]

Options:
  -h, --help                               output usage information

Commands:
  address [options]
  balance <address>
  transfer [options] <from> <to> <amount>
  buy_order <symbol> <price> <quantity>
  sell_order <symbol> <price> <quantity>
  cancel_order <symbol> <ref_id>

Transfer demo:

Transfer demo

Trade Demo:

Trade demo

Contact

Feel free to reach out or join the KZen Research Telegram for discussions on code and research.

You can’t perform that action at this time.