@alephium/web3 0.0.3 → 0.1.0-rc.0

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 (144) hide show
  1. package/.editorconfig +13 -0
  2. package/.eslintignore +2 -0
  3. package/.eslintrc.json +21 -0
  4. package/README.md +2 -2
  5. package/contracts/add.ral +7 -3
  6. package/contracts/greeter.ral +3 -1
  7. package/contracts/greeter_interface.ral +3 -0
  8. package/contracts/greeter_main.ral +9 -0
  9. package/contracts/main.ral +3 -5
  10. package/dev/user.conf +8 -4
  11. package/dist/alephium-web3.min.js +1 -1
  12. package/dist/alephium-web3.min.js.map +1 -1
  13. package/dist/scripts/check-versions.d.ts +1 -0
  14. package/dist/scripts/check-versions.js +39 -0
  15. package/dist/{cli → scripts}/create-project.d.ts +0 -0
  16. package/dist/scripts/create-project.js +124 -0
  17. package/dist/scripts/header.d.ts +0 -0
  18. package/dist/scripts/header.js +18 -0
  19. package/dist/scripts/rename-gitignore.d.ts +1 -0
  20. package/dist/scripts/rename-gitignore.js +24 -0
  21. package/dist/scripts/start-devnet.d.ts +1 -0
  22. package/dist/scripts/start-devnet.js +131 -0
  23. package/dist/scripts/stop-devnet.d.ts +1 -0
  24. package/dist/scripts/stop-devnet.js +32 -0
  25. package/dist/{api → src/api}/api-alephium.d.ts +287 -168
  26. package/dist/{api → src/api}/api-alephium.js +497 -115
  27. package/dist/{api → src/api}/api-explorer.d.ts +117 -19
  28. package/dist/{api → src/api}/api-explorer.js +206 -46
  29. package/dist/src/api/index.d.ts +10 -0
  30. package/dist/src/api/index.js +55 -0
  31. package/dist/{lib → src}/constants.d.ts +0 -0
  32. package/dist/{lib → src}/constants.js +0 -0
  33. package/dist/src/contract/contract.d.ts +182 -0
  34. package/dist/src/contract/contract.js +760 -0
  35. package/dist/src/contract/events.d.ts +29 -0
  36. package/dist/src/contract/events.js +77 -0
  37. package/dist/src/contract/index.d.ts +3 -0
  38. package/dist/src/contract/index.js +32 -0
  39. package/dist/src/contract/ralph.d.ts +12 -0
  40. package/dist/src/contract/ralph.js +362 -0
  41. package/dist/src/index.d.ts +5 -0
  42. package/dist/src/index.js +34 -0
  43. package/dist/src/signer/index.d.ts +2 -0
  44. package/dist/src/signer/index.js +31 -0
  45. package/dist/src/signer/node-wallet.d.ts +13 -0
  46. package/dist/src/signer/node-wallet.js +60 -0
  47. package/dist/src/signer/signer.d.ts +143 -0
  48. package/dist/src/signer/signer.js +184 -0
  49. package/dist/src/test/index.d.ts +7 -0
  50. package/dist/src/test/index.js +41 -0
  51. package/dist/src/test/privatekey-wallet.d.ts +12 -0
  52. package/dist/src/test/privatekey-wallet.js +68 -0
  53. package/dist/{lib → src/utils}/address.d.ts +0 -0
  54. package/dist/{lib → src/utils}/address.js +1 -1
  55. package/dist/{lib → src/utils}/bs58.d.ts +2 -2
  56. package/dist/{lib → src/utils}/bs58.js +3 -1
  57. package/dist/{lib → src/utils}/djb2.d.ts +0 -0
  58. package/dist/{lib → src/utils}/djb2.js +1 -1
  59. package/dist/src/utils/index.d.ts +6 -0
  60. package/dist/src/utils/index.js +35 -0
  61. package/dist/{lib → src/utils}/password-crypto.d.ts +0 -0
  62. package/dist/{lib → src/utils}/password-crypto.js +8 -7
  63. package/dist/src/utils/transaction.d.ts +2 -0
  64. package/dist/src/utils/transaction.js +58 -0
  65. package/dist/src/utils/utils.d.ts +30 -0
  66. package/dist/{lib → src/utils}/utils.js +83 -19
  67. package/gitignore +5 -4
  68. package/package.json +56 -40
  69. package/scripts/create-project.ts +136 -0
  70. package/scripts/header.js +17 -0
  71. package/scripts/start-devnet.js +3 -3
  72. package/src/api/api-alephium.ts +2323 -0
  73. package/src/api/api-explorer.ts +808 -0
  74. package/src/api/index.ts +35 -0
  75. package/src/constants.ts +20 -0
  76. package/src/contract/contract.ts +1014 -0
  77. package/src/contract/events.ts +102 -0
  78. package/src/contract/index.ts +21 -0
  79. package/src/contract/ralph.test.ts +178 -0
  80. package/src/contract/ralph.ts +362 -0
  81. package/src/fixtures/address.json +36 -0
  82. package/src/fixtures/balance.json +9 -0
  83. package/src/fixtures/self-clique.json +19 -0
  84. package/src/fixtures/transaction.json +13 -0
  85. package/src/fixtures/transactions.json +179 -0
  86. package/src/index.ts +24 -0
  87. package/src/signer/fixtures/genesis.json +26 -0
  88. package/src/signer/fixtures/wallets.json +26 -0
  89. package/src/signer/index.ts +20 -0
  90. package/src/signer/node-wallet.ts +74 -0
  91. package/src/signer/signer.ts +313 -0
  92. package/src/test/index.ts +32 -0
  93. package/src/test/privatekey-wallet.ts +58 -0
  94. package/src/utils/address.test.ts +47 -0
  95. package/src/utils/address.ts +39 -0
  96. package/src/utils/bs58.ts +26 -0
  97. package/src/utils/djb2.test.ts +35 -0
  98. package/src/utils/djb2.ts +25 -0
  99. package/src/utils/index.ts +24 -0
  100. package/src/utils/password-crypto.test.ts +27 -0
  101. package/src/utils/password-crypto.ts +77 -0
  102. package/src/utils/transaction.test.ts +50 -0
  103. package/src/utils/transaction.ts +39 -0
  104. package/src/utils/utils.test.ts +160 -0
  105. package/src/utils/utils.ts +209 -0
  106. package/templates/{README.md → base/README.md} +4 -4
  107. package/templates/base/package.json +35 -0
  108. package/templates/base/src/greeter.ts +41 -0
  109. package/templates/base/tsconfig.json +19 -0
  110. package/templates/react/README.md +34 -0
  111. package/templates/react/config-overrides.js +18 -0
  112. package/templates/react/package.json +66 -0
  113. package/templates/react/src/App.tsx +42 -0
  114. package/templates/react/src/artifacts/greeter.ral.json +26 -0
  115. package/templates/react/src/artifacts/greeter_main.ral.json +22 -0
  116. package/templates/shared/.eslintrc.json +12 -0
  117. package/templates/shared/scripts/header.js +0 -0
  118. package/test/contract.test.ts +161 -0
  119. package/test/events.test.ts +139 -0
  120. package/webpack.config.js +1 -1
  121. package/contracts/greeter-main.ral +0 -8
  122. package/dist/cli/create-project.js +0 -87
  123. package/dist/lib/clique.d.ts +0 -23
  124. package/dist/lib/clique.js +0 -149
  125. package/dist/lib/contract.d.ts +0 -152
  126. package/dist/lib/contract.js +0 -711
  127. package/dist/lib/explorer.d.ts +0 -8
  128. package/dist/lib/explorer.js +0 -46
  129. package/dist/lib/index.d.ts +0 -12
  130. package/dist/lib/index.js +0 -60
  131. package/dist/lib/node.d.ts +0 -10
  132. package/dist/lib/node.js +0 -64
  133. package/dist/lib/numbers.d.ts +0 -7
  134. package/dist/lib/numbers.js +0 -128
  135. package/dist/lib/signer.d.ts +0 -17
  136. package/dist/lib/signer.js +0 -70
  137. package/dist/lib/storage-browser.d.ts +0 -9
  138. package/dist/lib/storage-browser.js +0 -52
  139. package/dist/lib/storage-node.d.ts +0 -9
  140. package/dist/lib/storage-node.js +0 -65
  141. package/dist/lib/utils.d.ts +0 -11
  142. package/dist/lib/wallet.d.ts +0 -30
  143. package/dist/lib/wallet.js +0 -142
  144. package/templates/package.json +0 -29
