@avalabs/glacier-sdk 2.8.0-alpha.115 → 2.8.0-alpha.117

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,39 +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
- declare enum Network {
76
- MAINNET = "mainnet",
77
- FUJI = "fuji"
78
- }
79
-
80
- declare class DefaultService {
81
- readonly httpRequest: BaseHttpRequest;
82
- constructor(httpRequest: BaseHttpRequest);
83
- /**
84
- * Get current validator stats for a given network
85
- * @returns GetCurrentValidatorsStatsResponse
86
- * @throws ApiError
87
- */
88
- getCurrentValidatorStats({ network, }: {
89
- /**
90
- * Either mainnet or a testnet.
91
- */
92
- network: Network;
93
- }): CancelablePromise<GetCurrentValidatorsStatsResponse>;
94
- }
95
-
96
63
  declare enum CollectionSortByOption {
97
64
  COLLECTION_ADDRESS = "collectionAddress",
98
65
  SALE_TIMESTAMP = "saleTimestamp",
@@ -1378,7 +1345,7 @@ declare class EvmService {
1378
1345
  * @returns ListErc20BalancesResponse
1379
1346
  * @throws ApiError
1380
1347
  */
1381
- listErc20Balances({ chainId, address, blockNumber, pageSize, pageToken, currency, }: {
1348
+ listErc20Balances({ chainId, address, blockNumber, pageSize, pageToken, contractAddresses, currency, }: {
1382
1349
  /**
1383
1350
  * A supported evm chain id. Use the `/chains` endpoint to get
1384
1351
  * a list of supported chain ids.
@@ -1401,6 +1368,10 @@ declare class EvmService {
1401
1368
  * A page token, received from a previous list call. Provide this to retrieve the subsequent page.
1402
1369
  */
1403
1370
  pageToken?: string;
1371
+ /**
1372
+ * A comma separated list of contract addresses to filter by.
1373
+ */
1374
+ contractAddresses?: string;
1404
1375
  /**
1405
1376
  * The currency that return values should use. Defaults to USD.
1406
1377
  */
@@ -2432,6 +2403,28 @@ type ChainAddressChainIdMapListResponse = {
2432
2403
  addresses: Array<ChainAddressChainIdMap>;
2433
2404
  };
2434
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
+
2435
2428
  type ProposerDetails = {
2436
2429
  proposerId?: string;
2437
2430
  proposerParentId?: string;
@@ -2452,6 +2445,23 @@ type GetPrimaryNetworkBlockResponse = {
2452
2445
  proposerDetails?: ProposerDetails;
2453
2446
  };
2454
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
+
2455
2465
  type CChainSharedAssetBalance = {
2456
2466
  /**
2457
2467
  * Unique ID for an asset.
@@ -2542,10 +2552,6 @@ type PChainBalance = {
2542
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.
2543
2553
  */
2544
2554
  lockedStaked: Array<PChainAsset>;
2545
- /**
2546
- * 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.
2547
- */
2548
- lockedUnstaked: Array<PChainAsset>;
2549
2555
  };
2550
2556
 
2551
2557
  type ListPChainBalancesResponse = {
@@ -2603,16 +2609,6 @@ type PChainUtxo = {
2603
2609
  utxoStartTimestamp?: number;
2604
2610
  utxoEndTimestamp?: number;
2605
2611
  rewardType?: RewardType;
2606
- /**
2607
- * To be deprecated
2608
- * @deprecated
2609
- */
2610
- fromTx?: string;
2611
- /**
2612
- * To be deprecated
2613
- * @deprecated
2614
- */
2615
- toTx?: string;
2616
2612
  };
2617
2613
 
2618
2614
  type PChainTransaction = {
@@ -2674,11 +2670,6 @@ type PChainTransaction = {
2674
2670
  */
2675
2671
  estimatedReward?: string;
2676
2672
  rewardTxHash?: string;
2677
- /**
2678
- * To be deprecated
2679
- * @deprecated
2680
- */
2681
- rewardTx?: string;
2682
2673
  memo?: string;
2683
2674
  /**
2684
2675
  * Present for RewardValidatorTx
@@ -2725,6 +2716,28 @@ type ListPrimaryNetworkBlocksResponse = {
2725
2716
  chainInfo: PrimaryNetworkChainInfo;
2726
2717
  };
2727
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
+
2728
2741
  type ListUtxosResponse = {
2729
2742
  /**
2730
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.
@@ -3004,6 +3017,11 @@ type ListXChainVerticesResponse = {
3004
3017
  chainInfo: PrimaryNetworkChainInfo;
3005
3018
  };
3006
3019
 
3020
+ declare enum Network {
3021
+ MAINNET = "mainnet",
3022
+ FUJI = "fuji"
3023
+ }
3024
+
3007
3025
  declare enum PChainId {
3008
3026
  _11111111111111111111111111111111LPO_YY = "11111111111111111111111111111111LpoYY",
3009
3027
  P_CHAIN = "p-chain"
@@ -3377,11 +3395,73 @@ declare class PrimaryNetworkService {
3377
3395
  */
3378
3396
  network: Network;
3379
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>;
3380
3461
  }
3381
3462
 
3382
3463
  type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest;
3383
3464
  declare class Glacier {
3384
- readonly default: DefaultService;
3385
3465
  readonly evm: EvmService;
3386
3466
  readonly healthCheck: HealthCheckService;
3387
3467
  readonly operations: OperationsService;
@@ -3407,4 +3487,4 @@ declare class ApiError extends Error {
3407
3487
  constructor(request: ApiRequestOptions, response: ApiResult, message: string);
3408
3488
  }
3409
3489
 
3410
- 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, 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,23 +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:currentStats",
365
- path: {
366
- "network": network
367
- }
368
- });
369
- }
370
- }
371
-
372
355
  class EvmService {
373
356
  constructor(httpRequest) {
374
357
  this.httpRequest = httpRequest;
@@ -398,6 +381,7 @@ class EvmService {
398
381
  blockNumber,
399
382
  pageSize = 10,
400
383
  pageToken,
384
+ contractAddresses,
401
385
  currency
402
386
  }) {
403
387
  return this.httpRequest.request({
@@ -411,6 +395,7 @@ class EvmService {
411
395
  "blockNumber": blockNumber,
412
396
  "pageSize": pageSize,
413
397
  "pageToken": pageToken,
398
+ "contractAddresses": contractAddresses,
414
399
  "currency": currency
415
400
  }
416
401
  });
@@ -1199,6 +1184,55 @@ class PrimaryNetworkService {
1199
1184
  }
1200
1185
  });
1201
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
+ }
1202
1236
  }
1203
1237
 
1204
1238
  class Glacier {
@@ -1215,7 +1249,6 @@ class Glacier {
1215
1249
  HEADERS: config == null ? void 0 : config.HEADERS,
1216
1250
  ENCODE_PATH: config == null ? void 0 : config.ENCODE_PATH
1217
1251
  });
1218
- this.default = new DefaultService(this.request);
1219
1252
  this.evm = new EvmService(this.request);
1220
1253
  this.healthCheck = new HealthCheckService(this.request);
1221
1254
  this.operations = new OperationsService(this.request);
@@ -1585,7 +1618,6 @@ exports.CancelablePromise = CancelablePromise;
1585
1618
  exports.ChainStatus = ChainStatus;
1586
1619
  exports.CollectionSortByOption = CollectionSortByOption;
1587
1620
  exports.CurrencyCode = CurrencyCode;
1588
- exports.DefaultService = DefaultService;
1589
1621
  exports.ErcType = ErcType;
1590
1622
  exports.EvmService = EvmService;
1591
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,14 +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
50
  export { GetEvmBlockResponse } from './generated/models/GetEvmBlockResponse.js';
49
51
  export { GetNativeBalanceResponse } from './generated/models/GetNativeBalanceResponse.js';
52
+ export { GetNetworkDetailsResponse } from './generated/models/GetNetworkDetailsResponse.js';
50
53
  export { GetPrimaryNetworkBlockResponse } from './generated/models/GetPrimaryNetworkBlockResponse.js';
51
54
  export { GetTransactionResponse } from './generated/models/GetTransactionResponse.js';
52
55
  export { InternalTransaction } from './generated/models/InternalTransaction.js';
53
56
  export { InternalTransactionDetails } from './generated/models/InternalTransactionDetails.js';
54
57
  export { InternalTransactionOpCall } from './generated/models/InternalTransactionOpCall.js';
58
+ export { ListBlockchainsResponse } from './generated/models/ListBlockchainsResponse.js';
55
59
  export { ListCChainAtomicBalancesResponse } from './generated/models/ListCChainAtomicBalancesResponse.js';
56
60
  export { ListCChainAtomicTransactionsResponse } from './generated/models/ListCChainAtomicTransactionsResponse.js';
57
61
  export { ListChainsResponse } from './generated/models/ListChainsResponse.js';
@@ -76,6 +80,7 @@ export { ListPChainBalancesResponse } from './generated/models/ListPChainBalance
76
80
  export { ListPChainTransactionsResponse } from './generated/models/ListPChainTransactionsResponse.js';
77
81
  export { ListPChainUtxosResponse } from './generated/models/ListPChainUtxosResponse.js';
78
82
  export { ListPrimaryNetworkBlocksResponse } from './generated/models/ListPrimaryNetworkBlocksResponse.js';
83
+ export { ListSubnetsResponse } from './generated/models/ListSubnetsResponse.js';
79
84
  export { ListTransactionDetailsResponse } from './generated/models/ListTransactionDetailsResponse.js';
80
85
  export { ListTransfersResponse } from './generated/models/ListTransfersResponse.js';
81
86
  export { ListUtxosResponse } from './generated/models/ListUtxosResponse.js';
@@ -120,6 +125,7 @@ export { RewardType } from './generated/models/RewardType.js';
120
125
  export { RichAddress } from './generated/models/RichAddress.js';
121
126
  export { SortOrder } from './generated/models/SortOrder.js';
122
127
  export { StakingDistribution } from './generated/models/StakingDistribution.js';
128
+ export { Subnet } from './generated/models/Subnet.js';
123
129
  export { TokenWithPrice } from './generated/models/TokenWithPrice.js';
124
130
  export { TransactionDetails } from './generated/models/TransactionDetails.js';
125
131
  export { TransactionExportMetadata } from './generated/models/TransactionExportMetadata.js';
@@ -131,6 +137,7 @@ export { UtilityAddresses } from './generated/models/UtilityAddresses.js';
131
137
  export { Utxo } from './generated/models/Utxo.js';
132
138
  export { UtxoCredential } from './generated/models/UtxoCredential.js';
133
139
  export { UtxoType } from './generated/models/UtxoType.js';
140
+ export { ValidatorsDetails } from './generated/models/ValidatorsDetails.js';
134
141
  export { VmName } from './generated/models/VmName.js';
135
142
  export { XChainAssetBalance } from './generated/models/XChainAssetBalance.js';
136
143
  export { XChainAssetDetails } from './generated/models/XChainAssetDetails.js';
@@ -140,7 +147,6 @@ export { XChainLinearTransaction } from './generated/models/XChainLinearTransact
140
147
  export { XChainNonLinearTransaction } from './generated/models/XChainNonLinearTransaction.js';
141
148
  export { XChainSharedAssetBalance } from './generated/models/XChainSharedAssetBalance.js';
142
149
  export { XChainVertex } from './generated/models/XChainVertex.js';
143
- export { DefaultService } from './generated/services/DefaultService.js';
144
150
  export { EvmService } from './generated/services/EvmService.js';
145
151
  export { HealthCheckService } from './generated/services/HealthCheckService.js';
146
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.115",
3
+ "version": "2.8.0-alpha.117",
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": "203071cd8cdbb92c74512524b9c0e35e2c572e05"
32
+ "gitHead": "9f8e3cfce0551856a750ee1cf55f7fab9e907bd6"
33
33
  }
@@ -1,22 +0,0 @@
1
- import { GetCurrentValidatorsStatsResponse } from '../models/GetCurrentValidatorsStatsResponse.js';
2
- import { Network } from '../models/Network.js';
3
- import { CancelablePromise } from '../core/CancelablePromise.js';
4
- import { BaseHttpRequest } from '../core/BaseHttpRequest.js';
5
-
6
- declare class DefaultService {
7
- readonly httpRequest: BaseHttpRequest;
8
- constructor(httpRequest: BaseHttpRequest);
9
- /**
10
- * Get current validator stats for a given network
11
- * @returns GetCurrentValidatorsStatsResponse
12
- * @throws ApiError
13
- */
14
- getCurrentValidatorStats({ network, }: {
15
- /**
16
- * Either mainnet or a testnet.
17
- */
18
- network: Network;
19
- }): CancelablePromise<GetCurrentValidatorsStatsResponse>;
20
- }
21
-
22
- export { DefaultService };
@@ -1,18 +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:currentStats",
11
- path: {
12
- "network": network
13
- }
14
- });
15
- }
16
- }
17
-
18
- export { DefaultService };