@xelis/sdk 0.11.15 → 0.11.17
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 +97 -18
- package/dist/types/daemon/websocket.d.ts +5 -2
- package/package.json +1 -1
package/dist/cjs/daemon/rpc.js
CHANGED
|
@@ -1,233 +1,222 @@
|
|
|
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
|
-
function RPC() {
|
|
24
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
25
|
-
}
|
|
26
|
-
RPC.prototype.getVersion = function () {
|
|
4
|
+
const types_1 = require("./types");
|
|
5
|
+
const http_1 = require("../rpc/http");
|
|
6
|
+
class RPC extends http_1.HttpRPC {
|
|
7
|
+
getVersion() {
|
|
27
8
|
return this.request(types_1.RPCMethod.GetVersion);
|
|
28
|
-
}
|
|
29
|
-
|
|
9
|
+
}
|
|
10
|
+
getHeight() {
|
|
30
11
|
return this.request(types_1.RPCMethod.GetHeight);
|
|
31
|
-
}
|
|
32
|
-
|
|
12
|
+
}
|
|
13
|
+
getTopoheight() {
|
|
33
14
|
return this.request(types_1.RPCMethod.GetTopoheight);
|
|
34
|
-
}
|
|
35
|
-
|
|
15
|
+
}
|
|
16
|
+
getPrunedTopoheight() {
|
|
36
17
|
return this.request(types_1.RPCMethod.GetPrunedTopoheight);
|
|
37
|
-
}
|
|
38
|
-
|
|
18
|
+
}
|
|
19
|
+
getInfo() {
|
|
39
20
|
return this.request(types_1.RPCMethod.GetInfo);
|
|
40
|
-
}
|
|
41
|
-
|
|
21
|
+
}
|
|
22
|
+
getDifficulty() {
|
|
42
23
|
return this.request(types_1.RPCMethod.GetDifficulty);
|
|
43
|
-
}
|
|
44
|
-
|
|
24
|
+
}
|
|
25
|
+
getTips() {
|
|
45
26
|
return this.request(types_1.RPCMethod.GetTips);
|
|
46
|
-
}
|
|
47
|
-
|
|
27
|
+
}
|
|
28
|
+
getDevFeeThresholds() {
|
|
48
29
|
return this.request(types_1.RPCMethod.GetDevFeeThresholds);
|
|
49
|
-
}
|
|
50
|
-
|
|
30
|
+
}
|
|
31
|
+
getSizeOnDisk() {
|
|
51
32
|
return this.request(types_1.RPCMethod.GetSizeOnDisk);
|
|
52
|
-
}
|
|
53
|
-
|
|
33
|
+
}
|
|
34
|
+
getStableHeight() {
|
|
54
35
|
return this.request(types_1.RPCMethod.GetStableHeight);
|
|
55
|
-
}
|
|
56
|
-
|
|
36
|
+
}
|
|
37
|
+
getStableTopoheight() {
|
|
57
38
|
return this.request(types_1.RPCMethod.GetStableTopoheight);
|
|
58
|
-
}
|
|
59
|
-
|
|
39
|
+
}
|
|
40
|
+
getHardForks() {
|
|
60
41
|
return this.request(types_1.RPCMethod.GetHardForks);
|
|
61
|
-
}
|
|
62
|
-
|
|
42
|
+
}
|
|
43
|
+
getBlockAtTopoheight(params) {
|
|
63
44
|
return this.request(types_1.RPCMethod.GetBlockAtTopoheight, params);
|
|
64
|
-
}
|
|
65
|
-
|
|
45
|
+
}
|
|
46
|
+
getBlocksAtHeight(params) {
|
|
66
47
|
return this.request(types_1.RPCMethod.GetBlocksAtHeight, params);
|
|
67
|
-
}
|
|
68
|
-
|
|
48
|
+
}
|
|
49
|
+
getBlockByHash(params) {
|
|
69
50
|
return this.request(types_1.RPCMethod.GetBlockByHash, params);
|
|
70
|
-
}
|
|
71
|
-
|
|
51
|
+
}
|
|
52
|
+
getTopBlock(params) {
|
|
72
53
|
return this.request(types_1.RPCMethod.GetTopBlock, params);
|
|
73
|
-
}
|
|
74
|
-
|
|
54
|
+
}
|
|
55
|
+
getBalance(params) {
|
|
75
56
|
return this.request(types_1.RPCMethod.GetBalance, params);
|
|
76
|
-
}
|
|
77
|
-
|
|
57
|
+
}
|
|
58
|
+
getStableBalance(params) {
|
|
78
59
|
return this.request(types_1.RPCMethod.GetStableBalance, params);
|
|
79
|
-
}
|
|
80
|
-
|
|
60
|
+
}
|
|
61
|
+
hasBalance(params) {
|
|
81
62
|
return this.request(types_1.RPCMethod.HasBalance, params);
|
|
82
|
-
}
|
|
83
|
-
|
|
63
|
+
}
|
|
64
|
+
getBalanceAtTopoheight(params) {
|
|
84
65
|
return this.request(types_1.RPCMethod.GetBalanceAtTopoheight, params);
|
|
85
|
-
}
|
|
86
|
-
|
|
66
|
+
}
|
|
67
|
+
getNonce(params) {
|
|
87
68
|
return this.request(types_1.RPCMethod.GetNonce, params);
|
|
88
|
-
}
|
|
89
|
-
|
|
69
|
+
}
|
|
70
|
+
hasNonce(params) {
|
|
90
71
|
return this.request(types_1.RPCMethod.HasNonce, params);
|
|
91
|
-
}
|
|
92
|
-
|
|
72
|
+
}
|
|
73
|
+
getNonceAtTopoheight(params) {
|
|
93
74
|
return this.request(types_1.RPCMethod.GetNonceAtTopoheight, params);
|
|
94
|
-
}
|
|
95
|
-
|
|
75
|
+
}
|
|
76
|
+
getAsset(params) {
|
|
96
77
|
return this.request(types_1.RPCMethod.GetAsset, params);
|
|
97
|
-
}
|
|
98
|
-
|
|
78
|
+
}
|
|
79
|
+
getAssets(params) {
|
|
99
80
|
return this.request(types_1.RPCMethod.GetAssets, params);
|
|
100
|
-
}
|
|
101
|
-
|
|
81
|
+
}
|
|
82
|
+
countAssets() {
|
|
102
83
|
return this.request(types_1.RPCMethod.CountAssets);
|
|
103
|
-
}
|
|
104
|
-
|
|
84
|
+
}
|
|
85
|
+
countTransactions() {
|
|
105
86
|
return this.request(types_1.RPCMethod.CountTransactions);
|
|
106
|
-
}
|
|
107
|
-
|
|
87
|
+
}
|
|
88
|
+
countAccounts() {
|
|
108
89
|
return this.request(types_1.RPCMethod.CountAccounts);
|
|
109
|
-
}
|
|
110
|
-
|
|
90
|
+
}
|
|
91
|
+
countContracts() {
|
|
111
92
|
return this.request(types_1.RPCMethod.CountContracts);
|
|
112
|
-
}
|
|
113
|
-
|
|
93
|
+
}
|
|
94
|
+
submitTransaction(hexData) {
|
|
114
95
|
return this.request(types_1.RPCMethod.SubmitTransaction, { data: hexData });
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return this.request(types_1.RPCMethod.GetTransactionExecutor, { hash
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return this.request(types_1.RPCMethod.GetTransaction, { hash
|
|
121
|
-
}
|
|
122
|
-
|
|
96
|
+
}
|
|
97
|
+
getTransationExecutor(hash) {
|
|
98
|
+
return this.request(types_1.RPCMethod.GetTransactionExecutor, { hash });
|
|
99
|
+
}
|
|
100
|
+
getTransaction(hash) {
|
|
101
|
+
return this.request(types_1.RPCMethod.GetTransaction, { hash });
|
|
102
|
+
}
|
|
103
|
+
getTransactions(txHashes) {
|
|
123
104
|
return this.request(types_1.RPCMethod.GetTransactions, { tx_hashes: txHashes });
|
|
124
|
-
}
|
|
125
|
-
|
|
105
|
+
}
|
|
106
|
+
isTxExecutedInBlock(params) {
|
|
126
107
|
return this.request(types_1.RPCMethod.IsTxExecutedInBlock, params);
|
|
127
|
-
}
|
|
128
|
-
|
|
108
|
+
}
|
|
109
|
+
p2pStatus() {
|
|
129
110
|
return this.request(types_1.RPCMethod.P2PStatus);
|
|
130
|
-
}
|
|
131
|
-
|
|
111
|
+
}
|
|
112
|
+
getPeers() {
|
|
132
113
|
return this.request(types_1.RPCMethod.GetPeers);
|
|
133
|
-
}
|
|
134
|
-
|
|
114
|
+
}
|
|
115
|
+
getMemPool(params) {
|
|
135
116
|
return this.request(types_1.RPCMethod.GetMempool, params);
|
|
136
|
-
}
|
|
137
|
-
|
|
117
|
+
}
|
|
118
|
+
getMempoolSummary(params) {
|
|
138
119
|
return this.request(types_1.RPCMethod.GetMempoolSummary, params);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
return this.request(types_1.RPCMethod.GetMempoolCache, { address
|
|
142
|
-
}
|
|
143
|
-
|
|
120
|
+
}
|
|
121
|
+
getMempoolCache(address) {
|
|
122
|
+
return this.request(types_1.RPCMethod.GetMempoolCache, { address });
|
|
123
|
+
}
|
|
124
|
+
getEstimatedFeeRates() {
|
|
144
125
|
return this.request(types_1.RPCMethod.GetEstimatedFeeRates);
|
|
145
|
-
}
|
|
146
|
-
|
|
126
|
+
}
|
|
127
|
+
getDAGOrder(params) {
|
|
147
128
|
return this.request(types_1.RPCMethod.GetDAGOrder, params);
|
|
148
|
-
}
|
|
149
|
-
|
|
129
|
+
}
|
|
130
|
+
getBlocksRangeByTopoheight(params) {
|
|
150
131
|
return this.request(types_1.RPCMethod.GetBlocksRangeByTopoheight, params);
|
|
151
|
-
}
|
|
152
|
-
|
|
132
|
+
}
|
|
133
|
+
getBlocksRangeByHeight(params) {
|
|
153
134
|
return this.request(types_1.RPCMethod.GetBlocksRangeByHeight, params);
|
|
154
|
-
}
|
|
155
|
-
|
|
135
|
+
}
|
|
136
|
+
getAccountHistory(params) {
|
|
156
137
|
return this.request(types_1.RPCMethod.GetAccountHistory, params);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
return this.request(types_1.RPCMethod.GetAccountAssets, { address
|
|
160
|
-
}
|
|
161
|
-
|
|
138
|
+
}
|
|
139
|
+
getAccountAssets(address) {
|
|
140
|
+
return this.request(types_1.RPCMethod.GetAccountAssets, { address });
|
|
141
|
+
}
|
|
142
|
+
getAccounts(params) {
|
|
162
143
|
return this.request(types_1.RPCMethod.GetAccounts, params);
|
|
163
|
-
}
|
|
164
|
-
|
|
144
|
+
}
|
|
145
|
+
isAccountRegistered(params) {
|
|
165
146
|
return this.request(types_1.RPCMethod.IsAccountRegistered, params);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
return this.request(types_1.RPCMethod.GetAccountRegistrationTopoheight, { address
|
|
169
|
-
}
|
|
170
|
-
|
|
147
|
+
}
|
|
148
|
+
getAccountRegistrationTopoheight(address) {
|
|
149
|
+
return this.request(types_1.RPCMethod.GetAccountRegistrationTopoheight, { address });
|
|
150
|
+
}
|
|
151
|
+
validateAddress(params) {
|
|
171
152
|
return this.request(types_1.RPCMethod.ValidateAddress, params);
|
|
172
|
-
}
|
|
173
|
-
|
|
153
|
+
}
|
|
154
|
+
splitAddress(params) {
|
|
174
155
|
return this.request(types_1.RPCMethod.SplitAddress, params);
|
|
175
|
-
}
|
|
176
|
-
|
|
156
|
+
}
|
|
157
|
+
extractKeyFromAddress(params) {
|
|
177
158
|
return this.request(types_1.RPCMethod.ExtractKeyFromAddress, params);
|
|
178
|
-
}
|
|
179
|
-
|
|
159
|
+
}
|
|
160
|
+
makeIntegratedAddress(params) {
|
|
180
161
|
return this.request(types_1.RPCMethod.MakeIntegratedAddress, params);
|
|
181
|
-
}
|
|
182
|
-
|
|
162
|
+
}
|
|
163
|
+
decryptExtraData(params) {
|
|
183
164
|
return this.request(types_1.RPCMethod.DecryptExtraData, params);
|
|
184
|
-
}
|
|
185
|
-
|
|
165
|
+
}
|
|
166
|
+
getMultisigAtTopoheight(params) {
|
|
186
167
|
return this.request(types_1.RPCMethod.GetMultisigAtTopoheight, params);
|
|
187
|
-
}
|
|
188
|
-
|
|
168
|
+
}
|
|
169
|
+
getMultisig(params) {
|
|
189
170
|
return this.request(types_1.RPCMethod.GetMultisig, params);
|
|
190
|
-
}
|
|
191
|
-
|
|
171
|
+
}
|
|
172
|
+
hasMultisig(params) {
|
|
192
173
|
return this.request(types_1.RPCMethod.HasMultisig, params);
|
|
193
|
-
}
|
|
194
|
-
|
|
174
|
+
}
|
|
175
|
+
hasMultisigAtTopoheight(params) {
|
|
195
176
|
return this.request(types_1.RPCMethod.HasMultisigAtTopoheight, params);
|
|
196
|
-
}
|
|
197
|
-
|
|
177
|
+
}
|
|
178
|
+
getContractLogs(params) {
|
|
179
|
+
return this.request(types_1.RPCMethod.GetContractLogs, params);
|
|
180
|
+
}
|
|
181
|
+
getContractScheduledExecutionsAtTopoheight(params) {
|
|
182
|
+
return this.request(types_1.RPCMethod.GetContractScheduledExecutionsAtTopoheight, params);
|
|
183
|
+
}
|
|
184
|
+
getContractRegisteredExecutionsAtTopoheight(params) {
|
|
185
|
+
return this.request(types_1.RPCMethod.GetContractRegisteredExecutionsAtTopoheight, params);
|
|
186
|
+
}
|
|
187
|
+
getContractOutputs(params) {
|
|
198
188
|
return this.request(types_1.RPCMethod.GetContractOutputs, params);
|
|
199
|
-
}
|
|
200
|
-
|
|
189
|
+
}
|
|
190
|
+
getContractModule(params) {
|
|
201
191
|
return this.request(types_1.RPCMethod.GetContractModule, params);
|
|
202
|
-
}
|
|
203
|
-
|
|
192
|
+
}
|
|
193
|
+
getContractData(params) {
|
|
204
194
|
return this.request(types_1.RPCMethod.GetContractData, params);
|
|
205
|
-
}
|
|
206
|
-
|
|
195
|
+
}
|
|
196
|
+
getContractDataAtTopoheight(params) {
|
|
207
197
|
return this.request(types_1.RPCMethod.GetContractDataAtTopoheight, params);
|
|
208
|
-
}
|
|
209
|
-
|
|
198
|
+
}
|
|
199
|
+
getContractBalance(params) {
|
|
210
200
|
return this.request(types_1.RPCMethod.GetContractBalance, params);
|
|
211
|
-
}
|
|
212
|
-
|
|
201
|
+
}
|
|
202
|
+
getContractBalanceAtTopoheight(params) {
|
|
213
203
|
return this.request(types_1.RPCMethod.GetContractBalanceAtTopoheight, params);
|
|
214
|
-
}
|
|
215
|
-
|
|
204
|
+
}
|
|
205
|
+
getContractAssets(params) {
|
|
216
206
|
return this.request(types_1.RPCMethod.GetContractAssets, params);
|
|
217
|
-
}
|
|
218
|
-
|
|
207
|
+
}
|
|
208
|
+
getP2PBlockPropagation(params) {
|
|
219
209
|
return this.request(types_1.RPCMethod.GetP2PBlockPropagation, params);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
return this.request(types_1.RPCMethod.GetBlockTemplate, { address
|
|
223
|
-
}
|
|
224
|
-
|
|
210
|
+
}
|
|
211
|
+
getBlockTemplate(address) {
|
|
212
|
+
return this.request(types_1.RPCMethod.GetBlockTemplate, { address });
|
|
213
|
+
}
|
|
214
|
+
getMinerWork(params) {
|
|
225
215
|
return this.request(types_1.RPCMethod.GetMinerWork, params);
|
|
226
|
-
}
|
|
227
|
-
|
|
216
|
+
}
|
|
217
|
+
submitBlock(params) {
|
|
228
218
|
return this.request(types_1.RPCMethod.SubmitBlock, params);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
}(http_1.HttpRPC));
|
|
219
|
+
}
|
|
220
|
+
}
|
|
232
221
|
exports.RPC = RPC;
|
|
233
|
-
exports
|
|
222
|
+
exports.default = RPC;
|
package/dist/cjs/daemon/types.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RPCEvent = exports.RPCMethod = exports.BlockType = exports.BalanceType = void 0;
|
|
4
4
|
var BalanceType;
|
|
5
5
|
(function (BalanceType) {
|
|
@@ -73,6 +73,9 @@ var RPCMethod;
|
|
|
73
73
|
RPCMethod["GetMultisig"] = "get_multisig";
|
|
74
74
|
RPCMethod["HasMultisig"] = "has_multisig";
|
|
75
75
|
RPCMethod["HasMultisigAtTopoheight"] = "has_multisig_at_topoheight";
|
|
76
|
+
RPCMethod["GetContractLogs"] = "get_contract_logs";
|
|
77
|
+
RPCMethod["GetContractScheduledExecutionsAtTopoheight"] = "get_contract_scheduled_executions_at_topoheight";
|
|
78
|
+
RPCMethod["GetContractRegisteredExecutionsAtTopoheight"] = "get_contract_registered_executions_at_topoheight";
|
|
76
79
|
RPCMethod["GetContractOutputs"] = "get_contract_outputs";
|
|
77
80
|
RPCMethod["GetContractModule"] = "get_contract_module";
|
|
78
81
|
RPCMethod["GetContractData"] = "get_contract_data";
|