@avalabs/glacier-sdk 2.8.0-canary.b9648ce.0 → 2.8.0-canary.c83789f.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.
- package/dist/index.d.ts +75 -14
- package/dist/index.js +106 -50
- package/esm/generated/Glacier.d.ts +2 -0
- package/esm/generated/Glacier.js +26 -10
- package/esm/generated/core/ApiError.js +5 -0
- package/esm/generated/core/CancelablePromise.js +11 -6
- package/esm/generated/core/request.js +14 -31
- package/esm/generated/models/Erc1155Contract.d.ts +2 -1
- package/esm/generated/models/Erc20Contract.d.ts +2 -1
- package/esm/generated/models/Erc721Contract.d.ts +0 -1
- package/esm/generated/models/ImageAsset.d.ts +0 -3
- package/esm/generated/models/PricingProviders.d.ts +5 -0
- package/esm/generated/models/UnknownContract.d.ts +0 -1
- package/esm/generated/services/NfTsService.d.ts +69 -0
- package/esm/generated/services/NfTsService.js +50 -0
- package/esm/generated/services/PrimaryNetworkService.d.ts +1 -5
- package/esm/generated/services/PrimaryNetworkService.js +1 -3
- package/esm/generated/services/PrimaryNetworkTransactionsService.d.ts +5 -1
- package/esm/index.d.ts +2 -0
- package/esm/index.js +1 -0
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1012,9 +1012,6 @@ type ContractDeploymentDetails = {
|
|
|
1012
1012
|
};
|
|
1013
1013
|
|
|
1014
1014
|
type ImageAsset = {
|
|
1015
|
-
/**
|
|
1016
|
-
* INPUT ONLY
|
|
1017
|
-
*/
|
|
1018
1015
|
assetId?: string;
|
|
1019
1016
|
/**
|
|
1020
1017
|
* OUTPUT ONLY
|
|
@@ -1022,6 +1019,10 @@ type ImageAsset = {
|
|
|
1022
1019
|
imageUri?: string;
|
|
1023
1020
|
};
|
|
1024
1021
|
|
|
1022
|
+
type PricingProviders = {
|
|
1023
|
+
coingeckoCoinId?: string;
|
|
1024
|
+
};
|
|
1025
|
+
|
|
1025
1026
|
declare enum ResourceLinkType {
|
|
1026
1027
|
BLOG = "Blog",
|
|
1027
1028
|
COIN_GECKO = "CoinGecko",
|
|
@@ -1059,7 +1060,6 @@ type Erc1155Contract = {
|
|
|
1059
1060
|
logoAsset?: ImageAsset;
|
|
1060
1061
|
bannerAsset?: ImageAsset;
|
|
1061
1062
|
color?: string;
|
|
1062
|
-
coingeckoCoinId?: string;
|
|
1063
1063
|
resourceLinks?: Array<ResourceLink>;
|
|
1064
1064
|
tags?: Array<string>;
|
|
1065
1065
|
/**
|
|
@@ -1072,6 +1072,7 @@ type Erc1155Contract = {
|
|
|
1072
1072
|
* The contract symbol.
|
|
1073
1073
|
*/
|
|
1074
1074
|
symbol?: string;
|
|
1075
|
+
pricingProviders?: PricingProviders;
|
|
1075
1076
|
};
|
|
1076
1077
|
declare namespace Erc1155Contract {
|
|
1077
1078
|
enum ercType {
|
|
@@ -1090,7 +1091,6 @@ type Erc20Contract = {
|
|
|
1090
1091
|
logoAsset?: ImageAsset;
|
|
1091
1092
|
bannerAsset?: ImageAsset;
|
|
1092
1093
|
color?: string;
|
|
1093
|
-
coingeckoCoinId?: string;
|
|
1094
1094
|
resourceLinks?: Array<ResourceLink>;
|
|
1095
1095
|
tags?: Array<string>;
|
|
1096
1096
|
/**
|
|
@@ -1107,6 +1107,7 @@ type Erc20Contract = {
|
|
|
1107
1107
|
* The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation.
|
|
1108
1108
|
*/
|
|
1109
1109
|
decimals: number;
|
|
1110
|
+
pricingProviders: PricingProviders;
|
|
1110
1111
|
};
|
|
1111
1112
|
declare namespace Erc20Contract {
|
|
1112
1113
|
enum ercType {
|
|
@@ -1125,7 +1126,6 @@ type Erc721Contract = {
|
|
|
1125
1126
|
logoAsset?: ImageAsset;
|
|
1126
1127
|
bannerAsset?: ImageAsset;
|
|
1127
1128
|
color?: string;
|
|
1128
|
-
coingeckoCoinId?: string;
|
|
1129
1129
|
resourceLinks?: Array<ResourceLink>;
|
|
1130
1130
|
tags?: Array<string>;
|
|
1131
1131
|
/**
|
|
@@ -1156,7 +1156,6 @@ type UnknownContract = {
|
|
|
1156
1156
|
logoAsset?: ImageAsset;
|
|
1157
1157
|
bannerAsset?: ImageAsset;
|
|
1158
1158
|
color?: string;
|
|
1159
|
-
coingeckoCoinId?: string;
|
|
1160
1159
|
resourceLinks?: Array<ResourceLink>;
|
|
1161
1160
|
tags?: Array<string>;
|
|
1162
1161
|
/**
|
|
@@ -1731,6 +1730,67 @@ declare class HealthCheckService {
|
|
|
1731
1730
|
}>;
|
|
1732
1731
|
}
|
|
1733
1732
|
|
|
1733
|
+
declare class NfTsService {
|
|
1734
|
+
readonly httpRequest: BaseHttpRequest;
|
|
1735
|
+
constructor(httpRequest: BaseHttpRequest);
|
|
1736
|
+
/**
|
|
1737
|
+
* Reindex NFT metadata
|
|
1738
|
+
* Triggers reindexing of token metadata for an NFT token. Reindexing can only be called once per hour for each NFT token.
|
|
1739
|
+
* @returns any
|
|
1740
|
+
* @throws ApiError
|
|
1741
|
+
*/
|
|
1742
|
+
reindexNft({ chainId, address, tokenId, }: {
|
|
1743
|
+
/**
|
|
1744
|
+
* A supported evm chain id. Use the `/chains` endpoint to get a list of supported chain ids.
|
|
1745
|
+
*/
|
|
1746
|
+
chainId: string;
|
|
1747
|
+
/**
|
|
1748
|
+
* Contract address on the relevant chain.
|
|
1749
|
+
*/
|
|
1750
|
+
address: string;
|
|
1751
|
+
/**
|
|
1752
|
+
* TokenId on the contract
|
|
1753
|
+
*/
|
|
1754
|
+
tokenId: string;
|
|
1755
|
+
}): CancelablePromise<any>;
|
|
1756
|
+
/**
|
|
1757
|
+
* Get token details
|
|
1758
|
+
* Gets token details for a specific token of an NFT contract.
|
|
1759
|
+
* @returns any
|
|
1760
|
+
* @throws ApiError
|
|
1761
|
+
*/
|
|
1762
|
+
getTokenDetails({ chainId, address, tokenId, }: {
|
|
1763
|
+
/**
|
|
1764
|
+
* A supported evm chain id. Use the `/chains` endpoint to get a list of supported chain ids.
|
|
1765
|
+
*/
|
|
1766
|
+
chainId: string;
|
|
1767
|
+
/**
|
|
1768
|
+
* Contract address on the relevant chain.
|
|
1769
|
+
*/
|
|
1770
|
+
address: string;
|
|
1771
|
+
/**
|
|
1772
|
+
* TokenId on the contract
|
|
1773
|
+
*/
|
|
1774
|
+
tokenId: string;
|
|
1775
|
+
}): CancelablePromise<(Erc721Token | Erc1155Token)>;
|
|
1776
|
+
/**
|
|
1777
|
+
* Get collection details
|
|
1778
|
+
* Gets collection details for a NFT contract.
|
|
1779
|
+
* @returns any
|
|
1780
|
+
* @throws ApiError
|
|
1781
|
+
*/
|
|
1782
|
+
getCollection({ chainId, address, }: {
|
|
1783
|
+
/**
|
|
1784
|
+
* A supported evm chain id. Use the `/chains` endpoint to get a list of supported chain ids.
|
|
1785
|
+
*/
|
|
1786
|
+
chainId: string;
|
|
1787
|
+
/**
|
|
1788
|
+
* Contract address on the relevant chain.
|
|
1789
|
+
*/
|
|
1790
|
+
address: string;
|
|
1791
|
+
}): CancelablePromise<(Erc721Contract | Erc1155Contract)>;
|
|
1792
|
+
}
|
|
1793
|
+
|
|
1734
1794
|
type EvmNetworkOptions = {
|
|
1735
1795
|
addresses: Array<string>;
|
|
1736
1796
|
includeChains: Array<string>;
|
|
@@ -2256,15 +2316,11 @@ declare class PrimaryNetworkService {
|
|
|
2256
2316
|
* @returns ListDelegatorDetailsResponse
|
|
2257
2317
|
* @throws ApiError
|
|
2258
2318
|
*/
|
|
2259
|
-
listDelegators({ network,
|
|
2319
|
+
listDelegators({ network, pageSize, pageToken, sortOrder, delegationStatus, rewardAddresses, nodeIds, }: {
|
|
2260
2320
|
/**
|
|
2261
2321
|
* Either mainnet or a testnet.
|
|
2262
2322
|
*/
|
|
2263
2323
|
network: Network;
|
|
2264
|
-
/**
|
|
2265
|
-
* A primary network (P or X chain) nodeId.
|
|
2266
|
-
*/
|
|
2267
|
-
nodeId: string;
|
|
2268
2324
|
/**
|
|
2269
2325
|
* The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
|
|
2270
2326
|
*/
|
|
@@ -3311,7 +3367,11 @@ declare class PrimaryNetworkTransactionsService {
|
|
|
3311
3367
|
}): CancelablePromise<(PChainTransaction | XChainNonLinearTransaction | XChainLinearTransaction | CChainExportTransaction | CChainImportTransaction)>;
|
|
3312
3368
|
/**
|
|
3313
3369
|
* List latest transactions
|
|
3314
|
-
* Lists the latest transactions on one of the Primary Network chains.
|
|
3370
|
+
* Lists the latest transactions on one of the Primary Network chains.
|
|
3371
|
+
*
|
|
3372
|
+
* Transactions are filterable by addresses.
|
|
3373
|
+
*
|
|
3374
|
+
* Given that each transaction may return a large number of UTXO objects, bounded only by the maximum transaction size, the query may return less transactions than the provided page size. The result will contain less results than the page size if the number of utxos contained in the resulting transactions reach a performance threshold.
|
|
3315
3375
|
* @returns any
|
|
3316
3376
|
* @throws ApiError
|
|
3317
3377
|
*/
|
|
@@ -3610,6 +3670,7 @@ declare class Glacier {
|
|
|
3610
3670
|
readonly evmChains: EvmChainsService;
|
|
3611
3671
|
readonly evmTransactions: EvmTransactionsService;
|
|
3612
3672
|
readonly healthCheck: HealthCheckService;
|
|
3673
|
+
readonly nfTs: NfTsService;
|
|
3613
3674
|
readonly operations: OperationsService;
|
|
3614
3675
|
readonly primaryNetwork: PrimaryNetworkService;
|
|
3615
3676
|
readonly primaryNetworkBalances: PrimaryNetworkBalancesService;
|
|
@@ -3639,4 +3700,4 @@ declare class ApiError extends Error {
|
|
|
3639
3700
|
constructor(request: ApiRequestOptions, response: ApiResult, message: string);
|
|
3640
3701
|
}
|
|
3641
3702
|
|
|
3642
|
-
export { ActiveDelegatorDetails, ActiveValidatorDetails, ApiError, Asset, BaseHttpRequest, Blockchain, BlockchainId, BlockchainIds, BlockchainInfo, CChainAtomicBalances, CChainExportTransaction, CChainImportTransaction, CChainSharedAssetBalance, CancelError, CancelablePromise, ChainAddressChainIdMap, ChainAddressChainIdMapListResponse, ChainInfo, ChainStatus, CompletedDelegatorDetails, CompletedValidatorDetails, ContractDeploymentDetails, CreateEvmTransactionExportRequest, CreatePrimaryNetworkTransactionExportRequest, CurrencyCode, DelegationStatusType, DelegatorsDetails, EVMInput, EVMOutput, Erc1155Contract, Erc1155Token, Erc1155TokenBalance, Erc1155TokenMetadata, Erc1155Transfer, Erc1155TransferDetails, Erc20Contract, Erc20Token, Erc20TokenBalance, Erc20Transfer, Erc20TransferDetails, Erc721Contract, Erc721Token, Erc721TokenBalance, Erc721TokenMetadata, Erc721Transfer, Erc721TransferDetails, EvmBalancesService, EvmBlock, EvmBlocksService, EvmChainsService, EvmNetworkOptions, EvmTransactionsService, FullNativeTransactionDetails, GetChainResponse, GetEvmBlockResponse, GetNativeBalanceResponse, GetNetworkDetailsResponse, GetPrimaryNetworkBlockResponse, GetTransactionResponse, Glacier, HealthCheckService, HistoricalReward, ImageAsset, InternalTransaction, InternalTransactionDetails, InternalTransactionOpCall, ListBlockchainsResponse, ListCChainAtomicBalancesResponse, ListCChainAtomicTransactionsResponse, ListChainsResponse, ListCollectibleBalancesResponse, ListContractsResponse, ListDelegatorDetailsResponse, ListErc1155BalancesResponse, ListErc1155TransactionsResponse, ListErc20BalancesResponse, ListErc20TransactionsResponse, ListErc721BalancesResponse, ListErc721TransactionsResponse, ListEvmBlocksResponse, ListHistoricalRewardsResponse, ListInternalTransactionsResponse, ListNativeTransactionsResponse, ListPChainBalancesResponse, ListPChainTransactionsResponse, ListPChainUtxosResponse, ListPendingRewardsResponse, ListPrimaryNetworkBlocksResponse, ListSubnetsResponse, ListTransactionDetailsResponse, ListTransfersResponse, ListUtxosResponse, ListValidatorDetailsResponse, ListXChainBalancesResponse, ListXChainTransactionsResponse, ListXChainVerticesResponse, Method, Money, NativeTokenBalance, NativeTransaction, Network, NetworkToken, NetworkTokenDetails, NetworkType, NftTokenMetadataStatus, OpenAPI, OpenAPIConfig, OperationStatus, OperationStatusCode, OperationStatusResponse, OperationType, OperationsService, PChainAsset, PChainBalance, PChainId, PChainSharedAsset, PChainTransaction, PChainTransactionType, PChainUtxo, PendingDelegatorDetails, PendingReward, PendingValidatorDetails, PrimaryNetwork, PrimaryNetworkBalancesService, PrimaryNetworkBlock, PrimaryNetworkBlocksService, PrimaryNetworkChainInfo, PrimaryNetworkChainName, PrimaryNetworkOptions, PrimaryNetworkRewardsService, PrimaryNetworkService, PrimaryNetworkTransactionsService, PrimaryNetworkTxType, PrimaryNetworkUtxOsService, PrimaryNetworkVerticesService, ProposerDetails, ResourceLink, ResourceLinkType, RewardType, Rewards, RichAddress, SortOrder, StakingDistribution, Subnet, TransactionDetails, TransactionExportMetadata, TransactionMethodType, TransactionStatus, TransactionVertexDetail, UnknownContract, UtilityAddresses, Utxo, UtxoCredential, UtxoType, ValidationStatusType, ValidatorsDetails, VmName, XChainAssetBalance, XChainAssetDetails, XChainBalances, XChainId, XChainLinearTransaction, XChainNonLinearTransaction, XChainSharedAssetBalance, XChainVertex };
|
|
3703
|
+
export { ActiveDelegatorDetails, ActiveValidatorDetails, ApiError, Asset, BaseHttpRequest, Blockchain, BlockchainId, BlockchainIds, BlockchainInfo, CChainAtomicBalances, CChainExportTransaction, CChainImportTransaction, CChainSharedAssetBalance, CancelError, CancelablePromise, ChainAddressChainIdMap, ChainAddressChainIdMapListResponse, ChainInfo, ChainStatus, CompletedDelegatorDetails, CompletedValidatorDetails, ContractDeploymentDetails, CreateEvmTransactionExportRequest, CreatePrimaryNetworkTransactionExportRequest, CurrencyCode, DelegationStatusType, DelegatorsDetails, EVMInput, EVMOutput, Erc1155Contract, Erc1155Token, Erc1155TokenBalance, Erc1155TokenMetadata, Erc1155Transfer, Erc1155TransferDetails, Erc20Contract, Erc20Token, Erc20TokenBalance, Erc20Transfer, Erc20TransferDetails, Erc721Contract, Erc721Token, Erc721TokenBalance, Erc721TokenMetadata, Erc721Transfer, Erc721TransferDetails, EvmBalancesService, EvmBlock, EvmBlocksService, EvmChainsService, EvmNetworkOptions, EvmTransactionsService, FullNativeTransactionDetails, GetChainResponse, GetEvmBlockResponse, GetNativeBalanceResponse, GetNetworkDetailsResponse, GetPrimaryNetworkBlockResponse, GetTransactionResponse, Glacier, HealthCheckService, HistoricalReward, ImageAsset, InternalTransaction, InternalTransactionDetails, InternalTransactionOpCall, ListBlockchainsResponse, ListCChainAtomicBalancesResponse, ListCChainAtomicTransactionsResponse, ListChainsResponse, ListCollectibleBalancesResponse, ListContractsResponse, ListDelegatorDetailsResponse, ListErc1155BalancesResponse, ListErc1155TransactionsResponse, ListErc20BalancesResponse, ListErc20TransactionsResponse, ListErc721BalancesResponse, ListErc721TransactionsResponse, ListEvmBlocksResponse, ListHistoricalRewardsResponse, ListInternalTransactionsResponse, ListNativeTransactionsResponse, ListPChainBalancesResponse, ListPChainTransactionsResponse, ListPChainUtxosResponse, ListPendingRewardsResponse, ListPrimaryNetworkBlocksResponse, ListSubnetsResponse, ListTransactionDetailsResponse, ListTransfersResponse, ListUtxosResponse, ListValidatorDetailsResponse, ListXChainBalancesResponse, ListXChainTransactionsResponse, ListXChainVerticesResponse, Method, Money, NativeTokenBalance, NativeTransaction, Network, NetworkToken, NetworkTokenDetails, NetworkType, NfTsService, NftTokenMetadataStatus, OpenAPI, OpenAPIConfig, OperationStatus, OperationStatusCode, OperationStatusResponse, OperationType, OperationsService, PChainAsset, PChainBalance, PChainId, PChainSharedAsset, PChainTransaction, PChainTransactionType, PChainUtxo, PendingDelegatorDetails, PendingReward, PendingValidatorDetails, PricingProviders, PrimaryNetwork, PrimaryNetworkBalancesService, PrimaryNetworkBlock, PrimaryNetworkBlocksService, PrimaryNetworkChainInfo, PrimaryNetworkChainName, PrimaryNetworkOptions, PrimaryNetworkRewardsService, PrimaryNetworkService, PrimaryNetworkTransactionsService, PrimaryNetworkTxType, PrimaryNetworkUtxOsService, PrimaryNetworkVerticesService, ProposerDetails, ResourceLink, ResourceLinkType, RewardType, Rewards, RichAddress, SortOrder, StakingDistribution, Subnet, TransactionDetails, TransactionExportMetadata, TransactionMethodType, TransactionStatus, TransactionVertexDetail, UnknownContract, UtilityAddresses, Utxo, UtxoCredential, UtxoType, ValidationStatusType, ValidatorsDetails, VmName, XChainAssetBalance, XChainAssetDetails, XChainBalances, XChainId, XChainLinearTransaction, XChainNonLinearTransaction, XChainSharedAssetBalance, XChainVertex };
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,11 @@ class BaseHttpRequest {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
class ApiError extends Error {
|
|
10
|
+
url;
|
|
11
|
+
status;
|
|
12
|
+
statusText;
|
|
13
|
+
body;
|
|
14
|
+
request;
|
|
10
15
|
constructor(request, response, message) {
|
|
11
16
|
super(message);
|
|
12
17
|
this.name = "ApiError";
|
|
@@ -28,6 +33,14 @@ class CancelError extends Error {
|
|
|
28
33
|
}
|
|
29
34
|
}
|
|
30
35
|
class CancelablePromise {
|
|
36
|
+
[Symbol.toStringTag];
|
|
37
|
+
_isResolved;
|
|
38
|
+
_isRejected;
|
|
39
|
+
_isCancelled;
|
|
40
|
+
_cancelHandlers;
|
|
41
|
+
_promise;
|
|
42
|
+
_resolve;
|
|
43
|
+
_reject;
|
|
31
44
|
constructor(executor) {
|
|
32
45
|
this._isResolved = false;
|
|
33
46
|
this._isRejected = false;
|
|
@@ -37,20 +50,18 @@ class CancelablePromise {
|
|
|
37
50
|
this._resolve = resolve;
|
|
38
51
|
this._reject = reject;
|
|
39
52
|
const onResolve = (value) => {
|
|
40
|
-
var _a;
|
|
41
53
|
if (this._isResolved || this._isRejected || this._isCancelled) {
|
|
42
54
|
return;
|
|
43
55
|
}
|
|
44
56
|
this._isResolved = true;
|
|
45
|
-
|
|
57
|
+
this._resolve?.(value);
|
|
46
58
|
};
|
|
47
59
|
const onReject = (reason) => {
|
|
48
|
-
var _a;
|
|
49
60
|
if (this._isResolved || this._isRejected || this._isCancelled) {
|
|
50
61
|
return;
|
|
51
62
|
}
|
|
52
63
|
this._isRejected = true;
|
|
53
|
-
|
|
64
|
+
this._reject?.(reason);
|
|
54
65
|
};
|
|
55
66
|
const onCancel = (cancelHandler) => {
|
|
56
67
|
if (this._isResolved || this._isRejected || this._isCancelled) {
|
|
@@ -80,7 +91,6 @@ class CancelablePromise {
|
|
|
80
91
|
return this._promise.finally(onFinally);
|
|
81
92
|
}
|
|
82
93
|
cancel() {
|
|
83
|
-
var _a;
|
|
84
94
|
if (this._isResolved || this._isRejected || this._isCancelled) {
|
|
85
95
|
return;
|
|
86
96
|
}
|
|
@@ -96,32 +106,13 @@ class CancelablePromise {
|
|
|
96
106
|
}
|
|
97
107
|
}
|
|
98
108
|
this._cancelHandlers.length = 0;
|
|
99
|
-
|
|
109
|
+
this._reject?.(new CancelError("Request aborted"));
|
|
100
110
|
}
|
|
101
111
|
get isCancelled() {
|
|
102
112
|
return this._isCancelled;
|
|
103
113
|
}
|
|
104
114
|
}
|
|
105
115
|
|
|
106
|
-
var __defProp = Object.defineProperty;
|
|
107
|
-
var __defProps = Object.defineProperties;
|
|
108
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
109
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
110
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
111
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
112
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
113
|
-
var __spreadValues = (a, b) => {
|
|
114
|
-
for (var prop in b || (b = {}))
|
|
115
|
-
if (__hasOwnProp.call(b, prop))
|
|
116
|
-
__defNormalProp(a, prop, b[prop]);
|
|
117
|
-
if (__getOwnPropSymbols)
|
|
118
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
119
|
-
if (__propIsEnum.call(b, prop))
|
|
120
|
-
__defNormalProp(a, prop, b[prop]);
|
|
121
|
-
}
|
|
122
|
-
return a;
|
|
123
|
-
};
|
|
124
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
125
116
|
const isDefined = (value) => {
|
|
126
117
|
return value !== void 0 && value !== null;
|
|
127
118
|
};
|
|
@@ -175,8 +166,7 @@ const getQueryString = (params) => {
|
|
|
175
166
|
const getUrl = (config, options) => {
|
|
176
167
|
const encoder = config.ENCODE_PATH || encodeURI;
|
|
177
168
|
const path = options.url.replace("{api-version}", config.VERSION).replace(/{(.*?)}/g, (substring, group) => {
|
|
178
|
-
|
|
179
|
-
if ((_a = options.path) == null ? void 0 : _a.hasOwnProperty(group)) {
|
|
169
|
+
if (options.path?.hasOwnProperty(group)) {
|
|
180
170
|
return encoder(String(options.path[group]));
|
|
181
171
|
}
|
|
182
172
|
return substring;
|
|
@@ -219,9 +209,12 @@ const getHeaders = async (config, options) => {
|
|
|
219
209
|
const username = await resolve(options, config.USERNAME);
|
|
220
210
|
const password = await resolve(options, config.PASSWORD);
|
|
221
211
|
const additionalHeaders = await resolve(options, config.HEADERS);
|
|
222
|
-
const headers = Object.entries(
|
|
223
|
-
Accept: "application/json"
|
|
224
|
-
|
|
212
|
+
const headers = Object.entries({
|
|
213
|
+
Accept: "application/json",
|
|
214
|
+
...additionalHeaders,
|
|
215
|
+
...options.headers
|
|
216
|
+
}).filter(([_, value]) => isDefined(value)).reduce((headers2, [key, value]) => ({
|
|
217
|
+
...headers2,
|
|
225
218
|
[key]: String(value)
|
|
226
219
|
}), {});
|
|
227
220
|
if (isStringWithValue(token)) {
|
|
@@ -245,9 +238,8 @@ const getHeaders = async (config, options) => {
|
|
|
245
238
|
return new Headers(headers);
|
|
246
239
|
};
|
|
247
240
|
const getRequestBody = (options) => {
|
|
248
|
-
var _a;
|
|
249
241
|
if (options.body) {
|
|
250
|
-
if (
|
|
242
|
+
if (options.mediaType?.includes("/json")) {
|
|
251
243
|
return JSON.stringify(options.body);
|
|
252
244
|
} else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {
|
|
253
245
|
return options.body;
|
|
@@ -261,7 +253,7 @@ const sendRequest = async (config, options, url, body, formData, headers, onCanc
|
|
|
261
253
|
const controller = new AbortController();
|
|
262
254
|
const request2 = {
|
|
263
255
|
headers,
|
|
264
|
-
body: body
|
|
256
|
+
body: body ?? formData,
|
|
265
257
|
method: options.method,
|
|
266
258
|
signal: controller.signal
|
|
267
259
|
};
|
|
@@ -299,15 +291,16 @@ const getResponseBody = async (response) => {
|
|
|
299
291
|
return void 0;
|
|
300
292
|
};
|
|
301
293
|
const catchErrorCodes = (options, result) => {
|
|
302
|
-
const errors =
|
|
294
|
+
const errors = {
|
|
303
295
|
400: "Bad Request",
|
|
304
296
|
401: "Unauthorized",
|
|
305
297
|
403: "Forbidden",
|
|
306
298
|
404: "Not Found",
|
|
307
299
|
500: "Internal Server Error",
|
|
308
300
|
502: "Bad Gateway",
|
|
309
|
-
503: "Service Unavailable"
|
|
310
|
-
|
|
301
|
+
503: "Service Unavailable",
|
|
302
|
+
...options.errors
|
|
303
|
+
};
|
|
311
304
|
const error = errors[result.status];
|
|
312
305
|
if (error) {
|
|
313
306
|
throw new ApiError(options, result, error);
|
|
@@ -332,7 +325,7 @@ const request = (config, options) => {
|
|
|
332
325
|
ok: response.ok,
|
|
333
326
|
status: response.status,
|
|
334
327
|
statusText: response.statusText,
|
|
335
|
-
body: responseHeader
|
|
328
|
+
body: responseHeader ?? responseBody
|
|
336
329
|
};
|
|
337
330
|
catchErrorCodes(options, result);
|
|
338
331
|
resolve2(result.body);
|
|
@@ -796,6 +789,55 @@ class HealthCheckService {
|
|
|
796
789
|
}
|
|
797
790
|
}
|
|
798
791
|
|
|
792
|
+
class NfTsService {
|
|
793
|
+
constructor(httpRequest) {
|
|
794
|
+
this.httpRequest = httpRequest;
|
|
795
|
+
}
|
|
796
|
+
reindexNft({
|
|
797
|
+
chainId,
|
|
798
|
+
address,
|
|
799
|
+
tokenId
|
|
800
|
+
}) {
|
|
801
|
+
return this.httpRequest.request({
|
|
802
|
+
method: "POST",
|
|
803
|
+
url: "/v1/chains/{chainId}/nfts/collections/{address}/tokens/{tokenId}:reindex",
|
|
804
|
+
path: {
|
|
805
|
+
"chainId": chainId,
|
|
806
|
+
"address": address,
|
|
807
|
+
"tokenId": tokenId
|
|
808
|
+
}
|
|
809
|
+
});
|
|
810
|
+
}
|
|
811
|
+
getTokenDetails({
|
|
812
|
+
chainId,
|
|
813
|
+
address,
|
|
814
|
+
tokenId
|
|
815
|
+
}) {
|
|
816
|
+
return this.httpRequest.request({
|
|
817
|
+
method: "GET",
|
|
818
|
+
url: "/v1/chains/{chainId}/nfts/collections/{address}/tokens/{tokenId}",
|
|
819
|
+
path: {
|
|
820
|
+
"chainId": chainId,
|
|
821
|
+
"address": address,
|
|
822
|
+
"tokenId": tokenId
|
|
823
|
+
}
|
|
824
|
+
});
|
|
825
|
+
}
|
|
826
|
+
getCollection({
|
|
827
|
+
chainId,
|
|
828
|
+
address
|
|
829
|
+
}) {
|
|
830
|
+
return this.httpRequest.request({
|
|
831
|
+
method: "GET",
|
|
832
|
+
url: "/v1/chains/{chainId}/nfts/collections/{address}",
|
|
833
|
+
path: {
|
|
834
|
+
"chainId": chainId,
|
|
835
|
+
"address": address
|
|
836
|
+
}
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
|
|
799
841
|
class OperationsService {
|
|
800
842
|
constructor(httpRequest) {
|
|
801
843
|
this.httpRequest = httpRequest;
|
|
@@ -956,7 +998,6 @@ class PrimaryNetworkService {
|
|
|
956
998
|
}
|
|
957
999
|
listDelegators({
|
|
958
1000
|
network,
|
|
959
|
-
nodeId,
|
|
960
1001
|
pageSize = 10,
|
|
961
1002
|
pageToken,
|
|
962
1003
|
sortOrder,
|
|
@@ -968,8 +1009,7 @@ class PrimaryNetworkService {
|
|
|
968
1009
|
method: "GET",
|
|
969
1010
|
url: "/v1/networks/{network}/delegators",
|
|
970
1011
|
path: {
|
|
971
|
-
"network": network
|
|
972
|
-
"nodeId": nodeId
|
|
1012
|
+
"network": network
|
|
973
1013
|
},
|
|
974
1014
|
query: {
|
|
975
1015
|
"pageSize": pageSize,
|
|
@@ -1320,24 +1360,39 @@ class PrimaryNetworkVerticesService {
|
|
|
1320
1360
|
}
|
|
1321
1361
|
|
|
1322
1362
|
class Glacier {
|
|
1363
|
+
evmBalances;
|
|
1364
|
+
evmBlocks;
|
|
1365
|
+
evmChains;
|
|
1366
|
+
evmTransactions;
|
|
1367
|
+
healthCheck;
|
|
1368
|
+
nfTs;
|
|
1369
|
+
operations;
|
|
1370
|
+
primaryNetwork;
|
|
1371
|
+
primaryNetworkBalances;
|
|
1372
|
+
primaryNetworkBlocks;
|
|
1373
|
+
primaryNetworkRewards;
|
|
1374
|
+
primaryNetworkTransactions;
|
|
1375
|
+
primaryNetworkUtxOs;
|
|
1376
|
+
primaryNetworkVertices;
|
|
1377
|
+
request;
|
|
1323
1378
|
constructor(config, HttpRequest = FetchHttpRequest) {
|
|
1324
|
-
var _a, _b, _c, _d;
|
|
1325
1379
|
this.request = new HttpRequest({
|
|
1326
|
-
BASE:
|
|
1327
|
-
VERSION:
|
|
1328
|
-
WITH_CREDENTIALS:
|
|
1329
|
-
CREDENTIALS:
|
|
1330
|
-
TOKEN: config
|
|
1331
|
-
USERNAME: config
|
|
1332
|
-
PASSWORD: config
|
|
1333
|
-
HEADERS: config
|
|
1334
|
-
ENCODE_PATH: config
|
|
1380
|
+
BASE: config?.BASE ?? "https://glacier-api-dev.avax.network",
|
|
1381
|
+
VERSION: config?.VERSION ?? "Beta",
|
|
1382
|
+
WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
|
|
1383
|
+
CREDENTIALS: config?.CREDENTIALS ?? "include",
|
|
1384
|
+
TOKEN: config?.TOKEN,
|
|
1385
|
+
USERNAME: config?.USERNAME,
|
|
1386
|
+
PASSWORD: config?.PASSWORD,
|
|
1387
|
+
HEADERS: config?.HEADERS,
|
|
1388
|
+
ENCODE_PATH: config?.ENCODE_PATH
|
|
1335
1389
|
});
|
|
1336
1390
|
this.evmBalances = new EvmBalancesService(this.request);
|
|
1337
1391
|
this.evmBlocks = new EvmBlocksService(this.request);
|
|
1338
1392
|
this.evmChains = new EvmChainsService(this.request);
|
|
1339
1393
|
this.evmTransactions = new EvmTransactionsService(this.request);
|
|
1340
1394
|
this.healthCheck = new HealthCheckService(this.request);
|
|
1395
|
+
this.nfTs = new NfTsService(this.request);
|
|
1341
1396
|
this.operations = new OperationsService(this.request);
|
|
1342
1397
|
this.primaryNetwork = new PrimaryNetworkService(this.request);
|
|
1343
1398
|
this.primaryNetworkBalances = new PrimaryNetworkBalancesService(this.request);
|
|
@@ -1732,6 +1787,7 @@ exports.HealthCheckService = HealthCheckService;
|
|
|
1732
1787
|
exports.InternalTransactionOpCall = InternalTransactionOpCall;
|
|
1733
1788
|
exports.Network = Network;
|
|
1734
1789
|
exports.NetworkType = NetworkType;
|
|
1790
|
+
exports.NfTsService = NfTsService;
|
|
1735
1791
|
exports.NftTokenMetadataStatus = NftTokenMetadataStatus;
|
|
1736
1792
|
exports.OpenAPI = OpenAPI;
|
|
1737
1793
|
exports.OperationStatus = OperationStatus;
|
|
@@ -5,6 +5,7 @@ import { EvmBlocksService } from './services/EvmBlocksService.js';
|
|
|
5
5
|
import { EvmChainsService } from './services/EvmChainsService.js';
|
|
6
6
|
import { EvmTransactionsService } from './services/EvmTransactionsService.js';
|
|
7
7
|
import { HealthCheckService } from './services/HealthCheckService.js';
|
|
8
|
+
import { NfTsService } from './services/NfTsService.js';
|
|
8
9
|
import { OperationsService } from './services/OperationsService.js';
|
|
9
10
|
import { PrimaryNetworkService } from './services/PrimaryNetworkService.js';
|
|
10
11
|
import { PrimaryNetworkBalancesService } from './services/PrimaryNetworkBalancesService.js';
|
|
@@ -21,6 +22,7 @@ declare class Glacier {
|
|
|
21
22
|
readonly evmChains: EvmChainsService;
|
|
22
23
|
readonly evmTransactions: EvmTransactionsService;
|
|
23
24
|
readonly healthCheck: HealthCheckService;
|
|
25
|
+
readonly nfTs: NfTsService;
|
|
24
26
|
readonly operations: OperationsService;
|
|
25
27
|
readonly primaryNetwork: PrimaryNetworkService;
|
|
26
28
|
readonly primaryNetworkBalances: PrimaryNetworkBalancesService;
|
package/esm/generated/Glacier.js
CHANGED
|
@@ -4,6 +4,7 @@ import { EvmBlocksService } from './services/EvmBlocksService.js';
|
|
|
4
4
|
import { EvmChainsService } from './services/EvmChainsService.js';
|
|
5
5
|
import { EvmTransactionsService } from './services/EvmTransactionsService.js';
|
|
6
6
|
import { HealthCheckService } from './services/HealthCheckService.js';
|
|
7
|
+
import { NfTsService } from './services/NfTsService.js';
|
|
7
8
|
import { OperationsService } from './services/OperationsService.js';
|
|
8
9
|
import { PrimaryNetworkService } from './services/PrimaryNetworkService.js';
|
|
9
10
|
import { PrimaryNetworkBalancesService } from './services/PrimaryNetworkBalancesService.js';
|
|
@@ -14,24 +15,39 @@ import { PrimaryNetworkUtxOsService } from './services/PrimaryNetworkUtxOsServic
|
|
|
14
15
|
import { PrimaryNetworkVerticesService } from './services/PrimaryNetworkVerticesService.js';
|
|
15
16
|
|
|
16
17
|
class Glacier {
|
|
18
|
+
evmBalances;
|
|
19
|
+
evmBlocks;
|
|
20
|
+
evmChains;
|
|
21
|
+
evmTransactions;
|
|
22
|
+
healthCheck;
|
|
23
|
+
nfTs;
|
|
24
|
+
operations;
|
|
25
|
+
primaryNetwork;
|
|
26
|
+
primaryNetworkBalances;
|
|
27
|
+
primaryNetworkBlocks;
|
|
28
|
+
primaryNetworkRewards;
|
|
29
|
+
primaryNetworkTransactions;
|
|
30
|
+
primaryNetworkUtxOs;
|
|
31
|
+
primaryNetworkVertices;
|
|
32
|
+
request;
|
|
17
33
|
constructor(config, HttpRequest = FetchHttpRequest) {
|
|
18
|
-
var _a, _b, _c, _d;
|
|
19
34
|
this.request = new HttpRequest({
|
|
20
|
-
BASE:
|
|
21
|
-
VERSION:
|
|
22
|
-
WITH_CREDENTIALS:
|
|
23
|
-
CREDENTIALS:
|
|
24
|
-
TOKEN: config
|
|
25
|
-
USERNAME: config
|
|
26
|
-
PASSWORD: config
|
|
27
|
-
HEADERS: config
|
|
28
|
-
ENCODE_PATH: config
|
|
35
|
+
BASE: config?.BASE ?? "https://glacier-api-dev.avax.network",
|
|
36
|
+
VERSION: config?.VERSION ?? "Beta",
|
|
37
|
+
WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
|
|
38
|
+
CREDENTIALS: config?.CREDENTIALS ?? "include",
|
|
39
|
+
TOKEN: config?.TOKEN,
|
|
40
|
+
USERNAME: config?.USERNAME,
|
|
41
|
+
PASSWORD: config?.PASSWORD,
|
|
42
|
+
HEADERS: config?.HEADERS,
|
|
43
|
+
ENCODE_PATH: config?.ENCODE_PATH
|
|
29
44
|
});
|
|
30
45
|
this.evmBalances = new EvmBalancesService(this.request);
|
|
31
46
|
this.evmBlocks = new EvmBlocksService(this.request);
|
|
32
47
|
this.evmChains = new EvmChainsService(this.request);
|
|
33
48
|
this.evmTransactions = new EvmTransactionsService(this.request);
|
|
34
49
|
this.healthCheck = new HealthCheckService(this.request);
|
|
50
|
+
this.nfTs = new NfTsService(this.request);
|
|
35
51
|
this.operations = new OperationsService(this.request);
|
|
36
52
|
this.primaryNetwork = new PrimaryNetworkService(this.request);
|
|
37
53
|
this.primaryNetworkBalances = new PrimaryNetworkBalancesService(this.request);
|
|
@@ -8,6 +8,14 @@ class CancelError extends Error {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
class CancelablePromise {
|
|
11
|
+
[Symbol.toStringTag];
|
|
12
|
+
_isResolved;
|
|
13
|
+
_isRejected;
|
|
14
|
+
_isCancelled;
|
|
15
|
+
_cancelHandlers;
|
|
16
|
+
_promise;
|
|
17
|
+
_resolve;
|
|
18
|
+
_reject;
|
|
11
19
|
constructor(executor) {
|
|
12
20
|
this._isResolved = false;
|
|
13
21
|
this._isRejected = false;
|
|
@@ -17,20 +25,18 @@ class CancelablePromise {
|
|
|
17
25
|
this._resolve = resolve;
|
|
18
26
|
this._reject = reject;
|
|
19
27
|
const onResolve = (value) => {
|
|
20
|
-
var _a;
|
|
21
28
|
if (this._isResolved || this._isRejected || this._isCancelled) {
|
|
22
29
|
return;
|
|
23
30
|
}
|
|
24
31
|
this._isResolved = true;
|
|
25
|
-
|
|
32
|
+
this._resolve?.(value);
|
|
26
33
|
};
|
|
27
34
|
const onReject = (reason) => {
|
|
28
|
-
var _a;
|
|
29
35
|
if (this._isResolved || this._isRejected || this._isCancelled) {
|
|
30
36
|
return;
|
|
31
37
|
}
|
|
32
38
|
this._isRejected = true;
|
|
33
|
-
|
|
39
|
+
this._reject?.(reason);
|
|
34
40
|
};
|
|
35
41
|
const onCancel = (cancelHandler) => {
|
|
36
42
|
if (this._isResolved || this._isRejected || this._isCancelled) {
|
|
@@ -60,7 +66,6 @@ class CancelablePromise {
|
|
|
60
66
|
return this._promise.finally(onFinally);
|
|
61
67
|
}
|
|
62
68
|
cancel() {
|
|
63
|
-
var _a;
|
|
64
69
|
if (this._isResolved || this._isRejected || this._isCancelled) {
|
|
65
70
|
return;
|
|
66
71
|
}
|
|
@@ -76,7 +81,7 @@ class CancelablePromise {
|
|
|
76
81
|
}
|
|
77
82
|
}
|
|
78
83
|
this._cancelHandlers.length = 0;
|
|
79
|
-
|
|
84
|
+
this._reject?.(new CancelError("Request aborted"));
|
|
80
85
|
}
|
|
81
86
|
get isCancelled() {
|
|
82
87
|
return this._isCancelled;
|
|
@@ -1,25 +1,6 @@
|
|
|
1
1
|
import { ApiError } from './ApiError.js';
|
|
2
2
|
import { CancelablePromise } from './CancelablePromise.js';
|
|
3
3
|
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __defProps = Object.defineProperties;
|
|
6
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {}))
|
|
13
|
-
if (__hasOwnProp.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
4
|
const isDefined = (value) => {
|
|
24
5
|
return value !== void 0 && value !== null;
|
|
25
6
|
};
|
|
@@ -73,8 +54,7 @@ const getQueryString = (params) => {
|
|
|
73
54
|
const getUrl = (config, options) => {
|
|
74
55
|
const encoder = config.ENCODE_PATH || encodeURI;
|
|
75
56
|
const path = options.url.replace("{api-version}", config.VERSION).replace(/{(.*?)}/g, (substring, group) => {
|
|
76
|
-
|
|
77
|
-
if ((_a = options.path) == null ? void 0 : _a.hasOwnProperty(group)) {
|
|
57
|
+
if (options.path?.hasOwnProperty(group)) {
|
|
78
58
|
return encoder(String(options.path[group]));
|
|
79
59
|
}
|
|
80
60
|
return substring;
|
|
@@ -117,9 +97,12 @@ const getHeaders = async (config, options) => {
|
|
|
117
97
|
const username = await resolve(options, config.USERNAME);
|
|
118
98
|
const password = await resolve(options, config.PASSWORD);
|
|
119
99
|
const additionalHeaders = await resolve(options, config.HEADERS);
|
|
120
|
-
const headers = Object.entries(
|
|
121
|
-
Accept: "application/json"
|
|
122
|
-
|
|
100
|
+
const headers = Object.entries({
|
|
101
|
+
Accept: "application/json",
|
|
102
|
+
...additionalHeaders,
|
|
103
|
+
...options.headers
|
|
104
|
+
}).filter(([_, value]) => isDefined(value)).reduce((headers2, [key, value]) => ({
|
|
105
|
+
...headers2,
|
|
123
106
|
[key]: String(value)
|
|
124
107
|
}), {});
|
|
125
108
|
if (isStringWithValue(token)) {
|
|
@@ -143,9 +126,8 @@ const getHeaders = async (config, options) => {
|
|
|
143
126
|
return new Headers(headers);
|
|
144
127
|
};
|
|
145
128
|
const getRequestBody = (options) => {
|
|
146
|
-
var _a;
|
|
147
129
|
if (options.body) {
|
|
148
|
-
if (
|
|
130
|
+
if (options.mediaType?.includes("/json")) {
|
|
149
131
|
return JSON.stringify(options.body);
|
|
150
132
|
} else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {
|
|
151
133
|
return options.body;
|
|
@@ -159,7 +141,7 @@ const sendRequest = async (config, options, url, body, formData, headers, onCanc
|
|
|
159
141
|
const controller = new AbortController();
|
|
160
142
|
const request2 = {
|
|
161
143
|
headers,
|
|
162
|
-
body: body
|
|
144
|
+
body: body ?? formData,
|
|
163
145
|
method: options.method,
|
|
164
146
|
signal: controller.signal
|
|
165
147
|
};
|
|
@@ -197,15 +179,16 @@ const getResponseBody = async (response) => {
|
|
|
197
179
|
return void 0;
|
|
198
180
|
};
|
|
199
181
|
const catchErrorCodes = (options, result) => {
|
|
200
|
-
const errors =
|
|
182
|
+
const errors = {
|
|
201
183
|
400: "Bad Request",
|
|
202
184
|
401: "Unauthorized",
|
|
203
185
|
403: "Forbidden",
|
|
204
186
|
404: "Not Found",
|
|
205
187
|
500: "Internal Server Error",
|
|
206
188
|
502: "Bad Gateway",
|
|
207
|
-
503: "Service Unavailable"
|
|
208
|
-
|
|
189
|
+
503: "Service Unavailable",
|
|
190
|
+
...options.errors
|
|
191
|
+
};
|
|
209
192
|
const error = errors[result.status];
|
|
210
193
|
if (error) {
|
|
211
194
|
throw new ApiError(options, result, error);
|
|
@@ -230,7 +213,7 @@ const request = (config, options) => {
|
|
|
230
213
|
ok: response.ok,
|
|
231
214
|
status: response.status,
|
|
232
215
|
statusText: response.statusText,
|
|
233
|
-
body: responseHeader
|
|
216
|
+
body: responseHeader ?? responseBody
|
|
234
217
|
};
|
|
235
218
|
catchErrorCodes(options, result);
|
|
236
219
|
resolve2(result.body);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ContractDeploymentDetails } from './ContractDeploymentDetails.js';
|
|
2
2
|
import { ImageAsset } from './ImageAsset.js';
|
|
3
|
+
import { PricingProviders } from './PricingProviders.js';
|
|
3
4
|
import { ResourceLink } from './ResourceLink.js';
|
|
4
5
|
|
|
5
6
|
type Erc1155Contract = {
|
|
@@ -13,7 +14,6 @@ type Erc1155Contract = {
|
|
|
13
14
|
logoAsset?: ImageAsset;
|
|
14
15
|
bannerAsset?: ImageAsset;
|
|
15
16
|
color?: string;
|
|
16
|
-
coingeckoCoinId?: string;
|
|
17
17
|
resourceLinks?: Array<ResourceLink>;
|
|
18
18
|
tags?: Array<string>;
|
|
19
19
|
/**
|
|
@@ -26,6 +26,7 @@ type Erc1155Contract = {
|
|
|
26
26
|
* The contract symbol.
|
|
27
27
|
*/
|
|
28
28
|
symbol?: string;
|
|
29
|
+
pricingProviders?: PricingProviders;
|
|
29
30
|
};
|
|
30
31
|
declare namespace Erc1155Contract {
|
|
31
32
|
enum ercType {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ContractDeploymentDetails } from './ContractDeploymentDetails.js';
|
|
2
2
|
import { ImageAsset } from './ImageAsset.js';
|
|
3
|
+
import { PricingProviders } from './PricingProviders.js';
|
|
3
4
|
import { ResourceLink } from './ResourceLink.js';
|
|
4
5
|
|
|
5
6
|
type Erc20Contract = {
|
|
@@ -13,7 +14,6 @@ type Erc20Contract = {
|
|
|
13
14
|
logoAsset?: ImageAsset;
|
|
14
15
|
bannerAsset?: ImageAsset;
|
|
15
16
|
color?: string;
|
|
16
|
-
coingeckoCoinId?: string;
|
|
17
17
|
resourceLinks?: Array<ResourceLink>;
|
|
18
18
|
tags?: Array<string>;
|
|
19
19
|
/**
|
|
@@ -30,6 +30,7 @@ type Erc20Contract = {
|
|
|
30
30
|
* The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation.
|
|
31
31
|
*/
|
|
32
32
|
decimals: number;
|
|
33
|
+
pricingProviders: PricingProviders;
|
|
33
34
|
};
|
|
34
35
|
declare namespace Erc20Contract {
|
|
35
36
|
enum ercType {
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Erc1155Contract } from '../models/Erc1155Contract.js';
|
|
2
|
+
import { Erc1155Token } from '../models/Erc1155Token.js';
|
|
3
|
+
import { Erc721Contract } from '../models/Erc721Contract.js';
|
|
4
|
+
import { Erc721Token } from '../models/Erc721Token.js';
|
|
5
|
+
import { CancelablePromise } from '../core/CancelablePromise.js';
|
|
6
|
+
import { BaseHttpRequest } from '../core/BaseHttpRequest.js';
|
|
7
|
+
|
|
8
|
+
declare class NfTsService {
|
|
9
|
+
readonly httpRequest: BaseHttpRequest;
|
|
10
|
+
constructor(httpRequest: BaseHttpRequest);
|
|
11
|
+
/**
|
|
12
|
+
* Reindex NFT metadata
|
|
13
|
+
* Triggers reindexing of token metadata for an NFT token. Reindexing can only be called once per hour for each NFT token.
|
|
14
|
+
* @returns any
|
|
15
|
+
* @throws ApiError
|
|
16
|
+
*/
|
|
17
|
+
reindexNft({ chainId, address, tokenId, }: {
|
|
18
|
+
/**
|
|
19
|
+
* A supported evm chain id. Use the `/chains` endpoint to get a list of supported chain ids.
|
|
20
|
+
*/
|
|
21
|
+
chainId: string;
|
|
22
|
+
/**
|
|
23
|
+
* Contract address on the relevant chain.
|
|
24
|
+
*/
|
|
25
|
+
address: string;
|
|
26
|
+
/**
|
|
27
|
+
* TokenId on the contract
|
|
28
|
+
*/
|
|
29
|
+
tokenId: string;
|
|
30
|
+
}): CancelablePromise<any>;
|
|
31
|
+
/**
|
|
32
|
+
* Get token details
|
|
33
|
+
* Gets token details for a specific token of an NFT contract.
|
|
34
|
+
* @returns any
|
|
35
|
+
* @throws ApiError
|
|
36
|
+
*/
|
|
37
|
+
getTokenDetails({ chainId, address, tokenId, }: {
|
|
38
|
+
/**
|
|
39
|
+
* A supported evm chain id. Use the `/chains` endpoint to get a list of supported chain ids.
|
|
40
|
+
*/
|
|
41
|
+
chainId: string;
|
|
42
|
+
/**
|
|
43
|
+
* Contract address on the relevant chain.
|
|
44
|
+
*/
|
|
45
|
+
address: string;
|
|
46
|
+
/**
|
|
47
|
+
* TokenId on the contract
|
|
48
|
+
*/
|
|
49
|
+
tokenId: string;
|
|
50
|
+
}): CancelablePromise<(Erc721Token | Erc1155Token)>;
|
|
51
|
+
/**
|
|
52
|
+
* Get collection details
|
|
53
|
+
* Gets collection details for a NFT contract.
|
|
54
|
+
* @returns any
|
|
55
|
+
* @throws ApiError
|
|
56
|
+
*/
|
|
57
|
+
getCollection({ chainId, address, }: {
|
|
58
|
+
/**
|
|
59
|
+
* A supported evm chain id. Use the `/chains` endpoint to get a list of supported chain ids.
|
|
60
|
+
*/
|
|
61
|
+
chainId: string;
|
|
62
|
+
/**
|
|
63
|
+
* Contract address on the relevant chain.
|
|
64
|
+
*/
|
|
65
|
+
address: string;
|
|
66
|
+
}): CancelablePromise<(Erc721Contract | Erc1155Contract)>;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export { NfTsService };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
class NfTsService {
|
|
2
|
+
constructor(httpRequest) {
|
|
3
|
+
this.httpRequest = httpRequest;
|
|
4
|
+
}
|
|
5
|
+
reindexNft({
|
|
6
|
+
chainId,
|
|
7
|
+
address,
|
|
8
|
+
tokenId
|
|
9
|
+
}) {
|
|
10
|
+
return this.httpRequest.request({
|
|
11
|
+
method: "POST",
|
|
12
|
+
url: "/v1/chains/{chainId}/nfts/collections/{address}/tokens/{tokenId}:reindex",
|
|
13
|
+
path: {
|
|
14
|
+
"chainId": chainId,
|
|
15
|
+
"address": address,
|
|
16
|
+
"tokenId": tokenId
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
getTokenDetails({
|
|
21
|
+
chainId,
|
|
22
|
+
address,
|
|
23
|
+
tokenId
|
|
24
|
+
}) {
|
|
25
|
+
return this.httpRequest.request({
|
|
26
|
+
method: "GET",
|
|
27
|
+
url: "/v1/chains/{chainId}/nfts/collections/{address}/tokens/{tokenId}",
|
|
28
|
+
path: {
|
|
29
|
+
"chainId": chainId,
|
|
30
|
+
"address": address,
|
|
31
|
+
"tokenId": tokenId
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
getCollection({
|
|
36
|
+
chainId,
|
|
37
|
+
address
|
|
38
|
+
}) {
|
|
39
|
+
return this.httpRequest.request({
|
|
40
|
+
method: "GET",
|
|
41
|
+
url: "/v1/chains/{chainId}/nfts/collections/{address}",
|
|
42
|
+
path: {
|
|
43
|
+
"chainId": chainId,
|
|
44
|
+
"address": address
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { NfTsService };
|
|
@@ -186,15 +186,11 @@ declare class PrimaryNetworkService {
|
|
|
186
186
|
* @returns ListDelegatorDetailsResponse
|
|
187
187
|
* @throws ApiError
|
|
188
188
|
*/
|
|
189
|
-
listDelegators({ network,
|
|
189
|
+
listDelegators({ network, pageSize, pageToken, sortOrder, delegationStatus, rewardAddresses, nodeIds, }: {
|
|
190
190
|
/**
|
|
191
191
|
* Either mainnet or a testnet.
|
|
192
192
|
*/
|
|
193
193
|
network: Network;
|
|
194
|
-
/**
|
|
195
|
-
* A primary network (P or X chain) nodeId.
|
|
196
|
-
*/
|
|
197
|
-
nodeId: string;
|
|
198
194
|
/**
|
|
199
195
|
* The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
|
|
200
196
|
*/
|
|
@@ -131,7 +131,6 @@ class PrimaryNetworkService {
|
|
|
131
131
|
}
|
|
132
132
|
listDelegators({
|
|
133
133
|
network,
|
|
134
|
-
nodeId,
|
|
135
134
|
pageSize = 10,
|
|
136
135
|
pageToken,
|
|
137
136
|
sortOrder,
|
|
@@ -143,8 +142,7 @@ class PrimaryNetworkService {
|
|
|
143
142
|
method: "GET",
|
|
144
143
|
url: "/v1/networks/{network}/delegators",
|
|
145
144
|
path: {
|
|
146
|
-
"network": network
|
|
147
|
-
"nodeId": nodeId
|
|
145
|
+
"network": network
|
|
148
146
|
},
|
|
149
147
|
query: {
|
|
150
148
|
"pageSize": pageSize,
|
|
@@ -40,7 +40,11 @@ declare class PrimaryNetworkTransactionsService {
|
|
|
40
40
|
}): CancelablePromise<(PChainTransaction | XChainNonLinearTransaction | XChainLinearTransaction | CChainExportTransaction | CChainImportTransaction)>;
|
|
41
41
|
/**
|
|
42
42
|
* List latest transactions
|
|
43
|
-
* Lists the latest transactions on one of the Primary Network chains.
|
|
43
|
+
* Lists the latest transactions on one of the Primary Network chains.
|
|
44
|
+
*
|
|
45
|
+
* Transactions are filterable by addresses.
|
|
46
|
+
*
|
|
47
|
+
* Given that each transaction may return a large number of UTXO objects, bounded only by the maximum transaction size, the query may return less transactions than the provided page size. The result will contain less results than the page size if the number of utxos contained in the resulting transactions reach a performance threshold.
|
|
44
48
|
* @returns any
|
|
45
49
|
* @throws ApiError
|
|
46
50
|
*/
|
package/esm/index.d.ts
CHANGED
|
@@ -112,6 +112,7 @@ export { PChainUtxo } from './generated/models/PChainUtxo.js';
|
|
|
112
112
|
export { PendingDelegatorDetails } from './generated/models/PendingDelegatorDetails.js';
|
|
113
113
|
export { PendingReward } from './generated/models/PendingReward.js';
|
|
114
114
|
export { PendingValidatorDetails } from './generated/models/PendingValidatorDetails.js';
|
|
115
|
+
export { PricingProviders } from './generated/models/PricingProviders.js';
|
|
115
116
|
export { PrimaryNetwork } from './generated/models/PrimaryNetwork.js';
|
|
116
117
|
export { PrimaryNetworkBlock } from './generated/models/PrimaryNetworkBlock.js';
|
|
117
118
|
export { PrimaryNetworkChainInfo } from './generated/models/PrimaryNetworkChainInfo.js';
|
|
@@ -153,6 +154,7 @@ export { EvmBlocksService } from './generated/services/EvmBlocksService.js';
|
|
|
153
154
|
export { EvmChainsService } from './generated/services/EvmChainsService.js';
|
|
154
155
|
export { EvmTransactionsService } from './generated/services/EvmTransactionsService.js';
|
|
155
156
|
export { HealthCheckService } from './generated/services/HealthCheckService.js';
|
|
157
|
+
export { NfTsService } from './generated/services/NfTsService.js';
|
|
156
158
|
export { OperationsService } from './generated/services/OperationsService.js';
|
|
157
159
|
export { PrimaryNetworkService } from './generated/services/PrimaryNetworkService.js';
|
|
158
160
|
export { PrimaryNetworkBalancesService } from './generated/services/PrimaryNetworkBalancesService.js';
|
package/esm/index.js
CHANGED
|
@@ -50,6 +50,7 @@ export { EvmBlocksService } from './generated/services/EvmBlocksService.js';
|
|
|
50
50
|
export { EvmChainsService } from './generated/services/EvmChainsService.js';
|
|
51
51
|
export { EvmTransactionsService } from './generated/services/EvmTransactionsService.js';
|
|
52
52
|
export { HealthCheckService } from './generated/services/HealthCheckService.js';
|
|
53
|
+
export { NfTsService } from './generated/services/NfTsService.js';
|
|
53
54
|
export { OperationsService } from './generated/services/OperationsService.js';
|
|
54
55
|
export { PrimaryNetworkService } from './generated/services/PrimaryNetworkService.js';
|
|
55
56
|
export { PrimaryNetworkBalancesService } from './generated/services/PrimaryNetworkBalancesService.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avalabs/glacier-sdk",
|
|
3
|
-
"version": "2.8.0-canary.
|
|
3
|
+
"version": "2.8.0-canary.c83789f.0+c83789f",
|
|
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": "
|
|
32
|
+
"gitHead": "c83789f8029e1957a57ac16351c210a5d77eb35e"
|
|
33
33
|
}
|