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