OSDN Git Service

update selection
[bytom/Bytom-JS-SDK.git] / README.md
index e9abb78..e8587e1 100644 (file)
--- a/README.md
+++ b/README.md
@@ -1,16 +1,27 @@
-# bytom-js-sdk
+# Bytom-JS-SDK
+[![npm version](https://img.shields.io/npm/v/bytom-js-sdk.svg?style=flat-square)](https://www.npmjs.com/package/bytom-js-sdk)
 
-## install
+## Install
 
 ``` bash
 npm install bytom-js-sdk
 ```
 
+## Use
+
 ```javascript
-let bytom = new Bytom("http://52.82.24.155:3000/", chrome.runtime.getURL("main.wasm"));
+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("test666", "123456").then((res)=>{
+bytom.sdk.keys.create("test_alias", "123456").then((res)=>{
     console.log(res)
 }).catch(error => {
     console.log(error)
@@ -20,4 +31,4 @@ bytom.sdk.keys.create("test666", "123456").then((res)=>{
 ## WebAssembly build
 
 Project depends on WebAssembly. \
-[Bytom-WebAssembly](https://github.com/Bytom-Community/Bytom-WebAssembly)
\ No newline at end of file
+See [Bytom-WebAssembly](https://github.com/oysheng/Bytom-WebAssembly).
\ No newline at end of file