@avalabs/glacier-sdk 2.8.0-alpha.150 → 2.8.0-alpha.151

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -60,6 +60,56 @@ declare abstract class BaseHttpRequest {
60
60
  abstract request<T>(options: ApiRequestOptions): CancelablePromise<T>;
61
61
  }
62
62
 
63
+ type AddressActivityMetadata = {
64
+ /**
65
+ * Ethereum address for the address_activity event type
66
+ */
67
+ address: string;
68
+ topic0?: string;
69
+ };
70
+
71
+ declare enum EventType {
72
+ ADDRESS_ACTIVITY = "address_activity"
73
+ }
74
+
75
+ declare enum WebhookStatusType {
76
+ ACTIVE = "active",
77
+ INACTIVE = "inactive"
78
+ }
79
+
80
+ type WebhookResponse = {
81
+ id: string;
82
+ eventType: EventType;
83
+ metadata: AddressActivityMetadata;
84
+ url: string;
85
+ chainId: string;
86
+ status: WebhookStatusType;
87
+ createdAt: number;
88
+ };
89
+
90
+ type ListWebhooksResponse = {
91
+ /**
92
+ * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages.
93
+ */
94
+ nextPageToken?: string;
95
+ webhooks: Array<WebhookResponse>;
96
+ };
97
+
98
+ type RegisterWebhookRequest = {
99
+ url: string;
100
+ chainId: string;
101
+ /**
102
+ * The type of event for the webhook
103
+ */
104
+ eventType: EventType;
105
+ metadata: AddressActivityMetadata;
106
+ };
107
+
108
+ declare enum WebhookStatus {
109
+ ACTIVE = "active",
110
+ INACTIVE = "inactive"
111
+ }
112
+
63
113
  declare class DefaultService {
64
114
  readonly httpRequest: BaseHttpRequest;
65
115
  constructor(httpRequest: BaseHttpRequest);
@@ -68,6 +118,47 @@ declare class DefaultService {
68
118
  * @throws ApiError
69
119
  */
70
120
  mediaControllerUploadImage(): CancelablePromise<any>;
121
+ /**
122
+ * Register a webhook
123
+ * Registers a new webhook.
124
+ * @returns WebhookResponse
125
+ * @throws ApiError
126
+ */
127
+ registerWebhook({ requestBody, }: {
128
+ requestBody: RegisterWebhookRequest;
129
+ }): CancelablePromise<WebhookResponse>;
130
+ /**
131
+ * List webhooks
132
+ * Lists webhooks for the user.
133
+ * @returns ListWebhooksResponse
134
+ * @throws ApiError
135
+ */
136
+ listWebhooks({ pageSize, pageToken, status, }: {
137
+ /**
138
+ * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
139
+ */
140
+ pageSize?: number;
141
+ /**
142
+ * A page token, received from a previous list call. Provide this to retrieve the subsequent page.
143
+ */
144
+ pageToken?: string;
145
+ /**
146
+ * Status of the webhook. Use "active" to return only active webhooks, "inactive" to return only inactive webhooks. Else if no status is provided, all configured webhooks will be returned.
147
+ */
148
+ status?: WebhookStatus;
149
+ }): CancelablePromise<ListWebhooksResponse>;
150
+ /**
151
+ * Deactivate a webhook
152
+ * Deactivates a webhook by ID.
153
+ * @returns WebhookResponse
154
+ * @throws ApiError
155
+ */
156
+ deactivateWebhook({ id, }: {
157
+ /**
158
+ * The webhook identifier.
159
+ */
160
+ id: string;
161
+ }): CancelablePromise<WebhookResponse>;
71
162
  }
72
163
 
73
164
  declare enum CurrencyCode {
@@ -1637,7 +1728,13 @@ declare class EvmTransactionsService {
1637
1728
  * A wallet address.
1638
1729
  */
1639
1730
  address: string;
1731
+ /**
1732
+ * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block.
1733
+ */
1640
1734
  startBlock?: number;
1735
+ /**
1736
+ * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block.
1737
+ */
1641
1738
  endBlock?: number;
1642
1739
  /**
1643
1740
  * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
@@ -1673,7 +1770,13 @@ declare class EvmTransactionsService {
1673
1770
  * A page token, received from a previous list call. Provide this to retrieve the subsequent page.
1674
1771
  */
1675
1772
  pageToken?: string;
1773
+ /**
1774
+ * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block.
1775
+ */
1676
1776
  startBlock?: number;
1777
+ /**
1778
+ * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block.
1779
+ */
1677
1780
  endBlock?: number;
1678
1781
  /**
1679
1782
  * The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided.
@@ -1695,7 +1798,13 @@ declare class EvmTransactionsService {
1695
1798
  * A wallet address.
1696
1799
  */
1697
1800
  address: string;
1801
+ /**
1802
+ * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block.
1803
+ */
1698
1804
  startBlock?: number;
1805
+ /**
1806
+ * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block.
1807
+ */
1699
1808
  endBlock?: number;
1700
1809
  /**
1701
1810
  * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
@@ -1721,7 +1830,13 @@ declare class EvmTransactionsService {
1721
1830
  * A wallet address.
1722
1831
  */
1723
1832
  address: string;
1833
+ /**
1834
+ * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block.
1835
+ */
1724
1836
  startBlock?: number;
1837
+ /**
1838
+ * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block.
1839
+ */
1725
1840
  endBlock?: number;
1726
1841
  /**
1727
1842
  * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
@@ -1747,7 +1862,13 @@ declare class EvmTransactionsService {
1747
1862
  * A wallet address.
1748
1863
  */
1749
1864
  address: string;
1865
+ /**
1866
+ * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block.
1867
+ */
1750
1868
  startBlock?: number;
1869
+ /**
1870
+ * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block.
1871
+ */
1751
1872
  endBlock?: number;
1752
1873
  /**
1753
1874
  * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
@@ -1773,7 +1894,13 @@ declare class EvmTransactionsService {
1773
1894
  * A wallet address.
1774
1895
  */
1775
1896
  address: string;
1897
+ /**
1898
+ * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block.
1899
+ */
1776
1900
  startBlock?: number;
1901
+ /**
1902
+ * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block.
1903
+ */
1777
1904
  endBlock?: number;
1778
1905
  /**
1779
1906
  * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
@@ -1801,7 +1928,13 @@ declare class EvmTransactionsService {
1801
1928
  * A wallet address.
1802
1929
  */
1803
1930
  address: string;
1931
+ /**
1932
+ * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block.
1933
+ */
1804
1934
  startBlock?: number;
1935
+ /**
1936
+ * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block.
1937
+ */
1805
1938
  endBlock?: number;
1806
1939
  /**
1807
1940
  * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
@@ -2846,6 +2979,7 @@ type GetPrimaryNetworkBlockResponse = {
2846
2979
  txCount: number;
2847
2980
  transactions: Array<string>;
2848
2981
  blockSizeBytes: number;
2982
+ currentSupply?: string;
2849
2983
  proposerDetails?: ProposerDetails;
2850
2984
  };
2851
2985
 
@@ -2858,6 +2992,7 @@ type PrimaryNetworkBlock = {
2858
2992
  txCount: number;
2859
2993
  transactions: Array<string>;
2860
2994
  blockSizeBytes: number;
2995
+ currentSupply?: string;
2861
2996
  proposerDetails?: ProposerDetails;
2862
2997
  };
2863
2998
 
@@ -3443,6 +3578,15 @@ type ListPChainTransactionsResponse = {
3443
3578
  chainInfo: PrimaryNetworkChainInfo;
3444
3579
  };
3445
3580
 
3581
+ declare enum XChainTransactionType {
3582
+ BASE_TX = "BaseTx",
3583
+ CREATE_ASSET_TX = "CreateAssetTx",
3584
+ OPERATION_TX = "OperationTx",
3585
+ IMPORT_TX = "ImportTx",
3586
+ EXPORT_TX = "ExportTx",
3587
+ UNKNOWN = "UNKNOWN"
3588
+ }
3589
+
3446
3590
  type XChainLinearTransaction = {
3447
3591
  /**
3448
3592
  * Unique ID for this transaction.
@@ -3459,7 +3603,7 @@ type XChainLinearTransaction = {
3459
3603
  /**
3460
3604
  * Type of transaction.
3461
3605
  */
3462
- txType: string;
3606
+ txType: XChainTransactionType;
3463
3607
  /**
3464
3608
  * Hex encoded memo bytes for this transaction.
3465
3609
  */
@@ -3536,7 +3680,7 @@ type XChainNonLinearTransaction = {
3536
3680
  /**
3537
3681
  * Type of transaction.
3538
3682
  */
3539
- txType: string;
3683
+ txType: XChainTransactionType;
3540
3684
  /**
3541
3685
  * Hex encoded memo bytes for this transaction.
3542
3686
  */
@@ -3971,4 +4115,4 @@ declare class ApiError extends Error {
3971
4115
  constructor(request: ApiRequestOptions, response: ApiResult, message: string);
3972
4116
  }
3973
4117
 
3974
- export { ActiveDelegatorDetails, ActiveValidatorDetails, ApiError, Asset, 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, EVMInput, EVMOutput, Erc1155Contract, Erc1155Token, Erc1155TokenBalance, Erc1155TokenMetadata, Erc1155Transfer, Erc1155TransferDetails, Erc20Contract, Erc20Token, Erc20TokenBalance, Erc20Transfer, Erc20TransferDetails, Erc721Contract, Erc721Token, Erc721TokenBalance, Erc721TokenMetadata, Erc721Transfer, Erc721TransferDetails, EvmBalancesService, EvmBlock, EvmBlocksService, EvmChainsService, EvmContractsService, 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, ListNftTokens, 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, UpdateContractResponse, UtilityAddresses, Utxo, UtxoCredential, UtxoType, ValidationStatusType, ValidatorHealthDetails, ValidatorsDetails, VmName, XChainAssetBalance, XChainAssetDetails, XChainBalances, XChainId, XChainLinearTransaction, XChainNonLinearTransaction, XChainSharedAssetBalance, XChainVertex };
4118
+ export { ActiveDelegatorDetails, ActiveValidatorDetails, AddressActivityMetadata, ApiError, Asset, 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, EVMInput, 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, 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, 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, RegisterWebhookRequest, ResourceLink, ResourceLinkType, RewardType, Rewards, RichAddress, SortOrder, StakingDistribution, Subnet, TransactionDetails, TransactionExportMetadata, TransactionMethodType, TransactionStatus, TransactionVertexDetail, UnknownContract, UpdateContractResponse, UtilityAddresses, Utxo, UtxoCredential, UtxoType, ValidationStatusType, ValidatorHealthDetails, ValidatorsDetails, VmName, WebhookResponse, WebhookStatus, WebhookStatusType, XChainAssetBalance, XChainAssetDetails, XChainBalances, XChainId, XChainLinearTransaction, XChainNonLinearTransaction, XChainSharedAssetBalance, XChainTransactionType, XChainVertex };
package/dist/index.js CHANGED
@@ -355,6 +355,42 @@ class DefaultService {
355
355
  url: "/v1/media/uploadImage"
356
356
  });
357
357
  }
358
+ registerWebhook({
359
+ requestBody
360
+ }) {
361
+ return this.httpRequest.request({
362
+ method: "POST",
363
+ url: "/v1/webhooks",
364
+ body: requestBody,
365
+ mediaType: "application/json"
366
+ });
367
+ }
368
+ listWebhooks({
369
+ pageSize = 10,
370
+ pageToken,
371
+ status
372
+ }) {
373
+ return this.httpRequest.request({
374
+ method: "GET",
375
+ url: "/v1/webhooks",
376
+ query: {
377
+ "pageSize": pageSize,
378
+ "pageToken": pageToken,
379
+ "status": status
380
+ }
381
+ });
382
+ }
383
+ deactivateWebhook({
384
+ id
385
+ }) {
386
+ return this.httpRequest.request({
387
+ method: "DELETE",
388
+ url: "/v1/webhooks/{id}",
389
+ path: {
390
+ "id": id
391
+ }
392
+ });
393
+ }
358
394
  }
359
395
 
360
396
  class EvmBalancesService {
@@ -1688,6 +1724,11 @@ exports.Erc721TokenBalance = void 0;
1688
1724
  })(Erc721TokenBalance2.ercType || (Erc721TokenBalance2.ercType = {}));
