@alephium/web3 0.8.2-test.3 → 0.9.0-rc.0

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