@alephium/web3 0.9.0-rc.0 → 0.9.0-rc.1

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