1689
1725
  })(exports.Erc721TokenBalance || (exports.Erc721TokenBalance = {}));
1690
1726
 
1727
+ var EventType = /* @__PURE__ */ ((EventType2) => {
1728
+ EventType2["ADDRESS_ACTIVITY"] = "address_activity";
1729
+ return EventType2;
1730
+ })(EventType || {});
1731
+
1691
1732
  var InternalTransactionOpCall = /* @__PURE__ */ ((InternalTransactionOpCall2) => {
1692
1733
  InternalTransactionOpCall2["UNKNOWN"] = "UNKNOWN";
1693
1734
  InternalTransactionOpCall2["CALL"] = "CALL";
@@ -1892,6 +1933,18 @@ var VmName = /* @__PURE__ */ ((VmName2) => {
1892
1933
  return VmName2;
1893
1934
  })(VmName || {});
1894
1935
 
1936
+ var WebhookStatus = /* @__PURE__ */ ((WebhookStatus2) => {
1937
+ WebhookStatus2["ACTIVE"] = "active";
1938
+ WebhookStatus2["INACTIVE"] = "inactive";
1939
+ return WebhookStatus2;
1940
+ })(WebhookStatus || {});
1941
+
1942
+ var WebhookStatusType = /* @__PURE__ */ ((WebhookStatusType2) => {
1943
+ WebhookStatusType2["ACTIVE"] = "active";
1944
+ WebhookStatusType2["INACTIVE"] = "inactive";
1945
+ return WebhookStatusType2;
1946
+ })(WebhookStatusType || {});
1947
+
1895
1948
  var XChainId = /* @__PURE__ */ ((XChainId2) => {
1896
1949
  XChainId2["_2O_YMBNV4E_NHYQK2FJJ_V5N_VQLDBTM_NJZQ5S3QS3LO6FTN_C6FBY_M"] = "2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM";
1897
1950
  XChainId2["_2JVSBOINJ9C2J33VNTVZ_YT_VJNZD_N2NKIWW_KJCUM_HUWEB5DB_BRM"] = "2JVSBoinj9C2J33VntvzYtVJNZdN2NKiwwKjcumHUWEb5DbBrm";
@@ -1915,6 +1968,16 @@ exports.XChainNonLinearTransaction = void 0;
1915
1968
  })(XChainNonLinearTransaction2.chainFormat || (XChainNonLinearTransaction2.chainFormat = {}));
1916
1969
  })(exports.XChainNonLinearTransaction || (exports.XChainNonLinearTransaction = {}));
