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