@alephium/web3 1.8.5 → 1.10.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 (41) hide show
  1. package/dist/alephium-web3.min.js +1 -1
  2. package/dist/alephium-web3.min.js.map +1 -1
  3. package/dist/src/api/api-alephium.d.ts +25 -6
  4. package/dist/src/api/api-alephium.js +33 -4
  5. package/dist/src/api/api-explorer.d.ts +810 -819
  6. package/dist/src/api/api-explorer.js +350 -360
  7. package/dist/src/codec/instr-codec.d.ts +2 -0
  8. package/dist/src/codec/instr-codec.js +54 -1
  9. package/dist/src/codec/unlock-script-codec.d.ts +1 -0
  10. package/dist/src/codec/unlock-script-codec.js +2 -1
  11. package/dist/src/constants.d.ts +4 -0
  12. package/dist/src/constants.js +5 -1
  13. package/dist/src/contract/contract.d.ts +5 -1
  14. package/dist/src/contract/contract.js +44 -8
  15. package/dist/src/contract/dapp-tx-builder.d.ts +26 -0
  16. package/dist/src/contract/dapp-tx-builder.js +187 -0
  17. package/dist/src/contract/events.d.ts +1 -0
  18. package/dist/src/contract/events.js +14 -3
  19. package/dist/src/contract/index.d.ts +1 -0
  20. package/dist/src/contract/index.js +3 -0
  21. package/dist/src/contract/ralph.js +2 -34
  22. package/dist/src/exchange/exchange.d.ts +13 -2
  23. package/dist/src/exchange/exchange.js +52 -14
  24. package/dist/src/exchange/index.d.ts +1 -1
  25. package/dist/src/exchange/index.js +3 -2
  26. package/dist/src/signer/types.d.ts +1 -0
  27. package/package.json +5 -5
  28. package/src/api/api-alephium.ts +49 -9
  29. package/src/api/api-explorer.ts +990 -1000
  30. package/src/codec/instr-codec.ts +56 -1
  31. package/src/codec/unlock-script-codec.ts +2 -0
  32. package/src/constants.ts +4 -0
  33. package/src/contract/contract.ts +46 -7
  34. package/src/contract/dapp-tx-builder.ts +209 -0
  35. package/src/contract/events.ts +15 -3
  36. package/src/contract/index.ts +1 -0
  37. package/src/contract/ralph.ts +4 -49
  38. package/src/exchange/exchange.ts +69 -17
  39. package/src/exchange/index.ts +10 -1
  40. package/src/signer/tx-builder.ts +2 -2
  41. package/src/signer/types.ts +1 -0
@@ -10,7 +10,7 @@
10
10
  * ---------------------------------------------------------------
11
11
  */
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.Api = exports.HttpClient = exports.ContentType = exports.PaginationLimitDefault = exports.Currencies = exports.MaxSizeAddresses = exports.PaginationLimitMax = exports.PaginationPageDefault = exports.MaxSizeAddressesForTokens = exports.MaxSizeTokens = exports.TokensWithPrice = exports.TokenStdInterfaceId = exports.IntervalType = void 0;
13
+ exports.Api = exports.HttpClient = exports.ContentType = exports.Currencies = exports.MaxSizeAddresses = exports.MaxSizeAddressesForTokens = exports.MaxSizeTokens = exports.PaginationPageDefault = exports.PaginationLimitMax = exports.PaginationLimitDefault = exports.TokenStdInterfaceId = exports.IntervalType = void 0;
14
14
  /** IntervalType */
15
15
  var IntervalType;
16
16
  (function (IntervalType) {
@@ -25,16 +25,20 @@ var TokenStdInterfaceId;
25
25
  TokenStdInterfaceId["NonFungible"] = "non-fungible";
26
26
  TokenStdInterfaceId["NonStandard"] = "non-standard";
27
27
  })(TokenStdInterfaceId = exports.TokenStdInterfaceId || (exports.TokenStdInterfaceId = {}));
28
- var TokensWithPrice;
29
- (function (TokensWithPrice) {
30
- TokensWithPrice["WETH"] = "WETH";
31
- TokensWithPrice["ALPH"] = "ALPH";
32
- TokensWithPrice["USDT"] = "USDT";
33
- TokensWithPrice["AYIN"] = "AYIN";
34
- TokensWithPrice["DAI"] = "DAI";
35
- TokensWithPrice["USDC"] = "USDC";
36
- TokensWithPrice["WBTC"] = "WBTC";
37
- })(TokensWithPrice = exports.TokensWithPrice || (exports.TokensWithPrice = {}));
28
+ var PaginationLimitDefault;
29
+ (function (PaginationLimitDefault) {
30
+ PaginationLimitDefault[PaginationLimitDefault["Value20"] = 20] = "Value20";
31
+ PaginationLimitDefault[PaginationLimitDefault["Value10"] = 10] = "Value10";
32
+ })(PaginationLimitDefault = exports.PaginationLimitDefault || (exports.PaginationLimitDefault = {}));
33
+ var PaginationLimitMax;
34
+ (function (PaginationLimitMax) {
35
+ PaginationLimitMax[PaginationLimitMax["Value100"] = 100] = "Value100";
36
+ PaginationLimitMax[PaginationLimitMax["Value20"] = 20] = "Value20";
37
+ })(PaginationLimitMax = exports.PaginationLimitMax || (exports.PaginationLimitMax = {}));
38
+ var PaginationPageDefault;
39
+ (function (PaginationPageDefault) {
40
+ PaginationPageDefault[PaginationPageDefault["Value1"] = 1] = "Value1";
41
+ })(PaginationPageDefault = exports.PaginationPageDefault || (exports.PaginationPageDefault = {}));
38
42
  var MaxSizeTokens;
