@avalabs/glacier-sdk 2.8.0-canary.a18b4e4.0 → 2.8.0-canary.a7af9dd.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 +1673 -712
- package/dist/index.js +681 -210
- package/esm/generated/Glacier.d.ts +10 -0
- package/esm/generated/Glacier.js +39 -10
- package/esm/generated/core/ApiError.js +5 -0
- package/esm/generated/core/CancelablePromise.d.ts +2 -8
- package/esm/generated/core/CancelablePromise.js +38 -31
- package/esm/generated/core/request.js +17 -33
- package/esm/generated/models/ActiveDelegatorDetails.d.ts +7 -3
- package/esm/generated/models/ActiveDelegatorDetails.js +8 -0
- package/esm/generated/models/ActiveValidatorDetails.d.ts +19 -6
- package/esm/generated/models/ActiveValidatorDetails.js +8 -0
- package/esm/generated/models/AddressActivityMetadata.d.ts +12 -0
- package/esm/generated/models/AddressesChangeRequest.d.ts +8 -0
- package/esm/generated/models/{XChainAssetBalance.d.ts → AggregatedAssetAmount.d.ts} +5 -6
- package/esm/generated/models/{Asset.d.ts → AssetAmount.d.ts} +5 -6
- package/esm/generated/models/AssetWithPriceInfo.d.ts +32 -0
- package/esm/generated/models/BlsCredentials.d.ts +6 -0
- package/esm/generated/models/CChainExportTransaction.d.ts +3 -3
- package/esm/generated/models/CChainImportTransaction.d.ts +3 -3
- package/esm/generated/models/CChainSharedAssetBalance.d.ts +3 -4
- package/esm/generated/models/ChainInfo.d.ts +2 -3
- package/esm/generated/models/ChainStatus.d.ts +3 -0
- package/esm/generated/models/CompletedDelegatorDetails.d.ts +7 -3
- package/esm/generated/models/CompletedDelegatorDetails.js +8 -0
- package/esm/generated/models/CompletedValidatorDetails.d.ts +14 -3
- package/esm/generated/models/CompletedValidatorDetails.js +8 -0
- package/esm/generated/models/ContractSubmissionBody.d.ts +10 -0
- package/esm/generated/models/ContractSubmissionErc1155.d.ts +31 -0
- package/esm/generated/models/ContractSubmissionErc1155.js +8 -0
- package/esm/generated/models/ContractSubmissionErc20.d.ts +31 -0
- package/esm/generated/models/ContractSubmissionErc20.js +8 -0
- package/esm/generated/models/ContractSubmissionErc721.d.ts +29 -0
- package/esm/generated/models/ContractSubmissionErc721.js +8 -0
- package/esm/generated/models/ContractSubmissionUnknown.d.ts +25 -0
- package/esm/generated/models/ContractSubmissionUnknown.js +8 -0
- package/esm/generated/models/CreateEvmTransactionExportRequest.d.ts +2 -6
- package/esm/generated/models/CreatePrimaryNetworkTransactionExportRequest.d.ts +2 -6
- package/esm/generated/models/CurrencyCode.d.ts +3 -0
- package/esm/generated/models/DeliveredSourceNotIndexedTeleporterMessage.d.ts +29 -0
- package/esm/generated/models/DeliveredSourceNotIndexedTeleporterMessage.js +8 -0
- package/esm/generated/models/DeliveredTeleporterMessage.d.ts +31 -0
- package/esm/generated/models/DeliveredTeleporterMessage.js +8 -0
- package/esm/generated/models/EVMInput.d.ts +3 -3
- package/esm/generated/models/EVMOperationType.d.ts +5 -0
- package/esm/generated/models/EVMOperationType.js +6 -0
- package/esm/generated/models/EVMOutput.d.ts +3 -3
- package/esm/generated/models/Erc1155TokenMetadata.d.ts +0 -3
- package/esm/generated/models/Erc20Contract.d.ts +1 -1
- package/esm/generated/models/Erc721TokenMetadata.d.ts +0 -3
- package/esm/generated/models/EventType.d.ts +5 -0
- package/esm/generated/models/EventType.js +6 -0
- package/esm/generated/models/GetChainResponse.d.ts +2 -3
- package/esm/generated/models/GetPrimaryNetworkBlockResponse.d.ts +1 -0
- package/esm/generated/models/GlacierApiFeature.d.ts +6 -0
- package/esm/generated/models/GlacierApiFeature.js +7 -0
- package/esm/generated/models/HistoricalReward.d.ts +2 -5
- package/esm/generated/models/ListContractsResponse.d.ts +1 -1
- package/esm/generated/models/ListNftTokens.d.ts +12 -0
- package/esm/generated/models/ListTeleporterMessagesResponse.d.ts +12 -0
- package/esm/generated/models/ListTransfersResponse.d.ts +1 -1
- package/esm/generated/models/ListValidatorDetailsResponse.d.ts +3 -2
- package/esm/generated/models/ListWebhookAddressesResponse.d.ts +10 -0
- package/esm/generated/models/ListWebhooksResponse.d.ts +11 -0
- package/esm/generated/models/Method.d.ts +0 -3
- package/esm/generated/models/Money.d.ts +0 -3
- package/esm/generated/models/NextPageToken.d.ts +8 -0
- package/esm/generated/models/NftTokenMetadataStatus.d.ts +3 -0
- package/esm/generated/models/OperationType.d.ts +4 -2
- package/esm/generated/models/OperationType.js +3 -1
- package/esm/generated/models/PChainBalance.d.ts +15 -15
- package/esm/generated/models/PChainSharedAsset.d.ts +22 -0
- package/esm/generated/models/PChainTransaction.d.ts +18 -7
- package/esm/generated/models/PChainTransactionType.d.ts +8 -4
- package/esm/generated/models/PChainTransactionType.js +8 -4
- package/esm/generated/models/PChainUtxo.d.ts +34 -14
- package/esm/generated/models/PendingDelegatorDetails.d.ts +7 -3
- package/esm/generated/models/PendingDelegatorDetails.js +8 -0
- package/esm/generated/models/PendingReward.d.ts +3 -3
- package/esm/generated/models/PendingTeleporterMessage.d.ts +29 -0
- package/esm/generated/models/PendingTeleporterMessage.js +8 -0
- package/esm/generated/models/PendingValidatorDetails.d.ts +14 -3
- package/esm/generated/models/PendingValidatorDetails.js +8 -0
- package/esm/generated/models/PrimaryNetworkAssetCap.d.ts +9 -0
- package/esm/generated/models/PrimaryNetworkAssetCap.js +7 -0
- package/esm/generated/models/PrimaryNetworkAssetType.d.ts +9 -0
- package/esm/generated/models/PrimaryNetworkAssetType.js +7 -0
- package/esm/generated/models/PrimaryNetworkBlock.d.ts +1 -0
- package/esm/generated/models/PrimaryNetworkOperationType.d.ts +7 -0
- package/esm/generated/models/PrimaryNetworkOperationType.js +8 -0
- package/esm/generated/models/PrimaryNetworkOptions.d.ts +1 -1
- package/esm/generated/models/PrimaryNetworkTxType.d.ts +8 -5
- package/esm/generated/models/PrimaryNetworkTxType.js +8 -5
- package/esm/generated/models/RegisterWebhookRequest.d.ts +19 -0
- package/esm/generated/models/RemovedValidatorDetails.d.ts +25 -0
- package/esm/generated/models/RemovedValidatorDetails.js +8 -0
- package/esm/generated/models/RewardType.d.ts +2 -1
- package/esm/generated/models/RewardType.js +1 -0
- package/esm/generated/models/Rewards.d.ts +2 -0
- package/esm/generated/models/RpcErrorDto.d.ts +7 -0
- package/esm/generated/models/RpcErrorResponseDto.d.ts +9 -0
- package/esm/generated/models/RpcRequestBodyDto.d.ts +8 -0
- package/esm/generated/models/RpcSuccessResponseDto.d.ts +7 -0
- package/esm/generated/models/SharedSecretsResponse.d.ts +5 -0
- package/esm/generated/models/SortByOption.d.ts +9 -0
- package/esm/generated/models/SortByOption.js +10 -0
- package/esm/generated/models/Subnet.d.ts +17 -0
- package/esm/generated/models/SubnetOwnershipInfo.d.ts +16 -0
- package/esm/generated/models/TeleporterDestinationTransaction.d.ts +9 -0
- package/esm/generated/models/TeleporterReceipt.d.ts +6 -0
- package/esm/generated/models/TeleporterRewardDetails.d.ts +37 -0
- package/esm/generated/models/TeleporterRewardDetails.js +8 -0
- package/esm/generated/models/TeleporterSourceTransaction.d.ts +7 -0
- package/esm/generated/models/TransactionMethodType.d.ts +3 -0
- package/esm/generated/models/UpdateContractResponse.d.ts +10 -0
- package/esm/generated/models/UpdateWebhookRequest.d.ts +12 -0
- package/esm/generated/models/Utxo.d.ts +30 -30
- package/esm/generated/models/UtxoCredential.d.ts +2 -2
- package/esm/generated/models/ValidationStatusType.d.ts +2 -1
- package/esm/generated/models/ValidationStatusType.js +1 -0
- package/esm/generated/models/ValidatorHealthDetails.d.ts +20 -0
- package/esm/generated/models/WebhookResponse.d.ts +25 -0
- package/esm/generated/models/WebhookStatus.d.ts +6 -0
- package/esm/generated/models/WebhookStatus.js +7 -0
- package/esm/generated/models/WebhookStatusType.d.ts +6 -0
- package/esm/generated/models/WebhookStatusType.js +7 -0
- package/esm/generated/models/XChainAssetDetails.d.ts +5 -8
- package/esm/generated/models/XChainBalances.d.ts +3 -3
- package/esm/generated/models/XChainLinearTransaction.d.ts +6 -8
- package/esm/generated/models/XChainNonLinearTransaction.d.ts +6 -8
- package/esm/generated/models/XChainSharedAssetBalance.d.ts +3 -4
- package/esm/generated/models/XChainTransactionType.d.ts +13 -0
- package/esm/generated/models/XChainTransactionType.js +11 -0
- package/esm/generated/services/DefaultService.d.ts +14 -0
- package/esm/generated/services/DefaultService.js +13 -0
- package/esm/generated/services/EvmBalancesService.d.ts +27 -23
- package/esm/generated/services/EvmBalancesService.js +10 -8
- package/esm/generated/services/EvmBlocksService.d.ts +7 -7
- package/esm/generated/services/EvmBlocksService.js +4 -4
- package/esm/generated/services/EvmChainsService.d.ts +7 -2
- package/esm/generated/services/EvmChainsService.js +4 -2
- package/esm/generated/services/EvmContractsService.d.ts +48 -0
- package/esm/generated/services/EvmContractsService.js +36 -0
- package/esm/generated/services/EvmTransactionsService.d.ts +91 -49
- package/esm/generated/services/EvmTransactionsService.js +33 -33
- package/esm/generated/services/NfTsService.d.ts +23 -16
- package/esm/generated/services/NfTsService.js +15 -9
- package/esm/generated/services/OperationsService.d.ts +11 -11
- package/esm/generated/services/OperationsService.js +10 -10
- package/esm/generated/services/PrimaryNetworkBlocksService.d.ts +10 -10
- package/esm/generated/services/PrimaryNetworkBlocksService.js +8 -8
- package/esm/generated/services/PrimaryNetworkRewardsService.d.ts +21 -8
- package/esm/generated/services/PrimaryNetworkRewardsService.js +12 -6
- package/esm/generated/services/PrimaryNetworkService.d.ts +70 -31
- package/esm/generated/services/PrimaryNetworkService.js +36 -18
- package/esm/generated/services/PrimaryNetworkTransactionsService.d.ts +16 -16
- package/esm/generated/services/PrimaryNetworkTransactionsService.js +8 -8
- package/esm/generated/services/PrimaryNetworkUtxOsService.d.ts +5 -5
- package/esm/generated/services/PrimaryNetworkUtxOsService.js +2 -2
- package/esm/generated/services/PrimaryNetworkVerticesService.d.ts +10 -10
- package/esm/generated/services/PrimaryNetworkVerticesService.js +6 -6
- package/esm/generated/services/RpcService.d.ts +25 -0
- package/esm/generated/services/RpcService.js +24 -0
- package/esm/generated/services/TeleporterService.d.ts +62 -0
- package/esm/generated/services/TeleporterService.js +41 -0
- package/esm/generated/services/WebhooksService.d.ts +143 -0
- package/esm/generated/services/WebhooksService.js +125 -0
- package/esm/index.d.ts +50 -3
- package/esm/index.js +30 -2
- package/package.json +3 -3
- package/esm/generated/models/CreateEvmTransactionExportRequest.js +0 -8
- package/esm/generated/models/CreatePrimaryNetworkTransactionExportRequest.js +0 -8
- package/esm/generated/models/PChainAsset.d.ts +0 -6
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { BaseHttpRequest } from './core/BaseHttpRequest.js';
|
|
2
2
|
import { OpenAPIConfig } from './core/OpenAPI.js';
|
|
3
|
+
import { DefaultService } from './services/DefaultService.js';
|
|
3
4
|
import { EvmBalancesService } from './services/EvmBalancesService.js';
|
|
4
5
|
import { EvmBlocksService } from './services/EvmBlocksService.js';
|
|
5
6
|
import { EvmChainsService } from './services/EvmChainsService.js';
|
|
7
|
+
import { EvmContractsService } from './services/EvmContractsService.js';
|
|
6
8
|
import { EvmTransactionsService } from './services/EvmTransactionsService.js';
|
|
7
9
|
import { HealthCheckService } from './services/HealthCheckService.js';
|
|
8
10
|
import { NfTsService } from './services/NfTsService.js';
|
|
@@ -14,12 +16,17 @@ import { PrimaryNetworkRewardsService } from './services/PrimaryNetworkRewardsSe
|
|
|
14
16
|
import { PrimaryNetworkTransactionsService } from './services/PrimaryNetworkTransactionsService.js';
|
|
15
17
|
import { PrimaryNetworkUtxOsService } from './services/PrimaryNetworkUtxOsService.js';
|
|
16
18
|
import { PrimaryNetworkVerticesService } from './services/PrimaryNetworkVerticesService.js';
|
|
19
|
+
import { RpcService } from './services/RpcService.js';
|
|
20
|
+
import { TeleporterService } from './services/TeleporterService.js';
|
|
21
|
+
import { WebhooksService } from './services/WebhooksService.js';
|
|
17
22
|
|
|
18
23
|
type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest;
|
|
19
24
|
declare class Glacier {
|
|
25
|
+
readonly default: DefaultService;
|
|
20
26
|
readonly evmBalances: EvmBalancesService;
|
|
21
27
|
readonly evmBlocks: EvmBlocksService;
|
|
22
28
|
readonly evmChains: EvmChainsService;
|
|
29
|
+
readonly evmContracts: EvmContractsService;
|
|
23
30
|
readonly evmTransactions: EvmTransactionsService;
|
|
24
31
|
readonly healthCheck: HealthCheckService;
|
|
25
32
|
readonly nfTs: NfTsService;
|
|
@@ -31,6 +38,9 @@ declare class Glacier {
|
|
|
31
38
|
readonly primaryNetworkTransactions: PrimaryNetworkTransactionsService;
|
|
32
39
|
readonly primaryNetworkUtxOs: PrimaryNetworkUtxOsService;
|
|
33
40
|
readonly primaryNetworkVertices: PrimaryNetworkVerticesService;
|
|
41
|
+
readonly rpc: RpcService;
|
|
42
|
+
readonly teleporter: TeleporterService;
|
|
43
|
+
readonly webhooks: WebhooksService;
|
|
34
44
|
readonly request: BaseHttpRequest;
|
|
35
45
|
constructor(config?: Partial<OpenAPIConfig>, HttpRequest?: HttpRequestConstructor);
|
|
36
46
|
}
|
package/esm/generated/Glacier.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { FetchHttpRequest } from './core/FetchHttpRequest.js';
|
|
2
|
+
import { DefaultService } from './services/DefaultService.js';
|
|
2
3
|
import { EvmBalancesService } from './services/EvmBalancesService.js';
|
|
3
4
|
import { EvmBlocksService } from './services/EvmBlocksService.js';
|
|
4
5
|
import { EvmChainsService } from './services/EvmChainsService.js';
|
|
6
|
+
import { EvmContractsService } from './services/EvmContractsService.js';
|
|
5
7
|
import { EvmTransactionsService } from './services/EvmTransactionsService.js';
|
|
6
8
|
import { HealthCheckService } from './services/HealthCheckService.js';
|
|
7
9
|
import { NfTsService } from './services/NfTsService.js';
|
|
@@ -13,24 +15,48 @@ import { PrimaryNetworkRewardsService } from './services/PrimaryNetworkRewardsSe
|
|
|
13
15
|
import { PrimaryNetworkTransactionsService } from './services/PrimaryNetworkTransactionsService.js';
|
|
14
16
|
import { PrimaryNetworkUtxOsService } from './services/PrimaryNetworkUtxOsService.js';
|
|
15
17
|
import { PrimaryNetworkVerticesService } from './services/PrimaryNetworkVerticesService.js';
|
|
18
|
+
import { RpcService } from './services/RpcService.js';
|
|
19
|
+
import { TeleporterService } from './services/TeleporterService.js';
|
|
20
|
+
import { WebhooksService } from './services/WebhooksService.js';
|
|
16
21
|
|
|
17
22
|
class Glacier {
|
|
23
|
+
default;
|
|
24
|
+
evmBalances;
|
|
25
|
+
evmBlocks;
|
|
26
|
+
evmChains;
|
|
27
|
+
evmContracts;
|
|
28
|
+
evmTransactions;
|
|
29
|
+
healthCheck;
|
|
30
|
+
nfTs;
|
|
31
|
+
operations;
|
|
32
|
+
primaryNetwork;
|
|
33
|
+
primaryNetworkBalances;
|
|
34
|
+
primaryNetworkBlocks;
|
|
35
|
+
primaryNetworkRewards;
|
|
36
|
+
primaryNetworkTransactions;
|
|
37
|
+
primaryNetworkUtxOs;
|
|
38
|
+
primaryNetworkVertices;
|
|
39
|
+
rpc;
|
|
40
|
+
teleporter;
|
|
41
|
+
webhooks;
|
|
42
|
+
request;
|
|
18
43
|
constructor(config, HttpRequest = FetchHttpRequest) {
|
|
19
|
-
var _a, _b, _c, _d;
|
|
20
44
|
this.request = new HttpRequest({
|
|
21
|
-
BASE:
|
|
22
|
-
VERSION:
|
|
23
|
-
WITH_CREDENTIALS:
|
|
24
|
-
CREDENTIALS:
|
|
25
|
-
TOKEN: config
|
|
26
|
-
USERNAME: config
|
|
27
|
-
PASSWORD: config
|
|
28
|
-
HEADERS: config
|
|
29
|
-
ENCODE_PATH: config
|
|
45
|
+
BASE: config?.BASE ?? "https://glacier-api-dev.avax.network",
|
|
46
|
+
VERSION: config?.VERSION ?? "Beta",
|
|
47
|
+
WITH_CREDENTIALS: config?.WITH_CREDENTIALS ?? false,
|
|
48
|
+
CREDENTIALS: config?.CREDENTIALS ?? "include",
|
|
49
|
+
TOKEN: config?.TOKEN,
|
|
50
|
+
USERNAME: config?.USERNAME,
|
|
51
|
+
PASSWORD: config?.PASSWORD,
|
|
52
|
+
HEADERS: config?.HEADERS,
|
|
53
|
+
ENCODE_PATH: config?.ENCODE_PATH
|
|
30
54
|
});
|
|
55
|
+
this.default = new DefaultService(this.request);
|
|
31
56
|
this.evmBalances = new EvmBalancesService(this.request);
|
|
32
57
|
this.evmBlocks = new EvmBlocksService(this.request);
|
|
33
58
|
this.evmChains = new EvmChainsService(this.request);
|
|
59
|
+
this.evmContracts = new EvmContractsService(this.request);
|
|
34
60
|
this.evmTransactions = new EvmTransactionsService(this.request);
|
|
35
61
|
this.healthCheck = new HealthCheckService(this.request);
|
|
36
62
|
this.nfTs = new NfTsService(this.request);
|
|
@@ -42,6 +68,9 @@ class Glacier {
|
|
|
42
68
|
this.primaryNetworkTransactions = new PrimaryNetworkTransactionsService(this.request);
|
|
43
69
|
this.primaryNetworkUtxOs = new PrimaryNetworkUtxOsService(this.request);
|
|
44
70
|
this.primaryNetworkVertices = new PrimaryNetworkVerticesService(this.request);
|
|
71
|
+
this.rpc = new RpcService(this.request);
|
|
72
|
+
this.teleporter = new TeleporterService(this.request);
|
|
73
|
+
this.webhooks = new WebhooksService(this.request);
|
|
45
74
|
}
|
|
46
75
|
}
|
|
47
76
|
|
|
@@ -9,15 +9,9 @@ interface OnCancel {
|
|
|
9
9
|
(cancelHandler: () => void): void;
|
|
10
10
|
}
|
|
11
11
|
declare class CancelablePromise<T> implements Promise<T> {
|
|
12
|
-
|
|
13
|
-
private _isResolved;
|
|
14
|
-
private _isRejected;
|
|
15
|
-
private _isCancelled;
|
|
16
|
-
private readonly _cancelHandlers;
|
|
17
|
-
private readonly _promise;
|
|
18
|
-
private _resolve?;
|
|
19
|
-
private _reject?;
|
|
12
|
+
#private;
|
|
20
13
|
constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void, onCancel: OnCancel) => void);
|
|
14
|
+
get [Symbol.toStringTag](): string;
|
|
21
15
|
then<TResult1 = T, TResult2 = never>(onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
|
|
22
16
|
catch<TResult = never>(onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;
|
|
23
17
|
finally(onFinally?: (() => void) | null): Promise<T>;
|
|
@@ -8,66 +8,73 @@ class CancelError extends Error {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
class CancelablePromise {
|
|
11
|
+
#isResolved;
|
|
12
|
+
#isRejected;
|
|
13
|
+
#isCancelled;
|
|
14
|
+
#cancelHandlers;
|
|
15
|
+
#promise;
|
|
16
|
+
#resolve;
|
|
17
|
+
#reject;
|
|
11
18
|
constructor(executor) {
|
|
12
|
-
this
|
|
13
|
-
this
|
|
14
|
-
this
|
|
15
|
-
this
|
|
16
|
-
this
|
|
17
|
-
this
|
|
18
|
-
this
|
|
19
|
+
this.#isResolved = false;
|
|
20
|
+
this.#isRejected = false;
|
|
21
|
+
this.#isCancelled = false;
|
|
22
|
+
this.#cancelHandlers = [];
|
|
23
|
+
this.#promise = new Promise((resolve, reject) => {
|
|
24
|
+
this.#resolve = resolve;
|
|
25
|
+
this.#reject = reject;
|
|
19
26
|
const onResolve = (value) => {
|
|
20
|
-
|
|
21
|
-
if (this._isResolved || this._isRejected || this._isCancelled) {
|
|
27
|
+
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
|
22
28
|
return;
|
|
23
29
|
}
|
|
24
|
-
this
|
|
25
|
-
|
|
30
|
+
this.#isResolved = true;
|
|
31
|
+
this.#resolve?.(value);
|
|
26
32
|
};
|
|
27
33
|
const onReject = (reason) => {
|
|
28
|
-
|
|
29
|
-
if (this._isResolved || this._isRejected || this._isCancelled) {
|
|
34
|
+
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
|
30
35
|
return;
|
|
31
36
|
}
|
|
32
|
-
this
|
|
33
|
-
|
|
37
|
+
this.#isRejected = true;
|
|
38
|
+
this.#reject?.(reason);
|
|
34
39
|
};
|
|
35
40
|
const onCancel = (cancelHandler) => {
|
|
36
|
-
if (this
|
|
41
|
+
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
|
37
42
|
return;
|
|
38
43
|
}
|
|
39
|
-
this.
|
|
44
|
+
this.#cancelHandlers.push(cancelHandler);
|
|
40
45
|
};
|
|
41
46
|
Object.defineProperty(onCancel, "isResolved", {
|
|
42
|
-
get: () => this
|
|
47
|
+
get: () => this.#isResolved
|
|
43
48
|
});
|
|
44
49
|
Object.defineProperty(onCancel, "isRejected", {
|
|
45
|
-
get: () => this
|
|
50
|
+
get: () => this.#isRejected
|
|
46
51
|
});
|
|
47
52
|
Object.defineProperty(onCancel, "isCancelled", {
|
|
48
|
-
get: () => this
|
|
53
|
+
get: () => this.#isCancelled
|
|
49
54
|
});
|
|
50
55
|
return executor(onResolve, onReject, onCancel);
|
|
51
56
|
});
|
|
52
57
|
}
|
|
58
|
+
get [Symbol.toStringTag]() {
|
|
59
|
+
return "Cancellable Promise";
|
|
60
|
+
}
|
|
53
61
|
then(onFulfilled, onRejected) {
|
|
54
|
-
return this.
|
|
62
|
+
return this.#promise.then(onFulfilled, onRejected);
|
|
55
63
|
}
|
|
56
64
|
catch(onRejected) {
|
|
57
|
-
return this.
|
|
65
|
+
return this.#promise.catch(onRejected);
|
|
58
66
|
}
|
|
59
67
|
finally(onFinally) {
|
|
60
|
-
return this.
|
|
68
|
+
return this.#promise.finally(onFinally);
|
|
61
69
|
}
|
|
62
70
|
cancel() {
|
|
63
|
-
|
|
64
|
-
if (this._isResolved || this._isRejected || this._isCancelled) {
|
|
71
|
+
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
|
65
72
|
return;
|
|
66
73
|
}
|
|
67
|
-
this
|
|
68
|
-
if (this.
|
|
74
|
+
this.#isCancelled = true;
|
|
75
|
+
if (this.#cancelHandlers.length) {
|
|
69
76
|
try {
|
|
70
|
-
for (const cancelHandler of this
|
|
77
|
+
for (const cancelHandler of this.#cancelHandlers) {
|
|
71
78
|
cancelHandler();
|
|
72
79
|
}
|
|
73
80
|
} catch (error) {
|
|
@@ -75,11 +82,11 @@ class CancelablePromise {
|
|
|
75
82
|
return;
|
|
76
83
|
}
|
|
77
84
|
}
|
|
78
|
-
this.
|
|
79
|
-
|
|
85
|
+
this.#cancelHandlers.length = 0;
|
|
86
|
+
this.#reject?.(new CancelError("Request aborted"));
|
|
80
87
|
}
|
|
81
88
|
get isCancelled() {
|
|
82
|
-
return this
|
|
89
|
+
return this.#isCancelled;
|
|
83
90
|
}
|
|
84
91
|
}
|
|
85
92
|
|
|
@@ -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
|
-
|
|
147
|
-
|
|
148
|
-
if ((_a = options.mediaType) == null ? void 0 : _a.includes("/json")) {
|
|
129
|
+
if (options.body !== void 0) {
|
|
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
|
};
|
|
@@ -183,7 +165,8 @@ const getResponseBody = async (response) => {
|
|
|
183
165
|
try {
|
|
184
166
|
const contentType = response.headers.get("Content-Type");
|
|
185
167
|
if (contentType) {
|
|
186
|
-
const
|
|
168
|
+
const jsonTypes = ["application/json", "application/problem+json"];
|
|
169
|
+
const isJSON = jsonTypes.some((type) => contentType.toLowerCase().startsWith(type));
|
|
187
170
|
if (isJSON) {
|
|
188
171
|
return await response.json();
|
|
189
172
|
} else {
|
|
@@ -197,15 +180,16 @@ const getResponseBody = async (response) => {
|
|
|
197
180
|
return void 0;
|
|
198
181
|
};
|
|
199
182
|
const catchErrorCodes = (options, result) => {
|
|
200
|
-
const errors =
|
|
183
|
+
const errors = {
|
|
201
184
|
400: "Bad Request",
|
|
202
185
|
401: "Unauthorized",
|
|
203
186
|
403: "Forbidden",
|
|
204
187
|
404: "Not Found",
|
|
205
188
|
500: "Internal Server Error",
|
|
206
189
|
502: "Bad Gateway",
|
|
207
|
-
503: "Service Unavailable"
|
|
208
|
-
|
|
190
|
+
503: "Service Unavailable",
|
|
191
|
+
...options.errors
|
|
192
|
+
};
|
|
209
193
|
const error = errors[result.status];
|
|
210
194
|
if (error) {
|
|
211
195
|
throw new ApiError(options, result, error);
|
|
@@ -230,7 +214,7 @@ const request = (config, options) => {
|
|
|
230
214
|
ok: response.ok,
|
|
231
215
|
status: response.status,
|
|
232
216
|
statusText: response.statusText,
|
|
233
|
-
body: responseHeader
|
|
217
|
+
body: responseHeader ?? responseBody
|
|
234
218
|
};
|
|
235
219
|
catchErrorCodes(options, result);
|
|
236
220
|
resolve2(result.body);
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import { DelegationStatusType } from './DelegationStatusType.js';
|
|
2
|
-
|
|
3
1
|
type ActiveDelegatorDetails = {
|
|
4
2
|
txHash: string;
|
|
3
|
+
nodeId: string;
|
|
5
4
|
rewardAddresses: Array<string>;
|
|
6
5
|
amountDelegated: string;
|
|
7
6
|
delegationFee: string;
|
|
8
7
|
startTimestamp: number;
|
|
9
8
|
endTimestamp: number;
|
|
10
|
-
delegationStatus: DelegationStatusType;
|
|
11
9
|
estimatedGrossReward: string;
|
|
12
10
|
estimatedNetReward: string;
|
|
11
|
+
delegationStatus: ActiveDelegatorDetails.delegationStatus;
|
|
13
12
|
};
|
|
13
|
+
declare namespace ActiveDelegatorDetails {
|
|
14
|
+
enum delegationStatus {
|
|
15
|
+
ACTIVE = "active"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
14
18
|
|
|
15
19
|
export { ActiveDelegatorDetails };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var ActiveDelegatorDetails;
|
|
2
|
+
((ActiveDelegatorDetails2) => {
|
|
3
|
+
((delegationStatus2) => {
|
|
4
|
+
delegationStatus2["ACTIVE"] = "active";
|
|
5
|
+
})(ActiveDelegatorDetails2.delegationStatus || (ActiveDelegatorDetails2.delegationStatus = {}));
|
|
6
|
+
})(ActiveDelegatorDetails || (ActiveDelegatorDetails = {}));
|
|
7
|
+
|
|
8
|
+
export { ActiveDelegatorDetails };
|
|
@@ -1,20 +1,33 @@
|
|
|
1
|
+
import { BlsCredentials } from './BlsCredentials.js';
|
|
1
2
|
import { Rewards } from './Rewards.js';
|
|
2
|
-
import {
|
|
3
|
+
import { ValidatorHealthDetails } from './ValidatorHealthDetails.js';
|
|
3
4
|
|
|
4
5
|
type ActiveValidatorDetails = {
|
|
6
|
+
txHash: string;
|
|
5
7
|
nodeId: string;
|
|
8
|
+
subnetId: string;
|
|
6
9
|
amountStaked: string;
|
|
7
|
-
delegationFee
|
|
10
|
+
delegationFee?: string;
|
|
8
11
|
startTimestamp: number;
|
|
9
12
|
endTimestamp: number;
|
|
10
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Present for AddPermissionlessValidatorTx
|
|
15
|
+
*/
|
|
16
|
+
blsCredentials?: BlsCredentials;
|
|
11
17
|
stakePercentage: number;
|
|
12
18
|
delegatorCount: number;
|
|
13
|
-
amountDelegated
|
|
19
|
+
amountDelegated?: string;
|
|
14
20
|
uptimePerformance: number;
|
|
15
|
-
avalancheGoVersion
|
|
16
|
-
delegationCapacity
|
|
21
|
+
avalancheGoVersion?: string;
|
|
22
|
+
delegationCapacity?: string;
|
|
17
23
|
potentialRewards: Rewards;
|
|
24
|
+
validationStatus: ActiveValidatorDetails.validationStatus;
|
|
25
|
+
validatorHealth: ValidatorHealthDetails;
|
|
18
26
|
};
|
|
27
|
+
declare namespace ActiveValidatorDetails {
|
|
28
|
+
enum validationStatus {
|
|
29
|
+
ACTIVE = "active"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
19
32
|
|
|
20
33
|
export { ActiveValidatorDetails };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var ActiveValidatorDetails;
|
|
2
|
+
((ActiveValidatorDetails2) => {
|
|
3
|
+
((validationStatus2) => {
|
|
4
|
+
validationStatus2["ACTIVE"] = "active";
|
|
5
|
+
})(ActiveValidatorDetails2.validationStatus || (ActiveValidatorDetails2.validationStatus = {}));
|
|
6
|
+
})(ActiveValidatorDetails || (ActiveValidatorDetails = {}));
|
|
7
|
+
|
|
8
|
+
export { ActiveValidatorDetails };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
type AddressActivityMetadata = {
|
|
2
|
+
/**
|
|
3
|
+
* Ethereum address(es) for the address_activity event type
|
|
4
|
+
*/
|
|
5
|
+
addresses: Array<any[]>;
|
|
6
|
+
/**
|
|
7
|
+
* Array of hexadecimal strings of the event signatures.
|
|
8
|
+
*/
|
|
9
|
+
eventSignatures?: Array<string>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { AddressActivityMetadata };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { PrimaryNetworkAssetType } from './PrimaryNetworkAssetType.js';
|
|
2
|
+
|
|
3
|
+
type AggregatedAssetAmount = {
|
|
2
4
|
/**
|
|
3
5
|
* Unique ID for an asset.
|
|
4
6
|
*/
|
|
@@ -15,10 +17,7 @@ type XChainAssetBalance = {
|
|
|
15
17
|
* Denomination of this asset to represent fungibility.
|
|
16
18
|
*/
|
|
17
19
|
denomination: number;
|
|
18
|
-
|
|
19
|
-
* Type of asset like SECP256K1 or NFT.
|
|
20
|
-
*/
|
|
21
|
-
type: string;
|
|
20
|
+
type: PrimaryNetworkAssetType;
|
|
22
21
|
/**
|
|
23
22
|
* Amount of the asset.
|
|
24
23
|
*/
|
|
@@ -26,4 +25,4 @@ type XChainAssetBalance = {
|
|
|
26
25
|
utxoCount: number;
|
|
27
26
|
};
|
|
28
27
|
|
|
29
|
-
export {
|
|
28
|
+
export { AggregatedAssetAmount };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import { PrimaryNetworkAssetType } from './PrimaryNetworkAssetType.js';
|
|
2
|
+
|
|
3
|
+
type AssetAmount = {
|
|
2
4
|
/**
|
|
3
5
|
* Unique ID for an asset.
|
|
4
6
|
*/
|
|
@@ -15,14 +17,11 @@ type Asset = {
|
|
|
15
17
|
* Denomination of this asset to represent fungibility.
|
|
16
18
|
*/
|
|
17
19
|
denomination: number;
|
|
18
|
-
|
|
19
|
-
* Type of asset like SECP256K1 or NFT.
|
|
20
|
-
*/
|
|
21
|
-
type: string;
|
|
20
|
+
type: PrimaryNetworkAssetType;
|
|
22
21
|
/**
|
|
23
22
|
* Amount of the asset.
|
|
24
23
|
*/
|
|
25
24
|
amount: string;
|
|
26
25
|
};
|
|
27
26
|
|
|
28
|
-
export {
|
|
27
|
+
export { AssetAmount };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Money } from './Money.js';
|
|
2
|
+
import { PrimaryNetworkAssetType } from './PrimaryNetworkAssetType.js';
|
|
3
|
+
|
|
4
|
+
type AssetWithPriceInfo = {
|
|
5
|
+
/**
|
|
6
|
+
* Unique ID for an asset.
|
|
7
|
+
*/
|
|
8
|
+
assetId: string;
|
|
9
|
+
/**
|
|
10
|
+
* Name of this asset.
|
|
11
|
+
*/
|
|
12
|
+
name: string;
|
|
13
|
+
/**
|
|
14
|
+
* Symbol for this asset (max 4 characters).
|
|
15
|
+
*/
|
|
16
|
+
symbol: string;
|
|
17
|
+
/**
|
|
18
|
+
* Denomination of this asset to represent fungibility.
|
|
19
|
+
*/
|
|
20
|
+
denomination: number;
|
|
21
|
+
type: PrimaryNetworkAssetType;
|
|
22
|
+
/**
|
|
23
|
+
* Amount of the asset.
|
|
24
|
+
*/
|
|
25
|
+
amount: string;
|
|
26
|
+
/**
|
|
27
|
+
* The historical asset price at the time the reward was granted, if available. Note, this is only provided if the reward occured more than 24 hours ago.
|
|
28
|
+
*/
|
|
29
|
+
historicalPrice?: Money;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export { AssetWithPriceInfo };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AssetAmount } from './AssetAmount.js';
|
|
2
2
|
import { EVMInput } from './EVMInput.js';
|
|
3
3
|
import { Utxo } from './Utxo.js';
|
|
4
4
|
|
|
@@ -26,11 +26,11 @@ type CChainExportTransaction = {
|
|
|
26
26
|
/**
|
|
27
27
|
* Assets unlocked by inputs of this transaction.
|
|
28
28
|
*/
|
|
29
|
-
amountUnlocked: Array<
|
|
29
|
+
amountUnlocked: Array<AssetAmount>;
|
|
30
30
|
/**
|
|
31
31
|
* Assets created by outputs of this transaction.
|
|
32
32
|
*/
|
|
33
|
-
amountCreated: Array<
|
|
33
|
+
amountCreated: Array<AssetAmount>;
|
|
34
34
|
/**
|
|
35
35
|
* Source chain for an atomic transaction.
|
|
36
36
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AssetAmount } from './AssetAmount.js';
|
|
2
2
|
import { EVMOutput } from './EVMOutput.js';
|
|
3
3
|
import { Utxo } from './Utxo.js';
|
|
4
4
|
|
|
@@ -26,11 +26,11 @@ type CChainImportTransaction = {
|
|
|
26
26
|
/**
|
|
27
27
|
* Assets unlocked by inputs of this transaction.
|
|
28
28
|
*/
|
|
29
|
-
amountUnlocked: Array<
|
|
29
|
+
amountUnlocked: Array<AssetAmount>;
|
|
30
30
|
/**
|
|
31
31
|
* Assets created by outputs of this transaction.
|
|
32
32
|
*/
|
|
33
|
-
amountCreated: Array<
|
|
33
|
+
amountCreated: Array<AssetAmount>;
|
|
34
34
|
/**
|
|
35
35
|
* Source chain for an atomic transaction.
|
|
36
36
|
*/
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { PrimaryNetworkAssetType } from './PrimaryNetworkAssetType.js';
|
|
2
|
+
|
|
1
3
|
type CChainSharedAssetBalance = {
|
|
2
4
|
/**
|
|
3
5
|
* Unique ID for an asset.
|
|
@@ -15,10 +17,7 @@ type CChainSharedAssetBalance = {
|
|
|
15
17
|
* Denomination of this asset to represent fungibility.
|
|
16
18
|
*/
|
|
17
19
|
denomination: number;
|
|
18
|
-
|
|
19
|
-
* Type of asset like SECP256K1 or NFT.
|
|
20
|
-
*/
|
|
21
|
-
type: string;
|
|
20
|
+
type: PrimaryNetworkAssetType;
|
|
22
21
|
/**
|
|
23
22
|
* Amount of the asset.
|
|
24
23
|
*/
|
|
@@ -5,9 +5,6 @@ import { VmName } from './VmName.js';
|
|
|
5
5
|
|
|
6
6
|
type ChainInfo = {
|
|
7
7
|
chainId: string;
|
|
8
|
-
/**
|
|
9
|
-
* Status of chain nodes. Chain nodes can become temporarily `UNAVAILABLE` for several reasons, such as validator stake falling below threshold. If chain nodes are `UNAVAILABLE`, requests that rely on data from the chain nodes may return 503 errors.
|
|
10
|
-
*/
|
|
11
8
|
status: ChainStatus;
|
|
12
9
|
chainName: string;
|
|
13
10
|
description: string;
|
|
@@ -22,6 +19,8 @@ type ChainInfo = {
|
|
|
22
19
|
utilityAddresses?: UtilityAddresses;
|
|
23
20
|
networkToken: NetworkToken;
|
|
24
21
|
chainLogoUri?: string;
|
|
22
|
+
private?: boolean;
|
|
23
|
+
enabledFeatures?: Array<'nftIndexing' | 'webhooks'>;
|
|
25
24
|
};
|
|
26
25
|
|
|
27
26
|
export { ChainInfo };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Status of chain nodes. Chain nodes can become temporarily `UNAVAILABLE` for several reasons, such as validator stake falling below threshold. If chain nodes are `UNAVAILABLE`, requests that rely on data from the chain nodes may return 503 errors.
|
|
3
|
+
*/
|
|
1
4
|
declare enum ChainStatus {
|
|
2
5
|
OK = "OK",
|
|
3
6
|
UNAVAILABLE = "UNAVAILABLE"
|