1917
1970
 
1971
+ var XChainTransactionType = /* @__PURE__ */ ((XChainTransactionType2) => {
1972
+ XChainTransactionType2["BASE_TX"] = "BaseTx";
1973
+ XChainTransactionType2["CREATE_ASSET_TX"] = "CreateAssetTx";
1974
+ XChainTransactionType2["OPERATION_TX"] = "OperationTx";
1975
+ XChainTransactionType2["IMPORT_TX"] = "ImportTx";
1976
+ XChainTransactionType2["EXPORT_TX"] = "ExportTx";
1977
+ XChainTransactionType2["UNKNOWN"] = "UNKNOWN";
1978
+ return XChainTransactionType2;
1979
+ })(XChainTransactionType || {});
1980
+
1918
1981
  exports.ApiError = ApiError;
1919
1982
  exports.BaseHttpRequest = BaseHttpRequest;
1920
1983
  exports.BlockchainId = BlockchainId;
@@ -1925,6 +1988,7 @@ exports.ChainStatus = ChainStatus;
1925
1988
  exports.CurrencyCode = CurrencyCode;
1926
1989
  exports.DefaultService = DefaultService;
1927
1990
  exports.DelegationStatusType = DelegationStatusType;
1991
+ exports.EventType = EventType;
1928
1992
  exports.EvmBalancesService = EvmBalancesService;
