@xelis/sdk 0.6.1 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/create_esm_pkg.js +13 -0
- package/dist/cjs/config.js +38 -0
- package/dist/cjs/daemon/rpc.js +143 -0
- package/dist/cjs/daemon/types.js +74 -0
- package/dist/cjs/daemon/websocket.js +236 -0
- package/dist/cjs/lib/rpc.js +89 -0
- package/dist/cjs/lib/types.js +2 -0
- package/dist/cjs/lib/websocket.js +283 -0
- package/dist/cjs/react/daemon.js +176 -0
- package/dist/cjs/wallet/rpc.js +131 -0
- package/dist/cjs/wallet/types.js +29 -0
- package/dist/cjs/wallet/websocket.js +92 -0
- package/dist/cjs/xswd/types.js +9 -0
- package/dist/cjs/xswd/websocket.js +38 -0
- package/dist/esm/config.js +35 -0
- package/dist/esm/daemon/rpc.js +140 -0
- package/{daemon → dist/esm/daemon}/types.js +13 -3
- package/dist/esm/daemon/websocket.js +233 -0
- package/dist/esm/lib/rpc.js +86 -0
- package/dist/esm/lib/websocket.js +277 -0
- package/dist/esm/package.json +1 -0
- package/dist/esm/react/daemon.js +144 -0
- package/dist/esm/wallet/rpc.js +128 -0
- package/{wallet → dist/esm/wallet}/types.js +1 -0
- package/dist/esm/wallet/websocket.js +89 -0
- package/dist/esm/xswd/websocket.js +35 -0
- package/{daemon → dist/types/daemon}/rpc.d.ts +17 -15
- package/{daemon → dist/types/daemon}/types.d.ts +127 -47
- package/{daemon → dist/types/daemon}/websocket.d.ts +20 -16
- package/{wallet → dist/types/wallet}/rpc.d.ts +9 -5
- package/{wallet → dist/types/wallet}/types.d.ts +26 -0
- package/{wallet → dist/types/wallet}/websocket.d.ts +7 -5
- package/jest.config.js +6 -0
- package/package.json +12 -3
- package/tsconfig.cjs.json +7 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +17 -0
- package/tsconfig.types.json +8 -0
- package/config.js +0 -25
- package/daemon/rpc.js +0 -113
- package/daemon/websocket.js +0 -159
- package/lib/rpc.js +0 -38
- package/lib/websocket.js +0 -202
- package/react/daemon.js +0 -82
- package/wallet/rpc.js +0 -55
- package/wallet/websocket.js +0 -60
- package/xswd/websocket.js +0 -16
- /package/{lib → dist/esm/lib}/types.js +0 -0
- /package/{xswd → dist/esm/xswd}/types.js +0 -0
- /package/{config.d.ts → dist/types/config.d.ts} +0 -0
- /package/{lib → dist/types/lib}/rpc.d.ts +0 -0
- /package/{lib → dist/types/lib}/types.d.ts +0 -0
- /package/{lib → dist/types/lib}/websocket.d.ts +0 -0
- /package/{react → dist/types/react}/daemon.d.ts +0 -0
- /package/{xswd → dist/types/xswd}/types.d.ts +0 -0
- /package/{xswd → dist/types/xswd}/websocket.d.ts +0 -0
package/wallet/websocket.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { WS as BaseWS } from '../lib/websocket';
|
|
2
|
-
import { RPCMethod } from './types';
|
|
3
|
-
export class WalletMethods {
|
|
4
|
-
constructor(ws, prefix = "") {
|
|
5
|
-
this.ws = ws;
|
|
6
|
-
this.prefix = prefix;
|
|
7
|
-
}
|
|
8
|
-
dataCall(method, params) {
|
|
9
|
-
return this.ws.dataCall(this.prefix + method, params);
|
|
10
|
-
}
|
|
11
|
-
getVersion() {
|
|
12
|
-
return this.dataCall(RPCMethod.GetVersion);
|
|
13
|
-
}
|
|
14
|
-
getNetwork() {
|
|
15
|
-
return this.dataCall(RPCMethod.GetNetwork);
|
|
16
|
-
}
|
|
17
|
-
getNonce() {
|
|
18
|
-
return this.dataCall(RPCMethod.GetNonce);
|
|
19
|
-
}
|
|
20
|
-
getTopoheight() {
|
|
21
|
-
return this.dataCall(RPCMethod.GetTopoheight);
|
|
22
|
-
}
|
|
23
|
-
getAddress(params = {}) {
|
|
24
|
-
return this.dataCall(RPCMethod.GetAddress, params);
|
|
25
|
-
}
|
|
26
|
-
rescan() {
|
|
27
|
-
return this.dataCall(RPCMethod.Rescan);
|
|
28
|
-
}
|
|
29
|
-
splitAddress(params) {
|
|
30
|
-
return this.dataCall(RPCMethod.SplitAddress, params);
|
|
31
|
-
}
|
|
32
|
-
getBalance(asset) {
|
|
33
|
-
return this.dataCall(RPCMethod.GetBalance, { asset });
|
|
34
|
-
}
|
|
35
|
-
getTrackedAssets() {
|
|
36
|
-
return this.dataCall(RPCMethod.GetTrackedAssets);
|
|
37
|
-
}
|
|
38
|
-
getAssetPrecision(params) {
|
|
39
|
-
return this.dataCall(RPCMethod.GetAssetPrecision, params);
|
|
40
|
-
}
|
|
41
|
-
getTransaction(hash) {
|
|
42
|
-
return this.dataCall(RPCMethod.GetTransaction, { hash });
|
|
43
|
-
}
|
|
44
|
-
buildTransaction(params) {
|
|
45
|
-
return this.dataCall(RPCMethod.BuildTransaction, params);
|
|
46
|
-
}
|
|
47
|
-
listTransactions(params) {
|
|
48
|
-
return this.dataCall(RPCMethod.GetTransaction, params);
|
|
49
|
-
}
|
|
50
|
-
isOnline() {
|
|
51
|
-
return this.dataCall(RPCMethod.IsOnline);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
export class WS extends BaseWS {
|
|
55
|
-
constructor(username, password) {
|
|
56
|
-
super({ auth: `${username}:${password}` });
|
|
57
|
-
this.methods = new WalletMethods(this);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
export default WS;
|
package/xswd/websocket.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { WS as BaseWS } from '../lib/websocket';
|
|
2
|
-
import { DaemonMethods } from '../daemon/websocket';
|
|
3
|
-
import { WalletMethods } from '../wallet/websocket';
|
|
4
|
-
export class WS extends BaseWS {
|
|
5
|
-
constructor() {
|
|
6
|
-
super();
|
|
7
|
-
this.timeout = 0;
|
|
8
|
-
this.daemon = new DaemonMethods(this, "node.");
|
|
9
|
-
this.wallet = new WalletMethods(this, "wallet.");
|
|
10
|
-
}
|
|
11
|
-
authorize(app) {
|
|
12
|
-
const data = JSON.stringify(app);
|
|
13
|
-
return this.call("", {}, data);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
export default WS;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|