OSDN Git Service

big boom
[bytom/Bytom-JS-SDK.git] / src / index.js
1 import keysApi from "./api/keys.js";
2 import accountsApi from "./api/accounts.js";
3 import transactionsApi from "./api/transactions.js";
4 import keysSDK from "./sdk/keys.js";
5 import accountsSDK from "./sdk/accounts.js";
6 import http from "./http.js";
7
8 //todo vue use
9 function Bytom(serverHost, wasmPath, baseURL, token) {
10     this.install = function(Vue, options) {
11         Vue.prototype.$Bytom = this;
12     };
13     
14     if(baseURL) {
15         this.http = new http(baseURL, token);
16
17         this.keys = new keysApi(this.http);
18         this.accounts = new accountsApi(this.http);
19         this.transactions = new transactionsApi(this.http);
20     }
21
22     Bytom.wasmPath = wasmPath;
23     this.sdk = {};
24     this.sdk.keys = new keysSDK();
25     this.sdk.accounts = new accountsSDK();
26 }
27
28 export default Bytom;