@@ -1,4 +1,5 @@
1
1
  export interface AddressBalance {
2
+ /** @format address */
2
3
  address: string;
3
4
  /** @format uint256 */
4
5
  balance: string;
@@ -11,35 +12,43 @@ export interface AddressBalance {
11
12
  warning?: string;
12
13
  }
13
14
  export interface AddressInfo {
15
+ /** @format address */
14
16
  address: string;
17
+ /** @format public-key */
15
18
  publicKey: string;
19
+ /** @format group-index */
16
20
  group: number;
17
21
  path: string;
18
22
  }
19
23
  export interface Addresses {
24
+ /** @format address */
20
25
  activeAddress: string;
21
26
  addresses: AddressInfo[];
22
27
  }
23
28
  export interface AssetInput {
24
29
  outputRef: OutputRef;
30
+ /** @format hex-string */
25
31
  unlockScript: string;
26
32
  }
27
33
  export interface AssetOutput {
28
34
  hint: number;
35
+ /** @format 32-byte-hash */
29
36
  key: string;
30
37
  /** @format uint256 */
31
38
  alphAmount: string;
39
+ /** @format address */
32
40
  address: string;
33
41
  tokens: Token[];
34
42
  /** @format int64 */
35
43
  lockTime: number;
36
- additionalData: string;
44
+ /** @format hex-string */
45
+ message: string;
37
46
  type: string;
38
47
  }
39
48
  export interface AssetState {
40
49
  /** @format uint256 */
41
50
  alphAmount: string;
42
- tokens: Token[];
51
+ tokens?: Token[];
43
52
  }
44
53
  export interface BadRequest {
45
54
  detail: string;
@@ -73,6 +82,7 @@ export interface Banned {
73
82
  type: string;
74
83
  }
75
84
  export interface BlockEntry {
85
+ /** @format block-hash */
76
86
  hash: string;
77
87
  /** @format int64 */
78
88
  timestamp: number;
@@ -81,13 +91,18 @@ export interface BlockEntry {
81
91
  height: number;
82
92
  deps: string[];
83
93
  transactions: Transaction[];
94
+ /** @format hex-string */
84
95
  nonce: string;
85
96
  version: number;
97
+ /** @format 32-byte-hash */
86
98
  depStateHash: string;
99
+ /** @format 32-byte-hash */
87
100
  txsHash: string;
101
+ /** @format hex-string */
88
102
  target: string;
89
103
  }
90
104
  export interface BlockHeaderEntry {
105
+ /** @format block-hash */
91
106
  hash: string;
92
107
  /** @format int64 */
93
108
  timestamp: number;
@@ -97,75 +112,98 @@ export interface BlockHeaderEntry {
97
112
  deps: string[];
98
113
  }
99
114
  export interface BrokerInfo {
115
+ /** @format clique-id */
100
116
  cliqueId: string;
101
117
  brokerId: number;
102
118
  brokerNum: number;
119
+ /** @format inet-socket-address */
103
120
  address: string;
104
121
  }
105
- export interface BuildContractDeployScriptTx {
122
+ export interface BuildDeployContractTx {
123
+ /** @format public-key */
106
124
  fromPublicKey: string;
125
+ /** @format hex-string */
107
126
  bytecode: string;
108
- initialFields: Val[];
109
127
  /** @format uint256 */
110
- alphAmount?: string;
128
+ initialAlphAmount?: string;
129
+ initialTokenAmounts?: Token[];
111
130
  /** @format uint256 */
112
131
  issueTokenAmount?: string;
113
- gas?: number;
132
+ /** @format gas */
133
+ gasAmount?: number;
114
134
  /** @format uint256 */
115
135
  gasPrice?: string;
116
- utxosLimit?: number;
117
136
  }
118
- export interface BuildContractDeployScriptTxResult {
119
- group: number;
137
+ export interface BuildDeployContractTxResult {
138
+ fromGroup: number;
139
+ toGroup: number;
120
140
  unsignedTx: string;
141
+ /** @format gas */
142
+ gasAmount: number;
143
+ /** @format uint256 */
144
+ gasPrice: string;
145
+ /** @format 32-byte-hash */
121
146
  txId: string;
147
+ /** @format address */
122
148
  contractAddress: string;
123
149
  }
150
+ export interface BuildExecuteScriptTx {
151
+ /** @format public-key */
152
+ fromPublicKey: string;
153
+ /** @format hex-string */
154
+ bytecode: string;
155
+ /** @format uint256 */
156
+ alphAmount?: string;
157
+ tokens?: Token[];
158
+ /** @format gas */
159
+ gasAmount?: number;
160
+ /** @format uint256 */
161
+ gasPrice?: string;
162
+ }
163
+ export interface BuildExecuteScriptTxResult {
164
+ fromGroup: number;
165
+ toGroup: number;
166
+ unsignedTx: string;
167
+ /** @format gas */
168
+ gasAmount: number;
169
+ /** @format uint256 */
170
+ gasPrice: string;
171
+ /** @format 32-byte-hash */
172
+ txId: string;
173
+ }
124
174
  export interface BuildInfo {
125
175
  releaseVersion: string;
126
176
  commit: string;
127
177
  }
128
178
  export interface BuildMultisig {
179
+ /** @format address */
129
180
  fromAddress: string;
130
181
  fromPublicKeys: string[];
131
182
  destinations: Destination[];
183
+ /** @format gas */
132
184
  gas?: number;
133
185
  /** @format uint256 */
134
186
  gasPrice?: string;
135
- utxosLimit?: number;
136
187
  }
137
188
  export interface BuildMultisigAddress {
138
189
  keys: string[];
139
190
  mrequired: number;
140
191
  }
141
192
  export interface BuildMultisigAddressResult {
193
+ /** @format address */
142
194
  address: string;
143
195
  }
144
- export interface BuildScriptTx {
145
- fromPublicKey: string;
146
- bytecode: string;
147
- /** @format uint256 */
148
- alphAmount?: string;
149
- tokens?: Token[];
150
- gas?: number;
151
- /** @format uint256 */
152
- gasPrice?: string;
153
- utxosLimit?: number;
154
- }
155
- export interface BuildScriptTxResult {
156
- unsignedTx: string;
157
- txId: string;
158
- group: number;
159
- }
160
196
  export interface BuildSweepAddressTransactions {
197
+ /** @format public-key */
161
198
  fromPublicKey: string;
199
+ /** @format address */
162
200
  toAddress: string;
163
201
  /** @format int64 */
164
202
  lockTime?: number;
165
- gas?: number;
203
+ /** @format gas */
204
+ gasAmount?: number;
166
205
  /** @format uint256 */
167
206
  gasPrice?: string;
168
- utxosLimit?: number;
169
207
  }
170
208
  export interface BuildSweepAddressTransactionsResult {
171
209
  unsignedTxs: SweepAddressTransaction[];
@@ -173,23 +211,47 @@ export interface BuildSweepAddressTransactionsResult {
173
211
  toGroup: number;
174
212
  }
175
213
  export interface BuildTransaction {
214
+ /** @format public-key */
176
215
  fromPublicKey: string;
177
216
  destinations: Destination[];
178
217
  utxos?: OutputRef[];
179
- gas?: number;
218
+ /** @format gas */
219
+ gasAmount?: number;
180
220
  /** @format uint256 */
181
221
  gasPrice?: string;
182
- utxosLimit?: number;
183
222
  }
184
223
  export interface BuildTransactionResult {
185
224
  unsignedTx: string;
225
+ /** @format gas */
186
226
  gasAmount: number;
187
227
  /** @format uint256 */
188
228
  gasPrice: string;
229
+ /** @format 32-byte-hash */
189
230
  txId: string;
190
231
  fromGroup: number;
191
232
  toGroup: number;
192
233
  }
234
+ export interface CallContract {
235
+ group: number;
236
+ /** @format block-hash */
237
+ worldStateBlockHash?: string;
238
+ /** @format 32-byte-hash */
239
+ txId?: string;
240
+ /** @format address */
241
+ address: string;
242
+ methodIndex: number;
243
+ args?: Val[];
244
+ existingContracts?: string[];
245
+ inputAssets?: TestInputAsset[];
246
+ }
247
+ export interface CallContractResult {
248
+ returns: Val[];
249
+ gasUsed: number;
250
+ contracts: ContractState[];
251
+ txInputs: string[];
252
+ txOutputs: Output[];
253
+ events: ContractEventByTxId[];
254
+ }
193
255
  export interface ChainInfo {
194
256
  currentHeight: number;
195
257
  }
@@ -200,16 +262,24 @@ export interface ChainParams {
200
262
  groups: number;
201
263
  }
202
264
  export interface ChangeActiveAddress {
265
+ /** @format address */
203
266
  address: string;
204
267
  }
205
- export interface CompileResult {
268
+ export interface CompileContractResult {
206
269
  bytecode: string;
270
+ /** @format 32-byte-hash */
207
271
  codeHash: string;
208
272
  fields: FieldsSig;
209
273
  functions: FunctionSig[];
210
274
  events: EventSig[];
211
275
  }
276
+ export interface CompileScriptResult {
277
+ bytecodeTemplate: string;
278
+ fields: FieldsSig;
279
+ functions: FunctionSig[];
280
+ }
212
281
  export interface Confirmed {
282
+ /** @format block-hash */
213
283
  blockHash: string;
214
284
  txIndex: number;
215
285
  chainConfirmations: number;
@@ -221,73 +291,104 @@ export interface Contract {
221
291
  code: string;
222
292
  }
223
293
  export interface ContractEvent {
294
+ /** @format block-hash */
224
295
  blockHash: string;
225
- contractAddress: string;
296
+ /** @format 32-byte-hash */
226
297
  txId: string;
227
298
  eventIndex: number;
228
299
  fields: Val[];
229
- type: string;
300
+ }
301
+ export interface ContractEventByTxId {
302
+ /** @format block-hash */
303
+ blockHash: string;
304
+ /** @format address */
305
+ contractAddress: string;
306
+ eventIndex: number;
307
+ fields: Val[];
308
+ }
309
+ export interface ContractEvents {
310
+ events: ContractEvent[];
311
+ nextStart: number;
312
+ }
313
+ export interface ContractEventsByTxId {
314
+ events: ContractEventByTxId[];
315
+ nextStart: number;
230
316
  }
231
317
  export interface ContractOutput {
232
318
  hint: number;
319
+ /** @format 32-byte-hash */
233
320
  key: string;
234
321
  /** @format uint256 */
235
322
  alphAmount: string;
323
+ /** @format address */
236
324
  address: string;
237
325
  tokens: Token[];
238
326
  type: string;
239
327
  }
240
328
  export interface ContractState {
329
+ /** @format address */
241
330
  address: string;
331
+ /** @format contract */
242
332
  bytecode: string;
333
+ /** @format 32-byte-hash */
243
334
  codeHash: string;
335
+ /** @format 32-byte-hash */
336
+ initialStateHash?: string;
244
337
  fields: Val[];
245
338
  asset: AssetState;
246
339
  }
247
- export interface DecodeTransaction {
340
+ export interface DecodeUnsignedTx {
248
341
  unsignedTx: string;
249
342
  }
343
+ export interface DecodeUnsignedTxResult {
344
+ fromGroup: number;
345
+ toGroup: number;
346
+ unsignedTx: UnsignedTx;
347
+ }
250
348
  export interface Destination {
349
+ /** @format address */
251
350
  address: string;
252
351
  /** @format uint256 */
253
352
  alphAmount: string;
254
353
  tokens?: Token[];
255
354
  /** @format int64 */
256
355
  lockTime?: number;
356
+ /** @format hex-string */
357
+ message?: string;
257
358
  }
258
359
  export declare type DiscoveryAction = Reachable | Unreachable;
259
- export declare type Event = ContractEvent | TxScriptEvent;
260
360
  export interface EventSig {
261
361
  name: string;
262
362
  signature: string;
363
+ fieldNames: string[];
263
364
  fieldTypes: string[];
264
365
  }
265
- export interface Events {
266
- chainFrom: number;
267
- chainTo: number;
268
- events: Event[];
269
- }
270
366
  export interface FetchResponse {
271
367
  blocks: BlockEntry[][];
272
368
  }
273
369
  export interface FieldsSig {
274
370
  signature: string;
371
+ names: string[];
275
372
  types: string[];
276
373
  }
277
374
  export interface FixedAssetOutput {
278
375
  hint: number;
376
+ /** @format 32-byte-hash */
279
377
  key: string;
280
378
  /** @format uint256 */
281
379
  alphAmount: string;
380
+ /** @format address */
282
381
  address: string;
283
382
  tokens: Token[];
284
383
  /** @format int64 */
285
384
  lockTime: number;
286
- additionalData: string;
385
+ /** @format hex-string */
386
+ message: string;
287
387
  }
288
388
  export interface FunctionSig {
289
389
  name: string;
290
390
  signature: string;
391
+ argNames: string[];
291
392
  argTypes: string[];
292
393
  returnTypes: string[];
293
394
  }
@@ -297,14 +398,12 @@ export interface Group {
297
398
  export interface HashesAtHeight {
298
399
  headers: string[];
299
400
  }
300
- export interface InputAsset {
301
- address: string;
302
- asset: AssetState;
303
- }
304
401
  export interface InterCliquePeerInfo {
402
+ /** @format clique-id */
305
403
  cliqueId: string;
306
404
  brokerId: number;
307
405
  groupNumPerBroker: number;
406
+ /** @format inet-socket-address */
308
407
  address: string;
309
408
  isSynced: boolean;
310
409
  clientVersion: string;
@@ -325,6 +424,7 @@ export declare type MisbehaviorAction = Ban | Unban;
325
424
  export interface NodeInfo {
326
425
  buildInfo: BuildInfo;
327
426
  upnp: boolean;
427
+ /** @format inet-socket-address */
328
428
  externalAddress?: string;
329
429
  }
330
430
  export interface NodeVersion {
@@ -337,15 +437,18 @@ export interface NotFound {
337
437
  export declare type Output = AssetOutput | ContractOutput;
338
438
  export interface OutputRef {
339
439
  hint: number;
440
+ /** @format 32-byte-hash */
340
441
  key: string;
341
442
  }
342
443
  export interface PeerAddress {
444
+ /** @format inet-address */
343
445
  address: string;
344
446
  restPort: number;
345
447
  wsPort: number;
346
448
  minerApiPort: number;
347
449
  }
348
450
  export interface PeerMisbehavior {
451
+ /** @format inet-address */
349
452
  peer: string;
350
453
  status: PeerStatus;
351
454
  }
@@ -373,6 +476,7 @@ export interface Script {
373
476
  code: string;
374
477
  }
375
478
  export interface SelfClique {
479
+ /** @format clique-id */
376
480
  cliqueId: string;
377
481
  nodes: PeerAddress[];
378
482
  selfReady: boolean;
@@ -385,6 +489,7 @@ export interface Sign {
385
489
  data: string;
386
490
  }
387
491
  export interface SignResult {
492
+ /** @format signature */
388
493
  signature: string;
389
494
  }
390
495
  export interface SubmitMultisig {
@@ -393,43 +498,71 @@ export interface SubmitMultisig {
393
498
  }
394
499
  export interface SubmitTransaction {
395
500
  unsignedTx: string;
501
+ /** @format signature */
396
502
  signature: string;
397
503
  }
504
+ export interface SubmitTxResult {
505
+ /** @format 32-byte-hash */
506
+ txId: string;
507
+ fromGroup: number;
508
+ toGroup: number;
509
+ }
398
510
  export interface Sweep {
511
+ /** @format address */
399
512
  toAddress: string;
400
513
  /** @format int64 */
401
514
  lockTime?: number;
402
- gas?: number;
515
+ /** @format gas */
516
+ gasAmount?: number;
403
517
  /** @format uint256 */
404
518
  gasPrice?: string;
405
519
  utxosLimit?: number;
406
520
  }
407
521
  export interface SweepAddressTransaction {
522
+ /** @format 32-byte-hash */
408
523
  txId: string;
409
524
  unsignedTx: string;
525
+ /** @format gas */
410
526
  gasAmount: number;
411
527
  /** @format uint256 */
412
528
  gasPrice: string;
413
529
  }
414
530
  export interface TestContract {
415
531
  group?: number;
532
+ /** @format block-hash */
533
+ blockHash?: string;
534
+ /** @format 32-byte-hash */
535
+ txId?: string;
536
+ /** @format address */
416
537
  address?: string;
538
+ /** @format contract */
417
539
  bytecode: string;
418
- initialFields: Val[];
540
+ initialFields?: Val[];
419
541
  initialAsset?: AssetState;
420
- testMethodIndex?: number;
421
- testArgs: Val[];
542
+ methodIndex?: number;
543
+ args?: Val[];
422
544
  existingContracts?: ContractState[];
423
- inputAssets?: InputAsset[];
545
+ inputAssets?: TestInputAsset[];
424
546
  }
425
547
  export interface TestContractResult {
548
+ /** @format address */
549
+ address: string;
550
+ /** @format 32-byte-hash */
551
+ codeHash: string;
426
552
  returns: Val[];
427
553
  gasUsed: number;
428
554
  contracts: ContractState[];
555
+ txInputs: string[];
429
556
  txOutputs: Output[];
430
- events: Event[];
557
+ events: ContractEventByTxId[];
558
+ }
559
+ export interface TestInputAsset {
560
+ /** @format address */
561
+ address: string;
562
+ asset: AssetState;
431
563
  }
432
564
  export interface Token {
565
+ /** @format 32-byte-hash */
433
566
  id: string;
434
567
  /** @format uint256 */
435
568
  amount: string;
@@ -449,14 +582,18 @@ export interface TransactionTemplate {
449
582
  }
450
583
  export interface Transfer {
451
584
  destinations: Destination[];
585
+ /** @format gas */
452
586
  gas?: number;
453
587
  /** @format uint256 */
454
588
  gasPrice?: string;
455
589
  utxosLimit?: number;
456
590
  }
457
591
  export interface TransferResult {
592
+ /** @format 32-byte-hash */
458
593
  txId: string;
594
+ /** @format group-index */
459
595
  fromGroup: number;
596
+ /** @format group-index */
460
597
  toGroup: number;
461
598
  }
462
599
  export interface TransferResults {
@@ -465,18 +602,6 @@ export interface TransferResults {
465
602
  export interface TxNotFound {
466
603
  type: string;
467
604
  }
468
- export interface TxResult {
469
- txId: string;
470
- fromGroup: number;
471
- toGroup: number;
472
- }
473
- export interface TxScriptEvent {
474
- blockHash: string;
475
- txId: string;
476
- eventIndex: number;
477
- fields: Val[];
478
- type: string;
479
- }
480
605
  export declare type TxStatus = Confirmed | MemPooled | TxNotFound;
481
606
  export interface UTXO {
482
607
  ref: OutputRef;
@@ -485,6 +610,7 @@ export interface UTXO {
485
610
  tokens: Token[];
486
611
  /** @format int64 */
487
612
  lockTime: number;
613
+ /** @format hex-string */
488
614
  additionalData: string;
489
615
  }
490
616
  export interface UTXOs {
@@ -508,9 +634,11 @@ export interface Unreachable {
508
634
  type: string;
509
635
  }
510
636
  export interface UnsignedTx {
637
+ /** @format 32-byte-hash */
511
638
  txId: string;
512
639
  version: number;
513
640
  networkId: number;
641
+ /** @format script */
514
642
  scriptOpt?: string;
515
643
  gasAmount: number;
516
644
  /** @format uint256 */
@@ -520,6 +648,7 @@ export interface UnsignedTx {
520
648
  }
521
649
  export declare type Val = ValAddress | ValArray | ValBool | ValByteVec | ValI256 | ValU256;
522
650
  export interface ValAddress {
651
+ /** @format address */
523
652
  value: string;
524
653
  type: string;
525
654
  }
@@ -532,6 +661,7 @@ export interface ValBool {
532
661
  type: string;
533
662
  }
534
663
  export interface ValByteVec {
664
+ /** @format hex-string */
535
665
  value: string;
536
666
  type: string;
537
667
  }
@@ -545,8 +675,11 @@ export interface ValU256 {
545
675
  type: string;
546
676
  }
547
677
  export interface VerifySignature {
678
+ /** @format hex-string */
548
679
  data: string;
680
+ /** @format signature */
549
681
  signature: string;
682
+ /** @format public-key */
550
683
  publicKey: string;
551
684
  }
552
685
  export interface WalletCreation {
@@ -641,7 +774,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
641
774
  }
642
775
  /**
643
776
  * @title Alephium API
644
- * @version 1.3.0
777
+ * @version 1.4.0
645
778
  * @baseUrl {protocol}://{host}:{port}
646
779
  */
647
780
  export declare class Api<SecurityDataType extends unknown> extends HttpClient<SecurityDataType> {
@@ -654,7 +787,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
654
787
  * @summary List available wallets
655
788
  * @request GET:/wallets
656
789
  */
657
- getWallets: (params?: RequestParams) => Promise<HttpResponse<WalletStatus[], BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
790
+ getWallets: (params?: RequestParams) => Promise<WalletStatus[]>;
658
791
  /**
659
792
  * No description
660
793
  *
@@ -663,7 +796,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
663
796
  * @summary Restore a wallet from your mnemonic
664
797
  * @request PUT:/wallets
665
798
  */
666
- putWallets: (data: WalletRestore, params?: RequestParams) => Promise<HttpResponse<WalletRestoreResult, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
799
+ putWallets: (data: WalletRestore, params?: RequestParams) => Promise<WalletRestoreResult>;
667
800
  /**
668
801
  * @description A new wallet will be created and respond with a mnemonic. Make sure to keep that mnemonic safely as it will allows you to recover your wallet. Default mnemonic size is 24, (options: 12, 15, 18, 21, 24).
669
802
  *
@@ -672,7 +805,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
672
805
  * @summary Create a new wallet
673
806
  * @request POST:/wallets
674
807
  */
675
- postWallets: (data: WalletCreation, params?: RequestParams) => Promise<HttpResponse<WalletCreationResult, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
808
+ postWallets: (data: WalletCreation, params?: RequestParams) => Promise<WalletCreationResult>;
676
809
  /**
677
810
  * No description
678
811
  *
@@ -681,7 +814,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
681
814
  * @summary Get wallet's status
682
815
  * @request GET:/wallets/{wallet_name}
683
816
  */
684
- getWalletsWalletName: (walletName: string, params?: RequestParams) => Promise<HttpResponse<WalletStatus, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
817
+ getWalletsWalletName: (walletName: string, params?: RequestParams) => Promise<WalletStatus>;
685
818
  /**
686
819
  * No description
687
820
  *
@@ -690,7 +823,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
690
823
  * @summary Delete your wallet file (can be recovered with your mnemonic)
691
824
  * @request DELETE:/wallets/{wallet_name}
692
825
  */
693
- deleteWalletsWalletName: (walletName: string, data: WalletDeletion, params?: RequestParams) => Promise<HttpResponse<void, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
826
+ deleteWalletsWalletName: (walletName: string, data: WalletDeletion, params?: RequestParams) => Promise<void>;
694
827
  /**
695
828
  * No description
696
829
  *
@@ -699,7 +832,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
699
832
  * @summary Lock your wallet
700
833
  * @request POST:/wallets/{wallet_name}/lock
701
834
  */
702
- postWalletsWalletNameLock: (walletName: string, params?: RequestParams) => Promise<HttpResponse<void, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
835
+ postWalletsWalletNameLock: (walletName: string, params?: RequestParams) => Promise<void>;
703
836
  /**
704
837
  * No description
705
838
  *
@@ -708,7 +841,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
708
841
  * @summary Unlock your wallet
709
842
  * @request POST:/wallets/{wallet_name}/unlock
710
843
  */
711
- postWalletsWalletNameUnlock: (walletName: string, data: WalletUnlock, params?: RequestParams) => Promise<HttpResponse<void, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
844
+ postWalletsWalletNameUnlock: (walletName: string, data: WalletUnlock, params?: RequestParams) => Promise<void>;
712
845
  /**
713
846
  * No description
714
847
  *
@@ -717,9 +850,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
717
850
  * @summary Get your total balance
718
851
  * @request GET:/wallets/{wallet_name}/balances
719
852
  */
720
- getWalletsWalletNameBalances: (walletName: string, query?: {
721
- utxosLimit?: number | undefined;
722
- } | undefined, params?: RequestParams) => Promise<HttpResponse<Balances, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
853
+ getWalletsWalletNameBalances: (walletName: string, params?: RequestParams) => Promise<Balances>;
723
854
  /**
724
855
  * No description
725
856
  *
@@ -728,7 +859,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
728
859
  * @summary Reveal your mnemonic. !!! use it with caution !!!
729
860
  * @request POST:/wallets/{wallet_name}/reveal-mnemonic
730
861
  */
731
- postWalletsWalletNameRevealMnemonic: (walletName: string, data: RevealMnemonic, params?: RequestParams) => Promise<HttpResponse<RevealMnemonicResult, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
862
+ postWalletsWalletNameRevealMnemonic: (walletName: string, data: RevealMnemonic, params?: RequestParams) => Promise<RevealMnemonicResult>;
732
863
  /**
733
864
  * No description
734
865
  *
@@ -737,7 +868,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
737
868
  * @summary Transfer ALPH from the active address
738
869
  * @request POST:/wallets/{wallet_name}/transfer
739
870
  */
740
- postWalletsWalletNameTransfer: (walletName: string, data: Transfer, params?: RequestParams) => Promise<HttpResponse<TransferResult, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
871
+ postWalletsWalletNameTransfer: (walletName: string, data: Transfer, params?: RequestParams) => Promise<TransferResult>;
741
872
  /**
742
873
  * No description
743
874
  *
@@ -746,7 +877,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
746
877
  * @summary Transfer all unlocked ALPH from the active address to another address
747
878
  * @request POST:/wallets/{wallet_name}/sweep-active-address
748
879
  */
749
- postWalletsWalletNameSweepActiveAddress: (walletName: string, data: Sweep, params?: RequestParams) => Promise<HttpResponse<TransferResults, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
880
+ postWalletsWalletNameSweepActiveAddress: (walletName: string, data: Sweep, params?: RequestParams) => Promise<TransferResults>;
750
881
  /**
751
882
  * No description
752
883
  *
@@ -755,7 +886,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
755
886
  * @summary Transfer unlocked ALPH from all addresses (including all mining addresses if applicable) to another address
756
887
  * @request POST:/wallets/{wallet_name}/sweep-all-addresses
757
888
  */
758
- postWalletsWalletNameSweepAllAddresses: (walletName: string, data: Sweep, params?: RequestParams) => Promise<HttpResponse<TransferResults, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
889
+ postWalletsWalletNameSweepAllAddresses: (walletName: string, data: Sweep, params?: RequestParams) => Promise<TransferResults>;
759
890
  /**
760
891
  * No description
761
892
  *
@@ -764,7 +895,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
764
895
  * @summary Sign the given data and return back the signature
765
896
  * @request POST:/wallets/{wallet_name}/sign
766
897
  */
767
- postWalletsWalletNameSign: (walletName: string, data: Sign, params?: RequestParams) => Promise<HttpResponse<SignResult, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
898
+ postWalletsWalletNameSign: (walletName: string, data: Sign, params?: RequestParams) => Promise<SignResult>;
768
899
  /**
769
900
  * No description
770
901
  *
@@ -773,7 +904,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
773
904
  * @summary List all your wallet's addresses
774
905
  * @request GET:/wallets/{wallet_name}/addresses
775
906
  */
776
- getWalletsWalletNameAddresses: (walletName: string, params?: RequestParams) => Promise<HttpResponse<Addresses, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
907
+ getWalletsWalletNameAddresses: (walletName: string, params?: RequestParams) => Promise<Addresses>;
777
908
  /**
778
909
  * No description
779
910
  *
@@ -782,7 +913,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
782
913
  * @summary Get address' info
783
914
  * @request GET:/wallets/{wallet_name}/addresses/{address}
784
915
  */
785
- getWalletsWalletNameAddressesAddress: (walletName: string, address: string, params?: RequestParams) => Promise<HttpResponse<AddressInfo, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
916
+ getWalletsWalletNameAddressesAddress: (walletName: string, address: string, params?: RequestParams) => Promise<AddressInfo>;
786
917
  /**
787
918
  * @description This endpoint can only be called if the wallet was created with the `isMiner = true` flag
788
919
  *
@@ -791,7 +922,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
791
922
  * @summary List all miner addresses per group
792
923
  * @request GET:/wallets/{wallet_name}/miner-addresses
793
924
  */
794
- getWalletsWalletNameMinerAddresses: (walletName: string, params?: RequestParams) => Promise<HttpResponse<MinerAddressesInfo[], BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
925
+ getWalletsWalletNameMinerAddresses: (walletName: string, params?: RequestParams) => Promise<MinerAddressesInfo[]>;
795
926
  /**
796
927
  * @description Cannot be called from a miner wallet
797
928
  *
@@ -802,7 +933,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
802
933
  */
803
934
  postWalletsWalletNameDeriveNextAddress: (walletName: string, query?: {
804
935
  group?: number | undefined;
805
- } | undefined, params?: RequestParams) => Promise<HttpResponse<AddressInfo, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
936
+ } | undefined, params?: RequestParams) => Promise<AddressInfo>;
806
937
  /**
807
938
  * @description Your wallet need to have been created with the miner flag set to true
808
939
  *
@@ -811,7 +942,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
811
942
  * @summary Derive your next miner addresses for each group
812
943
  * @request POST:/wallets/{wallet_name}/derive-next-miner-addresses
813
944
  */
814
- postWalletsWalletNameDeriveNextMinerAddresses: (walletName: string, params?: RequestParams) => Promise<HttpResponse<AddressInfo[], BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
945
+ postWalletsWalletNameDeriveNextMinerAddresses: (walletName: string, params?: RequestParams) => Promise<AddressInfo[]>;
815
946
  /**
816
947
  * No description
817
948
  *
@@ -820,7 +951,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
820
951
  * @summary Choose the active address
821
952
  * @request POST:/wallets/{wallet_name}/change-active-address
822
953
  */
823
- postWalletsWalletNameChangeActiveAddress: (walletName: string, data: ChangeActiveAddress, params?: RequestParams) => Promise<HttpResponse<void, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
954
+ postWalletsWalletNameChangeActiveAddress: (walletName: string, data: ChangeActiveAddress, params?: RequestParams) => Promise<void>;
824
955
  };
825
956
  infos: {
826
957
  /**
@@ -831,7 +962,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
831
962
  * @summary Get info about that node
832
963
  * @request GET:/infos/node
833
964
  */
834
- getInfosNode: (params?: RequestParams) => Promise<HttpResponse<NodeInfo, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
965
+ getInfosNode: (params?: RequestParams) => Promise<NodeInfo>;
835
966
  /**
836
967
  * No description
837
968
  *
@@ -840,7 +971,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
840
971
  * @summary Get version about that node
841
972
  * @request GET:/infos/version
842
973
  */
843
- getInfosVersion: (params?: RequestParams) => Promise<HttpResponse<NodeVersion, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
974
+ getInfosVersion: (params?: RequestParams) => Promise<NodeVersion>;
844
975
  /**
845
976
  * No description
846
977
  *
@@ -849,7 +980,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
849
980
  * @summary Get key params about your blockchain
850
981
  * @request GET:/infos/chain-params
851
982
  */
852
- getInfosChainParams: (params?: RequestParams) => Promise<HttpResponse<ChainParams, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
983
+ getInfosChainParams: (params?: RequestParams) => Promise<ChainParams>;
853
984
  /**
854
985
  * No description
855
986
  *
@@ -858,7 +989,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
858
989
  * @summary Get info about your own clique
859
990
  * @request GET:/infos/self-clique
860
991
  */
861
- getInfosSelfClique: (params?: RequestParams) => Promise<HttpResponse<SelfClique, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
992
+ getInfosSelfClique: (params?: RequestParams) => Promise<SelfClique>;
862
993
  /**
863
994
  * No description
864
995
  *
@@ -867,7 +998,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
867
998
  * @summary Get infos about the inter cliques
868
999
  * @request GET:/infos/inter-clique-peer-info
869
1000
  */
870
- getInfosInterCliquePeerInfo: (params?: RequestParams) => Promise<HttpResponse<InterCliquePeerInfo[], BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1001
+ getInfosInterCliquePeerInfo: (params?: RequestParams) => Promise<InterCliquePeerInfo[]>;
871
1002
  /**
872
1003
  * No description
873
1004
  *
@@ -876,7 +1007,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
876
1007
  * @summary Get discovered neighbors
877
1008
  * @request GET:/infos/discovered-neighbors
878
1009
  */
879
- getInfosDiscoveredNeighbors: (params?: RequestParams) => Promise<HttpResponse<BrokerInfo[], BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1010
+ getInfosDiscoveredNeighbors: (params?: RequestParams) => Promise<BrokerInfo[]>;
880
1011
  /**
881
1012
  * No description
882
1013
  *
@@ -885,7 +1016,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
885
1016
  * @summary Get the misbehaviors of peers
886
1017
  * @request GET:/infos/misbehaviors
887
1018
  */
888
- getInfosMisbehaviors: (params?: RequestParams) => Promise<HttpResponse<PeerMisbehavior[], BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1019
+ getInfosMisbehaviors: (params?: RequestParams) => Promise<PeerMisbehavior[]>;
889
1020
  /**
890
1021
  * No description
891
1022
  *
@@ -894,7 +1025,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
894
1025
  * @summary Ban/Unban given peers
895
1026
  * @request POST:/infos/misbehaviors
896
1027
  */
897
- postInfosMisbehaviors: (data: MisbehaviorAction, params?: RequestParams) => Promise<HttpResponse<void, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1028
+ postInfosMisbehaviors: (data: MisbehaviorAction, params?: RequestParams) => Promise<void>;
898
1029
  /**
899
1030
  * No description
900
1031
  *
@@ -903,7 +1034,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
903
1034
  * @summary Get the unreachable brokers
904
1035
  * @request GET:/infos/unreachable
905
1036
  */
906
- getInfosUnreachable: (params?: RequestParams) => Promise<HttpResponse<string[], BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1037
+ getInfosUnreachable: (params?: RequestParams) => Promise<string[]>;
907
1038
  /**
908
1039
  * No description
909
1040
  *
@@ -912,7 +1043,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
912
1043
  * @summary Set brokers to be unreachable/reachable
913
1044
  * @request POST:/infos/discovery
914
1045
  */
915
- postInfosDiscovery: (data: DiscoveryAction, params?: RequestParams) => Promise<HttpResponse<void, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1046
+ postInfosDiscovery: (data: DiscoveryAction, params?: RequestParams) => Promise<void>;
916
1047
  /**
917
1048
  * No description
918
1049
  *
@@ -924,7 +1055,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
924
1055
  getInfosHistoryHashrate: (query: {
925
1056
  fromTs: number;
926
1057
  toTs?: number;
927
- }, params?: RequestParams) => Promise<HttpResponse<string, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1058
+ }, params?: RequestParams) => Promise<string>;
928
1059
  /**
929
1060
  * No description
930
1061
  *
@@ -935,7 +1066,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
935
1066
  */
936
1067
  getInfosCurrentHashrate: (query?: {
937
1068
  timespan?: number | undefined;
938
- } | undefined, params?: RequestParams) => Promise<HttpResponse<string, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1069
+ } | undefined, params?: RequestParams) => Promise<string>;
939
1070
  };
940
1071
  blockflow: {
941
1072
  /**
@@ -949,7 +1080,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
949
1080
  getBlockflow: (query: {
950
1081
  fromTs: number;
951
1082
  toTs?: number;
952
- }, params?: RequestParams) => Promise<HttpResponse<FetchResponse, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1083
+ }, params?: RequestParams) => Promise<FetchResponse>;
953
1084
  /**
954
1085
  * No description
955
1086
  *
@@ -958,7 +1089,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
958
1089
  * @summary Get a block with hash
959
1090
  * @request GET:/blockflow/blocks/{block_hash}
960
1091
  */
961
- getBlockflowBlocksBlockHash: (blockHash: string, params?: RequestParams) => Promise<HttpResponse<BlockEntry, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1092
+ getBlockflowBlocksBlockHash: (blockHash: string, params?: RequestParams) => Promise<BlockEntry>;
962
1093
  /**
963
1094
  * No description
964
1095
  *
@@ -969,7 +1100,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
969
1100
  */
970
1101
  getBlockflowIsBlockInMainChain: (query: {
971
1102
  blockHash: string;
972
- }, params?: RequestParams) => Promise<HttpResponse<boolean, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1103
+ }, params?: RequestParams) => Promise<boolean>;
973
1104
  /**
974
1105
  * No description
975
1106
  *
@@ -982,7 +1113,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
982
1113
  fromGroup: number;
983
1114
  toGroup: number;
984
1115
  height: number;
985
- }, params?: RequestParams) => Promise<HttpResponse<HashesAtHeight, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1116
+ }, params?: RequestParams) => Promise<HashesAtHeight>;
986
1117
  /**
987
1118
  * No description
988
1119
  *
@@ -994,7 +1125,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
994
1125
  getBlockflowChainInfo: (query: {
995
1126
  fromGroup: number;
996
1127
  toGroup: number;
997
- }, params?: RequestParams) => Promise<HttpResponse<ChainInfo, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1128
+ }, params?: RequestParams) => Promise<ChainInfo>;
998
1129
  /**
999
1130
  * No description
1000
1131
  *
@@ -1003,7 +1134,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1003
1134
  * @summary Get block header
1004
1135
  * @request GET:/blockflow/headers/{block_hash}
1005
1136
  */
1006
- getBlockflowHeadersBlockHash: (blockHash: string, params?: RequestParams) => Promise<HttpResponse<BlockHeaderEntry, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1137
+ getBlockflowHeadersBlockHash: (blockHash: string, params?: RequestParams) => Promise<BlockHeaderEntry>;
1007
1138
  };
1008
1139
  addresses: {
1009
1140
  /**
@@ -1014,9 +1145,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1014
1145
  * @summary Get the balance of an address
1015
1146
  * @request GET:/addresses/{address}/balance
1016
1147
  */
1017
- getAddressesAddressBalance: (address: string, query?: {
1018
- utxosLimit?: number | undefined;
1019
- } | undefined, params?: RequestParams) => Promise<HttpResponse<Balance, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1148
+ getAddressesAddressBalance: (address: string, params?: RequestParams) => Promise<Balance>;
1020
1149
  /**
1021
1150
  * No description
1022
1151
  *
@@ -1025,9 +1154,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1025
1154
  * @summary Get the UTXOs of an address
1026
1155
  * @request GET:/addresses/{address}/utxos
1027
1156
  */
1028
- getAddressesAddressUtxos: (address: string, query?: {
1029
- utxosLimit?: number | undefined;
1030
- } | undefined, params?: RequestParams) => Promise<HttpResponse<UTXOs, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1157
+ getAddressesAddressUtxos: (address: string, params?: RequestParams) => Promise<UTXOs>;
1031
1158
  /**
1032
1159
  * No description
1033
1160
  *
@@ -1036,7 +1163,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1036
1163
  * @summary Get the group of an address
1037
1164
  * @request GET:/addresses/{address}/group
1038
1165
  */
1039
- getAddressesAddressGroup: (address: string, params?: RequestParams) => Promise<HttpResponse<Group, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1166
+ getAddressesAddressGroup: (address: string, params?: RequestParams) => Promise<Group>;
1040
1167
  };
1041
1168
  transactions: {
1042
1169
  /**
@@ -1047,7 +1174,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1047
1174
  * @summary List unconfirmed transactions
1048
1175
  * @request GET:/transactions/unconfirmed
1049
1176
  */
1050
- getTransactionsUnconfirmed: (params?: RequestParams) => Promise<HttpResponse<UnconfirmedTransactions[], BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1177
+ getTransactionsUnconfirmed: (params?: RequestParams) => Promise<UnconfirmedTransactions[]>;
1051
1178
  /**
1052
1179
  * No description
1053
1180
  *
@@ -1056,7 +1183,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1056
1183
  * @summary Build an unsigned transaction to a number of recipients
1057
1184
  * @request POST:/transactions/build
1058
1185
  */
1059
- postTransactionsBuild: (data: BuildTransaction, params?: RequestParams) => Promise<HttpResponse<BuildTransactionResult, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1186
+ postTransactionsBuild: (data: BuildTransaction, params?: RequestParams) => Promise<BuildTransactionResult>;
1060
1187
  /**
1061
1188
  * No description
1062
1189
  *
@@ -1065,7 +1192,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1065
1192
  * @summary Build unsigned transactions to send all unlocked balanced of one address to another address
1066
1193
  * @request POST:/transactions/sweep-address/build
1067
1194
  */
1068
- postTransactionsSweepAddressBuild: (data: BuildSweepAddressTransactions, params?: RequestParams) => Promise<HttpResponse<BuildSweepAddressTransactionsResult, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1195
+ postTransactionsSweepAddressBuild: (data: BuildSweepAddressTransactions, params?: RequestParams) => Promise<BuildSweepAddressTransactionsResult>;
1069
1196
  /**
1070
1197
  * No description
1071
1198
  *
@@ -1074,7 +1201,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1074
1201
  * @summary Submit a signed transaction
1075
1202
  * @request POST:/transactions/submit
1076
1203
  */
1077
- postTransactionsSubmit: (data: SubmitTransaction, params?: RequestParams) => Promise<HttpResponse<TxResult, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1204
+ postTransactionsSubmit: (data: SubmitTransaction, params?: RequestParams) => Promise<SubmitTxResult>;
1078
1205
  /**
1079
1206
  * No description
1080
1207
  *
@@ -1083,7 +1210,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1083
1210
  * @summary Decode an unsigned transaction
1084
1211
  * @request POST:/transactions/decode-unsigned-tx
1085
1212
  */
1086
- postTransactionsDecodeUnsignedTx: (data: DecodeTransaction, params?: RequestParams) => Promise<HttpResponse<UnsignedTx, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1213
+ postTransactionsDecodeUnsignedTx: (data: DecodeUnsignedTx, params?: RequestParams) => Promise<DecodeUnsignedTxResult>;
1087
1214
  /**
1088
1215
  * No description
1089
1216
  *
@@ -1096,7 +1223,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1096
1223
  txId: string;
1097
1224
  fromGroup?: number;
1098
1225
  toGroup?: number;
1099
- }, params?: RequestParams) => Promise<HttpResponse<TxStatus, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1226
+ }, params?: RequestParams) => Promise<Confirmed | MemPooled | TxNotFound>;
1100
1227
  };
1101
1228
  contracts: {
1102
1229
  /**
@@ -1107,16 +1234,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1107
1234
  * @summary Compile a script
1108
1235
  * @request POST:/contracts/compile-script
1109
1236
  */
1110
- postContractsCompileScript: (data: Script, params?: RequestParams) => Promise<HttpResponse<CompileResult, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1237
+ postContractsCompileScript: (data: Script, params?: RequestParams) => Promise<CompileScriptResult>;
1111
1238
  /**
1112
1239
  * No description
1113
1240
  *
1114
1241
  * @tags Contracts
1115
- * @name PostContractsUnsignedTxBuildScript
1242
+ * @name PostContractsUnsignedTxExecuteScript
1116
1243
  * @summary Build an unsigned script
1117
- * @request POST:/contracts/unsigned-tx/build-script
1244
+ * @request POST:/contracts/unsigned-tx/execute-script
1118
1245
  */
1119
- postContractsUnsignedTxBuildScript: (data: BuildScriptTx, params?: RequestParams) => Promise<HttpResponse<BuildScriptTxResult, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1246
+ postContractsUnsignedTxExecuteScript: (data: BuildExecuteScriptTx, params?: RequestParams) => Promise<BuildExecuteScriptTxResult>;
1120
1247
  /**
1121
1248
  * No description
1122
1249
  *
@@ -1125,16 +1252,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1125
1252
  * @summary Compile a smart contract
1126
1253
  * @request POST:/contracts/compile-contract
1127
1254
  */
1128
- postContractsCompileContract: (data: Contract, params?: RequestParams) => Promise<HttpResponse<CompileResult, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1255
+ postContractsCompileContract: (data: Contract, params?: RequestParams) => Promise<CompileContractResult>;
1129
1256
  /**
1130
1257
  * No description
1131
1258
  *
1132
1259
  * @tags Contracts
1133
- * @name PostContractsUnsignedTxBuildContract
1260
+ * @name PostContractsUnsignedTxDeployContract
1134
1261
  * @summary Build an unsigned contract
1135
- * @request POST:/contracts/unsigned-tx/build-contract
1262
+ * @request POST:/contracts/unsigned-tx/deploy-contract
1136
1263
  */
1137
- postContractsUnsignedTxBuildContract: (data: BuildContractDeployScriptTx, params?: RequestParams) => Promise<HttpResponse<BuildContractDeployScriptTxResult, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1264
+ postContractsUnsignedTxDeployContract: (data: BuildDeployContractTx, params?: RequestParams) => Promise<BuildDeployContractTxResult>;
1138
1265
  /**
1139
1266
  * No description
1140
1267
  *
@@ -1145,7 +1272,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1145
1272
  */
1146
1273
  getContractsAddressState: (address: string, query: {
1147
1274
  group: number;
1148
- }, params?: RequestParams) => Promise<HttpResponse<ContractState, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1275
+ }, params?: RequestParams) => Promise<ContractState>;
1149
1276
  /**
1150
1277
  * No description
1151
1278
  *
@@ -1154,7 +1281,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1154
1281
  * @summary Test contract
1155
1282
  * @request POST:/contracts/test-contract
1156
1283
  */
1157
- postContractsTestContract: (data: TestContract, params?: RequestParams) => Promise<HttpResponse<TestContractResult, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1284
+ postContractsTestContract: (data: TestContract, params?: RequestParams) => Promise<TestContractResult>;
1285
+ /**
1286
+ * No description
1287
+ *
1288
+ * @tags Contracts
1289
+ * @name PostContractsCallContract
1290
+ * @summary Call contract
1291
+ * @request POST:/contracts/call-contract
1292
+ */
1293
+ postContractsCallContract: (data: CallContract, params?: RequestParams) => Promise<CallContractResult>;
1158
1294
  };
1159
1295
  multisig: {
1160
1296
  /**
@@ -1165,7 +1301,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1165
1301
  * @summary Create the multisig address and unlock script
1166
1302
  * @request POST:/multisig/address
1167
1303
  */
1168
- postMultisigAddress: (data: BuildMultisigAddress, params?: RequestParams) => Promise<HttpResponse<BuildMultisigAddressResult, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1304
+ postMultisigAddress: (data: BuildMultisigAddress, params?: RequestParams) => Promise<BuildMultisigAddressResult>;
1169
1305
  /**
1170
1306
  * No description
1171
1307
  *
@@ -1174,7 +1310,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1174
1310
  * @summary Build a multisig unsigned transaction
1175
1311
  * @request POST:/multisig/build
1176
1312
  */
1177
- postMultisigBuild: (data: BuildMultisig, params?: RequestParams) => Promise<HttpResponse<BuildTransactionResult, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1313
+ postMultisigBuild: (data: BuildMultisig, params?: RequestParams) => Promise<BuildTransactionResult>;
1178
1314
  /**
1179
1315
  * No description
1180
1316
  *
@@ -1183,7 +1319,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1183
1319
  * @summary Submit a multi-signed transaction
1184
1320
  * @request POST:/multisig/submit
1185
1321
  */
1186
- postMultisigSubmit: (data: SubmitMultisig, params?: RequestParams) => Promise<HttpResponse<TxResult, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1322
+ postMultisigSubmit: (data: SubmitMultisig, params?: RequestParams) => Promise<SubmitTxResult>;
1187
1323
  };
1188
1324
  utils: {
1189
1325
  /**
@@ -1194,7 +1330,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1194
1330
  * @summary Verify the SecP256K1 signature of some data
1195
1331
  * @request POST:/utils/verify-signature
1196
1332
  */
1197
- postUtilsVerifySignature: (data: VerifySignature, params?: RequestParams) => Promise<HttpResponse<boolean, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1333
+ postUtilsVerifySignature: (data: VerifySignature, params?: RequestParams) => Promise<boolean>;
1198
1334
  /**
1199
1335
  * No description
1200
1336
  *
@@ -1203,7 +1339,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1203
1339
  * @summary Check and repair the indexing of block hashes
1204
1340
  * @request PUT:/utils/check-hash-indexing
1205
1341
  */
1206
- putUtilsCheckHashIndexing: (params?: RequestParams) => Promise<HttpResponse<void, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1342
+ putUtilsCheckHashIndexing: (params?: RequestParams) => Promise<void>;
1207
1343
  };
1208
1344
  miners: {
1209
1345
  /**
@@ -1216,7 +1352,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1216
1352
  */
1217
1353
  postMinersCpuMining: (query: {
1218
1354
  action: string;
1219
- }, params?: RequestParams) => Promise<HttpResponse<boolean, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1355
+ }, params?: RequestParams) => Promise<boolean>;
1220
1356
  /**
1221
1357
  * No description
1222
1358
  *
@@ -1225,7 +1361,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1225
1361
  * @summary List miner's addresses
1226
1362
  * @request GET:/miners/addresses
1227
1363
  */
1228
- getMinersAddresses: (params?: RequestParams) => Promise<HttpResponse<MinerAddresses, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1364
+ getMinersAddresses: (params?: RequestParams) => Promise<MinerAddresses>;
1229
1365
  /**
1230
1366
  * No description
1231
1367
  *
@@ -1234,59 +1370,42 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
1234
1370
  * @summary Update miner's addresses, but better to use user.conf instead
1235
1371
  * @request PUT:/miners/addresses
1236
1372
  */
1237
- putMinersAddresses: (data: MinerAddresses, params?: RequestParams) => Promise<HttpResponse<void, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1373
+ putMinersAddresses: (data: MinerAddresses, params?: RequestParams) => Promise<void>;
1238
1374
  };
1239
1375
  events: {
1240
1376
  /**
1241
1377
  * No description
1242
1378
  *
1243
1379
  * @tags Events
1244
- * @name GetEventsContractInBlock
1245
- * @summary Get events for a contract within a block
1246
- * @request GET:/events/contract/in-block
1380
+ * @name GetEventsContractContractaddress
1381
+ * @summary Get events for a contract within a counter range
1382
+ * @request GET:/events/contract/{contractAddress}
1247
1383
  */
1248
- getEventsContractInBlock: (query: {
1249
- block: string;
1250
- contractAddress: string;
1251
- }, params?: RequestParams) => Promise<HttpResponse<Events, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1384
+ getEventsContractContractaddress: (contractAddress: string, query: {
1385
+ start: number;
1386
+ end?: number;
1387
+ group?: number;
1388
+ }, params?: RequestParams) => Promise<ContractEvents>;
1252
1389
  /**
1253
1390
  * No description
1254
1391
  *
1255
1392
  * @tags Events
1256
- * @name GetEventsContractWithinBlocks
1257
- * @summary Get events for a contract within a range of blocks
1258
- * @request GET:/events/contract/within-blocks
1393
+ * @name GetEventsContractContractaddressCurrentCount
1394
+ * @summary Get current value of the events counter for a contract
1395
+ * @request GET:/events/contract/{contractAddress}/current-count
1259
1396
  */
1260
- getEventsContractWithinBlocks: (query: {
1261
- fromBlock: string;
1262
- toBlock?: string;
1263
- contractAddress: string;
1264
- }, params?: RequestParams) => Promise<HttpResponse<Events[], BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1397
+ getEventsContractContractaddressCurrentCount: (contractAddress: string, params?: RequestParams) => Promise<number>;
1265
1398
  /**
1266
1399
  * No description
1267
1400
  *
1268
1401
  * @tags Events
1269
- * @name GetEventsContractWithinTimeInterval
1270
- * @summary Get events for a contract within a time interval
1271
- * @request GET:/events/contract/within-time-interval
1272
- */
1273
- getEventsContractWithinTimeInterval: (query: {
1274
- fromTs: number;
1275
- toTs?: number;
1276
- contractAddress: string;
1277
- }, params?: RequestParams) => Promise<HttpResponse<Events[], BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1278
- /**
1279
- * No description
1280
- *
1281
- * @tags Events
1282
- * @name GetEventsTxScript
1402
+ * @name GetEventsTxIdTxid
1283
1403
  * @summary Get events for a TxScript
1284
- * @request GET:/events/tx-script
1404
+ * @request GET:/events/tx-id/{txId}
1285
1405
  */
1286
- getEventsTxScript: (query: {
1287
- block: string;
1288
- txId: string;
1289
- }, params?: RequestParams) => Promise<HttpResponse<Events, BadRequest | InternalServerError | NotFound | ServiceUnavailable | Unauthorized>>;
1406
+ getEventsTxIdTxid: (txId: string, query?: {
1407
+ group?: number | undefined;
1408
+ } | undefined, params?: RequestParams) => Promise<ContractEventsByTxId>;
1290
1409
  };
1291
1410
  }
1292
1411
  export {};