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