1929
1993
  exports.EvmBlocksService = EvmBlocksService;
1930
1994
  exports.EvmChainsService = EvmChainsService;
@@ -1962,4 +2026,7 @@ exports.TransactionStatus = TransactionStatus;
1962
2026
  exports.UtxoType = UtxoType;
1963
2027
  exports.ValidationStatusType = ValidationStatusType;
1964
2028
  exports.VmName = VmName;
2029
+ exports.WebhookStatus = WebhookStatus;
2030
+ exports.WebhookStatusType = WebhookStatusType;
1965
2031
  exports.XChainId = XChainId;
2032
+ exports.XChainTransactionType = XChainTransactionType;
@@ -0,0 +1,9 @@
1
+ type AddressActivityMetadata = {
2
+ /**
3
+ * Ethereum address for the address_activity event type
4
+ */
5
+ address: string;
6
+ topic0?: string;
7
+ };
8
+
9
+ export { AddressActivityMetadata };
@@ -0,0 +1,5 @@
1
+ declare enum EventType {
2
+ ADDRESS_ACTIVITY = "address_activity"
3
+ }
4
+
5
+ export { EventType };
@@ -0,0 +1,6 @@
1
+ var EventType = /* @__PURE__ */ ((EventType2) => {
2
+ EventType2["ADDRESS_ACTIVITY"] = "address_activity";
3
+ return EventType2;
4
+ })(EventType || {});
5
+
6
+ export { EventType };
@@ -9,6 +9,7 @@ type GetPrimaryNetworkBlockResponse = {
9
9
  txCount: number;
10
10
  transactions: Array<string>;
11
11
  blockSizeBytes: number;
12
+ currentSupply?: string;
12
13
  proposerDetails?: ProposerDetails;
13
14
  };
14
15
 
