1
0
mirror of https://github.com/Bytom/Bytom-JS-SDK.git synced 2020-06-03 17:14:19 +00:00
It is a project for Bytom Chrome extension JS SDK https://bytom.github.io/Bytom-JS-SDK
Go to file
2019-11-29 14:28:32 +08:00
docs update transactions 2019-11-29 14:28:32 +08:00
src update transactions 2019-11-29 14:28:32 +08:00
.eslintrc.js eslint and sign transaction api 2018-10-11 00:44:27 +08:00
.gitignore Add the doc page. 2019-04-18 14:49:56 +08:00
jsdoc.conf.json Add the doc page. 2019-04-18 14:49:56 +08:00
package-lock.json update the blockcenter js api. 2019-04-29 10:29:55 +08:00
package.json update the blockcenter js api. 2019-04-29 10:29:55 +08:00
README.md Add the doc page. 2019-04-18 14:49:56 +08:00

Bytom-JS-SDK

npm version

Install

npm install bytom-js-sdk

Use

let net = {
    main: "http://main-net-host/",
    test: "http://test-net-host/"
};
let bytom = new Bytom(net, chrome.runtime.getURL("main.wasm"));

//set Bytom net type (main test), default main net.
bytom.setNetType('test');
console.log(bytom.getNetType());

//create key
bytom.sdk.keys.create("test_alias", "123456").then((res)=>{
    console.log(res)
}).catch(error => {
    console.log(error)
});

WebAssembly build

Project depends on WebAssembly.
See Bytom-WebAssembly.