39
43
  (function (MaxSizeTokens) {
40
44
  MaxSizeTokens[MaxSizeTokens["Value80"] = 80] = "Value80";
@@ -43,15 +47,6 @@ var MaxSizeAddressesForTokens;
43
47
  (function (MaxSizeAddressesForTokens) {
44
48
  MaxSizeAddressesForTokens[MaxSizeAddressesForTokens["Value80"] = 80] = "Value80";
45
49
  })(MaxSizeAddressesForTokens = exports.MaxSizeAddressesForTokens || (exports.MaxSizeAddressesForTokens = {}));
46
- var PaginationPageDefault;
47
- (function (PaginationPageDefault) {
48
- PaginationPageDefault[PaginationPageDefault["Value1"] = 1] = "Value1";
49
- })(PaginationPageDefault = exports.PaginationPageDefault || (exports.PaginationPageDefault = {}));
50
- var PaginationLimitMax;
51
- (function (PaginationLimitMax) {
52
- PaginationLimitMax[PaginationLimitMax["Value100"] = 100] = "Value100";
53
- PaginationLimitMax[PaginationLimitMax["Value20"] = 20] = "Value20";
54
- })(PaginationLimitMax = exports.PaginationLimitMax || (exports.PaginationLimitMax = {}));
55
50
  var MaxSizeAddresses;
56
51
  (function (MaxSizeAddresses) {
57
52
  MaxSizeAddresses[MaxSizeAddresses["Value80"] = 80] = "Value80";
@@ -71,11 +66,6 @@ var Currencies;
71
66
  Currencies["Cad"] = "cad";
72
67
  Currencies["Aud"] = "aud";
73
68
  })(Currencies = exports.Currencies || (exports.Currencies = {}));
74
- var PaginationLimitDefault;
75
- (function (PaginationLimitDefault) {
76
- PaginationLimitDefault[PaginationLimitDefault["Value20"] = 20] = "Value20";
77
- PaginationLimitDefault[PaginationLimitDefault["Value10"] = 10] = "Value10";
78
- })(PaginationLimitDefault = exports.PaginationLimitDefault || (exports.PaginationLimitDefault = {}));
79
69
  require("cross-fetch/polyfill");
80
70
  const utils_1 = require("./utils");
81
71
  var ContentType;
@@ -221,141 +211,105 @@ exports.HttpClient = HttpClient;
221
211
  class Api extends HttpClient {
222
212
  constructor() {
223
213
  super(...arguments);
224
- this.contracts = {
214
+ this.blocks = {
225
215
  /**
226
- * @description Get sub contract addresses
216
+ * @description List latest blocks
227
217
  *
228
- * @tags Contracts
229
- * @name GetContractsContractAddressSubContracts
230
- * @request GET:/contracts/{contract_address}/sub-contracts
218
+ * @tags Blocks
219
+ * @name GetBlocks
220
+ * @request GET:/blocks
231
221
  */
232
- getContractsContractAddressSubContracts: (contractAddress, query, params = {}) => this.request({
233
- path: `/contracts/${contractAddress}/sub-contracts`,
222
+ getBlocks: (query, params = {}) => this.request({
223
+ path: `/blocks`,
234
224
  method: 'GET',
235
225
  query: query,
236
226
  format: 'json',
237
227
  ...params
238
228
  }).then(utils_1.convertHttpResponse),
239
229
  /**
240
- * @description Get contract liveness
230
+ * @description Get a block with hash
241
231
  *
242
- * @tags Contracts
243
- * @name GetContractsContractAddressCurrentLiveness
244
- * @request GET:/contracts/{contract_address}/current-liveness
232
+ * @tags Blocks
233
+ * @name GetBlocksBlockHash
234
+ * @request GET:/blocks/{block_hash}
245
235
  */
246
- getContractsContractAddressCurrentLiveness: (contractAddress, params = {}) => this.request({
247
- path: `/contracts/${contractAddress}/current-liveness`,
236
+ getBlocksBlockHash: (blockHash, params = {}) => this.request({
237
+ path: `/blocks/${blockHash}`,
248
238
  method: 'GET',
249
239
  format: 'json',
250
240
  ...params
251
241
  }).then(utils_1.convertHttpResponse),
252
242
  /**
253
- * @description Get contract parent address if exist
243
+ * @description Get block's transactions
254
244
  *
255
- * @tags Contracts
256
- * @name GetContractsContractAddressParent
257
- * @request GET:/contracts/{contract_address}/parent
245
+ * @tags Blocks
246
+ * @name GetBlocksBlockHashTransactions
247
+ * @request GET:/blocks/{block_hash}/transactions
258
248
  */
259
- getContractsContractAddressParent: (contractAddress, params = {}) => this.request({
260
- path: `/contracts/${contractAddress}/parent`,
249
+ getBlocksBlockHashTransactions: (blockHash, query, params = {}) => this.request({
250
+ path: `/blocks/${blockHash}/transactions`,
261
251
  method: 'GET',
252
+ query: query,
262
253
  format: 'json',
263
254
  ...params
264
255
  }).then(utils_1.convertHttpResponse)
265
256
  };
266
- this.addresses = {
267
- /**
268
- * @description Are the addresses used (at least 1 transaction)
269
- *
270
- * @tags Addresses, Addresses
271
- * @name PostAddressesUsed
272
- * @request POST:/addresses/used
273
- */
274
- postAddressesUsed: (data, params = {}) => this.request({
275
- path: `/addresses/used`,
276
- method: 'POST',
277
- body: data,
278
- type: ContentType.Json,
279
- format: 'json',
280
- ...params
281
- }).then(utils_1.convertHttpResponse),
282
- /**
283
- * No description
284
- *
285
- * @tags Addresses
286
- * @name GetAddressesAddressExportTransactionsCsv
287
- * @request GET:/addresses/{address}/export-transactions/csv
288
- */
289
- getAddressesAddressExportTransactionsCsv: (address, query, params = {}) => this.request({
290
- path: `/addresses/${address}/export-transactions/csv`,
291
- method: 'GET',
292
- query: query,
293
- format: 'text',
294
- ...params
295
- }).then(utils_1.convertHttpResponse),
257
+ this.transactions = {
296
258
  /**
297
- * @description Get address balance
259
+ * @description Get a transaction with hash
298
260
  *
299
- * @tags Addresses
300
- * @name GetAddressesAddressBalance
301
- * @request GET:/addresses/{address}/balance
261
+ * @tags Transactions
262
+ * @name GetTransactionsTransactionHash
263
+ * @request GET:/transactions/{transaction_hash}
302
264
  */
303
- getAddressesAddressBalance: (address, params = {}) => this.request({
304
- path: `/addresses/${address}/balance`,
265
+ getTransactionsTransactionHash: (transactionHash, params = {}) => this.request({
266
+ path: `/transactions/${transactionHash}`,
305
267
  method: 'GET',
306
268
  format: 'json',
307
269
  ...params
308
- }).then(utils_1.convertHttpResponse),
270
+ }).then(utils_1.convertHttpResponse)
271
+ };
272
+ this.addresses = {
309
273
  /**
310
- * @description List mempool transactions of a given address
274
+ * @description Get address information
311
275
  *
312
276
  * @tags Addresses
313
- * @name GetAddressesAddressMempoolTransactions
314
- * @request GET:/addresses/{address}/mempool/transactions
277
+ * @name GetAddressesAddress
278
+ * @request GET:/addresses/{address}
315
279
  */
316
- getAddressesAddressMempoolTransactions: (address, params = {}) => this.request({
317
- path: `/addresses/${address}/mempool/transactions`,
280
+ getAddressesAddress: (address, params = {}) => this.request({
281
+ path: `/addresses/${address}`,
318
282
  method: 'GET',
319
283
  format: 'json',
320
284
  ...params
321
285
  }).then(utils_1.convertHttpResponse),
322
286
  /**
323
- * @description List address tokens
287
+ * @description List transactions of a given address
324
288
  *
325
289
  * @tags Addresses
326
- * @name GetAddressesAddressTokensTokenIdTransactions
327
- * @request GET:/addresses/{address}/tokens/{token_id}/transactions
290
+ * @name GetAddressesAddressTransactions
291
+ * @request GET:/addresses/{address}/transactions
328
292
  */
329
- getAddressesAddressTokensTokenIdTransactions: (address, tokenId, query, params = {}) => this.request({
330
- path: `/addresses/${address}/tokens/${tokenId}/transactions`,
293
+ getAddressesAddressTransactions: (address, query, params = {}) => this.request({
294
+ path: `/addresses/${address}/transactions`,
331
295
  method: 'GET',
332
296
  query: query,
333
297
  format: 'json',
334
298
  ...params
335
299
  }).then(utils_1.convertHttpResponse),
336
300
  /**
337
- * @description Get latest transaction information of a given address
338
- *
339
- * @tags Addresses
340
- * @name GetAddressesAddressLatestTransaction
341
- * @request GET:/addresses/{address}/latest-transaction
342
- */
343
- getAddressesAddressLatestTransaction: (address, params = {}) => this.request({
344
- path: `/addresses/${address}/latest-transaction`,
345
- method: 'GET',
346
- format: 'json',
347
- ...params
348
- }).then(utils_1.convertHttpResponse),
349
- /**
350
- * @description Get total transactions of a given address
301
+ * @description List transactions for given addresses
351
302
  *
352
303
  * @tags Addresses
353
- * @name GetAddressesAddressTotalTransactions
354
- * @request GET:/addresses/{address}/total-transactions
304
+ * @name PostAddressesTransactions
305
+ * @request POST:/addresses/transactions
355
306
  */
356
- getAddressesAddressTotalTransactions: (address, params = {}) => this.request({
357
- path: `/addresses/${address}/total-transactions`,
358
- method: 'GET',
307
+ postAddressesTransactions: (query, data, params = {}) => this.request({
308
+ path: `/addresses/transactions`,
309
+ method: 'POST',
310
+ query: query,
311
+ body: data,
312
+ type: ContentType.Json,
359
313
  format: 'json',
360
314
  ...params
361
315
  }).then(utils_1.convertHttpResponse),
@@ -374,61 +328,54 @@ class Api extends HttpClient {
374
328
  ...params
375
329
  }).then(utils_1.convertHttpResponse),
376
330
  /**
377
- * @description List transactions of a given address
331
+ * @description Get total transactions of a given address
378
332
  *
379
333
  * @tags Addresses
380
- * @name GetAddressesAddressTransactions
381
- * @request GET:/addresses/{address}/transactions
334
+ * @name GetAddressesAddressTotalTransactions
335
+ * @request GET:/addresses/{address}/total-transactions
382
336
  */
383
- getAddressesAddressTransactions: (address, query, params = {}) => this.request({
384
- path: `/addresses/${address}/transactions`,
337
+ getAddressesAddressTotalTransactions: (address, params = {}) => this.request({
338
+ path: `/addresses/${address}/total-transactions`,
385
339
  method: 'GET',
386
- query: query,
387
340
  format: 'json',
388
341
  ...params
389
342
  }).then(utils_1.convertHttpResponse),
390
343
  /**
391
- * No description
344
+ * @description Get latest transaction information of a given address
392
345
  *
393
346
  * @tags Addresses
394
- * @name GetAddressesAddressAmountHistory
395
- * @request GET:/addresses/{address}/amount-history
347
+ * @name GetAddressesAddressLatestTransaction
348
+ * @request GET:/addresses/{address}/latest-transaction
396
349
  */
397
- getAddressesAddressAmountHistory: (address, query, params = {}) => this.request({
398
- path: `/addresses/${address}/amount-history`,
350
+ getAddressesAddressLatestTransaction: (address, params = {}) => this.request({
351
+ path: `/addresses/${address}/latest-transaction`,
399
352
  method: 'GET',
400
- query: query,
401
353
  format: 'json',
402
354
  ...params
403
355
  }).then(utils_1.convertHttpResponse),
404
356
  /**
405
- * @description List transactions for given addresses
357
+ * @description List mempool transactions of a given address
406
358
  *
407
359
  * @tags Addresses
408
- * @name PostAddressesTransactions
409
- * @request POST:/addresses/transactions
360
+ * @name GetAddressesAddressMempoolTransactions
361
+ * @request GET:/addresses/{address}/mempool/transactions
410
362
  */
411
- postAddressesTransactions: (query, data, params = {}) => this.request({
412
- path: `/addresses/transactions`,
413
- method: 'POST',
414
- query: query,
415
- body: data,
416
- type: ContentType.Json,
363
+ getAddressesAddressMempoolTransactions: (address, params = {}) => this.request({
364
+ path: `/addresses/${address}/mempool/transactions`,
365
+ method: 'GET',
417
366
  format: 'json',
418
367
  ...params
419
368
  }).then(utils_1.convertHttpResponse),
420
369
  /**
421
- * No description
370
+ * @description Get address balance
422
371
  *
423
372
  * @tags Addresses
424
- * @name GetAddressesAddressAmountHistoryDeprecated
425
- * @request GET:/addresses/{address}/amount-history-DEPRECATED
426
- * @deprecated
373
+ * @name GetAddressesAddressBalance
374
+ * @request GET:/addresses/{address}/balance
427
375
  */
428
- getAddressesAddressAmountHistoryDeprecated: (address, query, params = {}) => this.request({
429
- path: `/addresses/${address}/amount-history-DEPRECATED`,
376
+ getAddressesAddressBalance: (address, params = {}) => this.request({
377
+ path: `/addresses/${address}/balance`,
430
378
  method: 'GET',
431
- query: query,
432
379
  format: 'json',
433
380
  ...params
434
381
  }).then(utils_1.convertHttpResponse),
@@ -448,14 +395,14 @@ class Api extends HttpClient {
448
395
  ...params
449
396
  }).then(utils_1.convertHttpResponse),
450
397
  /**
451
- * @description Get address tokens with balance
398
+ * @description List address tokens
452
399
  *
453
400
  * @tags Addresses
454
- * @name GetAddressesAddressTokensBalance
455
- * @request GET:/addresses/{address}/tokens-balance
401
+ * @name GetAddressesAddressTokensTokenIdTransactions
402
+ * @request GET:/addresses/{address}/tokens/{token_id}/transactions
456
403
  */
457
- getAddressesAddressTokensBalance: (address, query, params = {}) => this.request({
458
- path: `/addresses/${address}/tokens-balance`,
404
+ getAddressesAddressTokensTokenIdTransactions: (address, tokenId, query, params = {}) => this.request({
405
+ path: `/addresses/${address}/tokens/${tokenId}/transactions`,
459
406
  method: 'GET',
460
407
  query: query,
461
408
  format: 'json',
@@ -474,19 +421,6 @@ class Api extends HttpClient {
474
421
  format: 'json',
475
422
  ...params
476
423
  }).then(utils_1.convertHttpResponse),
477
- /**
478
- * @description Get address information
479
- *
480
- * @tags Addresses
481
- * @name GetAddressesAddress
482
- * @request GET:/addresses/{address}
483
- */
484
- getAddressesAddress: (address, params = {}) => this.request({
485
- path: `/addresses/${address}`,
486
- method: 'GET',
487
- format: 'json',
488
- ...params
489
- }).then(utils_1.convertHttpResponse),
490
424
  /**
491
425
  * @description Get public key of p2pkh addresses, the address needs to have at least one input.
492
426
  *
@@ -499,36 +433,81 @@ class Api extends HttpClient {
499
433
  method: 'GET',
500
434
  format: 'json',
501
435
  ...params
502
- }).then(utils_1.convertHttpResponse)
503
- };
504
- this.infos = {
436
+ }).then(utils_1.convertHttpResponse),
505
437
  /**
506
- * @description Get token supply list
438
+ * @description Get address tokens with balance
507
439
  *
508
- * @tags Infos
509
- * @name GetInfosSupply
510
- * @request GET:/infos/supply
440
+ * @tags Addresses
441
+ * @name GetAddressesAddressTokensBalance
442
+ * @request GET:/addresses/{address}/tokens-balance
511
443
  */
512
- getInfosSupply: (query, params = {}) => this.request({
513
- path: `/infos/supply`,
444
+ getAddressesAddressTokensBalance: (address, query, params = {}) => this.request({
445
+ path: `/addresses/${address}/tokens-balance`,
514
446
  method: 'GET',
515
447
  query: query,
516
448
  format: 'json',
517
449
  ...params
518
450
  }).then(utils_1.convertHttpResponse),
519
451
  /**
520
- * @description Get the ALPH locked supply
452
+ * @description Are the addresses used (at least 1 transaction)
521
453
  *
522
- * @tags Infos
523
- * @name GetInfosSupplyLockedAlph
524
- * @request GET:/infos/supply/locked-alph
525
- */
526
- getInfosSupplyLockedAlph: (params = {}) => this.request({
527
- path: `/infos/supply/locked-alph`,
454
+ * @tags Addresses, Addresses
455
+ * @name PostAddressesUsed
456
+ * @request POST:/addresses/used
457
+ */
458
+ postAddressesUsed: (data, params = {}) => this.request({
459
+ path: `/addresses/used`,
460
+ method: 'POST',
461
+ body: data,
462
+ type: ContentType.Json,
463
+ format: 'json',
464
+ ...params
465
+ }).then(utils_1.convertHttpResponse),
466
+ /**
467
+ * No description
468
+ *
469
+ * @tags Addresses
470
+ * @name GetAddressesAddressExportTransactionsCsv
471
+ * @request GET:/addresses/{address}/export-transactions/csv
472
+ */
473
+ getAddressesAddressExportTransactionsCsv: (address, query, params = {}) => this.request({
474
+ path: `/addresses/${address}/export-transactions/csv`,
528
475
  method: 'GET',
476
+ query: query,
529
477
  format: 'text',
530
478
  ...params
531
479
  }).then(utils_1.convertHttpResponse),
480
+ /**
481
+ * No description
482
+ *
483
+ * @tags Addresses
484
+ * @name GetAddressesAddressAmountHistoryDeprecated
485
+ * @request GET:/addresses/{address}/amount-history-DEPRECATED
486
+ * @deprecated
487
+ */
488
+ getAddressesAddressAmountHistoryDeprecated: (address, query, params = {}) => this.request({
489
+ path: `/addresses/${address}/amount-history-DEPRECATED`,
490
+ method: 'GET',
491
+ query: query,
492
+ format: 'json',
493
+ ...params
494
+ }).then(utils_1.convertHttpResponse),
495
+ /**
496
+ * No description
497
+ *
498
+ * @tags Addresses
499
+ * @name GetAddressesAddressAmountHistory
500
+ * @request GET:/addresses/{address}/amount-history
501
+ */
502
+ getAddressesAddressAmountHistory: (address, query, params = {}) => this.request({
503
+ path: `/addresses/${address}/amount-history`,
504
+ method: 'GET',
505
+ query: query,
506
+ format: 'json',
507
+ ...params
508
+ }).then(utils_1.convertHttpResponse)
509
+ };
510
+ this.infos = {
532
511
  /**
533
512
  * @description Get explorer informations
534
513
  *
@@ -543,16 +522,30 @@ class Api extends HttpClient {
543
522
  ...params
544
523
  }).then(utils_1.convertHttpResponse),
545
524
  /**
546
- * @description Get the ALPH circulating supply
525
+ * @description List latest height for each chain
547
526
  *
548
527
  * @tags Infos
549
- * @name GetInfosSupplyCirculatingAlph
550
- * @request GET:/infos/supply/circulating-alph
528
+ * @name GetInfosHeights
529
+ * @request GET:/infos/heights
551
530
  */
552
- getInfosSupplyCirculatingAlph: (params = {}) => this.request({
553
- path: `/infos/supply/circulating-alph`,
531
+ getInfosHeights: (params = {}) => this.request({
532
+ path: `/infos/heights`,
554
533
  method: 'GET',
555
- format: 'text',
534
+ format: 'json',
535
+ ...params
536
+ }).then(utils_1.convertHttpResponse),
537
+ /**
538
+ * @description Get token supply list
539
+ *
540
+ * @tags Infos
541
+ * @name GetInfosSupply
542
+ * @request GET:/infos/supply
543
+ */
544
+ getInfosSupply: (query, params = {}) => this.request({
545
+ path: `/infos/supply`,
546
+ method: 'GET',
547
+ query: query,
548
+ format: 'json',
556
549
  ...params
557
550
  }).then(utils_1.convertHttpResponse),
558
551
  /**
@@ -569,14 +562,14 @@ class Api extends HttpClient {
569
562
  ...params
570
563
  }).then(utils_1.convertHttpResponse),
571
564
  /**
572
- * @description Get the total number of transactions
565
+ * @description Get the ALPH circulating supply
573
566
  *
574
567
  * @tags Infos
575
- * @name GetInfosTotalTransactions
576
- * @request GET:/infos/total-transactions
568
+ * @name GetInfosSupplyCirculatingAlph
569
+ * @request GET:/infos/supply/circulating-alph
577
570
  */
578
- getInfosTotalTransactions: (params = {}) => this.request({
579
- path: `/infos/total-transactions`,
571
+ getInfosSupplyCirculatingAlph: (params = {}) => this.request({
572
+ path: `/infos/supply/circulating-alph`,
580
573
  method: 'GET',
581
574
  format: 'text',
582
575
  ...params
@@ -595,16 +588,29 @@ class Api extends HttpClient {
595
588
  ...params
596
589
  }).then(utils_1.convertHttpResponse),
597
590
  /**
598
- * @description List latest height for each chain
591
+ * @description Get the ALPH locked supply
599
592
  *
600
593
  * @tags Infos
601
- * @name GetInfosHeights
602
- * @request GET:/infos/heights
594
+ * @name GetInfosSupplyLockedAlph
595
+ * @request GET:/infos/supply/locked-alph
603
596
  */
604
- getInfosHeights: (params = {}) => this.request({
605
- path: `/infos/heights`,
597
+ getInfosSupplyLockedAlph: (params = {}) => this.request({
598
+ path: `/infos/supply/locked-alph`,
606
599
  method: 'GET',
607
- format: 'json',
600
+ format: 'text',
601
+ ...params
602
+ }).then(utils_1.convertHttpResponse),
603
+ /**
604
+ * @description Get the total number of transactions
605
+ *
606
+ * @tags Infos
607
+ * @name GetInfosTotalTransactions
608
+ * @request GET:/infos/total-transactions
609
+ */
610
+ getInfosTotalTransactions: (params = {}) => this.request({
611
+ path: `/infos/total-transactions`,
612
+ method: 'GET',
613
+ format: 'text',
608
614
  ...params
609
615
  }).then(utils_1.convertHttpResponse),
610
616
  /**
@@ -621,60 +627,34 @@ class Api extends HttpClient {
621
627
  ...params
622
628
  }).then(utils_1.convertHttpResponse)
623
629
  };
624
- this.utils = {
625
- /**
626
- * @description Perform a sanity check
627
- *
628
- * @tags Utils
629
- * @name PutUtilsSanityCheck
630
- * @request PUT:/utils/sanity-check
631
- */
632
- putUtilsSanityCheck: (params = {}) => this.request({
633
- path: `/utils/sanity-check`,
634
- method: 'PUT',
635
- ...params
636
- }).then(utils_1.convertHttpResponse),
637
- /**
638
- * @description Update global log level, accepted: TRACE, DEBUG, INFO, WARN, ERROR
639
- *
640
- * @tags Utils
641
- * @name PutUtilsUpdateGlobalLoglevel
642
- * @request PUT:/utils/update-global-loglevel
643
- */
644
- putUtilsUpdateGlobalLoglevel: (data, params = {}) => this.request({
645
- path: `/utils/update-global-loglevel`,
646
- method: 'PUT',
647
- body: data,
648
- ...params
649
- }).then(utils_1.convertHttpResponse),
630
+ this.mempool = {
650
631
  /**
651
- * @description Update logback values
632
+ * @description list mempool transactions
652
633
  *
653
- * @tags Utils
654
- * @name PutUtilsUpdateLogConfig
655
- * @request PUT:/utils/update-log-config
634
+ * @tags Mempool
635
+ * @name GetMempoolTransactions
636
+ * @request GET:/mempool/transactions
656
637
  */
657
- putUtilsUpdateLogConfig: (data, params = {}) => this.request({
658
- path: `/utils/update-log-config`,
659
- method: 'PUT',
660
- body: data,
661
- type: ContentType.Json,
638
+ getMempoolTransactions: (query, params = {}) => this.request({
639
+ path: `/mempool/transactions`,
640
+ method: 'GET',
641
+ query: query,
642
+ format: 'json',
662
643
  ...params
663
644
  }).then(utils_1.convertHttpResponse)
664
645
  };
665
646
  this.tokens = {
666
647
  /**
667
- * @description Return metadata for the given fungible tokens, if metadata doesn't exist or token isn't a fungible, it won't be in the output list
648
+ * @description List token information
668
649
  *
669
650
  * @tags Tokens
670
- * @name PostTokensFungibleMetadata
671
- * @request POST:/tokens/fungible-metadata
651
+ * @name GetTokens
652
+ * @request GET:/tokens
672
653
  */
673
- postTokensFungibleMetadata: (data, params = {}) => this.request({
674
- path: `/tokens/fungible-metadata`,
675
- method: 'POST',
676
- body: data,
677
- type: ContentType.Json,
654
+ getTokens: (query, params = {}) => this.request({
655
+ path: `/tokens`,
656
+ method: 'GET',
657
+ query: query,
678
658
  format: 'json',
679
659
  ...params
680
660
  }).then(utils_1.convertHttpResponse),
@@ -693,34 +673,6 @@ class Api extends HttpClient {
693
673
  format: 'json',
694
674
  ...params
695
675
  }).then(utils_1.convertHttpResponse),
696
- /**
697
- * @description List token information
698
- *
699
- * @tags Tokens
700
- * @name GetTokens
701
- * @request GET:/tokens
702
- */
703
- getTokens: (query, params = {}) => this.request({
704
- path: `/tokens`,
705
- method: 'GET',
706
- query: query,
707
- format: 'json',
708
- ...params
709
- }).then(utils_1.convertHttpResponse),
710
- /**
711
- * @description Get a sorted list of top addresses by {token_id} balance. Updates once per day.
712
- *
713
- * @tags Tokens
714
- * @name GetTokensHoldersTokenTokenId
715
- * @request GET:/tokens/holders/token/{token_id}
716
- */
717
- getTokensHoldersTokenTokenId: (tokenId, query, params = {}) => this.request({
718
- path: `/tokens/holders/token/${tokenId}`,
719
- method: 'GET',
720
- query: query,
721
- format: 'json',
722
- ...params
723
- }).then(utils_1.convertHttpResponse),
724
676
  /**
725
677
  * @description List token transactions
726
678
  *
@@ -735,21 +687,6 @@ class Api extends HttpClient {
735
687
  format: 'json',
736
688
  ...params
737
689
  }).then(utils_1.convertHttpResponse),
738
- /**
739
- * @description Return metadata for the given nft collection addresses, if metadata doesn't exist or address isn't a nft collection, it won't be in the output list
740
- *
741
- * @tags Tokens
742
- * @name PostTokensNftCollectionMetadata
743
- * @request POST:/tokens/nft-collection-metadata
744
- */
745
- postTokensNftCollectionMetadata: (data, params = {}) => this.request({
746
- path: `/tokens/nft-collection-metadata`,
747
- method: 'POST',
748
- body: data,
749
- type: ContentType.Json,
750
- format: 'json',
751
- ...params
752
- }).then(utils_1.convertHttpResponse),
753
690
  /**
754
691
  * @description List token addresses
755
692
  *
@@ -765,16 +702,17 @@ class Api extends HttpClient {
765
702
  ...params
766
703
  }).then(utils_1.convertHttpResponse),
767
704
  /**
768
- * @description Get a sorted list of top addresses by ALPH balance. Updates once per day.
705
+ * @description Return metadata for the given fungible tokens, if metadata doesn't exist or token isn't a fungible, it won't be in the output list
769
706
  *
770
707
  * @tags Tokens
771
- * @name GetTokensHoldersAlph
772
- * @request GET:/tokens/holders/alph
708
+ * @name PostTokensFungibleMetadata
709
+ * @request POST:/tokens/fungible-metadata
773
710
  */
774
- getTokensHoldersAlph: (query, params = {}) => this.request({
775
- path: `/tokens/holders/alph`,
776
- method: 'GET',
777
- query: query,
711
+ postTokensFungibleMetadata: (data, params = {}) => this.request({
712
+ path: `/tokens/fungible-metadata`,
713
+ method: 'POST',
714
+ body: data,
715
+ type: ContentType.Json,
778
716
  format: 'json',
779
717
  ...params
780
718
  }).then(utils_1.convertHttpResponse),
@@ -792,94 +730,94 @@ class Api extends HttpClient {
792
730
  type: ContentType.Json,
793
731
  format: 'json',
794
732
  ...params
795
- }).then(utils_1.convertHttpResponse)
796
- };
797
- this.market = {
733
+ }).then(utils_1.convertHttpResponse),
798
734
  /**
799
- * No description
735
+ * @description Return metadata for the given nft collection addresses, if metadata doesn't exist or address isn't a nft collection, it won't be in the output list
800
736
  *
801
- * @tags Market
802
- * @name PostMarketPrices
803
- * @request POST:/market/prices
737
+ * @tags Tokens
738
+ * @name PostTokensNftCollectionMetadata
739
+ * @request POST:/tokens/nft-collection-metadata
804
740
  */
805
- postMarketPrices: (query, data, params = {}) => this.request({
806
- path: `/market/prices`,
741
+ postTokensNftCollectionMetadata: (data, params = {}) => this.request({
742
+ path: `/tokens/nft-collection-metadata`,
807
743
  method: 'POST',
808
- query: query,
809
744
  body: data,
810
745
  type: ContentType.Json,
811
746
  format: 'json',
812
747
  ...params
813
748
  }).then(utils_1.convertHttpResponse),
814
749
  /**
815
- * No description
750
+ * @description Get a sorted list of top addresses by ALPH balance. Updates once per day.
816
751
  *
817
- * @tags Market
818
- * @name GetMarketPricesSymbolCharts
819
- * @request GET:/market/prices/{symbol}/charts
752
+ * @tags Tokens
753
+ * @name GetTokensHoldersAlph
754
+ * @request GET:/tokens/holders/alph
820
755
  */
821
- getMarketPricesSymbolCharts: (symbol, query, params = {}) => this.request({
822
- path: `/market/prices/${symbol}/charts`,
756
+ getTokensHoldersAlph: (query, params = {}) => this.request({
757
+ path: `/tokens/holders/alph`,
823
758
  method: 'GET',
824
759
  query: query,
825
760
  format: 'json',
826
761
  ...params
827
- }).then(utils_1.convertHttpResponse)
828
- };
829
- this.blocks = {
762
+ }).then(utils_1.convertHttpResponse),
830
763
  /**
831
- * @description Get block's transactions
764
+ * @description Get a sorted list of top addresses by {token_id} balance. Updates once per day.
832
765
  *
833
- * @tags Blocks
834
- * @name GetBlocksBlockHashTransactions
835
- * @request GET:/blocks/{block_hash}/transactions
766
+ * @tags Tokens
767
+ * @name GetTokensHoldersTokenTokenId
768
+ * @request GET:/tokens/holders/token/{token_id}
836
769
  */
837
- getBlocksBlockHashTransactions: (blockHash, query, params = {}) => this.request({
838
- path: `/blocks/${blockHash}/transactions`,
770
+ getTokensHoldersTokenTokenId: (tokenId, query, params = {}) => this.request({
771
+ path: `/tokens/holders/token/${tokenId}`,
839
772
  method: 'GET',
840
773
  query: query,
841
774
  format: 'json',
842
775
  ...params
843
- }).then(utils_1.convertHttpResponse),
776
+ }).then(utils_1.convertHttpResponse)
777
+ };
778
+ this.charts = {
844
779
  /**
845
- * @description Get a block with hash
780
+ * @description `interval-type` query param: hourly, daily
846
781
  *
847
- * @tags Blocks
848
- * @name GetBlocksBlockHash
849
- * @request GET:/blocks/{block_hash}
782
+ * @tags Charts
783
+ * @name GetChartsHashrates
784
+ * @summary Get hashrate chart in H/s
785
+ * @request GET:/charts/hashrates
850
786
  */
851
- getBlocksBlockHash: (blockHash, params = {}) => this.request({
852
- path: `/blocks/${blockHash}`,
787
+ getChartsHashrates: (query, params = {}) => this.request({
788
+ path: `/charts/hashrates`,
853
789
  method: 'GET',
790
+ query: query,
854
791
  format: 'json',
855
792
  ...params
856
793
  }).then(utils_1.convertHttpResponse),
857
794
  /**
858
- * @description List latest blocks
795
+ * @description `interval-type` query param: hourly, daily
859
796
  *
860
- * @tags Blocks
861
- * @name GetBlocks
862
- * @request GET:/blocks
797
+ * @tags Charts
798
+ * @name GetChartsTransactionsCount
799
+ * @summary Get transaction count history
800
+ * @request GET:/charts/transactions-count
863
801
  */
864
- getBlocks: (query, params = {}) => this.request({
865
- path: `/blocks`,
802
+ getChartsTransactionsCount: (query, params = {}) => this.request({
803
+ path: `/charts/transactions-count`,
866
804
  method: 'GET',
867
805
  query: query,
868
806
  format: 'json',
869
807
  ...params
870
- }).then(utils_1.convertHttpResponse)
871
- };
872
- this.transactions = {
808
+ }).then(utils_1.convertHttpResponse),
873
809
  /**
874
- * @description Get a transaction with hash
810
+ * @description `interval-type` query param: hourly, daily
875
811
  *
876
- * @tags Transactions
877
- * @name GetTransactionsTransactionHash
878
- * @request GET:/transactions/{transaction_hash}
812
+ * @tags Charts
813
+ * @name GetChartsTransactionsCountPerChain
814
+ * @summary Get transaction count history per chain
815
+ * @request GET:/charts/transactions-count-per-chain
879
816
  */
880
- getTransactionsTransactionHash: (transactionHash, params = {}) => this.request({
881
- path: `/transactions/${transactionHash}`,
817
+ getChartsTransactionsCountPerChain: (query, params = {}) => this.request({
818
+ path: `/charts/transactions-count-per-chain`,
882
819
  method: 'GET',
820
+ query: query,
883
821
  format: 'json',
884
822
  ...params
885
823
  }).then(utils_1.convertHttpResponse)
@@ -927,69 +865,121 @@ class Api extends HttpClient {
927
865
  ...params
928
866
  }).then(utils_1.convertHttpResponse)
929
867
  };
930
- this.charts = {
868
+ this.contracts = {
931
869
  /**
932
- * @description `interval-type` query param: hourly, daily
870
+ * @description Get contract liveness
933
871
  *
934
- * @tags Charts
935
- * @name GetChartsTransactionsCountPerChain
936
- * @summary Get transaction count history per chain
937
- * @request GET:/charts/transactions-count-per-chain
872
+ * @tags Contracts
873
+ * @name GetContractsContractAddressCurrentLiveness
874
+ * @request GET:/contracts/{contract_address}/current-liveness
938
875
  */
939
- getChartsTransactionsCountPerChain: (query, params = {}) => this.request({
940
- path: `/charts/transactions-count-per-chain`,
876
+ getContractsContractAddressCurrentLiveness: (contractAddress, params = {}) => this.request({
877
+ path: `/contracts/${contractAddress}/current-liveness`,
941
878
  method: 'GET',
942
- query: query,
943
879
  format: 'json',
944
880
  ...params
945
881
  }).then(utils_1.convertHttpResponse),
946
882
  /**
947
- * @description `interval-type` query param: hourly, daily
883
+ * @description Get contract parent address if exist
948
884
  *
949
- * @tags Charts
950
- * @name GetChartsTransactionsCount
951
- * @summary Get transaction count history
952
- * @request GET:/charts/transactions-count
885
+ * @tags Contracts
886
+ * @name GetContractsContractAddressParent
887
+ * @request GET:/contracts/{contract_address}/parent
953
888
  */
954
- getChartsTransactionsCount: (query, params = {}) => this.request({
955
- path: `/charts/transactions-count`,
889
+ getContractsContractAddressParent: (contractAddress, params = {}) => this.request({
890
+ path: `/contracts/${contractAddress}/parent`,
956
891
  method: 'GET',
957
- query: query,
958
892
  format: 'json',
959
893
  ...params
960
894
  }).then(utils_1.convertHttpResponse),
961
895
  /**
962
- * @description `interval-type` query param: hourly, daily
896
+ * @description Get sub contract addresses
963
897
  *
964
- * @tags Charts
965
- * @name GetChartsHashrates
966
- * @summary Get hashrate chart in H/s
967
- * @request GET:/charts/hashrates
898
+ * @tags Contracts
899
+ * @name GetContractsContractAddressSubContracts
900
+ * @request GET:/contracts/{contract_address}/sub-contracts
968
901
  */
969
- getChartsHashrates: (query, params = {}) => this.request({
970
- path: `/charts/hashrates`,
902
+ getContractsContractAddressSubContracts: (contractAddress, query, params = {}) => this.request({
903
+ path: `/contracts/${contractAddress}/sub-contracts`,
971
904
  method: 'GET',
972
905
  query: query,
973
906
  format: 'json',
974
907
  ...params
975
908
  }).then(utils_1.convertHttpResponse)
976
909
  };
977
- this.mempool = {
910
+ this.market = {
978
911
  /**
979
- * @description list mempool transactions
912
+ * No description
980
913
  *
981
- * @tags Mempool
982
- * @name GetMempoolTransactions
983
- * @request GET:/mempool/transactions
914
+ * @tags Market
915
+ * @name PostMarketPrices
916
+ * @request POST:/market/prices
984
917
  */
985
- getMempoolTransactions: (query, params = {}) => this.request({
986
- path: `/mempool/transactions`,
918
+ postMarketPrices: (query, data, params = {}) => this.request({
919
+ path: `/market/prices`,
920
+ method: 'POST',
921
+ query: query,
922
+ body: data,
923
+ type: ContentType.Json,
924
+ format: 'json',
925
+ ...params
926
+ }).then(utils_1.convertHttpResponse),
927
+ /**
928
+ * No description
929
+ *
930
+ * @tags Market
931
+ * @name GetMarketPricesSymbolCharts
932
+ * @request GET:/market/prices/{symbol}/charts
933
+ */
934
+ getMarketPricesSymbolCharts: (symbol, query, params = {}) => this.request({
935
+ path: `/market/prices/${symbol}/charts`,
987
936
  method: 'GET',
988
937
  query: query,
989
938
  format: 'json',
990
939
  ...params
991
940
  }).then(utils_1.convertHttpResponse)
992
941
  };
942
+ this.utils = {
943
+ /**
944
+ * @description Perform a sanity check
945
+ *
946
+ * @tags Utils
947
+ * @name PutUtilsSanityCheck
948
+ * @request PUT:/utils/sanity-check
949
+ */
950
+ putUtilsSanityCheck: (params = {}) => this.request({
951
+ path: `/utils/sanity-check`,
952
+ method: 'PUT',
953
+ ...params
954
+ }).then(utils_1.convertHttpResponse),
955
+ /**
956
+ * @description Update global log level, accepted: TRACE, DEBUG, INFO, WARN, ERROR
957
+ *
958
+ * @tags Utils
959
+ * @name PutUtilsUpdateGlobalLoglevel
960
+ * @request PUT:/utils/update-global-loglevel
961
+ */
962
+ putUtilsUpdateGlobalLoglevel: (data, params = {}) => this.request({
963
+ path: `/utils/update-global-loglevel`,
964
+ method: 'PUT',
965
+ body: data,
966
+ ...params
967
+ }).then(utils_1.convertHttpResponse),
968
+ /**
969
+ * @description Update logback values
970
+ *
971
+ * @tags Utils
972
+ * @name PutUtilsUpdateLogConfig
973
+ * @request PUT:/utils/update-log-config
974
+ */
975
+ putUtilsUpdateLogConfig: (data, params = {}) => this.request({
976
+ path: `/utils/update-log-config`,
977
+ method: 'PUT',
978
+ body: data,
979
+ type: ContentType.Json,
980
+ ...params
981
+ }).then(utils_1.convertHttpResponse)
982
+ };
993
983
  }
994
984
  }
995
985
  exports.Api = Api;