@@ -0,0 +1,11 @@
1
+ import { WebhookResponse } from './WebhookResponse.js';
2
+
3
+ type ListWebhooksResponse = {
4
+ /**
5
+ * A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages.
6
+ */
7
+ nextPageToken?: string;
8
+ webhooks: Array<WebhookResponse>;
9
+ };
10
+
11
+ export { ListWebhooksResponse };
@@ -9,6 +9,7 @@ type PrimaryNetworkBlock = {
9
9
  txCount: number;
10
10
  transactions: Array<string>;
11
11
  blockSizeBytes: number;
12
+ currentSupply?: string;
12
13
  proposerDetails?: ProposerDetails;
13
14
  };
14
15
 
@@ -0,0 +1,14 @@
1
+ import { AddressActivityMetadata } from './AddressActivityMetadata.js';
2
+ import { EventType } from './EventType.js';
3
+
4
+ type RegisterWebhookRequest = {
5
+ url: string;
6
+ chainId: string;
7
+ /**
8
+ * The type of event for the webhook
9
+ */
10
+ eventType: EventType;
11
+ metadata: AddressActivityMetadata;
12
+ };
13
+
14
+ export { RegisterWebhookRequest };
@@ -0,0 +1,15 @@
1
+ import { AddressActivityMetadata } from './AddressActivityMetadata.js';
2
+ import { EventType } from './EventType.js';
3
+ import { WebhookStatusType } from './WebhookStatusType.js';
4
+
5
+ type WebhookResponse = {
6
+ id: string;
7
+ eventType: EventType;
8
+ metadata: AddressActivityMetadata;
9
+ url: string;
10
+ chainId: string;
11
+ status: WebhookStatusType;
12
+ createdAt: number;
13
+ };
14
+
15
+ export { WebhookResponse };
@@ -0,0 +1,6 @@
1
+ declare enum WebhookStatus {
2
+ ACTIVE = "active",
3
+ INACTIVE = "inactive"
4
+ }
5
+
6
+ export { WebhookStatus };
@@ -0,0 +1,7 @@
1
+ var WebhookStatus = /* @__PURE__ */ ((WebhookStatus2) => {
2
+ WebhookStatus2["ACTIVE"] = "active";
3
+ WebhookStatus2["INACTIVE"] = "inactive";
4
+ return WebhookStatus2;
5
+ })(WebhookStatus || {});
6
+
7
+ export { WebhookStatus };
@@ -0,0 +1,6 @@
1
+ declare enum WebhookStatusType {
2
+ ACTIVE = "active",
3
+ INACTIVE = "inactive"
4
+ }
5
+
6
+ export { WebhookStatusType };
@@ -0,0 +1,7 @@
1
+ var WebhookStatusType = /* @__PURE__ */ ((WebhookStatusType2) => {
2
+ WebhookStatusType2["ACTIVE"] = "active";
3
+ WebhookStatusType2["INACTIVE"] = "inactive";
4
+ return WebhookStatusType2;
5
+ })(WebhookStatusType || {});
6
+
7
+ export { WebhookStatusType };
@@ -1,6 +1,7 @@
1
1
  import { Asset } from './Asset.js';
2
2
  import { Utxo } from './Utxo.js';
3
3
  import { XChainAssetDetails } from './XChainAssetDetails.js';
4
+ import { XChainTransactionType } from './XChainTransactionType.js';
4
5
 
