@avalabs/glacier-sdk 2.4.1-alpha.10 → 2.4.1-alpha.6

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/src/V1.ts DELETED
@@ -1,231 +0,0 @@
1
- /* eslint-disable */
2
- /* tslint:disable */
3
- /*
4
- * ---------------------------------------------------------------
5
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
6
- * ## ##
7
- * ## AUTHOR: acacode ##
8
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
9
- * ---------------------------------------------------------------
10
- */
11
-
12
- import {
13
- ChainInfoDto,
14
- ChainsDto,
15
- Erc20BalancesDto,
16
- Erc721BalancesDto,
17
- ListTransactionDetailsDto,
18
- NativeBalanceDto,
19
- TransactionDetailsDto,
20
- } from './data-contracts';
21
- import { HttpClient, RequestParams } from './http-client';
22
-
23
- export class V1<
24
- SecurityDataType = unknown
25
- > extends HttpClient<SecurityDataType> {
26
- /**
27
- * No description
28
- *
29
- * @name HealthCheck
30
- * @summary Get the health of the service.
31
- * @request GET:/v1/health-check
32
- * @response `200` `{ status?: string, info?: Record<string, { status?: string }>, error?: Record<string, { status?: string }>, details?: Record<string, { status?: string }> }` The Health Check is successful
33
- * @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
34
- */
35
- healthCheck = (params: RequestParams = {}) =>
36
- this.request<
37
- {
38
- status?: string;
39
- info?: Record<string, { status?: string }>;
40
- error?: Record<string, { status?: string }>;
41
- details?: Record<string, { status?: string }>;
42
- },
43
- {
44
- status?: string;
45
- info?: Record<string, { status?: string }>;
46
- error?: Record<string, { status?: string }>;
47
- details?: Record<string, { status?: string }>;
48
- }
49
- >({
50
- path: `/v1/health-check`,
51
- method: 'GET',
52
- format: 'json',
53
- ...params,
54
- });
55
- /**
56
- * No description
57
- *
58
- * @name GetNativeBalance
59
- * @summary Get native token balance of a wallet address for a given chain.
60
- * @request GET:/v1/chains/{chainId}/addresses/{address}/balances:getNative
61
- * @response `200` `NativeBalanceDto`
62
- */
63
- getNativeBalance = (
64
- chainId: string,
65
- address: string,
66
- query?: {
67
- currency?:
68
- | 'usd'
69
- | 'eur'
70
- | 'aud'
71
- | 'cad'
72
- | 'chf'
73
- | 'clp'
74
- | 'czk'
75
- | 'dkk'
76
- | 'gbp'
77
- | 'hkd'
78
- | 'huf';
79
- },
80
- params: RequestParams = {}
81
- ) =>
82
- this.request<NativeBalanceDto, any>({
83
- path: `/v1/chains/${chainId}/addresses/${address}/balances:getNative`,
84
- method: 'GET',
85
- query: query,
86
- format: 'json',
87
- ...params,
88
- });
89
- /**
90
- * No description
91
- *
92
- * @name ListErc20Balances
93
- * @summary Get erc-20 token balances of a wallet address for a given chain.
94
- * @request GET:/v1/chains/{chainId}/addresses/{address}/balances:listErc20
95
- * @response `200` `Erc20BalancesDto`
96
- */
97
- listErc20Balances = (
98
- chainId: string,
99
- address: string,
100
- query?: {
101
- pageSize?: number;
102
- pageToken?: string;
103
- currency?:
104
- | 'usd'
105
- | 'eur'
106
- | 'aud'
107
- | 'cad'
108
- | 'chf'
109
- | 'clp'
110
- | 'czk'
111
- | 'dkk'
112
- | 'gbp'
113
- | 'hkd'
114
- | 'huf';
115
- },
116
- params: RequestParams = {}
117
- ) =>
118
- this.request<Erc20BalancesDto, any>({
119
- path: `/v1/chains/${chainId}/addresses/${address}/balances:listErc20`,
120
- method: 'GET',
121
- query: query,
122
- format: 'json',
123
- ...params,
124
- });
125
- /**
126
- * No description
127
- *
128
- * @name ListErc721Balances
129
- * @summary Get erc-721 token balances of a wallet address for a given chain.
130
- * @request GET:/v1/chains/{chainId}/addresses/{address}/balances:listErc721
131
- * @response `200` `Erc721BalancesDto`
132
- */
133
- listErc721Balances = (
134
- chainId: string,
135
- address: string,
136
- query?: {
137
- pageSize?: number;
138
- pageToken?: string;
139
- currency?:
140
- | 'usd'
141
- | 'eur'
142
- | 'aud'
143
- | 'cad'
144
- | 'chf'
145
- | 'clp'
146
- | 'czk'
147
- | 'dkk'
148
- | 'gbp'
149
- | 'hkd'
150
- | 'huf';
151
- },
152
- params: RequestParams = {}
153
- ) =>
154
- this.request<Erc721BalancesDto, any>({
155
- path: `/v1/chains/${chainId}/addresses/${address}/balances:listErc721`,
156
- method: 'GET',
157
- query: query,
158
- format: 'json',
159
- ...params,
160
- });
161
- /**
162
- * @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.
163
- *
164
- * @name ListTransactions
165
- * @summary Gets a list of transactions for a wallet address and chain.
166
- * @request GET:/v1/chains/{chainId}/addresses/{address}/transactions
167
- * @response `200` `ListTransactionDetailsDto`
168
- */
169
- listTransactions = (
170
- chainId: string,
171
- address: string,
172
- query?: { pageSize?: number; pageToken?: string },
173
- params: RequestParams = {}
174
- ) =>
175
- this.request<ListTransactionDetailsDto, any>({
176
- path: `/v1/chains/${chainId}/addresses/${address}/transactions`,
177
- method: 'GET',
178
- query: query,
179
- format: 'json',
180
- ...params,
181
- });
182
- /**
183
- * No description
184
- *
185
- * @name GetTransaction
186
- * @summary Gets the details of a single transaction.
187
- * @request GET:/v1/chains/{chainId}/transactions/{txHash}
188
- * @response `200` `TransactionDetailsDto`
189
- */
190
- getTransaction = (
191
- chainId: string,
192
- txHash: string,
193
- params: RequestParams = {}
194
- ) =>
195
- this.request<TransactionDetailsDto, any>({
196
- path: `/v1/chains/${chainId}/transactions/${txHash}`,
197
- method: 'GET',
198
- format: 'json',
199
- ...params,
200
- });
201
- /**
202
- * No description
203
- *
204
- * @name SupportedChains
205
- * @summary Gets the list of chains supported by the api.
206
- * @request GET:/v1/chains
207
- * @response `200` `ChainsDto`
208
- */
209
- supportedChains = (params: RequestParams = {}) =>
210
- this.request<ChainsDto, any>({
211
- path: `/v1/chains`,
212
- method: 'GET',
213
- format: 'json',
214
- ...params,
215
- });
216
- /**
217
- * No description
218
- *
219
- * @name GetChainInfo
220
- * @summary Gets chain information by chain id.
221
- * @request GET:/v1/chains/{chainId}
222
- * @response `200` `ChainInfoDto`
223
- */
224
- getChainInfo = (chainId: string, params: RequestParams = {}) =>
225
- this.request<ChainInfoDto, any>({
226
- path: `/v1/chains/${chainId}`,
227
- method: 'GET',
228
- format: 'json',
229
- ...params,
230
- });
231
- }
@@ -1,277 +0,0 @@
1
- /* eslint-disable */
2
- /* tslint:disable */
3
- /*
4
- * ---------------------------------------------------------------
5
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
6
- * ## ##
7
- * ## AUTHOR: acacode ##
8
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
9
- * ---------------------------------------------------------------
10
- */
11
-
12
- export interface MoneyDto {
13
- /**
14
- * ISO 4217 currency code.
15
- * @example usd
16
- */
17
- currencyCode:
18
- | 'usd'
19
- | 'eur'
20
- | 'aud'
21
- | 'cad'
22
- | 'chf'
23
- | 'clp'
24
- | 'czk'
25
- | 'dkk'
26
- | 'gbp'
27
- | 'hkd'
28
- | 'huf';
29
-
30
- /**
31
- * Monetary value in base 10 decimals.
32
- * @example 42.42
33
- */
34
- value: number;
35
- }
36
-
37
- export interface NativeTokenBalanceDto {
38
- chainId: string;
39
- name: string;
40
- symbol: string;
41
- decimals: number;
42
- logoUri: string;
43
- price?: MoneyDto;
44
- balance: string;
45
- balanceValue?: MoneyDto;
46
- }
47
-
48
- export interface NativeBalanceDto {
49
- nativeTokenBalance: NativeTokenBalanceDto;
50
- }
51
-
52
- export interface Erc20TokenBalanceDto {
53
- chainId: string;
54
- contractAddress: string;
55
- name: string;
56
- symbol: string;
57
- decimals: number;
58
- tags?: string[];
59
- logoUri?: string;
60
- price?: MoneyDto;
61
- balance: string;
62
- balanceValue?: MoneyDto;
63
- }
64
-
65
- export interface Erc20BalancesDto {
66
- /** 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. */
67
- nextPageToken?: string;
68
- erc20TokenBalances: Erc20TokenBalanceDto[];
69
- }
70
-
71
- export interface Erc721TokenBalanceDto {
72
- chainId: string;
73
- contractAddress: string;
74
- name: string;
75
- symbol: string;
76
- tokenId: string;
77
- tokenUri: string;
78
- }
79
-
80
- export interface Erc721BalancesDto {
81
- /** 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. */
82
- nextPageToken?: string;
83
- erc721TokenBalances: Erc721TokenBalanceDto[];
84
- }
85
-
86
- export interface AddressDto {
87
- /** @example 0x71C7656EC7ab88b098defB751B7401B5f6d8976F */
88
- address: string;
89
- name?: string;
90
- symbol?: string;
91
- tags?: string[];
92
- logoUri?: string;
93
- }
94
-
95
- export interface MethodDto {
96
- /**
97
- * The contract method hash identifier.
98
- * @example 0xa9059cbb
99
- */
100
- methodHash: string;
101
-
102
- /**
103
- * The contract method name including parameter types.
104
- * @example transfer(address,uint256)
105
- */
106
- methodName?: string;
107
- }
108
-
109
- export interface NativeTransactionDto {
110
- /**
111
- * The block number on the chain.
112
- * @example 339
113
- */
114
- blockNumber: string;
115
-
116
- /**
117
- * The block finality timestamp.
118
- * @example 1648672486
119
- */
120
- blockTimestamp: number;
121
-
122
- /**
123
- * The block hash identifier.
124
- * @example 0x17533aeb5193378b9ff441d61728e7a2ebaf10f61fd5310759451627dfca2e7c
125
- */
126
- blockHash: string;
127
-
128
- /**
129
- * The index at which the transaction occured in the block (0-indexed).
130
- * @example 0
131
- */
132
- blockIndex: number;
133
-
134
- /**
135
- * The transaction hash identifier.
136
- * @example 0x3e9303f81be00b4af28515dab7b914bf3dbff209ea10e7071fa24d4af0a112d4
137
- */
138
- txHash: string;
139
-
140
- /**
141
- * The transaction status, which is either 0 (failed) or 1 (successful).
142
- * @example 1
143
- */
144
- txStatus: string;
145
-
146
- /**
147
- * The transaction type.
148
- * @example 1
149
- */
150
- txType: number;
151
-
152
- /**
153
- * The gas limit set for the transaction.
154
- * @example 51373
155
- */
156
- gasLimit: string;
157
-
158
- /**
159
- * The amount of gas used.
160
- * @example 51373
161
- */
162
- gasUsed: string;
163
-
164
- /**
165
- * The gas price denominated by the number of decimals of the native token.
166
- * @example 470000000000
167
- */
168
- gasPrice: string;
169
-
170
- /**
171
- * The nonce used by the sender of the transaction.
172
- * @example 1
173
- */
174
- nonce: string;
175
- from: AddressDto;
176
- to: AddressDto;
177
- method?: MethodDto;
178
-
179
- /** @example 10000000000000000000 */
180
- value: string;
181
- }
182
-
183
- export interface Erc20TokenDto {
184
- /** @example 0x71C7656EC7ab88b098defB751B7401B5f6d8976F */
185
- contractAddress: string;
186
- tokenName: string;
187
- tokenSymbol: string;
188
- tokenDecimals: number;
189
- price?: MoneyDto;
190
- }
191
-
192
- export interface Erc20TransferDetailsDto {
193
- from: AddressDto;
194
- to: AddressDto;
195
- erc20Token: Erc20TokenDto;
196
-
197
- /** @example 10000000000000000000 */
198
- value: string;
199
- }
200
-
201
- export interface Erc721TokenDto {
202
- /** @example 0x71C7656EC7ab88b098defB751B7401B5f6d8976F */
203
- contractAddress: string;
204
- tokenName: string;
205
- tokenSymbol: string;
206
- tokenId: string;
207
- tokenUri: string;
208
- }
209
-
210
- export interface Erc721TransferDetailsDto {
211
- from: AddressDto;
212
- to: AddressDto;
213
- erc721Token: Erc721TokenDto;
214
- }
215
-
216
- export interface InternalTransactionDetailsDto {
217
- from: AddressDto;
218
- to: AddressDto;
219
- internalTxType:
220
- | 'UNKNOWN'
221
- | 'CALL'
222
- | 'CREATE'
223
- | 'CREATE2'
224
- | 'CALLCODE'
225
- | 'DELEGATECALL'
226
- | 'STATICCALL';
227
-
228
- /** @example 10000000000000000000 */
229
- value: string;
230
- isReverted: boolean;
231
- }
232
-
233
- export interface TransactionDetailsDto {
234
- nativeTransaction: NativeTransactionDto;
235
- erc20Transfers?: Erc20TransferDetailsDto[];
236
- erc721Transfers?: Erc721TransferDetailsDto[];
237
- internalTransactions?: InternalTransactionDetailsDto[];
238
- }
239
-
240
- export interface ListTransactionDetailsDto {
241
- /** 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. */
242
- nextPageToken?: string;
243
- transactions: TransactionDetailsDto[];
244
- }
245
-
246
- export interface UtilityAddresses {
247
- multicall?: string;
248
- }
249
-
250
- export interface NetworkToken {
251
- name: string;
252
- symbol: string;
253
- description: string;
254
- decimals: number;
255
- logoUri?: string;
256
- }
257
-
258
- export interface ChainInfoDto {
259
- chainId: string;
260
- chainName: string;
261
- description: string;
262
- platformChainId: string;
263
- subnetId: string;
264
- vmId: string;
265
- vmName: 'EVM' | 'BITCOIN' | 'ETHEREUM';
266
- explorerUrl?: string;
267
- rpcUrl: string;
268
- wsUrl?: string;
269
- isTestnet: boolean;
270
- utilityAddresses?: UtilityAddresses;
271
- networkToken: NetworkToken;
272
- chainLogoUri?: string;
273
- }
274
-
275
- export interface ChainsDto {
276
- chains: ChainInfoDto[];
277
- }