A BenchCore API wrapper, written in TypeScript to interact with BenchCore rootchains and sidechains.
benchcore-api
is a library client designed to facilitate how you interact with BenchCore RootChains and SideChains.
- TypeScript is is a superset of JavaScript which mainly offers optional static typing, classes, and interfaces. The learning curve is not that steep.
- Types are optional,
benchcore-api
compiles into ES5 so you can work with both, ECMAScript or TypeScript. - A better development experience, including auto-complete and fully documented.
API documentation is hosted on GitHub Pages, and is generated from TypeDoc.
benchcore-api is avaliable from npm
.
yarn add benchcore-api
or
npm i benchcore-api --save
For the best TypeScript experience, you should either use Visual Studio Code, or a plug-in for your favorite text editor.
Get delegate list from Dexnet network.
import { Client, Network, NetworkType } from 'benchcore-api';
const dexnet = Network.getDefault(NetworkType.Dexnet);
const client = new Client(dexnet);
client.delegate.list().subscribe((list) => {
console.log(list);
});
Get address from passphrase.
import { PrivateKey } from 'benchcore-api/core';
// if no specify a second param, default is bench
const key = PrivateKey.fromSeed('again sell dizzy shoes stumble bonus salt two exhibit slender romance fade');
console.log(key.getPublicKey().getAddress()); // BAfYEq6hRSMwV2yx45M1bpNx5KgdPyVBZW
For more examples please see documentation or look for tests in each directory.
npm run test
Jared Rice Sr. - @jaredricesr; Lúcio Rubens - @luciorubeens;
BenchCore API (benchcore-api
) is licensed under the MIT License - see the LICENSE file for details.