5
6
  type XChainLinearTransaction = {
6
7
  /**
@@ -18,7 +19,7 @@ type XChainLinearTransaction = {
18
19
  /**
19
20
  * Type of transaction.
20
21
  */
21
- txType: string;
22
+ txType: XChainTransactionType;
22
23
  /**
23
24
  * Hex encoded memo bytes for this transaction.
24
25
  */
@@ -2,6 +2,7 @@ import { Asset } from './Asset.js';
2
2
  import { TransactionVertexDetail } from './TransactionVertexDetail.js';
3
3
  import { Utxo } from './Utxo.js';
4
4
  import { XChainAssetDetails } from './XChainAssetDetails.js';
5
+ import { XChainTransactionType } from './XChainTransactionType.js';
5
6
 
6
7
  type XChainNonLinearTransaction = {
7
8
  /**
@@ -19,7 +20,7 @@ type XChainNonLinearTransaction = {
19
20
  /**
20
21
  * Type of transaction.
21
22
  */
22
- txType: string;
23
+ txType: XChainTransactionType;
23
24
  /**
24
25
  * Hex encoded memo bytes for this transaction.
25
26
  */
@@ -0,0 +1,10 @@
1
+ declare enum XChainTransactionType {
2
+ BASE_TX = "BaseTx",
3
+ CREATE_ASSET_TX = "CreateAssetTx",
4
+ OPERATION_TX = "OperationTx",
5
+ IMPORT_TX = "ImportTx",
6
+ EXPORT_TX = "ExportTx",
7
+ UNKNOWN = "UNKNOWN"
8
+ }
9
+
10
+ export { XChainTransactionType };
@@ -0,0 +1,11 @@
1
+ var XChainTransactionType = /* @__PURE__ */ ((XChainTransactionType2) => {
2
+ XChainTransactionType2["BASE_TX"] = "BaseTx";
3
+ XChainTransactionType2["CREATE_ASSET_TX"] = "CreateAssetTx";
4
+ XChainTransactionType2["OPERATION_TX"] = "OperationTx";
5
+ XChainTransactionType2["IMPORT_TX"] = "ImportTx";
6
+ XChainTransactionType2["EXPORT_TX"] = "ExportTx";
7
+ XChainTransactionType2["UNKNOWN"] = "UNKNOWN";
8
+ return XChainTransactionType2;
9
+ })(XChainTransactionType || {});
10
+
11
+ export { XChainTransactionType };
@@ -1,3 +1,7 @@
1
+ import { ListWebhooksResponse } from '../models/ListWebhooksResponse.js';
2
+ import { RegisterWebhookRequest } from '../models/RegisterWebhookRequest.js';
3
+ import { WebhookResponse } from '../models/WebhookResponse.js';
4
+ import { WebhookStatus } from '../models/WebhookStatus.js';
1
5
  import { CancelablePromise } from '../core/CancelablePromise.js';
2
6
  import { BaseHttpRequest } from '../core/BaseHttpRequest.js';
3
7
 
@@ -9,6 +13,47 @@ declare class DefaultService {
9
13
  * @throws ApiError
10
14
  */
11
15
  mediaControllerUploadImage(): CancelablePromise<any>;
16
+ /**
17
+ * Register a webhook
18
+ * Registers a new webhook.
19
+ * @returns WebhookResponse
20
+ * @throws ApiError
21
+ */
22
+ registerWebhook({ requestBody, }: {
23
+ requestBody: RegisterWebhookRequest;
24
+ }): CancelablePromise<WebhookResponse>;
25
+ /**
26
+ * List webhooks
27
+ * Lists webhooks for the user.
28
+ * @returns ListWebhooksResponse
29
+ * @throws ApiError
30
+ */
31
+ listWebhooks({ pageSize, pageToken, status, }: {
32
+ /**
33
+ * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
34
+ */
35
+ pageSize?: number;
36
+ /**
37
+ * A page token, received from a previous list call. Provide this to retrieve the subsequent page.
38
+ */
39
+ pageToken?: string;
40
+ /**
41
+ * Status of the webhook. Use "active" to return only active webhooks, "inactive" to return only inactive webhooks. Else if no status is provided, all configured webhooks will be returned.
42
+ */
43
+ status?: WebhookStatus;
44
+ }): CancelablePromise<ListWebhooksResponse>;
45
+ /**
46
+ * Deactivate a webhook
47
+ * Deactivates a webhook by ID.
48
+ * @returns WebhookResponse
49
+ * @throws ApiError
50
+ */
51
+ deactivateWebhook({ id, }: {
52
+ /**
53
+ * The webhook identifier.
54
+ */
55
+ id: string;
56
+ }): CancelablePromise<WebhookResponse>;
12
57
  }
13
58
 
14
59
  export { DefaultService };
@@ -8,6 +8,42 @@ class DefaultService {
8
8
  url: "/v1/media/uploadImage"
9
9
  });
10
10
  }
11
+ registerWebhook({
12
+ requestBody
13
+ }) {
14
+ return this.httpRequest.request({
15
+ method: "POST",
16
+ url: "/v1/webhooks",
17
+ body: requestBody,
18
+ mediaType: "application/json"
19
+ });
20
+ }
21
+ listWebhooks({
22
+ pageSize = 10,
23
+ pageToken,
24
+ status
25
+ }) {
26
+ return this.httpRequest.request({
27
+ method: "GET",
28
+ url: "/v1/webhooks",
29
+ query: {
30
+ "pageSize": pageSize,
31
+ "pageToken": pageToken,
32
+ "status": status
33
+ }
34
+ });
35
+ }
36
+ deactivateWebhook({
37
+ id
38
+ }) {
39
+ return this.httpRequest.request({
40
+ method: "DELETE",
41
+ url: "/v1/webhooks/{id}",
42
+ path: {
43
+ "id": id
44
+ }
45
+ });
46
+ }
11
47
  }
12
48
 
13
49
  export { DefaultService };
