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