@avalabs/glacier-sdk 2.8.0-alpha.116 → 2.8.0-alpha.118

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.
package/dist/index.d.ts CHANGED
@@ -60,55 +60,6 @@ declare abstract class BaseHttpRequest {
60
60
  abstract request<T>(options: ApiRequestOptions): CancelablePromise<T>;
61
61
  }
62
62
 
63
- type StakingDistribution = {
64
- version: string;
65
- stakedAmount: string;
66
- };
67
-
68
- type GetCurrentValidatorsStatsResponse = {
69
- validatorCount: number;
70
- totalStakedAmount: string;
71
- estimatedAnnualStakingReward: string;
72
- stakingDistributionByVersion: Array<StakingDistribution>;
73
- };
74
-
75
- type GetDelegatorStatsResponse = {
76
- delegatorCount: number;
77
- totalStakedAmount: string;
78
- };
79
-
80
- declare enum Network {
81
- MAINNET = "mainnet",
82
- FUJI = "fuji"
83
- }
84
-
85
- declare class DefaultService {
86
- readonly httpRequest: BaseHttpRequest;
87
- constructor(httpRequest: BaseHttpRequest);
88
- /**
89
- * Get current validator stats for a given network
90
- * @returns GetCurrentValidatorsStatsResponse
91
- * @throws ApiError
92
- */
93
- getCurrentValidatorStats({ network, }: {
94
- /**
95
- * Either mainnet or a testnet.
96
- */
97
- network: Network;
98
- }): CancelablePromise<GetCurrentValidatorsStatsResponse>;
99
- /**
100
- * Get current delegator stats for a given network
101
- * @returns GetDelegatorStatsResponse
102
- * @throws ApiError
103
- */
104
- getDelegatorStats({ network, }: {
105
- /**
106
- * Either mainnet or a testnet.
107
- */
108
- network: Network;
109
- }): CancelablePromise<GetDelegatorStatsResponse>;
110
- }
111
-
112
63
  declare enum CollectionSortByOption {
113
64
  COLLECTION_ADDRESS = "collectionAddress",
114
65
  SALE_TIMESTAMP = "saleTimestamp",
@@ -1394,7 +1345,7 @@ declare class EvmService {
1394
1345
  * @returns ListErc20BalancesResponse
1395
1346
  * @throws ApiError
1396
1347
  */
1397
- listErc20Balances({ chainId, address, blockNumber, pageSize, pageToken, currency, }: {
1348
+ listErc20Balances({ chainId, address, blockNumber, pageSize, pageToken, contractAddresses, currency, }: {
1398
1349
  /**
1399
1350
  * A supported evm chain id. Use the `/chains` endpoint to get
1400
1351
  * a list of supported chain ids.
@@ -1417,6 +1368,10 @@ declare class EvmService {
1417
1368
  * A page token, received from a previous list call. Provide this to retrieve the subsequent page.
1418
1369
  */
1419
1370
  pageToken?: string;
1371
+ /**
1372
+ * A comma separated list of contract addresses to filter by.
1373
+ */
1374
+ contractAddresses?: string;
1420
1375
  /**
1421
1376
  * The currency that return values should use. Defaults to USD.
1422
1377
  */
@@ -2448,6 +2403,28 @@ type ChainAddressChainIdMapListResponse = {
2448
2403
  addresses: Array<ChainAddressChainIdMap>;
2449
2404
  };
2450
2405
 
2406
+ type DelegatorsDetails = {
2407
+ delegatorCount: number;
2408
+ totalAmountStaked: string;
2409
+ };
2410
+
2411
+ type StakingDistribution = {
2412
+ version: string;
2413
+ stakedAmount: string;
2414
+ };
2415
+
2416
+ type ValidatorsDetails = {
2417
+ validatorCount: number;
2418
+ totalAmountStaked: string;
2419
+ estimatedAnnualStakingReward: string;
2420
+ stakingDistributionByVersion: Array<StakingDistribution>;
2421
+ };
2422
+
2423
+ type GetNetworkDetailsResponse = {
2424
+ currentValidatorStats: ValidatorsDetails;
2425
+ currentDelegatorStats: DelegatorsDetails;
2426
+ };
2427
+
2451
2428
  type ProposerDetails = {
2452
2429
  proposerId?: string;
2453
2430
  proposerParentId?: string;
@@ -2468,6 +2445,23 @@ type GetPrimaryNetworkBlockResponse = {
2468
2445
  proposerDetails?: ProposerDetails;
2469
2446
  };
2470
2447
 
2448
+ type Blockchain = {
2449
+ createBlockTimestamp: number;
2450
+ createBlockNumber: string;
2451
+ blockchainId: string;
2452
+ vmId: string;
2453
+ subnetId: string;
2454
+ blockchainName: string;
2455
+ };
2456
+
2457
+ type ListBlockchainsResponse = {
2458
+ /**
2459
+ * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages.
2460
+ */
2461
+ nextPageToken?: string;
2462
+ blockchains: Array<Blockchain>;
2463
+ };
2464
+
2471
2465
  type CChainSharedAssetBalance = {
2472
2466
  /**
2473
2467
  * Unique ID for an asset.
@@ -2558,10 +2552,6 @@ type PChainBalance = {
2558
2552
  * A list of objects containing P-chain Asset ID and the amount of that Asset ID. Denotes the amount of staked Avax that will be locked when the staking period ends.
2559
2553
  */
2560
2554
  lockedStaked: Array<PChainAsset>;
2561
- /**
2562
- * A list of objects containing P-chain Asset ID and the amount of that Asset ID. Denotes the amount of unstaked Avax that is locked. Sum of lockedPlatform and lockedStakeable. TO BE DEPRECATED.
2563
- */
2564
- lockedUnstaked: Array<PChainAsset>;
2565
2555
  };
2566
2556
 
2567
2557
  type ListPChainBalancesResponse = {
@@ -2619,16 +2609,6 @@ type PChainUtxo = {
2619
2609
  utxoStartTimestamp?: number;
2620
2610
  utxoEndTimestamp?: number;
2621
2611
  rewardType?: RewardType;
2622
- /**
2623
- * To be deprecated
2624
- * @deprecated
2625
- */
2626
- fromTx?: string;
2627
- /**
2628
- * To be deprecated
2629
- * @deprecated
2630
- */
2631
- toTx?: string;
2632
2612
  };
2633
2613
 
2634
2614
  type PChainTransaction = {
@@ -2690,11 +2670,6 @@ type PChainTransaction = {
2690
2670
  */
2691
2671
  estimatedReward?: string;
2692
2672
  rewardTxHash?: string;
2693
- /**
2694
- * To be deprecated
2695
- * @deprecated
2696
- */
2697
- rewardTx?: string;
2698
2673
  memo?: string;
2699
2674
  /**
2700
2675
  * Present for RewardValidatorTx
@@ -2741,6 +2716,28 @@ type ListPrimaryNetworkBlocksResponse = {
2741
2716
  chainInfo: PrimaryNetworkChainInfo;
2742
2717
  };
2743
2718
 
2719
+ type BlockchainInfo = {
2720
+ blockchainId: string;
2721
+ };
2722
+
2723
+ type Subnet = {
2724
+ createBlockTimestamp: number;
2725
+ createBlockIndex: string;
2726
+ subnetId: string;
2727
+ ownerAddresses: Array<string>;
2728
+ threshold: number;
2729
+ locktime: number;
2730
+ blockchains: Array<BlockchainInfo>;
2731
+ };
2732
+
2733
+ type ListSubnetsResponse = {
2734
+ /**
2735
+ * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages.
2736
+ */
2737
+ nextPageToken?: string;
2738
+ subnets: Array<Subnet>;
2739
+ };
2740
+
2744
2741
  type ListUtxosResponse = {
2745
2742
  /**
2746
2743
  * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages.
@@ -3020,6 +3017,11 @@ type ListXChainVerticesResponse = {
3020
3017
  chainInfo: PrimaryNetworkChainInfo;
3021
3018
  };
3022
3019
 
3020
+ declare enum Network {
3021
+ MAINNET = "mainnet",
3022
+ FUJI = "fuji"
3023
+ }
3024
+
3023
3025
  declare enum PChainId {
3024
3026
  _11111111111111111111111111111111LPO_YY = "11111111111111111111111111111111LpoYY",
3025
3027
  P_CHAIN = "p-chain"
@@ -3393,11 +3395,73 @@ declare class PrimaryNetworkService {
3393
3395
  */
3394
3396
  network: Network;
3395
3397
  }): CancelablePromise<ChainAddressChainIdMapListResponse>;
3398
+ /**
3399
+ * Get validators and delegators stats for a given network
3400
+ * @returns GetNetworkDetailsResponse
3401
+ * @throws ApiError
3402
+ */
3403
+ getValidatorsAndDelegatorsStats({ network, }: {
3404
+ /**
3405
+ * Either mainnet or a testnet.
3406
+ */
3407
+ network: Network;
3408
+ }): CancelablePromise<GetNetworkDetailsResponse>;
3409
+ /**
3410
+ * Returns all blockchains registered on the network.
3411
+ * @returns ListBlockchainsResponse
3412
+ * @throws ApiError
3413
+ */
3414
+ listBlockchains({ network, pageSize, pageToken, sortOrder, }: {
3415
+ /**
3416
+ * Either mainnet or a testnet.
3417
+ */
3418
+ network: Network;
3419
+ /**
3420
+ * The maximum number of items to return. The minimum page size
3421
+ * is 1. The maximum pageSize is 100.
3422
+ */
3423
+ pageSize?: number;
3424
+ /**
3425
+ * A page token, received from a previous list call. Provide this to retrieve the subsequent page.
3426
+ */
3427
+ pageToken?: string;
3428
+ /**
3429
+ * The order by which to sort results. Use "asc" for ascending
3430
+ * order, "desc" for descending order. Sorted by timestamp or the `sortBy`
3431
+ * query parameter, if provided.
3432
+ */
3433
+ sortOrder?: SortOrder;
3434
+ }): CancelablePromise<ListBlockchainsResponse>;
3435
+ /**
3436
+ * Returns all subnets registered on the network.
3437
+ * @returns ListSubnetsResponse
3438
+ * @throws ApiError
3439
+ */
3440
+ listSubnets({ network, pageSize, pageToken, sortOrder, }: {
3441
+ /**
3442
+ * Either mainnet or a testnet.
3443
+ */
3444
+ network: Network;
3445
+ /**
3446
+ * The maximum number of items to return. The minimum page size
3447
+ * is 1. The maximum pageSize is 100.
3448
+ */
3449
+ pageSize?: number;
3450
+ /**
3451
+ * A page token, received from a previous list call. Provide this to retrieve the subsequent page.
3452
+ */
3453
+ pageToken?: string;
3454
+ /**
3455
+ * The order by which to sort results. Use "asc" for ascending
3456
+ * order, "desc" for descending order. Sorted by timestamp or the `sortBy`
3457
+ * query parameter, if provided.
3458
+ */
3459
+ sortOrder?: SortOrder;
3460
+ }): CancelablePromise<ListSubnetsResponse>;
3396
3461
  }
3397
3462
 
3398
3463
  type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest;
3399
3464
  declare class Glacier {
3400
- readonly default: DefaultService;
3401
3465
  readonly evm: EvmService;
3402
3466
  readonly healthCheck: HealthCheckService;
3403
3467
  readonly operations: OperationsService;
@@ -3423,4 +3487,4 @@ declare class ApiError extends Error {
3423
3487
  constructor(request: ApiRequestOptions, response: ApiResult, message: string);
3424
3488
  }
3425
3489
 
3426
- export { Address, ApiError, Asset, BaseHttpRequest, BlockchainId, BlockchainIds, CChainAtomicBalances, CChainExportTransaction, CChainImportTransaction, CChainSharedAssetBalance, CancelError, CancelListingEventResponse, CancelablePromise, ChainAddressChainIdMap, ChainAddressChainIdMapListResponse, ChainInfo, ChainStatus, CloseAuctionEventResponse, CollectionMetrics, CollectionSortByOption, CreateEvmTransactionExportRequest, CreatePrimaryNetworkTransactionExportRequest, CurrencyCode, DefaultService, EVMInput, EVMOutput, Erc1155Token, Erc1155TokenBalance, Erc1155TokenMetadata, Erc1155Transfer, Erc1155TransferDetails, Erc20Token, Erc20TokenBalance, Erc20Transfer, Erc20TransferDetails, Erc721Token, Erc721TokenBalance, Erc721TokenMetadata, Erc721Transfer, Erc721TransferDetails, ErcType, EvmBlock, EvmNetworkOptions, EvmService, FloorPrice, FullNativeTransactionDetails, GetChainResponse, GetCurrentValidatorsStatsResponse, GetDelegatorStatsResponse, GetEvmBlockResponse, GetNativeBalanceResponse, GetPrimaryNetworkBlockResponse, GetTransactionResponse, Glacier, HealthCheckService, InternalTransaction, InternalTransactionDetails, InternalTransactionOpCall, ListCChainAtomicBalancesResponse, ListCChainAtomicTransactionsResponse, ListChainsResponse, ListCollectibleBalancesResponse, ListErc1155BalancesResponse, ListErc1155TransactionsResponse, ListErc20BalancesResponse, ListErc20TransactionsResponse, ListErc721BalancesResponse, ListErc721TransactionsResponse, ListEvmBlocksResponse, ListInternalTransactionsResponse, ListListingsResponse, ListNativeTransactionsResponse, ListNftCollectionWithMetricsResponse, ListPChainBalancesResponse, ListPChainTransactionsResponse, ListPChainUtxosResponse, ListPrimaryNetworkBlocksResponse, ListTransactionDetailsResponse, ListTransfersResponse, ListUtxosResponse, ListXChainBalancesResponse, ListXChainTransactionsResponse, ListXChainVerticesResponse, ListingCurrencyType, ListingEventType, ListingResponse, ListingType, ListingsSortByOption, Method, Money, NativeTokenBalance, NativeTransaction, Network, NetworkToken, NetworkTokenDetails, NftCollection, NftCollectionWithMetrics, NftFilterOptionsProperty, NftSearchBody, NftSearchResultTypeOption, NftTokenMetadataStatus, OpenAPI, OpenAPIConfig, OpenListingEventResponse, OperationStatus, OperationStatusCode, OperationStatusResponse, OperationType, OperationsService, PChainAsset, PChainBalance, PChainId, PChainTransaction, PChainTransactionType, PChainUtxo, PaginationParams, PrimaryNetwork, PrimaryNetworkBlock, PrimaryNetworkChainInfo, PrimaryNetworkChainName, PrimaryNetworkOptions, PrimaryNetworkService, ProposerDetails, PurchaseListingEventResponse, ResourceLink, ResourceLinkType, RewardType, RichAddress, SortOrder, StakingDistribution, TokenWithPrice, TransactionDetails, TransactionExportMetadata, TransactionMethodType, TransactionStatus, TransactionVertexDetail, TrendingTimeframe, UtilityAddresses, Utxo, UtxoCredential, UtxoType, VmName, XChainAssetBalance, XChainAssetDetails, XChainBalances, XChainId, XChainLinearTransaction, XChainNonLinearTransaction, XChainSharedAssetBalance, XChainVertex };
3490
+ export { Address, ApiError, Asset, BaseHttpRequest, Blockchain, BlockchainId, BlockchainIds, BlockchainInfo, CChainAtomicBalances, CChainExportTransaction, CChainImportTransaction, CChainSharedAssetBalance, CancelError, CancelListingEventResponse, CancelablePromise, ChainAddressChainIdMap, ChainAddressChainIdMapListResponse, ChainInfo, ChainStatus, CloseAuctionEventResponse, CollectionMetrics, CollectionSortByOption, CreateEvmTransactionExportRequest, CreatePrimaryNetworkTransactionExportRequest, CurrencyCode, DelegatorsDetails, EVMInput, EVMOutput, Erc1155Token, Erc1155TokenBalance, Erc1155TokenMetadata, Erc1155Transfer, Erc1155TransferDetails, Erc20Token, Erc20TokenBalance, Erc20Transfer, Erc20TransferDetails, Erc721Token, Erc721TokenBalance, Erc721TokenMetadata, Erc721Transfer, Erc721TransferDetails, ErcType, EvmBlock, EvmNetworkOptions, EvmService, FloorPrice, FullNativeTransactionDetails, GetChainResponse, GetEvmBlockResponse, GetNativeBalanceResponse, GetNetworkDetailsResponse, GetPrimaryNetworkBlockResponse, GetTransactionResponse, Glacier, HealthCheckService, InternalTransaction, InternalTransactionDetails, InternalTransactionOpCall, ListBlockchainsResponse, ListCChainAtomicBalancesResponse, ListCChainAtomicTransactionsResponse, ListChainsResponse, ListCollectibleBalancesResponse, ListErc1155BalancesResponse, ListErc1155TransactionsResponse, ListErc20BalancesResponse, ListErc20TransactionsResponse, ListErc721BalancesResponse, ListErc721TransactionsResponse, ListEvmBlocksResponse, ListInternalTransactionsResponse, ListListingsResponse, ListNativeTransactionsResponse, ListNftCollectionWithMetricsResponse, ListPChainBalancesResponse, ListPChainTransactionsResponse, ListPChainUtxosResponse, ListPrimaryNetworkBlocksResponse, ListSubnetsResponse, ListTransactionDetailsResponse, ListTransfersResponse, ListUtxosResponse, ListXChainBalancesResponse, ListXChainTransactionsResponse, ListXChainVerticesResponse, ListingCurrencyType, ListingEventType, ListingResponse, ListingType, ListingsSortByOption, Method, Money, NativeTokenBalance, NativeTransaction, Network, NetworkToken, NetworkTokenDetails, NftCollection, NftCollectionWithMetrics, NftFilterOptionsProperty, NftSearchBody, NftSearchResultTypeOption, NftTokenMetadataStatus, OpenAPI, OpenAPIConfig, OpenListingEventResponse, OperationStatus, OperationStatusCode, OperationStatusResponse, OperationType, OperationsService, PChainAsset, PChainBalance, PChainId, PChainTransaction, PChainTransactionType, PChainUtxo, PaginationParams, PrimaryNetwork, PrimaryNetworkBlock, PrimaryNetworkChainInfo, PrimaryNetworkChainName, PrimaryNetworkOptions, PrimaryNetworkService, ProposerDetails, PurchaseListingEventResponse, ResourceLink, ResourceLinkType, RewardType, RichAddress, SortOrder, StakingDistribution, Subnet, TokenWithPrice, TransactionDetails, TransactionExportMetadata, TransactionMethodType, TransactionStatus, TransactionVertexDetail, TrendingTimeframe, UtilityAddresses, Utxo, UtxoCredential, UtxoType, ValidatorsDetails, VmName, XChainAssetBalance, XChainAssetDetails, XChainBalances, XChainId, XChainLinearTransaction, XChainNonLinearTransaction, XChainSharedAssetBalance, XChainVertex };
package/dist/index.js CHANGED
@@ -352,34 +352,6 @@ class FetchHttpRequest extends BaseHttpRequest {
352
352
  }
353
353
  }
354
354
 
355
- class DefaultService {
356
- constructor(httpRequest) {
357
- this.httpRequest = httpRequest;
358
- }
359
- getCurrentValidatorStats({
360
- network
361
- }) {
362
- return this.httpRequest.request({
363
- method: "GET",
364
- url: "/v1/networks/{network}/validators:stats",
365
- path: {
366
- "network": network
367
- }
368
- });
369
- }
370
- getDelegatorStats({
371
- network
372
- }) {
373
- return this.httpRequest.request({
374
- method: "GET",
375
- url: "/v1/networks/{network}/delegators:stats",
376
- path: {
377
- "network": network
378
- }
379
- });
380
- }
381
- }
382
-
383
355
  class EvmService {
384
356
  constructor(httpRequest) {
385
357
  this.httpRequest = httpRequest;
@@ -409,6 +381,7 @@ class EvmService {
409
381
  blockNumber,
410
382
  pageSize = 10,
411
383
  pageToken,
384
+ contractAddresses,
412
385
  currency
413
386
  }) {
414
387
  return this.httpRequest.request({
@@ -422,6 +395,7 @@ class EvmService {
422
395
  "blockNumber": blockNumber,
423
396
  "pageSize": pageSize,
424
397
  "pageToken": pageToken,
398
+ "contractAddresses": contractAddresses,
425
399
  "currency": currency
426
400
  }
427
401
  });
@@ -1210,6 +1184,55 @@ class PrimaryNetworkService {
1210
1184
  }
1211
1185
  });
1212
1186
  }
1187
+ getValidatorsAndDelegatorsStats({
1188
+ network
1189
+ }) {
1190
+ return this.httpRequest.request({
1191
+ method: "GET",
1192
+ url: "/v1/networks/{network}",
1193
+ path: {
1194
+ "network": network
1195
+ }
1196
+ });
1197
+ }
1198
+ listBlockchains({
1199
+ network,
1200
+ pageSize = 10,
1201
+ pageToken,
1202
+ sortOrder
1203
+ }) {
1204
+ return this.httpRequest.request({
1205
+ method: "GET",
1206
+ url: "/v1/networks/{network}/blockchains",
1207
+ path: {
1208
+ "network": network
1209
+ },
1210
+ query: {
1211
+ "pageSize": pageSize,
1212
+ "pageToken": pageToken,
1213
+ "sortOrder": sortOrder
1214
+ }
1215
+ });
1216
+ }
1217
+ listSubnets({
1218
+ network,
1219
+ pageSize = 10,
1220
+ pageToken,
1221
+ sortOrder
1222
+ }) {
1223
+ return this.httpRequest.request({
1224
+ method: "GET",
1225
+ url: "/v1/networks/{network}/subnets",
1226
+ path: {
1227
+ "network": network
1228
+ },
1229
+ query: {
1230
+ "pageSize": pageSize,
1231
+ "pageToken": pageToken,
1232
+ "sortOrder": sortOrder
1233
+ }
1234
+ });
1235
+ }
1213
1236
  }
1214
1237
 
1215
1238
  class Glacier {
@@ -1226,7 +1249,6 @@ class Glacier {
1226
1249
  HEADERS: config == null ? void 0 : config.HEADERS,
1227
1250
  ENCODE_PATH: config == null ? void 0 : config.ENCODE_PATH
1228
1251
  });
1229
- this.default = new DefaultService(this.request);
1230
1252
  this.evm = new EvmService(this.request);
1231
1253
  this.healthCheck = new HealthCheckService(this.request);
1232
1254
  this.operations = new OperationsService(this.request);
@@ -1596,7 +1618,6 @@ exports.CancelablePromise = CancelablePromise;
1596
1618
  exports.ChainStatus = ChainStatus;
1597
1619
  exports.CollectionSortByOption = CollectionSortByOption;
1598
1620
  exports.CurrencyCode = CurrencyCode;
1599
- exports.DefaultService = DefaultService;
1600
1621
  exports.ErcType = ErcType;
1601
1622
  exports.EvmService = EvmService;
1602
1623
  exports.Glacier = Glacier;
@@ -1,6 +1,5 @@
1
1
  import { BaseHttpRequest } from './core/BaseHttpRequest.js';
2
2
  import { OpenAPIConfig } from './core/OpenAPI.js';
3
- import { DefaultService } from './services/DefaultService.js';
4
3
  import { EvmService } from './services/EvmService.js';
5
4
  import { HealthCheckService } from './services/HealthCheckService.js';
6
5
  import { OperationsService } from './services/OperationsService.js';
@@ -8,7 +7,6 @@ import { PrimaryNetworkService } from './services/PrimaryNetworkService.js';
8
7
 
9
8
  type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest;
10
9
  declare class Glacier {
11
- readonly default: DefaultService;
12
10
  readonly evm: EvmService;
13
11
  readonly healthCheck: HealthCheckService;
14
12
  readonly operations: OperationsService;
@@ -1,5 +1,4 @@
1
1
  import { FetchHttpRequest } from './core/FetchHttpRequest.js';
2
- import { DefaultService } from './services/DefaultService.js';
3
2
  import { EvmService } from './services/EvmService.js';
4
3
  import { HealthCheckService } from './services/HealthCheckService.js';
5
4
  import { OperationsService } from './services/OperationsService.js';
@@ -19,7 +18,6 @@ class Glacier {
19
18
  HEADERS: config == null ? void 0 : config.HEADERS,
20
19
  ENCODE_PATH: config == null ? void 0 : config.ENCODE_PATH
21
20
  });
22
- this.default = new DefaultService(this.request);
23
21
  this.evm = new EvmService(this.request);
24
22
  this.healthCheck = new HealthCheckService(this.request);
25
23
  this.operations = new OperationsService(this.request);
@@ -0,0 +1,10 @@
1
+ type Blockchain = {
2
+ createBlockTimestamp: number;
3
+ createBlockNumber: string;
4
+ blockchainId: string;
5
+ vmId: string;
6
+ subnetId: string;
7
+ blockchainName: string;
8
+ };
9
+
10
+ export { Blockchain };
@@ -0,0 +1,5 @@
1
+ type BlockchainInfo = {
2
+ blockchainId: string;
3
+ };
4
+
5
+ export { BlockchainInfo };
@@ -0,0 +1,6 @@
1
+ type DelegatorsDetails = {
2
+ delegatorCount: number;
3
+ totalAmountStaked: string;
4
+ };
5
+
6
+ export { DelegatorsDetails };
@@ -0,0 +1,9 @@
1
+ import { DelegatorsDetails } from './DelegatorsDetails.js';
2
+ import { ValidatorsDetails } from './ValidatorsDetails.js';
3
+
4
+ type GetNetworkDetailsResponse = {
5
+ currentValidatorStats: ValidatorsDetails;
6
+ currentDelegatorStats: DelegatorsDetails;
7
+ };
8
+
9
+ export { GetNetworkDetailsResponse };
@@ -0,0 +1,11 @@
1
+ import { Blockchain } from './Blockchain.js';
2
+
3
+ type ListBlockchainsResponse = {
4
+ /**
5
+ * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages.
6
+ */
7
+ nextPageToken?: string;
8
+ blockchains: Array<Blockchain>;
9
+ };
10
+
11
+ export { ListBlockchainsResponse };
@@ -0,0 +1,11 @@
1
+ import { Subnet } from './Subnet.js';
2
+
3
+ type ListSubnetsResponse = {
4
+ /**
5
+ * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages.
6
+ */
7
+ nextPageToken?: string;
8
+ subnets: Array<Subnet>;
9
+ };
10
+
11
+ export { ListSubnetsResponse };
@@ -21,10 +21,6 @@ type PChainBalance = {
21
21
  * A list of objects containing P-chain Asset ID and the amount of that Asset ID. Denotes the amount of staked Avax that will be locked when the staking period ends.
22
22
  */
23
23
  lockedStaked: Array<PChainAsset>;
24
- /**
25
- * A list of objects containing P-chain Asset ID and the amount of that Asset ID. Denotes the amount of unstaked Avax that is locked. Sum of lockedPlatform and lockedStakeable. TO BE DEPRECATED.
26
- */
27
- lockedUnstaked: Array<PChainAsset>;
28
24
  };
29
25
 
30
26
  export { PChainBalance };
@@ -61,11 +61,6 @@ type PChainTransaction = {
61
61
  */
62
62
  estimatedReward?: string;
63
63
  rewardTxHash?: string;
64
- /**
65
- * To be deprecated
66
- * @deprecated
67
- */
68
- rewardTx?: string;
69
64
  memo?: string;
70
65
  /**
71
66
  * Present for RewardValidatorTx
@@ -26,16 +26,6 @@ type PChainUtxo = {
26
26
  utxoStartTimestamp?: number;
27
27
  utxoEndTimestamp?: number;
28
28
  rewardType?: RewardType;
29
- /**
30
- * To be deprecated
31
- * @deprecated
32
- */
33
- fromTx?: string;
34
- /**
35
- * To be deprecated
36
- * @deprecated
37
- */
38
- toTx?: string;
39
29
  };
40
30
 
41
31
  export { PChainUtxo };
@@ -0,0 +1,13 @@
1
+ import { BlockchainInfo } from './BlockchainInfo.js';
2
+
3
+ type Subnet = {
4
+ createBlockTimestamp: number;
5
+ createBlockIndex: string;
6
+ subnetId: string;
7
+ ownerAddresses: Array<string>;
8
+ threshold: number;
9
+ locktime: number;
10
+ blockchains: Array<BlockchainInfo>;
11
+ };
12
+
13
+ export { Subnet };
@@ -1,10 +1,10 @@
1
1
  import { StakingDistribution } from './StakingDistribution.js';
2
2
 
3
- type GetCurrentValidatorsStatsResponse = {
3
+ type ValidatorsDetails = {
4
4
  validatorCount: number;
5
- totalStakedAmount: string;
5
+ totalAmountStaked: string;
6
6
  estimatedAnnualStakingReward: string;
7
7
  stakingDistributionByVersion: Array<StakingDistribution>;
8
8
  };
9
9
 
10
- export { GetCurrentValidatorsStatsResponse };
10
+ export { ValidatorsDetails };
@@ -64,7 +64,7 @@ declare class EvmService {
64
64
  * @returns ListErc20BalancesResponse
65
65
  * @throws ApiError
66
66
  */
67
- listErc20Balances({ chainId, address, blockNumber, pageSize, pageToken, currency, }: {
67
+ listErc20Balances({ chainId, address, blockNumber, pageSize, pageToken, contractAddresses, currency, }: {
68
68
  /**
69
69
  * A supported evm chain id. Use the `/chains` endpoint to get
70
70
  * a list of supported chain ids.
@@ -87,6 +87,10 @@ declare class EvmService {
87
87
  * A page token, received from a previous list call. Provide this to retrieve the subsequent page.
88
88
  */
89
89
  pageToken?: string;
90
+ /**
91
+ * A comma separated list of contract addresses to filter by.
92
+ */
93
+ contractAddresses?: string;
90
94
  /**
91
95
  * The currency that return values should use. Defaults to USD.
92
96
  */
@@ -27,6 +27,7 @@ class EvmService {
27
27
  blockNumber,
28
28
  pageSize = 10,
29
29
  pageToken,
30
+ contractAddresses,
30
31
  currency
31
32
  }) {
32
33
  return this.httpRequest.request({
@@ -40,6 +41,7 @@ class EvmService {
40
41
  "blockNumber": blockNumber,
41
42
  "pageSize": pageSize,
42
43
  "pageToken": pageToken,
44
+ "contractAddresses": contractAddresses,
43
45
  "currency": currency
44
46
  }
45
47
  });
@@ -2,13 +2,16 @@ import { BlockchainId } from '../models/BlockchainId.js';
2
2
  import { CChainExportTransaction } from '../models/CChainExportTransaction.js';
3
3
  import { CChainImportTransaction } from '../models/CChainImportTransaction.js';
4
4
  import { ChainAddressChainIdMapListResponse } from '../models/ChainAddressChainIdMapListResponse.js';
5
+ import { GetNetworkDetailsResponse } from '../models/GetNetworkDetailsResponse.js';
5
6
  import { GetPrimaryNetworkBlockResponse } from '../models/GetPrimaryNetworkBlockResponse.js';
7
+ import { ListBlockchainsResponse } from '../models/ListBlockchainsResponse.js';
6
8
  import { ListCChainAtomicBalancesResponse } from '../models/ListCChainAtomicBalancesResponse.js';
7
9
  import { ListCChainAtomicTransactionsResponse } from '../models/ListCChainAtomicTransactionsResponse.js';
8
10
  import { ListPChainBalancesResponse } from '../models/ListPChainBalancesResponse.js';
9
11
  import { ListPChainTransactionsResponse } from '../models/ListPChainTransactionsResponse.js';
10
12
  import { ListPChainUtxosResponse } from '../models/ListPChainUtxosResponse.js';
11
13
  import { ListPrimaryNetworkBlocksResponse } from '../models/ListPrimaryNetworkBlocksResponse.js';
14
+ import { ListSubnetsResponse } from '../models/ListSubnetsResponse.js';
12
15
  import { ListUtxosResponse } from '../models/ListUtxosResponse.js';
13
16
  import { ListXChainBalancesResponse } from '../models/ListXChainBalancesResponse.js';
14
17
  import { ListXChainTransactionsResponse } from '../models/ListXChainTransactionsResponse.js';
@@ -387,6 +390,69 @@ declare class PrimaryNetworkService {
387
390
  */
388
391
  network: Network;
389
392
  }): CancelablePromise<ChainAddressChainIdMapListResponse>;
393
+ /**
394
+ * Get validators and delegators stats for a given network
395
+ * @returns GetNetworkDetailsResponse
396
+ * @throws ApiError
397
+ */
398
+ getValidatorsAndDelegatorsStats({ network, }: {
399
+ /**
400
+ * Either mainnet or a testnet.
401
+ */
402
+ network: Network;
403
+ }): CancelablePromise<GetNetworkDetailsResponse>;
404
+ /**
405
+ * Returns all blockchains registered on the network.
406
+ * @returns ListBlockchainsResponse
407
+ * @throws ApiError
408
+ */
409
+ listBlockchains({ network, pageSize, pageToken, sortOrder, }: {
410
+ /**
411
+ * Either mainnet or a testnet.
412
+ */
413
+ network: Network;
414
+ /**
415
+ * The maximum number of items to return. The minimum page size
416
+ * is 1. The maximum pageSize is 100.
417
+ */
418
+ pageSize?: number;
419
+ /**
420
+ * A page token, received from a previous list call. Provide this to retrieve the subsequent page.
421
+ */
422
+ pageToken?: string;
423
+ /**
424
+ * The order by which to sort results. Use "asc" for ascending
425
+ * order, "desc" for descending order. Sorted by timestamp or the `sortBy`
426
+ * query parameter, if provided.
427
+ */
428
+ sortOrder?: SortOrder;
429
+ }): CancelablePromise<ListBlockchainsResponse>;
430
+ /**
431
+ * Returns all subnets registered on the network.
432
+ * @returns ListSubnetsResponse
433
+ * @throws ApiError
434
+ */
435
+ listSubnets({ network, pageSize, pageToken, sortOrder, }: {
436
+ /**
437
+ * Either mainnet or a testnet.
438
+ */
439
+ network: Network;
440
+ /**
441
+ * The maximum number of items to return. The minimum page size
442
+ * is 1. The maximum pageSize is 100.
443
+ */
444
+ pageSize?: number;
445
+ /**
446
+ * A page token, received from a previous list call. Provide this to retrieve the subsequent page.
447
+ */
448
+ pageToken?: string;
449
+ /**
450
+ * The order by which to sort results. Use "asc" for ascending
451
+ * order, "desc" for descending order. Sorted by timestamp or the `sortBy`
452
+ * query parameter, if provided.
453
+ */
454
+ sortOrder?: SortOrder;
455
+ }): CancelablePromise<ListSubnetsResponse>;
390
456
  }
391
457
 
392
458
  export { PrimaryNetworkService };
@@ -270,6 +270,55 @@ class PrimaryNetworkService {
270
270
  }
271
271
  });
272
272
  }
273
+ getValidatorsAndDelegatorsStats({
274
+ network
275
+ }) {
276
+ return this.httpRequest.request({
277
+ method: "GET",
278
+ url: "/v1/networks/{network}",
279
+ path: {
280
+ "network": network
281
+ }
282
+ });
283
+ }
284
+ listBlockchains({
285
+ network,
286
+ pageSize = 10,
287
+ pageToken,
288
+ sortOrder
289
+ }) {
290
+ return this.httpRequest.request({
291
+ method: "GET",
292
+ url: "/v1/networks/{network}/blockchains",
293
+ path: {
294
+ "network": network
295
+ },
296
+ query: {
297
+ "pageSize": pageSize,
298
+ "pageToken": pageToken,
299
+ "sortOrder": sortOrder
300
+ }
301
+ });
302
+ }
303
+ listSubnets({
304
+ network,
305
+ pageSize = 10,
306
+ pageToken,
307
+ sortOrder
308
+ }) {
309
+ return this.httpRequest.request({
310
+ method: "GET",
311
+ url: "/v1/networks/{network}/subnets",
312
+ path: {
313
+ "network": network
314
+ },
315
+ query: {
316
+ "pageSize": pageSize,
317
+ "pageToken": pageToken,
318
+ "sortOrder": sortOrder
319
+ }
320
+ });
321
+ }
273
322
  }
274
323
 
275
324
  export { PrimaryNetworkService };
package/esm/index.d.ts CHANGED
@@ -5,8 +5,10 @@ export { CancelError, CancelablePromise } from './generated/core/CancelablePromi
5
5
  export { OpenAPI, OpenAPIConfig } from './generated/core/OpenAPI.js';
6
6
  export { Address } from './generated/models/Address.js';
7
7
  export { Asset } from './generated/models/Asset.js';
8
+ export { Blockchain } from './generated/models/Blockchain.js';
8
9
  export { BlockchainId } from './generated/models/BlockchainId.js';
9
10
  export { BlockchainIds } from './generated/models/BlockchainIds.js';
11
+ export { BlockchainInfo } from './generated/models/BlockchainInfo.js';
10
12
  export { CancelListingEventResponse } from './generated/models/CancelListingEventResponse.js';
11
13
  export { CChainAtomicBalances } from './generated/models/CChainAtomicBalances.js';
12
14
  export { CChainExportTransaction } from './generated/models/CChainExportTransaction.js';
@@ -22,6 +24,7 @@ export { CollectionSortByOption } from './generated/models/CollectionSortByOptio
22
24
  export { CreateEvmTransactionExportRequest } from './generated/models/CreateEvmTransactionExportRequest.js';
23
25
  export { CreatePrimaryNetworkTransactionExportRequest } from './generated/models/CreatePrimaryNetworkTransactionExportRequest.js';
24
26
  export { CurrencyCode } from './generated/models/CurrencyCode.js';
27
+ export { DelegatorsDetails } from './generated/models/DelegatorsDetails.js';
25
28
  export { Erc1155Token } from './generated/models/Erc1155Token.js';
26
29
  export { Erc1155TokenBalance } from './generated/models/Erc1155TokenBalance.js';
27
30
  export { Erc1155TokenMetadata } from './generated/models/Erc1155TokenMetadata.js';
@@ -44,15 +47,15 @@ export { EVMOutput } from './generated/models/EVMOutput.js';
44
47
  export { FloorPrice } from './generated/models/FloorPrice.js';
45
48
  export { FullNativeTransactionDetails } from './generated/models/FullNativeTransactionDetails.js';
46
49
  export { GetChainResponse } from './generated/models/GetChainResponse.js';
47
- export { GetCurrentValidatorsStatsResponse } from './generated/models/GetCurrentValidatorsStatsResponse.js';
48
- export { GetDelegatorStatsResponse } from './generated/models/GetDelegatorStatsResponse.js';
49
50
  export { GetEvmBlockResponse } from './generated/models/GetEvmBlockResponse.js';
50
51
  export { GetNativeBalanceResponse } from './generated/models/GetNativeBalanceResponse.js';
52
+ export { GetNetworkDetailsResponse } from './generated/models/GetNetworkDetailsResponse.js';
51
53
  export { GetPrimaryNetworkBlockResponse } from './generated/models/GetPrimaryNetworkBlockResponse.js';
52
54
  export { GetTransactionResponse } from './generated/models/GetTransactionResponse.js';
53
55
  export { InternalTransaction } from './generated/models/InternalTransaction.js';
54
56
  export { InternalTransactionDetails } from './generated/models/InternalTransactionDetails.js';
55
57
  export { InternalTransactionOpCall } from './generated/models/InternalTransactionOpCall.js';
58
+ export { ListBlockchainsResponse } from './generated/models/ListBlockchainsResponse.js';
56
59
  export { ListCChainAtomicBalancesResponse } from './generated/models/ListCChainAtomicBalancesResponse.js';
57
60
  export { ListCChainAtomicTransactionsResponse } from './generated/models/ListCChainAtomicTransactionsResponse.js';
58
61
  export { ListChainsResponse } from './generated/models/ListChainsResponse.js';
@@ -77,6 +80,7 @@ export { ListPChainBalancesResponse } from './generated/models/ListPChainBalance
77
80
  export { ListPChainTransactionsResponse } from './generated/models/ListPChainTransactionsResponse.js';
78
81
  export { ListPChainUtxosResponse } from './generated/models/ListPChainUtxosResponse.js';
79
82
  export { ListPrimaryNetworkBlocksResponse } from './generated/models/ListPrimaryNetworkBlocksResponse.js';
83
+ export { ListSubnetsResponse } from './generated/models/ListSubnetsResponse.js';
80
84
  export { ListTransactionDetailsResponse } from './generated/models/ListTransactionDetailsResponse.js';
81
85
  export { ListTransfersResponse } from './generated/models/ListTransfersResponse.js';
82
86
  export { ListUtxosResponse } from './generated/models/ListUtxosResponse.js';
@@ -121,6 +125,7 @@ export { RewardType } from './generated/models/RewardType.js';
121
125
  export { RichAddress } from './generated/models/RichAddress.js';
122
126
  export { SortOrder } from './generated/models/SortOrder.js';
123
127
  export { StakingDistribution } from './generated/models/StakingDistribution.js';
128
+ export { Subnet } from './generated/models/Subnet.js';
124
129
  export { TokenWithPrice } from './generated/models/TokenWithPrice.js';
125
130
  export { TransactionDetails } from './generated/models/TransactionDetails.js';
126
131
  export { TransactionExportMetadata } from './generated/models/TransactionExportMetadata.js';
@@ -132,6 +137,7 @@ export { UtilityAddresses } from './generated/models/UtilityAddresses.js';
132
137
  export { Utxo } from './generated/models/Utxo.js';
133
138
  export { UtxoCredential } from './generated/models/UtxoCredential.js';
134
139
  export { UtxoType } from './generated/models/UtxoType.js';
140
+ export { ValidatorsDetails } from './generated/models/ValidatorsDetails.js';
135
141
  export { VmName } from './generated/models/VmName.js';
136
142
  export { XChainAssetBalance } from './generated/models/XChainAssetBalance.js';
137
143
  export { XChainAssetDetails } from './generated/models/XChainAssetDetails.js';
@@ -141,7 +147,6 @@ export { XChainLinearTransaction } from './generated/models/XChainLinearTransact
141
147
  export { XChainNonLinearTransaction } from './generated/models/XChainNonLinearTransaction.js';
142
148
  export { XChainSharedAssetBalance } from './generated/models/XChainSharedAssetBalance.js';
143
149
  export { XChainVertex } from './generated/models/XChainVertex.js';
144
- export { DefaultService } from './generated/services/DefaultService.js';
145
150
  export { EvmService } from './generated/services/EvmService.js';
146
151
  export { HealthCheckService } from './generated/services/HealthCheckService.js';
147
152
  export { OperationsService } from './generated/services/OperationsService.js';
package/esm/index.js CHANGED
@@ -45,7 +45,6 @@ export { VmName } from './generated/models/VmName.js';
45
45
  export { XChainId } from './generated/models/XChainId.js';
46
46
  export { XChainLinearTransaction } from './generated/models/XChainLinearTransaction.js';
47
47
  export { XChainNonLinearTransaction } from './generated/models/XChainNonLinearTransaction.js';
48
- export { DefaultService } from './generated/services/DefaultService.js';
49
48
  export { EvmService } from './generated/services/EvmService.js';
50
49
  export { HealthCheckService } from './generated/services/HealthCheckService.js';
51
50
  export { OperationsService } from './generated/services/OperationsService.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avalabs/glacier-sdk",
3
- "version": "2.8.0-alpha.116",
3
+ "version": "2.8.0-alpha.118",
4
4
  "description": "sdk for interacting with glacier-api",
5
5
  "author": "Oliver Wang <oliver.wang@avalabs.org>",
6
6
  "homepage": "https://github.com/ava-labs/avalanche-sdks#readme",
@@ -29,5 +29,5 @@
29
29
  "bugs": {
30
30
  "url": "https://github.com/ava-labs/avalanche-sdks/issues"
31
31
  },
32
- "gitHead": "69b0db81cb80d97625df5a58b8ae1d715c971141"
32
+ "gitHead": "923823812836bbc23a06c4753df9be4010f9a9c6"
33
33
  }
@@ -1,6 +0,0 @@
1
- type GetDelegatorStatsResponse = {
2
- delegatorCount: number;
3
- totalStakedAmount: string;
4
- };
5
-
6
- export { GetDelegatorStatsResponse };
@@ -1,34 +0,0 @@
1
- import { GetCurrentValidatorsStatsResponse } from '../models/GetCurrentValidatorsStatsResponse.js';
2
- import { GetDelegatorStatsResponse } from '../models/GetDelegatorStatsResponse.js';
3
- import { Network } from '../models/Network.js';
4
- import { CancelablePromise } from '../core/CancelablePromise.js';
5
- import { BaseHttpRequest } from '../core/BaseHttpRequest.js';
6
-
7
- declare class DefaultService {
8
- readonly httpRequest: BaseHttpRequest;
9
- constructor(httpRequest: BaseHttpRequest);
10
- /**
11
- * Get current validator stats for a given network
12
- * @returns GetCurrentValidatorsStatsResponse
13
- * @throws ApiError
14
- */
15
- getCurrentValidatorStats({ network, }: {
16
- /**
17
- * Either mainnet or a testnet.
18
- */
19
- network: Network;
20
- }): CancelablePromise<GetCurrentValidatorsStatsResponse>;
21
- /**
22
- * Get current delegator stats for a given network
23
- * @returns GetDelegatorStatsResponse
24
- * @throws ApiError
25
- */
26
- getDelegatorStats({ network, }: {
27
- /**
28
- * Either mainnet or a testnet.
29
- */
30
- network: Network;
31
- }): CancelablePromise<GetDelegatorStatsResponse>;
32
- }
33
-
34
- export { DefaultService };
@@ -1,29 +0,0 @@
1
- class DefaultService {
2
- constructor(httpRequest) {
3
- this.httpRequest = httpRequest;
4
- }
5
- getCurrentValidatorStats({
6
- network
7
- }) {
8
- return this.httpRequest.request({
9
- method: "GET",
10
- url: "/v1/networks/{network}/validators:stats",
11
- path: {
12
- "network": network
13
- }
14
- });
15
- }
16
- getDelegatorStats({
17
- network
18
- }) {
19
- return this.httpRequest.request({
20
- method: "GET",
21
- url: "/v1/networks/{network}/delegators:stats",
22
- path: {
23
- "network": network
24
- }
25
- });
26
- }
27
- }
28
-
29
- export { DefaultService };