@@ -75,7 +75,13 @@ declare class EvmTransactionsService {
75
75
  * A wallet address.
76
76
  */
77
77
  address: string;
78
+ /**
79
+ * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block.
80
+ */
78
81
  startBlock?: number;
82
+ /**
83
+ * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block.
84
+ */
79
85
  endBlock?: number;
80
86
  /**
81
87
  * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
@@ -111,7 +117,13 @@ declare class EvmTransactionsService {
111
117
  * A page token, received from a previous list call. Provide this to retrieve the subsequent page.
112
118
  */
113
119
  pageToken?: string;
120
+ /**
121
+ * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block.
122
+ */
114
123
  startBlock?: number;
124
+ /**
125
+ * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block.
126
+ */
115
127
  endBlock?: number;
116
128
  /**
117
129
  * The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided.
@@ -133,7 +145,13 @@ declare class EvmTransactionsService {
133
145
  * A wallet address.
134
146
  */
135
147
  address: string;
148
+ /**
149
+ * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block.
150
+ */
136
151
  startBlock?: number;
152
+ /**
153
+ * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block.
154
+ */
137
155
  endBlock?: number;
138
156
  /**
139
157
  * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
@@ -159,7 +177,13 @@ declare class EvmTransactionsService {
159
177
  * A wallet address.
160
178
  */
161
179
  address: string;
180
+ /**
181
+ * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block.
182
+ */
162
183
  startBlock?: number;
184
+ /**
185
+ * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block.
186
+ */
163
187
  endBlock?: number;
164
188
  /**
165
189
  * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
@@ -185,7 +209,13 @@ declare class EvmTransactionsService {
185
209
  * A wallet address.
186
210
  */
187
211
  address: string;
212
+ /**
213
+ * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block.
214
+ */
188
215
  startBlock?: number;
216
+ /**
217
+ * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block.
218
+ */
189
219
  endBlock?: number;
190
220
  /**
191
221
  * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
@@ -211,7 +241,13 @@ declare class EvmTransactionsService {
211
241
  * A wallet address.
212
242
  */
213
243
  address: string;
244
+ /**
245
+ * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block.
246
+ */
214
247
  startBlock?: number;
248
+ /**
249
+ * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block.
250
+ */
215
251
  endBlock?: number;
216
252
  /**
217
253
  * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
@@ -239,7 +275,13 @@ declare class EvmTransactionsService {
239
275
  * A wallet address.
240
276
  */
241
277
  address: string;
278
+ /**
279
+ * The block range start number, inclusive. If endBlock is not defined when startBlock is defined, the end of the range will be the most recent block.
280
+ */
242
281
  startBlock?: number;
282
+ /**
283
+ * The block range end number, exclusive. If startBlock is not defined when endBlock is defined, the start of the range will be the genesis block.
284
+ */
243
285
  endBlock?: number;
244
286
  /**
245
287
  * The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
package/esm/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export { CancelError, CancelablePromise } from './generated/core/CancelablePromi
5
5
  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
+ export { AddressActivityMetadata } from './generated/models/AddressActivityMetadata.js';
8
9
  export { Asset } from './generated/models/Asset.js';
9
10
  export { Blockchain } from './generated/models/Blockchain.js';
10
11
  export { BlockchainId } from './generated/models/BlockchainId.js';
@@ -48,6 +49,7 @@ export { Erc721TokenBalance } from './generated/models/Erc721TokenBalance.js';
48
49
  export { Erc721TokenMetadata } from './generated/models/Erc721TokenMetadata.js';
49
50
  export { Erc721Transfer } from './generated/models/Erc721Transfer.js';
50
51
  export { Erc721TransferDetails } from './generated/models/Erc721TransferDetails.js';
52
+ export { EventType } from './generated/models/EventType.js';
51
53
  export { EvmBlock } from './generated/models/EvmBlock.js';
52
54
  export { EVMInput } from './generated/models/EVMInput.js';
53
55
  export { EvmNetworkOptions } from './generated/models/EvmNetworkOptions.js';
@@ -92,6 +94,7 @@ export { ListTransactionDetailsResponse } from './generated/models/ListTransacti
92
94
  export { ListTransfersResponse } from './generated/models/ListTransfersResponse.js';
93
95
  export { ListUtxosResponse } from './generated/models/ListUtxosResponse.js';
94
96
  export { ListValidatorDetailsResponse } from './generated/models/ListValidatorDetailsResponse.js';
97
+ export { ListWebhooksResponse } from './generated/models/ListWebhooksResponse.js';
95
98
  export { ListXChainBalancesResponse } from './generated/models/ListXChainBalancesResponse.js';
96
99
  export { ListXChainTransactionsResponse } from './generated/models/ListXChainTransactionsResponse.js';
97
100
  export { ListXChainVerticesResponse } from './generated/models/ListXChainVerticesResponse.js';
@@ -126,6 +129,7 @@ export { PrimaryNetworkChainName } from './generated/models/PrimaryNetworkChainN
126
129
  export { PrimaryNetworkOptions } from './generated/models/PrimaryNetworkOptions.js';
127
130
  export { PrimaryNetworkTxType } from './generated/models/PrimaryNetworkTxType.js';
128
131
  export { ProposerDetails } from './generated/models/ProposerDetails.js';
132
+ export { RegisterWebhookRequest } from './generated/models/RegisterWebhookRequest.js';
129
133
  export { ResourceLink } from './generated/models/ResourceLink.js';
130
134
  export { ResourceLinkType } from './generated/models/ResourceLinkType.js';
131
135
  export { Rewards } from './generated/models/Rewards.js';
@@ -149,6 +153,9 @@ export { ValidationStatusType } from './generated/models/ValidationStatusType.js
149
153
  export { ValidatorHealthDetails } from './generated/models/ValidatorHealthDetails.js';
150
154
  export { ValidatorsDetails } from './generated/models/ValidatorsDetails.js';
151
155
  export { VmName } from './generated/models/VmName.js';
156
+ export { WebhookResponse } from './generated/models/WebhookResponse.js';
157
+ export { WebhookStatus } from './generated/models/WebhookStatus.js';
158
+ export { WebhookStatusType } from './generated/models/WebhookStatusType.js';
152
159
  export { XChainAssetBalance } from './generated/models/XChainAssetBalance.js';
153
160
  export { XChainAssetDetails } from './generated/models/XChainAssetDetails.js';
154
161
  export { XChainBalances } from './generated/models/XChainBalances.js';
@@ -156,6 +163,7 @@ export { XChainId } from './generated/models/XChainId.js';
156
163
  export { XChainLinearTransaction } from './generated/models/XChainLinearTransaction.js';
157
164
  export { XChainNonLinearTransaction } from './generated/models/XChainNonLinearTransaction.js';
158
165
  export { XChainSharedAssetBalance } from './generated/models/XChainSharedAssetBalance.js';
166
+ export { XChainTransactionType } from './generated/models/XChainTransactionType.js';
159
167
  export { XChainVertex } from './generated/models/XChainVertex.js';
160
168
  export { DefaultService } from './generated/services/DefaultService.js';
161
169
  export { EvmBalancesService } from './generated/services/EvmBalancesService.js';
package/esm/index.js CHANGED
@@ -29,6 +29,7 @@ export { Erc20TokenBalance } from './generated/models/Erc20TokenBalance.js';
29
29
  export { Erc721Contract } from './generated/models/Erc721Contract.js';
30
30
  export { Erc721Token } from './generated/models/Erc721Token.js';
31
31
  export { Erc721TokenBalance } from './generated/models/Erc721TokenBalance.js';
32
+ export { EventType } from './generated/models/EventType.js';
32
33
  export { InternalTransactionOpCall } from './generated/models/InternalTransactionOpCall.js';
33
34
  export { Network } from './generated/models/Network.js';
34
35
  export { NetworkType } from './generated/models/NetworkType.js';
@@ -52,9 +53,12 @@ export { UnknownContract } from './generated/models/UnknownContract.js';
52
53
  export { UtxoType } from './generated/models/UtxoType.js';
53
54
  export { ValidationStatusType } from './generated/models/ValidationStatusType.js';
54
55
  export { VmName } from './generated/models/VmName.js';
56
+ export { WebhookStatus } from './generated/models/WebhookStatus.js';
57
+ export { WebhookStatusType } from './generated/models/WebhookStatusType.js';
55
58
  export { XChainId } from './generated/models/XChainId.js';
56
59
  export { XChainLinearTransaction } from './generated/models/XChainLinearTransaction.js';
57
60
  export { XChainNonLinearTransaction } from './generated/models/XChainNonLinearTransaction.js';
61
+ export { XChainTransactionType } from './generated/models/XChainTransactionType.js';
58
62
  export { DefaultService } from './generated/services/DefaultService.js';
59
63
  export { EvmBalancesService } from './generated/services/EvmBalancesService.js';
60
64
  export { EvmBlocksService } from './generated/services/EvmBlocksService.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avalabs/glacier-sdk",
3
- "version": "2.8.0-alpha.150",
3
+ "version": "2.8.0-alpha.151",
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": "59e3f86499cb455a7a3676f89c4f6035541ec973"
32
+ "gitHead": "f158777b928d4073f347269615449fc464d080bb"
33
33
  }