@xelis/sdk 0.11.15 → 0.11.16
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/dist/cjs/address/bech32.js +47 -56
- package/dist/cjs/address/index.js +20 -21
- package/dist/cjs/config.js +26 -38
- package/dist/cjs/contract/contract.js +178 -0
- package/dist/cjs/contract/typed_contract.js +259 -0
- package/dist/cjs/contract/xvm_serializer.js +170 -0
- package/dist/cjs/daemon/rpc.js +157 -168
- package/dist/cjs/daemon/types.js +4 -1
- package/dist/cjs/daemon/websocket.js +170 -181
- package/dist/cjs/data/element.js +39 -41
- package/dist/cjs/data/value.js +106 -111
- package/dist/cjs/react/daemon.js +33 -43
- package/dist/cjs/rpc/http.js +75 -132
- package/dist/cjs/rpc/parse_json/parse_json.js +4 -4
- package/dist/cjs/rpc/types.js +1 -1
- package/dist/cjs/rpc/websocket.js +131 -201
- package/dist/cjs/wallet/rpc.js +98 -117
- package/dist/cjs/wallet/types.js +1 -1
- package/dist/cjs/wallet/websocket.js +105 -126
- package/dist/cjs/xswd/relayer/app.js +57 -36
- package/dist/cjs/xswd/relayer/index.js +25 -27
- package/dist/cjs/xswd/types.js +1 -1
- package/dist/cjs/xswd/websocket.js +15 -33
- package/dist/esm/address/bech32.js +46 -55
- package/dist/esm/address/index.js +16 -17
- package/dist/esm/config.js +25 -37
- package/dist/esm/contract/contract.js +172 -0
- package/dist/esm/contract/typed_contract.js +251 -0
- package/dist/esm/contract/xvm_serializer.js +163 -0
- package/dist/esm/daemon/rpc.js +153 -165
- package/dist/esm/daemon/types.js +3 -0
- package/dist/esm/daemon/websocket.js +166 -179
- package/dist/esm/data/element.js +37 -40
- package/dist/esm/data/value.js +104 -112
- package/dist/esm/react/daemon.js +30 -40
- package/dist/esm/rpc/http.js +73 -131
- package/dist/esm/rpc/parse_json/parse_json.js +1 -1
- package/dist/esm/rpc/websocket.js +126 -197
- package/dist/esm/wallet/rpc.js +93 -113
- package/dist/esm/wallet/websocket.js +101 -124
- package/dist/esm/xswd/relayer/app.js +54 -34
- package/dist/esm/xswd/relayer/index.js +22 -24
- package/dist/esm/xswd/websocket.js +10 -29
- package/dist/types/contract/contract.d.ts +80 -0
- package/dist/types/contract/typed_contract.d.ts +94 -0
- package/dist/types/contract/xvm_serializer.d.ts +69 -0
- package/dist/types/daemon/rpc.d.ts +5 -2
- package/dist/types/daemon/types.d.ts +96 -17
- package/dist/types/daemon/websocket.d.ts +5 -2
- package/package.json +1 -1
package/dist/cjs/wallet/rpc.js
CHANGED
|
@@ -1,154 +1,135 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
exports.__esModule = true;
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.RPC = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
RPC.prototype.getVersion = function () {
|
|
4
|
+
const js_base64_1 = require("js-base64");
|
|
5
|
+
const types_1 = require("./types");
|
|
6
|
+
const http_1 = require("../rpc/http");
|
|
7
|
+
class RPC extends http_1.HttpRPC {
|
|
8
|
+
constructor(endpoint, username, password) {
|
|
9
|
+
super(endpoint);
|
|
10
|
+
const authValue = js_base64_1.Base64.encode(`${username}:${password}`);
|
|
11
|
+
this.headers.set("Authorization", `Basic ${authValue}`);
|
|
12
|
+
}
|
|
13
|
+
getVersion() {
|
|
31
14
|
return this.request(types_1.RPCMethod.GetVersion);
|
|
32
|
-
}
|
|
33
|
-
|
|
15
|
+
}
|
|
16
|
+
getNetwork() {
|
|
34
17
|
return this.request(types_1.RPCMethod.GetNetwork);
|
|
35
|
-
}
|
|
36
|
-
|
|
18
|
+
}
|
|
19
|
+
getNonce() {
|
|
37
20
|
return this.request(types_1.RPCMethod.GetNonce);
|
|
38
|
-
}
|
|
39
|
-
|
|
21
|
+
}
|
|
22
|
+
getTopoheight() {
|
|
40
23
|
return this.request(types_1.RPCMethod.GetTopoheight);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (params === void 0) { params = {}; }
|
|
24
|
+
}
|
|
25
|
+
getAddress(params = {}) {
|
|
44
26
|
return this.request(types_1.RPCMethod.GetAddress, params);
|
|
45
|
-
}
|
|
46
|
-
|
|
27
|
+
}
|
|
28
|
+
splitAddress(params) {
|
|
47
29
|
return this.request(types_1.RPCMethod.SplitAddress, params);
|
|
48
|
-
}
|
|
49
|
-
|
|
30
|
+
}
|
|
31
|
+
rescan(params) {
|
|
50
32
|
return this.request(types_1.RPCMethod.Rescan, params);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return this.request(types_1.RPCMethod.GetBalance, { asset
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return this.request(types_1.RPCMethod.HasBalance, { asset
|
|
57
|
-
}
|
|
58
|
-
|
|
33
|
+
}
|
|
34
|
+
getBalance(asset) {
|
|
35
|
+
return this.request(types_1.RPCMethod.GetBalance, { asset });
|
|
36
|
+
}
|
|
37
|
+
hasBalance(asset) {
|
|
38
|
+
return this.request(types_1.RPCMethod.HasBalance, { asset });
|
|
39
|
+
}
|
|
40
|
+
getTrackedAssets() {
|
|
59
41
|
return this.request(types_1.RPCMethod.GetTrackedAssets);
|
|
60
|
-
}
|
|
61
|
-
|
|
42
|
+
}
|
|
43
|
+
getAssetPrecision(params) {
|
|
62
44
|
return this.request(types_1.RPCMethod.GetAssetPrecision, params);
|
|
63
|
-
}
|
|
64
|
-
|
|
45
|
+
}
|
|
46
|
+
getAssets() {
|
|
65
47
|
return this.request(types_1.RPCMethod.GetAssets);
|
|
66
|
-
}
|
|
67
|
-
|
|
48
|
+
}
|
|
49
|
+
getAsset(params) {
|
|
68
50
|
return this.request(types_1.RPCMethod.GetAsset, params);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return this.request(types_1.RPCMethod.GetTransaction, { hash
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return this.request(types_1.RPCMethod.SearchTransaction, { hash
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return this.request(types_1.RPCMethod.DumpTransaction, { hash
|
|
78
|
-
}
|
|
79
|
-
|
|
51
|
+
}
|
|
52
|
+
getTransaction(hash) {
|
|
53
|
+
return this.request(types_1.RPCMethod.GetTransaction, { hash });
|
|
54
|
+
}
|
|
55
|
+
searchTransaction(hash) {
|
|
56
|
+
return this.request(types_1.RPCMethod.SearchTransaction, { hash });
|
|
57
|
+
}
|
|
58
|
+
dumpTransaction(hash) {
|
|
59
|
+
return this.request(types_1.RPCMethod.DumpTransaction, { hash });
|
|
60
|
+
}
|
|
61
|
+
buildTransaction(params) {
|
|
80
62
|
return this.request(types_1.RPCMethod.BuildTransaction, params);
|
|
81
|
-
}
|
|
82
|
-
|
|
63
|
+
}
|
|
64
|
+
buildTransactionOffline(params) {
|
|
83
65
|
return this.request(types_1.RPCMethod.BuildTransactionOffline, params);
|
|
84
|
-
}
|
|
85
|
-
|
|
66
|
+
}
|
|
67
|
+
buildUnsignedTransaction(params) {
|
|
86
68
|
return this.request(types_1.RPCMethod.BuildUnsignedTransaction, params);
|
|
87
|
-
}
|
|
88
|
-
|
|
69
|
+
}
|
|
70
|
+
signUnsignedTransaction(params) {
|
|
89
71
|
return this.request(types_1.RPCMethod.SignUnsignedTransaction, params);
|
|
90
|
-
}
|
|
91
|
-
|
|
72
|
+
}
|
|
73
|
+
finalizeUnsignedTransaction(params) {
|
|
92
74
|
return this.request(types_1.RPCMethod.FinalizeUnsignedTransaction, params);
|
|
93
|
-
}
|
|
94
|
-
|
|
75
|
+
}
|
|
76
|
+
clearTxCache() {
|
|
95
77
|
return this.request(types_1.RPCMethod.ClearTxCache);
|
|
96
|
-
}
|
|
97
|
-
|
|
78
|
+
}
|
|
79
|
+
listTransactions(params) {
|
|
98
80
|
return this.request(types_1.RPCMethod.ListTransactions, params);
|
|
99
|
-
}
|
|
100
|
-
|
|
81
|
+
}
|
|
82
|
+
isOnline() {
|
|
101
83
|
return this.request(types_1.RPCMethod.IsOnline);
|
|
102
|
-
}
|
|
103
|
-
|
|
84
|
+
}
|
|
85
|
+
setOnlineMode(params) {
|
|
104
86
|
return this.request(types_1.RPCMethod.SetOnlineMode, params);
|
|
105
|
-
}
|
|
106
|
-
|
|
87
|
+
}
|
|
88
|
+
setOfflineMode() {
|
|
107
89
|
return this.request(types_1.RPCMethod.SetOfflineMode);
|
|
108
|
-
}
|
|
109
|
-
|
|
90
|
+
}
|
|
91
|
+
signData(data) {
|
|
110
92
|
return this.request(types_1.RPCMethod.SignData, data.toObject());
|
|
111
|
-
}
|
|
112
|
-
|
|
93
|
+
}
|
|
94
|
+
estimateFees(params) {
|
|
113
95
|
return this.request(types_1.RPCMethod.EstimateFees, params);
|
|
114
|
-
}
|
|
115
|
-
|
|
96
|
+
}
|
|
97
|
+
estimateExtraDataSize(params) {
|
|
116
98
|
return this.request(types_1.RPCMethod.EstimateExtraDataSize, params);
|
|
117
|
-
}
|
|
118
|
-
|
|
99
|
+
}
|
|
100
|
+
networkInfo() {
|
|
119
101
|
return this.request(types_1.RPCMethod.NetworkInfo);
|
|
120
|
-
}
|
|
121
|
-
|
|
102
|
+
}
|
|
103
|
+
decryptExtraData(params) {
|
|
122
104
|
return this.request(types_1.RPCMethod.DecryptExtraData, params);
|
|
123
|
-
}
|
|
124
|
-
|
|
105
|
+
}
|
|
106
|
+
decryptCiphertext(params) {
|
|
125
107
|
return this.request(types_1.RPCMethod.DecryptCiphertext, params);
|
|
126
|
-
}
|
|
127
|
-
|
|
108
|
+
}
|
|
109
|
+
getMatchingKeys(params) {
|
|
128
110
|
return this.request(types_1.RPCMethod.GetMatchingKeys, params);
|
|
129
|
-
}
|
|
130
|
-
|
|
111
|
+
}
|
|
112
|
+
countMatchingEntries(params) {
|
|
131
113
|
return this.request(types_1.RPCMethod.CountMatchingEntries, params);
|
|
132
|
-
}
|
|
133
|
-
|
|
114
|
+
}
|
|
115
|
+
getValueFromKey(params) {
|
|
134
116
|
return this.request(types_1.RPCMethod.GetValueFromKey, params);
|
|
135
|
-
}
|
|
136
|
-
|
|
117
|
+
}
|
|
118
|
+
store(params) {
|
|
137
119
|
return this.request(types_1.RPCMethod.Store, params);
|
|
138
|
-
}
|
|
139
|
-
|
|
120
|
+
}
|
|
121
|
+
delete(params) {
|
|
140
122
|
return this.request(types_1.RPCMethod.Delete, params);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
return this.request(types_1.RPCMethod.DeleteTreeEntries, { tree
|
|
144
|
-
}
|
|
145
|
-
|
|
123
|
+
}
|
|
124
|
+
deleteTreeEntries(tree) {
|
|
125
|
+
return this.request(types_1.RPCMethod.DeleteTreeEntries, { tree });
|
|
126
|
+
}
|
|
127
|
+
hasKey(params) {
|
|
146
128
|
return this.request(types_1.RPCMethod.HasKey, params);
|
|
147
|
-
}
|
|
148
|
-
|
|
129
|
+
}
|
|
130
|
+
queryDB(params) {
|
|
149
131
|
return this.request(types_1.RPCMethod.QueryDB, params);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
}(http_1.HttpRPC));
|
|
132
|
+
}
|
|
133
|
+
}
|
|
153
134
|
exports.RPC = RPC;
|
|
154
|
-
exports
|
|
135
|
+
exports.default = RPC;
|
package/dist/cjs/wallet/types.js
CHANGED
|
@@ -1,170 +1,149 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
exports.__esModule = true;
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.WS = exports.WalletMethods = void 0;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (prefix === void 0) { prefix = ""; }
|
|
4
|
+
const websocket_1 = require("../rpc/websocket");
|
|
5
|
+
const types_1 = require("./types");
|
|
6
|
+
class WalletMethods {
|
|
7
|
+
constructor(ws, prefix = "") {
|
|
24
8
|
this.ws = ws;
|
|
25
9
|
this.prefix = prefix;
|
|
26
10
|
}
|
|
27
|
-
|
|
11
|
+
dataCall(method, params) {
|
|
28
12
|
return this.ws.dataCall(this.prefix + method, params);
|
|
29
|
-
}
|
|
30
|
-
|
|
13
|
+
}
|
|
14
|
+
closeListener(event, listener) {
|
|
31
15
|
this.ws.closeListener(event, listener);
|
|
32
|
-
}
|
|
33
|
-
|
|
16
|
+
}
|
|
17
|
+
listen(event, listener) {
|
|
34
18
|
this.ws.listen(this.prefix + event, listener);
|
|
35
|
-
}
|
|
36
|
-
|
|
19
|
+
}
|
|
20
|
+
getVersion() {
|
|
37
21
|
return this.dataCall(types_1.RPCMethod.GetVersion);
|
|
38
|
-
}
|
|
39
|
-
|
|
22
|
+
}
|
|
23
|
+
getNetwork() {
|
|
40
24
|
return this.dataCall(types_1.RPCMethod.GetNetwork);
|
|
41
|
-
}
|
|
42
|
-
|
|
25
|
+
}
|
|
26
|
+
getNonce() {
|
|
43
27
|
return this.dataCall(types_1.RPCMethod.GetNonce);
|
|
44
|
-
}
|
|
45
|
-
|
|
28
|
+
}
|
|
29
|
+
getTopoheight() {
|
|
46
30
|
return this.dataCall(types_1.RPCMethod.GetTopoheight);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (params === void 0) { params = {}; }
|
|
31
|
+
}
|
|
32
|
+
getAddress(params = {}) {
|
|
50
33
|
return this.dataCall(types_1.RPCMethod.GetAddress, params);
|
|
51
|
-
}
|
|
52
|
-
|
|
34
|
+
}
|
|
35
|
+
splitAddress(params) {
|
|
53
36
|
return this.dataCall(types_1.RPCMethod.SplitAddress, params);
|
|
54
|
-
}
|
|
55
|
-
|
|
37
|
+
}
|
|
38
|
+
rescan(params) {
|
|
56
39
|
return this.dataCall(types_1.RPCMethod.Rescan, params);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return this.dataCall(types_1.RPCMethod.GetBalance, { asset
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return this.dataCall(types_1.RPCMethod.HasBalance, { asset
|
|
63
|
-
}
|
|
64
|
-
|
|
40
|
+
}
|
|
41
|
+
getBalance(asset) {
|
|
42
|
+
return this.dataCall(types_1.RPCMethod.GetBalance, { asset });
|
|
43
|
+
}
|
|
44
|
+
hasBalance(asset) {
|
|
45
|
+
return this.dataCall(types_1.RPCMethod.HasBalance, { asset });
|
|
46
|
+
}
|
|
47
|
+
getTrackedAssets() {
|
|
65
48
|
return this.dataCall(types_1.RPCMethod.GetTrackedAssets);
|
|
66
|
-
}
|
|
67
|
-
|
|
49
|
+
}
|
|
50
|
+
getAssetPrecision(params) {
|
|
68
51
|
return this.dataCall(types_1.RPCMethod.GetAssetPrecision, params);
|
|
69
|
-
}
|
|
70
|
-
|
|
52
|
+
}
|
|
53
|
+
getAssets() {
|
|
71
54
|
return this.dataCall(types_1.RPCMethod.GetAssets);
|
|
72
|
-
}
|
|
73
|
-
|
|
55
|
+
}
|
|
56
|
+
getAsset(params) {
|
|
74
57
|
return this.dataCall(types_1.RPCMethod.GetAsset, params);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return this.dataCall(types_1.RPCMethod.GetTransaction, { hash
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return this.dataCall(types_1.RPCMethod.SearchTransaction, { hash
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return this.dataCall(types_1.RPCMethod.DumpTransaction, { hash
|
|
84
|
-
}
|
|
85
|
-
|
|
58
|
+
}
|
|
59
|
+
getTransaction(hash) {
|
|
60
|
+
return this.dataCall(types_1.RPCMethod.GetTransaction, { hash });
|
|
61
|
+
}
|
|
62
|
+
searchTransaction(hash) {
|
|
63
|
+
return this.dataCall(types_1.RPCMethod.SearchTransaction, { hash });
|
|
64
|
+
}
|
|
65
|
+
dumpTransaction(hash) {
|
|
66
|
+
return this.dataCall(types_1.RPCMethod.DumpTransaction, { hash });
|
|
67
|
+
}
|
|
68
|
+
buildTransaction(params) {
|
|
86
69
|
return this.dataCall(types_1.RPCMethod.BuildTransaction, params);
|
|
87
|
-
}
|
|
88
|
-
|
|
70
|
+
}
|
|
71
|
+
buildTransactionOffline(params) {
|
|
89
72
|
return this.dataCall(types_1.RPCMethod.BuildTransactionOffline, params);
|
|
90
|
-
}
|
|
91
|
-
|
|
73
|
+
}
|
|
74
|
+
buildUnsignedTransaction(params) {
|
|
92
75
|
return this.dataCall(types_1.RPCMethod.BuildUnsignedTransaction, params);
|
|
93
|
-
}
|
|
94
|
-
|
|
76
|
+
}
|
|
77
|
+
signUnsignedTransaction(params) {
|
|
95
78
|
return this.dataCall(types_1.RPCMethod.SignUnsignedTransaction, params);
|
|
96
|
-
}
|
|
97
|
-
|
|
79
|
+
}
|
|
80
|
+
finalizeUnsignedTransaction(params) {
|
|
98
81
|
return this.dataCall(types_1.RPCMethod.FinalizeUnsignedTransaction, params);
|
|
99
|
-
}
|
|
100
|
-
|
|
82
|
+
}
|
|
83
|
+
clearTxCache() {
|
|
101
84
|
return this.dataCall(types_1.RPCMethod.ClearTxCache);
|
|
102
|
-
}
|
|
103
|
-
|
|
85
|
+
}
|
|
86
|
+
listTransactions(params) {
|
|
104
87
|
return this.dataCall(types_1.RPCMethod.GetTransaction, params);
|
|
105
|
-
}
|
|
106
|
-
|
|
88
|
+
}
|
|
89
|
+
isOnline() {
|
|
107
90
|
return this.dataCall(types_1.RPCMethod.IsOnline);
|
|
108
|
-
}
|
|
109
|
-
|
|
91
|
+
}
|
|
92
|
+
setOnlineMode(params) {
|
|
110
93
|
return this.dataCall(types_1.RPCMethod.SetOfflineMode, params);
|
|
111
|
-
}
|
|
112
|
-
|
|
94
|
+
}
|
|
95
|
+
setOfflineMode() {
|
|
113
96
|
return this.dataCall(types_1.RPCMethod.SetOfflineMode);
|
|
114
|
-
}
|
|
115
|
-
|
|
97
|
+
}
|
|
98
|
+
signData(data) {
|
|
116
99
|
return this.dataCall(types_1.RPCMethod.SignData, data.toObject());
|
|
117
|
-
}
|
|
118
|
-
|
|
100
|
+
}
|
|
101
|
+
estimateFees(params) {
|
|
119
102
|
return this.dataCall(types_1.RPCMethod.EstimateFees, params);
|
|
120
|
-
}
|
|
121
|
-
|
|
103
|
+
}
|
|
104
|
+
estimateExtraDataSize(params) {
|
|
122
105
|
return this.dataCall(types_1.RPCMethod.EstimateExtraDataSize, params);
|
|
123
|
-
}
|
|
124
|
-
|
|
106
|
+
}
|
|
107
|
+
networkInfo() {
|
|
125
108
|
return this.dataCall(types_1.RPCMethod.NetworkInfo);
|
|
126
|
-
}
|
|
127
|
-
|
|
109
|
+
}
|
|
110
|
+
decryptExtraData(params) {
|
|
128
111
|
return this.dataCall(types_1.RPCMethod.DecryptExtraData, params);
|
|
129
|
-
}
|
|
130
|
-
|
|
112
|
+
}
|
|
113
|
+
decryptCiphertext(params) {
|
|
131
114
|
return this.dataCall(types_1.RPCMethod.DecryptCiphertext, params);
|
|
132
|
-
}
|
|
133
|
-
|
|
115
|
+
}
|
|
116
|
+
getMatchingKeys(params) {
|
|
134
117
|
return this.dataCall(types_1.RPCMethod.GetMatchingKeys, params);
|
|
135
|
-
}
|
|
136
|
-
|
|
118
|
+
}
|
|
119
|
+
countMatchingEntries(params) {
|
|
137
120
|
return this.dataCall(types_1.RPCMethod.CountMatchingEntries, params);
|
|
138
|
-
}
|
|
139
|
-
|
|
121
|
+
}
|
|
122
|
+
getValueFromKey(params) {
|
|
140
123
|
return this.dataCall(types_1.RPCMethod.GetValueFromKey, params);
|
|
141
|
-
}
|
|
142
|
-
|
|
124
|
+
}
|
|
125
|
+
store(params) {
|
|
143
126
|
return this.dataCall(types_1.RPCMethod.Store, params);
|
|
144
|
-
}
|
|
145
|
-
|
|
127
|
+
}
|
|
128
|
+
delete(params) {
|
|
146
129
|
return this.dataCall(types_1.RPCMethod.Delete, params);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
return this.dataCall(types_1.RPCMethod.DeleteTreeEntries, { tree
|
|
150
|
-
}
|
|
151
|
-
|
|
130
|
+
}
|
|
131
|
+
deleteTreeEntries(tree) {
|
|
132
|
+
return this.dataCall(types_1.RPCMethod.DeleteTreeEntries, { tree });
|
|
133
|
+
}
|
|
134
|
+
hasKey(params) {
|
|
152
135
|
return this.dataCall(types_1.RPCMethod.HasKey, params);
|
|
153
|
-
}
|
|
154
|
-
|
|
136
|
+
}
|
|
137
|
+
queryDB(params) {
|
|
155
138
|
return this.dataCall(types_1.RPCMethod.QueryDB, params);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
}());
|
|
139
|
+
}
|
|
140
|
+
}
|
|
159
141
|
exports.WalletMethods = WalletMethods;
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
}
|
|
167
|
-
return WS;
|
|
168
|
-
}(websocket_1.WSRPC));
|
|
142
|
+
class WS extends websocket_1.WSRPC {
|
|
143
|
+
constructor(endpoint, username, password) {
|
|
144
|
+
super(endpoint, { auth: `${username}:${password}` });
|
|
145
|
+
this.methods = new WalletMethods(this);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
169
148
|
exports.WS = WS;
|
|
170
|
-
exports
|
|
149
|
+
exports.default = WS;
|