@avalabs/glacier-sdk 2.8.0-canary.35b5ae4.0 → 2.8.0-canary.3665604.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 +45 -11
- package/dist/index.js +38 -27
- package/esm/generated/core/CancelablePromise.js +3 -6
- package/esm/generated/core/OpenAPI.d.ts +5 -5
- package/esm/generated/core/request.js +7 -22
- package/esm/generated/models/AddressActivityMetadata.d.ts +2 -2
- package/esm/generated/models/AddressesChangeRequest.d.ts +8 -0
- package/esm/generated/models/ChainInfo.d.ts +1 -1
- package/esm/generated/models/GetChainResponse.d.ts +1 -1
- package/esm/generated/models/GlacierApiFeature.d.ts +2 -1
- package/esm/generated/models/GlacierApiFeature.js +1 -0
- package/esm/generated/services/WebhooksService.d.ts +27 -0
- package/esm/generated/services/WebhooksService.js +28 -0
- package/esm/index.d.ts +1 -0
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -40,11 +40,11 @@ type OpenAPIConfig = {
|
|
|
40
40
|
VERSION: string;
|
|
41
41
|
WITH_CREDENTIALS: boolean;
|
|
42
42
|
CREDENTIALS: 'include' | 'omit' | 'same-origin';
|
|
43
|
-
TOKEN?: string | Resolver<string
|
|
44
|
-
USERNAME?: string | Resolver<string
|
|
45
|
-
PASSWORD?: string | Resolver<string
|
|
46
|
-
HEADERS?: Headers | Resolver<Headers
|
|
47
|
-
ENCODE_PATH?: (
|
|
43
|
+
TOKEN?: string | Resolver<string>;
|
|
44
|
+
USERNAME?: string | Resolver<string>;
|
|
45
|
+
PASSWORD?: string | Resolver<string>;
|
|
46
|
+
HEADERS?: Headers | Resolver<Headers>;
|
|
47
|
+
ENCODE_PATH?: (path: string) => string;
|
|
48
48
|
};
|
|
49
49
|
declare const OpenAPI: OpenAPIConfig;
|
|
50
50
|
|
|
@@ -682,11 +682,12 @@ type GetChainResponse = {
|
|
|
682
682
|
networkToken: NetworkToken;
|
|
683
683
|
chainLogoUri?: string;
|
|
684
684
|
private?: boolean;
|
|
685
|
-
enabledFeatures?: Array<'nftIndexing'>;
|
|
685
|
+
enabledFeatures?: Array<'nftIndexing' | 'webhooks'>;
|
|
686
686
|
};
|
|
687
687
|
|
|
688
688
|
declare enum GlacierApiFeature {
|
|
689
|
-
NFT_INDEXING = "nftIndexing"
|
|
689
|
+
NFT_INDEXING = "nftIndexing",
|
|
690
|
+
WEBHOOKS = "webhooks"
|
|
690
691
|
}
|
|
691
692
|
|
|
692
693
|
type ChainInfo = {
|
|
@@ -706,7 +707,7 @@ type ChainInfo = {
|
|
|
706
707
|
networkToken: NetworkToken;
|
|
707
708
|
chainLogoUri?: string;
|
|
708
709
|
private?: boolean;
|
|
709
|
-
enabledFeatures?: Array<'nftIndexing'>;
|
|
710
|
+
enabledFeatures?: Array<'nftIndexing' | 'webhooks'>;
|
|
710
711
|
};
|
|
711
712
|
|
|
712
713
|
type ListChainsResponse = {
|
|
@@ -4321,11 +4322,18 @@ declare class TeleporterService {
|
|
|
4321
4322
|
}): CancelablePromise<NextPageToken>;
|
|
4322
4323
|
}
|
|
4323
4324
|
|
|
4325
|
+
type AddressesChangeRequest = {
|
|
4326
|
+
/**
|
|
4327
|
+
* Ethereum address(es) for the address_activity event type
|
|
4328
|
+
*/
|
|
4329
|
+
addresses: Array<any[]>;
|
|
4330
|
+
};
|
|
4331
|
+
|
|
4324
4332
|
type AddressActivityMetadata = {
|
|
4325
4333
|
/**
|
|
4326
|
-
* Ethereum address for the address_activity event type
|
|
4334
|
+
* Ethereum address(es) for the address_activity event type
|
|
4327
4335
|
*/
|
|
4328
|
-
|
|
4336
|
+
addresses: Array<any[]>;
|
|
4329
4337
|
/**
|
|
4330
4338
|
* Array of hexadecimal strings of the event signatures.
|
|
4331
4339
|
*/
|
|
@@ -4485,6 +4493,32 @@ declare class WebhooksService {
|
|
|
4485
4493
|
* @throws ApiError
|
|
4486
4494
|
*/
|
|
4487
4495
|
getSharedSecret(): CancelablePromise<SharedSecretsResponse>;
|
|
4496
|
+
/**
|
|
4497
|
+
* Add address(es) to a webhook
|
|
4498
|
+
* Adding address(es) to a given webhook.
|
|
4499
|
+
* @returns WebhookResponse
|
|
4500
|
+
* @throws ApiError
|
|
4501
|
+
*/
|
|
4502
|
+
addAddressesToWebhook({ id, requestBody, }: {
|
|
4503
|
+
/**
|
|
4504
|
+
* The webhook identifier.
|
|
4505
|
+
*/
|
|
4506
|
+
id: string;
|
|
4507
|
+
requestBody: AddressesChangeRequest;
|
|
4508
|
+
}): CancelablePromise<WebhookResponse>;
|
|
4509
|
+
/**
|
|
4510
|
+
* Remove address(es) from a webhook
|
|
4511
|
+
* Removing address(es) from a given webhook.
|
|
4512
|
+
* @returns WebhookResponse
|
|
4513
|
+
* @throws ApiError
|
|
4514
|
+
*/
|
|
4515
|
+
removeAddressesFromWebhook({ id, requestBody, }: {
|
|
4516
|
+
/**
|
|
4517
|
+
* The webhook identifier.
|
|
4518
|
+
*/
|
|
4519
|
+
id: string;
|
|
4520
|
+
requestBody: AddressesChangeRequest;
|
|
4521
|
+
}): CancelablePromise<WebhookResponse>;
|
|
4488
4522
|
}
|
|
4489
4523
|
|
|
4490
4524
|
type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest;
|
|
@@ -4529,4 +4563,4 @@ declare class ApiError extends Error {
|
|
|
4529
4563
|
constructor(request: ApiRequestOptions, response: ApiResult, message: string);
|
|
4530
4564
|
}
|
|
4531
4565
|
|
|
4532
|
-
export { ActiveDelegatorDetails, ActiveValidatorDetails, AddressActivityMetadata, AggregatedAssetAmount, ApiError, AssetAmount, AssetWithPriceInfo, BaseHttpRequest, Blockchain, BlockchainId, BlockchainIds, BlockchainInfo, CChainAtomicBalances, CChainExportTransaction, CChainImportTransaction, CChainSharedAssetBalance, CancelError, CancelablePromise, ChainAddressChainIdMap, ChainAddressChainIdMapListResponse, ChainInfo, ChainStatus, CompletedDelegatorDetails, CompletedValidatorDetails, ContractDeploymentDetails, ContractSubmissionBody, ContractSubmissionErc1155, ContractSubmissionErc20, ContractSubmissionErc721, ContractSubmissionUnknown, CreateEvmTransactionExportRequest, CreatePrimaryNetworkTransactionExportRequest, CurrencyCode, DefaultService, DelegationStatusType, DelegatorsDetails, DeliveredSourceNotIndexedTeleporterMessage, DeliveredTeleporterMessage, EVMInput, EVMOperationType, EVMOutput, Erc1155Contract, Erc1155Token, Erc1155TokenBalance, Erc1155TokenMetadata, Erc1155Transfer, Erc1155TransferDetails, Erc20Contract, Erc20Token, Erc20TokenBalance, Erc20Transfer, Erc20TransferDetails, Erc721Contract, Erc721Token, Erc721TokenBalance, Erc721TokenMetadata, Erc721Transfer, Erc721TransferDetails, EventType, EvmBalancesService, EvmBlock, EvmBlocksService, EvmChainsService, EvmContractsService, EvmNetworkOptions, EvmTransactionsService, FullNativeTransactionDetails, GetChainResponse, GetEvmBlockResponse, GetNativeBalanceResponse, GetNetworkDetailsResponse, GetPrimaryNetworkBlockResponse, GetTransactionResponse, Glacier, GlacierApiFeature, HealthCheckService, HistoricalReward, ImageAsset, InternalTransaction, InternalTransactionDetails, InternalTransactionOpCall, ListBlockchainsResponse, ListCChainAtomicBalancesResponse, ListCChainAtomicTransactionsResponse, ListChainsResponse, ListCollectibleBalancesResponse, ListContractsResponse, ListDelegatorDetailsResponse, ListErc1155BalancesResponse, ListErc1155TransactionsResponse, ListErc20BalancesResponse, ListErc20TransactionsResponse, ListErc721BalancesResponse, ListErc721TransactionsResponse, ListEvmBlocksResponse, ListHistoricalRewardsResponse, ListInternalTransactionsResponse, ListNativeTransactionsResponse, ListNftTokens, ListPChainBalancesResponse, ListPChainTransactionsResponse, ListPChainUtxosResponse, ListPendingRewardsResponse, ListPrimaryNetworkBlocksResponse, ListSubnetsResponse, ListTransactionDetailsResponse, ListTransfersResponse, ListUtxosResponse, ListValidatorDetailsResponse, ListWebhooksResponse, ListXChainBalancesResponse, ListXChainTransactionsResponse, ListXChainVerticesResponse, Method, Money, NativeTokenBalance, NativeTransaction, Network, NetworkToken, NetworkTokenDetails, NetworkType, NextPageToken, NfTsService, NftTokenMetadataStatus, OpenAPI, OpenAPIConfig, OperationStatus, OperationStatusCode, OperationStatusResponse, OperationType, OperationsService, PChainBalance, PChainId, PChainSharedAsset, PChainTransaction, PChainTransactionType, PChainUtxo, PendingDelegatorDetails, PendingReward, PendingTeleporterMessage, PendingValidatorDetails, PricingProviders, PrimaryNetwork, PrimaryNetworkAssetCap, PrimaryNetworkAssetType, PrimaryNetworkBalancesService, PrimaryNetworkBlock, PrimaryNetworkBlocksService, PrimaryNetworkChainInfo, PrimaryNetworkChainName, PrimaryNetworkOperationType, PrimaryNetworkOptions, PrimaryNetworkRewardsService, PrimaryNetworkService, PrimaryNetworkTransactionsService, PrimaryNetworkTxType, PrimaryNetworkUtxOsService, PrimaryNetworkVerticesService, ProposerDetails, RegisterWebhookRequest, RemovedValidatorDetails, ResourceLink, ResourceLinkType, RewardType, Rewards, RichAddress, RpcErrorDto, RpcErrorResponseDto, RpcRequestBodyDto, RpcService, RpcSuccessResponseDto, SharedSecretsResponse, SortOrder, StakingDistribution, Subnet, SubnetOwnershipInfo, TeleporterDestinationTransaction, TeleporterReceipt, TeleporterRewardDetails, TeleporterService, TeleporterSourceTransaction, TransactionDetails, TransactionExportMetadata, TransactionMethodType, TransactionStatus, TransactionVertexDetail, UnknownContract, UpdateContractResponse, UpdateWebhookRequest, UtilityAddresses, Utxo, UtxoCredential, UtxoType, ValidationStatusType, ValidatorHealthDetails, ValidatorsDetails, VmName, WebhookResponse, WebhookStatus, WebhookStatusType, WebhooksService, XChainAssetDetails, XChainBalances, XChainId, XChainLinearTransaction, XChainNonLinearTransaction, XChainSharedAssetBalance, XChainTransactionType, XChainVertex };
|
|
4566
|
+
export { ActiveDelegatorDetails, ActiveValidatorDetails, AddressActivityMetadata, AddressesChangeRequest, AggregatedAssetAmount, ApiError, AssetAmount, AssetWithPriceInfo, BaseHttpRequest, Blockchain, BlockchainId, BlockchainIds, BlockchainInfo, CChainAtomicBalances, CChainExportTransaction, CChainImportTransaction, CChainSharedAssetBalance, CancelError, CancelablePromise, ChainAddressChainIdMap, ChainAddressChainIdMapListResponse, ChainInfo, ChainStatus, CompletedDelegatorDetails, CompletedValidatorDetails, ContractDeploymentDetails, ContractSubmissionBody, ContractSubmissionErc1155, ContractSubmissionErc20, ContractSubmissionErc721, ContractSubmissionUnknown, CreateEvmTransactionExportRequest, CreatePrimaryNetworkTransactionExportRequest, CurrencyCode, DefaultService, DelegationStatusType, DelegatorsDetails, DeliveredSourceNotIndexedTeleporterMessage, DeliveredTeleporterMessage, EVMInput, EVMOperationType, EVMOutput, Erc1155Contract, Erc1155Token, Erc1155TokenBalance, Erc1155TokenMetadata, Erc1155Transfer, Erc1155TransferDetails, Erc20Contract, Erc20Token, Erc20TokenBalance, Erc20Transfer, Erc20TransferDetails, Erc721Contract, Erc721Token, Erc721TokenBalance, Erc721TokenMetadata, Erc721Transfer, Erc721TransferDetails, EventType, EvmBalancesService, EvmBlock, EvmBlocksService, EvmChainsService, EvmContractsService, EvmNetworkOptions, EvmTransactionsService, FullNativeTransactionDetails, GetChainResponse, GetEvmBlockResponse, GetNativeBalanceResponse, GetNetworkDetailsResponse, GetPrimaryNetworkBlockResponse, GetTransactionResponse, Glacier, GlacierApiFeature, HealthCheckService, HistoricalReward, ImageAsset, InternalTransaction, InternalTransactionDetails, InternalTransactionOpCall, ListBlockchainsResponse, ListCChainAtomicBalancesResponse, ListCChainAtomicTransactionsResponse, ListChainsResponse, ListCollectibleBalancesResponse, ListContractsResponse, ListDelegatorDetailsResponse, ListErc1155BalancesResponse, ListErc1155TransactionsResponse, ListErc20BalancesResponse, ListErc20TransactionsResponse, ListErc721BalancesResponse, ListErc721TransactionsResponse, ListEvmBlocksResponse, ListHistoricalRewardsResponse, ListInternalTransactionsResponse, ListNativeTransactionsResponse, ListNftTokens, ListPChainBalancesResponse, ListPChainTransactionsResponse, ListPChainUtxosResponse, ListPendingRewardsResponse, ListPrimaryNetworkBlocksResponse, ListSubnetsResponse, ListTransactionDetailsResponse, ListTransfersResponse, ListUtxosResponse, ListValidatorDetailsResponse, ListWebhooksResponse, ListXChainBalancesResponse, ListXChainTransactionsResponse, ListXChainVerticesResponse, Method, Money, NativeTokenBalance, NativeTransaction, Network, NetworkToken, NetworkTokenDetails, NetworkType, NextPageToken, NfTsService, NftTokenMetadataStatus, OpenAPI, OpenAPIConfig, OperationStatus, OperationStatusCode, OperationStatusResponse, OperationType, OperationsService, PChainBalance, PChainId, PChainSharedAsset, PChainTransaction, PChainTransactionType, PChainUtxo, PendingDelegatorDetails, PendingReward, PendingTeleporterMessage, PendingValidatorDetails, PricingProviders, PrimaryNetwork, PrimaryNetworkAssetCap, PrimaryNetworkAssetType, PrimaryNetworkBalancesService, PrimaryNetworkBlock, PrimaryNetworkBlocksService, PrimaryNetworkChainInfo, PrimaryNetworkChainName, PrimaryNetworkOperationType, PrimaryNetworkOptions, PrimaryNetworkRewardsService, PrimaryNetworkService, PrimaryNetworkTransactionsService, PrimaryNetworkTxType, PrimaryNetworkUtxOsService, PrimaryNetworkVerticesService, ProposerDetails, RegisterWebhookRequest, RemovedValidatorDetails, ResourceLink, ResourceLinkType, RewardType, Rewards, RichAddress, RpcErrorDto, RpcErrorResponseDto, RpcRequestBodyDto, RpcService, RpcSuccessResponseDto, SharedSecretsResponse, SortOrder, StakingDistribution, Subnet, SubnetOwnershipInfo, TeleporterDestinationTransaction, TeleporterReceipt, TeleporterRewardDetails, TeleporterService, TeleporterSourceTransaction, TransactionDetails, TransactionExportMetadata, TransactionMethodType, TransactionStatus, TransactionVertexDetail, UnknownContract, UpdateContractResponse, UpdateWebhookRequest, UtilityAddresses, Utxo, UtxoCredential, UtxoType, ValidationStatusType, ValidatorHealthDetails, ValidatorsDetails, VmName, WebhookResponse, WebhookStatus, WebhookStatusType, WebhooksService, XChainAssetDetails, XChainBalances, XChainId, XChainLinearTransaction, XChainNonLinearTransaction, XChainSharedAssetBalance, XChainTransactionType, XChainVertex };
|
package/dist/index.js
CHANGED
|
@@ -53,16 +53,14 @@ class CancelablePromise {
|
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
55
|
this.#isResolved = true;
|
|
56
|
-
|
|
57
|
-
this.#resolve(value);
|
|
56
|
+
this.#resolve?.(value);
|
|
58
57
|
};
|
|
59
58
|
const onReject = (reason) => {
|
|
60
59
|
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
|
61
60
|
return;
|
|
62
61
|
}
|
|
63
62
|
this.#isRejected = true;
|
|
64
|
-
|
|
65
|
-
this.#reject(reason);
|
|
63
|
+
this.#reject?.(reason);
|
|
66
64
|
};
|
|
67
65
|
const onCancel = (cancelHandler) => {
|
|
68
66
|
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
|
@@ -110,8 +108,7 @@ class CancelablePromise {
|
|
|
110
108
|
}
|
|
111
109
|
}
|
|
112
110
|
this.#cancelHandlers.length = 0;
|
|
113
|
-
|
|
114
|
-
this.#reject(new CancelError("Request aborted"));
|
|
111
|
+
this.#reject?.(new CancelError("Request aborted"));
|
|
115
112
|
}
|
|
116
113
|
get isCancelled() {
|
|
117
114
|
return this.#isCancelled;
|
|
@@ -210,12 +207,10 @@ const resolve = async (options, resolver) => {
|
|
|
210
207
|
return resolver;
|
|
211
208
|
};
|
|
212
209
|
const getHeaders = async (config, options) => {
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
resolve(options, config.HEADERS)
|
|
218
|
-
]);
|
|
210
|
+
const token = await resolve(options, config.TOKEN);
|
|
211
|
+
const username = await resolve(options, config.USERNAME);
|
|
212
|
+
const password = await resolve(options, config.PASSWORD);
|
|
213
|
+
const additionalHeaders = await resolve(options, config.HEADERS);
|
|
219
214
|
const headers = Object.entries({
|
|
220
215
|
Accept: "application/json",
|
|
221
216
|
...additionalHeaders,
|
|
@@ -231,7 +226,7 @@ const getHeaders = async (config, options) => {
|
|
|
231
226
|
const credentials = base64(`${username}:${password}`);
|
|
232
227
|
headers["Authorization"] = `Basic ${credentials}`;
|
|
233
228
|
}
|
|
234
|
-
if (options.body
|
|
229
|
+
if (options.body) {
|
|
235
230
|
if (options.mediaType) {
|
|
236
231
|
headers["Content-Type"] = options.mediaType;
|
|
237
232
|
} else if (isBlob(options.body)) {
|
|
@@ -314,20 +309,7 @@ const catchErrorCodes = (options, result) => {
|
|
|
314
309
|
throw new ApiError(options, result, error);
|
|
315
310
|
}
|
|
316
311
|
if (!result.ok) {
|
|
317
|
-
|
|
318
|
-
const errorStatusText = result.statusText ?? "unknown";
|
|
319
|
-
const errorBody = (() => {
|
|
320
|
-
try {
|
|
321
|
-
return JSON.stringify(result.body, null, 2);
|
|
322
|
-
} catch (e) {
|
|
323
|
-
return void 0;
|
|
324
|
-
}
|
|
325
|
-
})();
|
|
326
|
-
throw new ApiError(
|
|
327
|
-
options,
|
|
328
|
-
result,
|
|
329
|
-
`Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`
|
|
330
|
-
);
|
|
312
|
+
throw new ApiError(options, result, "Generic Error");
|
|
331
313
|
}
|
|
332
314
|
};
|
|
333
315
|
const request = (config, options) => {
|
|
@@ -1591,6 +1573,34 @@ class WebhooksService {
|
|
|
1591
1573
|
url: "/v1/webhooks:getSharedSecret"
|
|
1592
1574
|
});
|
|
1593
1575
|
}
|
|
1576
|
+
addAddressesToWebhook({
|
|
1577
|
+
id,
|
|
1578
|
+
requestBody
|
|
1579
|
+
}) {
|
|
1580
|
+
return this.httpRequest.request({
|
|
1581
|
+
method: "PATCH",
|
|
1582
|
+
url: "/v1/webhooks/{id}/addresses",
|
|
1583
|
+
path: {
|
|
1584
|
+
"id": id
|
|
1585
|
+
},
|
|
1586
|
+
body: requestBody,
|
|
1587
|
+
mediaType: "application/json"
|
|
1588
|
+
});
|
|
1589
|
+
}
|
|
1590
|
+
removeAddressesFromWebhook({
|
|
1591
|
+
id,
|
|
1592
|
+
requestBody
|
|
1593
|
+
}) {
|
|
1594
|
+
return this.httpRequest.request({
|
|
1595
|
+
method: "DELETE",
|
|
1596
|
+
url: "/v1/webhooks/{id}/addresses",
|
|
1597
|
+
path: {
|
|
1598
|
+
"id": id
|
|
1599
|
+
},
|
|
1600
|
+
body: requestBody,
|
|
1601
|
+
mediaType: "application/json"
|
|
1602
|
+
});
|
|
1603
|
+
}
|
|
1594
1604
|
}
|
|
1595
1605
|
|
|
1596
1606
|
class Glacier {
|
|
@@ -1871,6 +1881,7 @@ var EVMOperationType = /* @__PURE__ */ ((EVMOperationType2) => {
|
|
|
1871
1881
|
|
|
1872
1882
|
var GlacierApiFeature = /* @__PURE__ */ ((GlacierApiFeature2) => {
|
|
1873
1883
|
GlacierApiFeature2["NFT_INDEXING"] = "nftIndexing";
|
|
1884
|
+
GlacierApiFeature2["WEBHOOKS"] = "webhooks";
|
|
1874
1885
|
return GlacierApiFeature2;
|
|
1875
1886
|
})(GlacierApiFeature || {});
|
|
1876
1887
|
|
|
@@ -28,16 +28,14 @@ class CancelablePromise {
|
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
this.#isResolved = true;
|
|
31
|
-
|
|
32
|
-
this.#resolve(value);
|
|
31
|
+
this.#resolve?.(value);
|
|
33
32
|
};
|
|
34
33
|
const onReject = (reason) => {
|
|
35
34
|
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
|
36
35
|
return;
|
|
37
36
|
}
|
|
38
37
|
this.#isRejected = true;
|
|
39
|
-
|
|
40
|
-
this.#reject(reason);
|
|
38
|
+
this.#reject?.(reason);
|
|
41
39
|
};
|
|
42
40
|
const onCancel = (cancelHandler) => {
|
|
43
41
|
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
|
@@ -85,8 +83,7 @@ class CancelablePromise {
|
|
|
85
83
|
}
|
|
86
84
|
}
|
|
87
85
|
this.#cancelHandlers.length = 0;
|
|
88
|
-
|
|
89
|
-
this.#reject(new CancelError("Request aborted"));
|
|
86
|
+
this.#reject?.(new CancelError("Request aborted"));
|
|
90
87
|
}
|
|
91
88
|
get isCancelled() {
|
|
92
89
|
return this.#isCancelled;
|
|
@@ -7,11 +7,11 @@ type OpenAPIConfig = {
|
|
|
7
7
|
VERSION: string;
|
|
8
8
|
WITH_CREDENTIALS: boolean;
|
|
9
9
|
CREDENTIALS: 'include' | 'omit' | 'same-origin';
|
|
10
|
-
TOKEN?: string | Resolver<string
|
|
11
|
-
USERNAME?: string | Resolver<string
|
|
12
|
-
PASSWORD?: string | Resolver<string
|
|
13
|
-
HEADERS?: Headers | Resolver<Headers
|
|
14
|
-
ENCODE_PATH?: (
|
|
10
|
+
TOKEN?: string | Resolver<string>;
|
|
11
|
+
USERNAME?: string | Resolver<string>;
|
|
12
|
+
PASSWORD?: string | Resolver<string>;
|
|
13
|
+
HEADERS?: Headers | Resolver<Headers>;
|
|
14
|
+
ENCODE_PATH?: (path: string) => string;
|
|
15
15
|
};
|
|
16
16
|
declare const OpenAPI: OpenAPIConfig;
|
|
17
17
|
|
|
@@ -93,12 +93,10 @@ const resolve = async (options, resolver) => {
|
|
|
93
93
|
return resolver;
|
|
94
94
|
};
|
|
95
95
|
const getHeaders = async (config, options) => {
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
resolve(options, config.HEADERS)
|
|
101
|
-
]);
|
|
96
|
+
const token = await resolve(options, config.TOKEN);
|
|
97
|
+
const username = await resolve(options, config.USERNAME);
|
|
98
|
+
const password = await resolve(options, config.PASSWORD);
|
|
99
|
+
const additionalHeaders = await resolve(options, config.HEADERS);
|
|
102
100
|
const headers = Object.entries({
|
|
103
101
|
Accept: "application/json",
|
|
104
102
|
...additionalHeaders,
|
|
@@ -114,7 +112,7 @@ const getHeaders = async (config, options) => {
|
|
|
114
112
|
const credentials = base64(`${username}:${password}`);
|
|
115
113
|
headers["Authorization"] = `Basic ${credentials}`;
|
|
116
114
|
}
|
|
117
|
-
if (options.body
|
|
115
|
+
if (options.body) {
|
|
118
116
|
if (options.mediaType) {
|
|
119
117
|
headers["Content-Type"] = options.mediaType;
|
|
120
118
|
} else if (isBlob(options.body)) {
|
|
@@ -197,20 +195,7 @@ const catchErrorCodes = (options, result) => {
|
|
|
197
195
|
throw new ApiError(options, result, error);
|
|
198
196
|
}
|
|
199
197
|
if (!result.ok) {
|
|
200
|
-
|
|
201
|
-
const errorStatusText = result.statusText ?? "unknown";
|
|
202
|
-
const errorBody = (() => {
|
|
203
|
-
try {
|
|
204
|
-
return JSON.stringify(result.body, null, 2);
|
|
205
|
-
} catch (e) {
|
|
206
|
-
return void 0;
|
|
207
|
-
}
|
|
208
|
-
})();
|
|
209
|
-
throw new ApiError(
|
|
210
|
-
options,
|
|
211
|
-
result,
|
|
212
|
-
`Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`
|
|
213
|
-
);
|
|
198
|
+
throw new ApiError(options, result, "Generic Error");
|
|
214
199
|
}
|
|
215
200
|
};
|
|
216
201
|
const request = (config, options) => {
|
|
@@ -240,4 +225,4 @@ const request = (config, options) => {
|
|
|
240
225
|
});
|
|
241
226
|
};
|
|
242
227
|
|
|
243
|
-
export {
|
|
228
|
+
export { request, sendRequest };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
type AddressActivityMetadata = {
|
|
2
2
|
/**
|
|
3
|
-
* Ethereum address for the address_activity event type
|
|
3
|
+
* Ethereum address(es) for the address_activity event type
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
addresses: Array<any[]>;
|
|
6
6
|
/**
|
|
7
7
|
* Array of hexadecimal strings of the event signatures.
|
|
8
8
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AddressesChangeRequest } from '../models/AddressesChangeRequest.js';
|
|
1
2
|
import { ListWebhooksResponse } from '../models/ListWebhooksResponse.js';
|
|
2
3
|
import { RegisterWebhookRequest } from '../models/RegisterWebhookRequest.js';
|
|
3
4
|
import { SharedSecretsResponse } from '../models/SharedSecretsResponse.js';
|
|
@@ -90,6 +91,32 @@ declare class WebhooksService {
|
|
|
90
91
|
* @throws ApiError
|
|
91
92
|
*/
|
|
92
93
|
getSharedSecret(): CancelablePromise<SharedSecretsResponse>;
|
|
94
|
+
/**
|
|
95
|
+
* Add address(es) to a webhook
|
|
96
|
+
* Adding address(es) to a given webhook.
|
|
97
|
+
* @returns WebhookResponse
|
|
98
|
+
* @throws ApiError
|
|
99
|
+
*/
|
|
100
|
+
addAddressesToWebhook({ id, requestBody, }: {
|
|
101
|
+
/**
|
|
102
|
+
* The webhook identifier.
|
|
103
|
+
*/
|
|
104
|
+
id: string;
|
|
105
|
+
requestBody: AddressesChangeRequest;
|
|
106
|
+
}): CancelablePromise<WebhookResponse>;
|
|
107
|
+
/**
|
|
108
|
+
* Remove address(es) from a webhook
|
|
109
|
+
* Removing address(es) from a given webhook.
|
|
110
|
+
* @returns WebhookResponse
|
|
111
|
+
* @throws ApiError
|
|
112
|
+
*/
|
|
113
|
+
removeAddressesFromWebhook({ id, requestBody, }: {
|
|
114
|
+
/**
|
|
115
|
+
* The webhook identifier.
|
|
116
|
+
*/
|
|
117
|
+
id: string;
|
|
118
|
+
requestBody: AddressesChangeRequest;
|
|
119
|
+
}): CancelablePromise<WebhookResponse>;
|
|
93
120
|
}
|
|
94
121
|
|
|
95
122
|
export { WebhooksService };
|
|
@@ -75,6 +75,34 @@ class WebhooksService {
|
|
|
75
75
|
url: "/v1/webhooks:getSharedSecret"
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
+
addAddressesToWebhook({
|
|
79
|
+
id,
|
|
80
|
+
requestBody
|
|
81
|
+
}) {
|
|
82
|
+
return this.httpRequest.request({
|
|
83
|
+
method: "PATCH",
|
|
84
|
+
url: "/v1/webhooks/{id}/addresses",
|
|
85
|
+
path: {
|
|
86
|
+
"id": id
|
|
87
|
+
},
|
|
88
|
+
body: requestBody,
|
|
89
|
+
mediaType: "application/json"
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
removeAddressesFromWebhook({
|
|
93
|
+
id,
|
|
94
|
+
requestBody
|
|
95
|
+
}) {
|
|
96
|
+
return this.httpRequest.request({
|
|
97
|
+
method: "DELETE",
|
|
98
|
+
url: "/v1/webhooks/{id}/addresses",
|
|
99
|
+
path: {
|
|
100
|
+
"id": id
|
|
101
|
+
},
|
|
102
|
+
body: requestBody,
|
|
103
|
+
mediaType: "application/json"
|
|
104
|
+
});
|
|
105
|
+
}
|
|
78
106
|
}
|
|
79
107
|
|
|
80
108
|
export { WebhooksService };
|
package/esm/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { OpenAPI, OpenAPIConfig } from './generated/core/OpenAPI.js';
|
|
|
6
6
|
export { ActiveDelegatorDetails } from './generated/models/ActiveDelegatorDetails.js';
|
|
7
7
|
export { ActiveValidatorDetails } from './generated/models/ActiveValidatorDetails.js';
|
|
8
8
|
export { AddressActivityMetadata } from './generated/models/AddressActivityMetadata.js';
|
|
9
|
+
export { AddressesChangeRequest } from './generated/models/AddressesChangeRequest.js';
|
|
9
10
|
export { AggregatedAssetAmount } from './generated/models/AggregatedAssetAmount.js';
|
|
10
11
|
export { AssetAmount } from './generated/models/AssetAmount.js';
|
|
11
12
|
export { AssetWithPriceInfo } from './generated/models/AssetWithPriceInfo.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.3665604.0+3665604",
|
|
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",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
],
|
|
15
15
|
"sideEffects": false,
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"openapi-typescript-codegen": "0.
|
|
17
|
+
"openapi-typescript-codegen": "0.24.0"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"bugs": {
|
|
30
30
|
"url": "https://github.com/ava-labs/avalanche-sdks/issues"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "3665604f77de54e5769da4be54337cb98f522848"
|
|
33
33
|
}
|