@avalabs/glacier-sdk 2.8.0-alpha.6 → 2.8.0-alpha.60

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
@@ -1,3 +1,491 @@
1
- export * from './src/generated/models';
2
- export * from './src/glacierClient';
3
- //# sourceMappingURL=index.d.ts.map
1
+ import { HttpOptions } from '@avalabs/utils-sdk';
2
+
3
+ declare enum CurrencyCode {
4
+ Usd = "usd",
5
+ Eur = "eur",
6
+ Aud = "aud",
7
+ Cad = "cad",
8
+ Chf = "chf",
9
+ Clp = "clp",
10
+ Czk = "czk",
11
+ Dkk = "dkk",
12
+ Gbp = "gbp",
13
+ Hkd = "hkd",
14
+ Huf = "huf"
15
+ }
16
+ interface Money {
17
+ /**
18
+ * ISO 4217 currency code.
19
+ * @example usd
20
+ */
21
+ currencyCode: CurrencyCode;
22
+ /**
23
+ * Monetary value in base 10 decimals.
24
+ * @example 42.42
25
+ */
26
+ value: number;
27
+ }
28
+ interface NativeTokenBalance {
29
+ name: string;
30
+ symbol: string;
31
+ decimals: number;
32
+ logoUri?: string;
33
+ chainId: string;
34
+ price?: Money;
35
+ balance: string;
36
+ balanceValue?: Money;
37
+ }
38
+ interface NativeBalance {
39
+ nativeTokenBalance: NativeTokenBalance;
40
+ }
41
+ interface Erc20TokenBalance {
42
+ /** @example 0x71C7656EC7ab88b098defB751B7401B5f6d8976F */
43
+ address: string;
44
+ name: string;
45
+ symbol: string;
46
+ decimals: number;
47
+ logoUri?: string;
48
+ price?: Money;
49
+ chainId: string;
50
+ balance: string;
51
+ balanceValue?: Money;
52
+ }
53
+ interface Erc20Balances {
54
+ /** 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. */
55
+ nextPageToken?: string;
56
+ erc20TokenBalances: Erc20TokenBalance[];
57
+ }
58
+ declare enum Erc721MetadataStatus {
59
+ UNKNOWN = "UNKNOWN",
60
+ MISSING_TOKEN = "MISSING_TOKEN",
61
+ INVALID_TOKEN_URI = "INVALID_TOKEN_URI",
62
+ INVALID_TOKEN_URI_SCHEME = "INVALID_TOKEN_URI_SCHEME",
63
+ UNREACHABLE_TOKEN_URI = "UNREACHABLE_TOKEN_URI",
64
+ THROTTLED_TOKEN_URI = "THROTTLED_TOKEN_URI",
65
+ METADATA_CONTENT_TOO_LARGE = "METADATA_CONTENT_TOO_LARGE",
66
+ INVALID_METADATA = "INVALID_METADATA",
67
+ INVALID_METADATA_JSON = "INVALID_METADATA_JSON",
68
+ INDEXED = "INDEXED",
69
+ UNINDEXED = "UNINDEXED"
70
+ }
71
+ interface Erc721Metadata {
72
+ /**
73
+ * The metadata indexing status of the nft.
74
+ * @example indexed
75
+ */
76
+ indexStatus: Erc721MetadataStatus;
77
+ metadataLastUpdatedTimestamp?: number;
78
+ name?: string;
79
+ symbol?: string;
80
+ imageUri?: string;
81
+ description?: string;
82
+ animationUri?: string;
83
+ externalUrl?: string;
84
+ background?: string;
85
+ attributes?: string;
86
+ }
87
+ interface Erc721TokenBalance {
88
+ /** @example 0x71C7656EC7ab88b098defB751B7401B5f6d8976F */
89
+ address: string;
90
+ name: string;
91
+ symbol: string;
92
+ tokenId: string;
93
+ tokenUri: string;
94
+ metadata: Erc721Metadata;
95
+ chainId: string;
96
+ }
97
+ interface Erc721Balances {
98
+ /** 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. */
99
+ nextPageToken?: string;
100
+ erc721TokenBalances: Erc721TokenBalance[];
101
+ }
102
+ interface Block {
103
+ /**
104
+ * The block number on the chain.
105
+ * @example 339
106
+ */
107
+ blockNumber: string;
108
+ /**
109
+ * The block finality timestamp.
110
+ * @example 1648672486
111
+ */
112
+ blockTimestamp: number;
113
+ /**
114
+ * The block hash identifier.
115
+ * @example 0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c
116
+ */
117
+ blockHash: string;
118
+ /** The number of transactions in the block. */
119
+ txCount: number;
120
+ /** The base gas fee for a transaction to be included in the block. */
121
+ baseFee: string;
122
+ /** The gas used for transactions in the block. */
123
+ gasUsed: string;
124
+ /** The total gas limit set for transactions in the block. */
125
+ gasLimit: string;
126
+ gasCost: string;
127
+ /** The hash of the parent block. */
128
+ parentHash: string;
129
+ /** The amount of fees spent/burned for transactions in the block. */
130
+ feesSpent: string;
131
+ /** The cumulative number of transactions for the chain including this block. */
132
+ cumulativeTransactions: string;
133
+ }
134
+ interface ListBlocks {
135
+ /** 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. */
136
+ nextPageToken?: string;
137
+ blocks: Block[];
138
+ }
139
+ interface ListTransfers {
140
+ /** 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. */
141
+ nextPageToken?: string;
142
+ transfers: Erc20Transfer[] | Erc721Transfer[];
143
+ }
144
+ interface RichAddress {
145
+ name?: string;
146
+ symbol?: string;
147
+ decimals?: number;
148
+ logoUri?: string;
149
+ /** @example 0x71C7656EC7ab88b098defB751B7401B5f6d8976F */
150
+ address: string;
151
+ }
152
+ interface Method {
153
+ /**
154
+ * The contract method hash identifier.
155
+ * @example 0xa9059cbb
156
+ */
157
+ methodHash: string;
158
+ /**
159
+ * The contract method name including parameter types.
160
+ * @example transfer(address,uint256)
161
+ */
162
+ methodName?: string;
163
+ }
164
+ interface NativeTransaction {
165
+ /**
166
+ * The block number on the chain.
167
+ * @example 339
168
+ */
169
+ blockNumber: string;
170
+ /**
171
+ * The block finality timestamp.
172
+ * @example 1648672486
173
+ */
174
+ blockTimestamp: number;
175
+ /**
176
+ * The block hash identifier.
177
+ * @example 0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c
178
+ */
179
+ blockHash: string;
180
+ /**
181
+ * The index at which the transaction occured in the block (0-indexed).
182
+ * @example 0
183
+ */
184
+ blockIndex: number;
185
+ /**
186
+ * The transaction hash identifier.
187
+ * @example 0x3e9303f81be00b4af28515dab7b914bf3dbff209ea10e7071fa24d4af0a112d4
188
+ */
189
+ txHash: string;
190
+ /**
191
+ * The transaction status, which is either 0 (failed) or 1 (successful).
192
+ * @example 1
193
+ */
194
+ txStatus: string;
195
+ /**
196
+ * The transaction type.
197
+ * @example 1
198
+ */
199
+ txType: number;
200
+ /**
201
+ * The gas limit set for the transaction.
202
+ * @example 51373
203
+ */
204
+ gasLimit: string;
205
+ /**
206
+ * The amount of gas used.
207
+ * @example 51373
208
+ */
209
+ gasUsed: string;
210
+ /**
211
+ * The gas price denominated by the number of decimals of the native token.
212
+ * @example 470000000000
213
+ */
214
+ gasPrice: string;
215
+ /**
216
+ * The nonce used by the sender of the transaction.
217
+ * @example 1
218
+ */
219
+ nonce: string;
220
+ from: RichAddress;
221
+ to: RichAddress;
222
+ method?: Method;
223
+ /** @example 10000000000000000000 */
224
+ value: string;
225
+ }
226
+ interface Erc20Token {
227
+ /** @example 0x71C7656EC7ab88b098defB751B7401B5f6d8976F */
228
+ address: string;
229
+ name: string;
230
+ symbol: string;
231
+ decimals: number;
232
+ logoUri?: string;
233
+ price?: Money;
234
+ }
235
+ interface Erc20TransferDetails {
236
+ from: RichAddress;
237
+ to: RichAddress;
238
+ erc20Token: Erc20Token;
239
+ /** @example 10000000000000000000 */
240
+ value: string;
241
+ }
242
+ interface Erc721Token {
243
+ /** @example 0x71C7656EC7ab88b098defB751B7401B5f6d8976F */
244
+ address: string;
245
+ name: string;
246
+ symbol: string;
247
+ tokenId: string;
248
+ tokenUri: string;
249
+ metadata: Erc721Metadata;
250
+ }
251
+ interface Erc721TransferDetails {
252
+ from: RichAddress;
253
+ to: RichAddress;
254
+ erc721Token: Erc721Token;
255
+ }
256
+ declare enum InternalTransactionOpCall {
257
+ UNKNOWN = "UNKNOWN",
258
+ CALL = "CALL",
259
+ CREATE = "CREATE",
260
+ CREATE2 = "CREATE2",
261
+ CALLCODE = "CALLCODE",
262
+ DELEGATECALL = "DELEGATECALL",
263
+ STATICCALL = "STATICCALL"
264
+ }
265
+ interface InternalTransactionDetails {
266
+ from: RichAddress;
267
+ to: RichAddress;
268
+ internalTxType: InternalTransactionOpCall;
269
+ /** @example 10000000000000000000 */
270
+ value: string;
271
+ isReverted: boolean;
272
+ }
273
+ interface TransactionDetails {
274
+ nativeTransaction: NativeTransaction;
275
+ erc20Transfers?: Erc20TransferDetails[];
276
+ erc721Transfers?: Erc721TransferDetails[];
277
+ internalTransactions?: InternalTransactionDetails[];
278
+ }
279
+ interface ListTransactionDetails {
280
+ /** 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. */
281
+ nextPageToken?: string;
282
+ transactions: TransactionDetails[];
283
+ }
284
+ interface ListNativeTransactions {
285
+ /** 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. */
286
+ nextPageToken?: string;
287
+ transactions: NativeTransaction[];
288
+ }
289
+ interface Erc20Transfer {
290
+ /**
291
+ * The block number on the chain.
292
+ * @example 339
293
+ */
294
+ blockNumber: string;
295
+ /**
296
+ * The block finality timestamp.
297
+ * @example 1648672486
298
+ */
299
+ blockTimestamp: number;
300
+ /**
301
+ * The transaction hash identifier.
302
+ * @example 0x3e9303f81be00b4af28515dab7b914bf3dbff209ea10e7071fa24d4af0a112d4
303
+ */
304
+ txHash: string;
305
+ from: RichAddress;
306
+ to: RichAddress;
307
+ erc20Token: Erc20Token;
308
+ /** @example 10000000000000000000 */
309
+ value: string;
310
+ }
311
+ interface ListErc20Transactions {
312
+ /** 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. */
313
+ nextPageToken?: string;
314
+ transactions: Erc20Transfer[];
315
+ }
316
+ interface Erc721Transfer {
317
+ /**
318
+ * The block number on the chain.
319
+ * @example 339
320
+ */
321
+ blockNumber: string;
322
+ /**
323
+ * The block finality timestamp.
324
+ * @example 1648672486
325
+ */
326
+ blockTimestamp: number;
327
+ /**
328
+ * The transaction hash identifier.
329
+ * @example 0x3e9303f81be00b4af28515dab7b914bf3dbff209ea10e7071fa24d4af0a112d4
330
+ */
331
+ txHash: string;
332
+ from: RichAddress;
333
+ to: RichAddress;
334
+ erc721Token: Erc721Token;
335
+ }
336
+ interface ListErc721Transactions {
337
+ /** 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. */
338
+ nextPageToken?: string;
339
+ transactions: Erc721Transfer[];
340
+ }
341
+ interface NetworkToken {
342
+ name: string;
343
+ symbol: string;
344
+ decimals: number;
345
+ logoUri?: string;
346
+ description?: string;
347
+ }
348
+ interface NetworkTokenDetails {
349
+ networkToken: NetworkToken;
350
+ currentPrice?: Money;
351
+ historicalPrice?: Money;
352
+ }
353
+ interface FullTransactionDetails {
354
+ nativeTransaction: NativeTransaction;
355
+ erc20Transfers?: Erc20TransferDetails[];
356
+ erc721Transfers?: Erc721TransferDetails[];
357
+ internalTransactions?: InternalTransactionDetails[];
358
+ networkTokenDetails: NetworkTokenDetails;
359
+ }
360
+ declare enum VmName {
361
+ EVM = "EVM",
362
+ BITCOIN = "BITCOIN",
363
+ ETHEREUM = "ETHEREUM"
364
+ }
365
+ interface UtilityAddresses {
366
+ multicall?: string;
367
+ }
368
+ interface ChainInfo {
369
+ chainId: string;
370
+ chainName: string;
371
+ description: string;
372
+ platformChainId?: string;
373
+ subnetId?: string;
374
+ vmId?: string;
375
+ vmName: VmName;
376
+ explorerUrl?: string;
377
+ rpcUrl: string;
378
+ wsUrl?: string;
379
+ isTestnet: boolean;
380
+ utilityAddresses?: UtilityAddresses;
381
+ networkToken: NetworkToken;
382
+ chainLogoUri?: string;
383
+ }
384
+ interface Chains {
385
+ chains: ChainInfo[];
386
+ }
387
+
388
+ interface HealthStatusCheck {
389
+ status?: string;
390
+ info?: Record<string, {
391
+ status?: string;
392
+ }>;
393
+ error?: Record<string, {
394
+ status?: string;
395
+ }>;
396
+ details?: Record<string, {
397
+ status?: string;
398
+ }>;
399
+ }
400
+
401
+ declare class GlacierClient {
402
+ private baseUrl;
403
+ private version;
404
+ private httpOptions?;
405
+ private httpClient;
406
+ constructor(baseUrl: string, version?: string, httpOptions?: HttpOptions | undefined);
407
+ /**
408
+ *
409
+ * @name HealthCheck
410
+ * @summary Get the health of the service.
411
+ * @request GET:/${version}/health-check
412
+ * @response `200` `{ status?: string, info?: Record<string, { status?: string }>, error?: Record<string, { status?: string }>, details?: Record<string, { status?: string }> }` The Health Check is successful
413
+ * @response `503` `{ status?: string, info?: Record<string, { status?: string }>, error?: Record<string, { status?: string }>, details?: Record<string, { status?: string }> }` The Health Check is not successful
414
+ */
415
+ healthCheck(params?: Record<string, any>, customOptions?: HttpOptions): Promise<HealthStatusCheck>;
416
+ /**
417
+ * No description
418
+ *
419
+ * @name GetNativeBalance
420
+ * @summary Get native token balance of a wallet address for a given chain.
421
+ * @request GET:/v1/chains/{chainId}/addresses/{address}/balances:getNative
422
+ * @response `200` `NativeBalanceDto`
423
+ */
424
+ getNativeBalance(chainId: string, address: string, query?: {
425
+ currency?: CurrencyCode;
426
+ }, params?: Record<string, any>, customOptions?: HttpOptions): Promise<NativeBalance>;
427
+ /**
428
+ *
429
+ * @name ListErc20Balances
430
+ * @summary Get erc-20 token balances of a wallet address for a given chain.
431
+ * @request GET:/v1/chains/{chainId}/addresses/{address}/balances:listErc20
432
+ * @response `200` `Erc20BalancesDto`
433
+ */
434
+ listErc20Balances(chainId: string, address: string, query?: {
435
+ pageSize?: number;
436
+ pageToken?: string;
437
+ currency?: CurrencyCode;
438
+ }, params?: Record<string, any>, customOptions?: HttpOptions): Promise<Erc20Balances>;
439
+ /**
440
+ * No description
441
+ *
442
+ * @name ListErc721Balances
443
+ * @summary Get erc-721 token balances of a wallet address for a given chain.
444
+ * @request GET:/v1/chains/{chainId}/addresses/{address}/balances:listErc721
445
+ * @response `200` `Erc721BalancesDto`
446
+ */
447
+ listErc721Balances(chainId: string, address: string, query?: {
448
+ pageSize?: number;
449
+ pageToken?: string;
450
+ currency?: CurrencyCode;
451
+ }, params?: Record<string, any>, customOptions?: HttpOptions): Promise<Erc721Balances>;
452
+ /**
453
+ * @description Gets a list of transactions where the given wallet address had an on-chain interaction for a given chain. The erc20 transfers, erc721 transfers, and internal transactions returned as part of the native transactions are only those where the address had an interaction. Therefore the transactions returned from this list may not be complete representations of the on-chain data. For a complete view of a transaction use the `/chains/:chainId/transactions/:txHash` endpoint.
454
+ *
455
+ * @name ListTransactions
456
+ * @summary Gets a list of transactions for a wallet address and chain.
457
+ * @request GET:/v1/chains/{chainId}/addresses/{address}/transactions
458
+ * @response `200` `ListTransactionDetailsDto`
459
+ */
460
+ listTransactions(chainId: string, address: string, query?: {
461
+ pageSize?: number;
462
+ pageToken?: string;
463
+ }, params?: Record<string, any>, customOptions?: HttpOptions): Promise<ListTransactionDetails>;
464
+ /**
465
+ *
466
+ * @name GetTransaction
467
+ * @summary Gets the details of a single transaction.
468
+ * @request GET:/v1/chains/{chainId}/transactions/{txHash}
469
+ * @response `200` `TransactionDetailsDto`
470
+ */
471
+ getTransaction(chainId: string, txHash: string, params?: Record<string, any>, customOptions?: HttpOptions): Promise<TransactionDetails>;
472
+ /**
473
+ *
474
+ * @name SupportedChains
475
+ * @summary Gets the list of chains supported by the api.
476
+ * @request GET:/v1/chains
477
+ * @response `200` `ChainsDto`
478
+ */
479
+ supportedChains(params?: Record<string, any>, customOptions?: HttpOptions): Promise<Chains>;
480
+ /**
481
+ * No description
482
+ *
483
+ * @name GetChainInfo
484
+ * @summary Gets chain information by chain id.
485
+ * @request GET:/v1/chains/{chainId}
486
+ * @response `200` `ChainInfoDto`
487
+ */
488
+ getChainInfo(chainId: string, params?: Record<string, any>, customOptions?: HttpOptions): Promise<ChainInfo>;
489
+ }
490
+
491
+ export { Block, ChainInfo, Chains, CurrencyCode, Erc20Balances, Erc20Token, Erc20TokenBalance, Erc20Transfer, Erc20TransferDetails, Erc721Balances, Erc721Metadata, Erc721MetadataStatus, Erc721Token, Erc721TokenBalance, Erc721Transfer, Erc721TransferDetails, FullTransactionDetails, GlacierClient, InternalTransactionDetails, InternalTransactionOpCall, ListBlocks, ListErc20Transactions, ListErc721Transactions, ListNativeTransactions, ListTransactionDetails, ListTransfers, Method, Money, NativeBalance, NativeTokenBalance, NativeTransaction, NetworkToken, NetworkTokenDetails, RichAddress, TransactionDetails, UtilityAddresses, VmName };