@avalabs/glacier-sdk 2.5.0-alpha.1 → 2.5.0-alpha.10

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.
@@ -1,29 +1,26 @@
1
- export interface MoneyDto {
2
- /**
3
- * ISO 4217 currency code.
4
- * @example usd
5
- */
6
- currencyCode: 'usd' | 'eur' | 'aud' | 'cad' | 'chf' | 'clp' | 'czk' | 'dkk' | 'gbp' | 'hkd' | 'huf';
1
+ export declare type CurrencyCode = 'usd' | 'eur' | 'aud' | 'cad' | 'chf' | 'clp' | 'czk' | 'dkk' | 'gbp' | 'hkd' | 'huf';
2
+ export interface Money {
3
+ currencyCode: CurrencyCode;
7
4
  /**
8
5
  * Monetary value in base 10 decimals.
9
6
  * @example 42.42
10
7
  */
11
8
  value: number;
12
9
  }
13
- export interface NativeTokenBalanceDto {
10
+ export interface NativeTokenBalance {
14
11
  chainId: string;
15
12
  name: string;
16
13
  symbol: string;
17
14
  decimals: number;
18
15
  logoUri: string;
19
- price?: MoneyDto;
16
+ price?: Money;
20
17
  balance: string;
21
- balanceValue?: MoneyDto;
18
+ balanceValue?: Money;
22
19
  }
23
- export interface NativeBalanceDto {
24
- nativeTokenBalance: NativeTokenBalanceDto;
20
+ export interface NativeBalance {
21
+ nativeTokenBalance: NativeTokenBalance;
25
22
  }
26
- export interface Erc20TokenBalanceDto {
23
+ export interface Erc20TokenBalance {
27
24
  chainId: string;
28
25
  contractAddress: string;
29
26
  name: string;
@@ -31,16 +28,16 @@ export interface Erc20TokenBalanceDto {
31
28
  decimals: number;
32
29
  tags?: string[];
33
30
  logoUri?: string;
34
- price?: MoneyDto;
31
+ price?: Money;
35
32
  balance: string;
36
- balanceValue?: MoneyDto;
33
+ balanceValue?: Money;
37
34
  }
38
- export interface Erc20BalancesDto {
35
+ export interface Erc20Balances {
39
36
  /** 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. */
40
37
  nextPageToken?: string;
41
- erc20TokenBalances: Erc20TokenBalanceDto[];
38
+ erc20TokenBalances: Erc20TokenBalance[];
42
39
  }
43
- export interface Erc721TokenBalanceDto {
40
+ export interface Erc721TokenBalance {
44
41
  chainId: string;
45
42
  contractAddress: string;
46
43
  name: string;
@@ -48,12 +45,12 @@ export interface Erc721TokenBalanceDto {
48
45
  tokenId: string;
49
46
  tokenUri: string;
50
47
  }
51
- export interface Erc721BalancesDto {
48
+ export interface Erc721Balances {
52
49
  /** 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. */
53
50
  nextPageToken?: string;
54
- erc721TokenBalances: Erc721TokenBalanceDto[];
51
+ erc721TokenBalances: Erc721TokenBalance[];
55
52
  }
56
- export interface AddressDto {
53
+ export interface Address {
57
54
  /** @example 0x71C7656EC7ab88b098defB751B7401B5f6d8976F */
58
55
  address: string;
59
56
  name?: string;
@@ -61,7 +58,7 @@ export interface AddressDto {
61
58
  tags?: string[];
62
59
  logoUri?: string;
63
60
  }
64
- export interface MethodDto {
61
+ export interface Method {
65
62
  /**
66
63
  * The contract method hash identifier.
67
64
  * @example 0xa9059cbb
@@ -73,7 +70,7 @@ export interface MethodDto {
73
70
  */
74
71
  methodName?: string;
75
72
  }
76
- export interface NativeTransactionDto {
73
+ export interface NativeTransaction {
77
74
  /**
78
75
  * The block number on the chain.
79
76
  * @example 339
@@ -129,28 +126,28 @@ export interface NativeTransactionDto {
129
126
  * @example 1
130
127
  */
131
128
  nonce: string;
132
- from: AddressDto;
133
- to: AddressDto;
134
- method?: MethodDto;
129
+ from: Address;
130
+ to: Address;
131
+ method?: Method;
135
132
  /** @example 10000000000000000000 */
136
133
  value: string;
137
134
  }
138
- export interface Erc20TokenDto {
135
+ export interface Erc20Token {
139
136
  /** @example 0x71C7656EC7ab88b098defB751B7401B5f6d8976F */
140
137
  contractAddress: string;
141
138
  tokenName: string;
142
139
  tokenSymbol: string;
143
140
  tokenDecimals: number;
144
- price?: MoneyDto;
141
+ price?: Money;
145
142
  }
146
- export interface Erc20TransferDetailsDto {
147
- from: AddressDto;
148
- to: AddressDto;
149
- erc20Token: Erc20TokenDto;
143
+ export interface Erc20TransferDetails {
144
+ from: Address;
145
+ to: Address;
146
+ erc20Token: Erc20Token;
150
147
  /** @example 10000000000000000000 */
151
148
  value: string;
152
149
  }
153
- export interface Erc721TokenDto {
150
+ export interface Erc721Token {
154
151
  /** @example 0x71C7656EC7ab88b098defB751B7401B5f6d8976F */
155
152
  contractAddress: string;
156
153
  tokenName: string;
@@ -158,29 +155,29 @@ export interface Erc721TokenDto {
158
155
  tokenId: string;
159
156
  tokenUri: string;
160
157
  }
161
- export interface Erc721TransferDetailsDto {
162
- from: AddressDto;
163
- to: AddressDto;
164
- erc721Token: Erc721TokenDto;
158
+ export interface Erc721TransferDetails {
159
+ from: Address;
160
+ to: Address;
161
+ erc721Token: Erc721Token;
165
162
  }
166
- export interface InternalTransactionDetailsDto {
167
- from: AddressDto;
168
- to: AddressDto;
163
+ export interface InternalTransactionDetails {
164
+ from: Address;
165
+ to: Address;
169
166
  internalTxType: 'UNKNOWN' | 'CALL' | 'CREATE' | 'CREATE2' | 'CALLCODE' | 'DELEGATECALL' | 'STATICCALL';
170
167
  /** @example 10000000000000000000 */
171
168
  value: string;
172
169
  isReverted: boolean;
173
170
  }
174
- export interface TransactionDetailsDto {
175
- nativeTransaction: NativeTransactionDto;
176
- erc20Transfers?: Erc20TransferDetailsDto[];
177
- erc721Transfers?: Erc721TransferDetailsDto[];
178
- internalTransactions?: InternalTransactionDetailsDto[];
171
+ export interface TransactionDetails {
172
+ nativeTransaction: NativeTransaction;
173
+ erc20Transfers?: Erc20TransferDetails[];
174
+ erc721Transfers?: Erc721TransferDetails[];
175
+ internalTransactions?: InternalTransactionDetails[];
179
176
  }
180
- export interface ListTransactionDetailsDto {
177
+ export interface ListTransactionDetails {
181
178
  /** 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. */
182
179
  nextPageToken?: string;
183
- transactions: TransactionDetailsDto[];
180
+ transactions: TransactionDetails[];
184
181
  }
185
182
  export interface UtilityAddresses {
186
183
  multicall?: string;
@@ -192,7 +189,7 @@ export interface NetworkToken {
192
189
  decimals: number;
193
190
  logoUri?: string;
194
191
  }
195
- export interface ChainInfoDto {
192
+ export interface ChainInfo {
196
193
  chainId: string;
197
194
  chainName: string;
198
195
  description: string;
@@ -208,7 +205,19 @@ export interface ChainInfoDto {
208
205
  networkToken: NetworkToken;
209
206
  chainLogoUri?: string;
210
207
  }
211
- export interface ChainsDto {
212
- chains: ChainInfoDto[];
213
- }
214
- //# sourceMappingURL=data-contracts.d.ts.map
208
+ export interface Chains {
209
+ chains: ChainInfo[];
210
+ }
211
+ export interface HealthStatusCheck {
212
+ status?: string;
213
+ info?: Record<string, {
214
+ status?: string;
215
+ }>;
216
+ error?: Record<string, {
217
+ status?: string;
218
+ }>;
219
+ details?: Record<string, {
220
+ status?: string;
221
+ }>;
222
+ }
223
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/models.ts"],"names":[],"mappings":"AAWA,oBAAY,YAAY,GACpB,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,GACL,KAAK,CAAC;AAEV,MAAM,WAAW,KAAK;IACpB,YAAY,EAAE,YAAY,CAAC;IAC3B;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,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CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IACpC,YAAY,EAAE,YAAY,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,MAAM;IACrB,MAAM,EAAE,SAAS,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC/C"}
package/index.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './src/data-contracts';
2
- export * from './src/V1';
1
+ export * from './src/models';
2
+ export * from './src/glacierClient';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avalabs/glacier-sdk",
3
- "version": "2.5.0-alpha.1",
3
+ "version": "2.5.0-alpha.10",
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",
@@ -35,5 +35,8 @@
35
35
  "bugs": {
36
36
  "url": "https://github.com/ava-labs/avalanche-sdks/issues"
37
37
  },
38
- "gitHead": "5e3c3d0e084e5f8b99721bb1eaa4d2ac351b2ff5"
38
+ "dependencies": {
39
+ "@avalabs/utils-sdk": "2.5.0-alpha.10"
40
+ },
41
+ "gitHead": "fa24c93d64e9ac7a5d74f53150616aa999316de6"
39
42
  }
@@ -0,0 +1,190 @@
1
+ import { HttpClient, HttpOptions } from '@avalabs/utils-sdk';
2
+ import {
3
+ ChainInfo,
4
+ Chains,
5
+ CurrencyCode,
6
+ Erc20Balances,
7
+ Erc721Balances,
8
+ HealthStatusCheck,
9
+ ListTransactionDetails,
10
+ NativeBalance,
11
+ TransactionDetails,
12
+ } from './models';
13
+
14
+ export class GlacierClient {
15
+ private httpClient: HttpClient;
16
+ constructor(
17
+ private baseUrl: string,
18
+ private version = 'v1',
19
+ private httpOptions?: HttpOptions
20
+ ) {
21
+ this.httpClient = new HttpClient(
22
+ `${this.baseUrl}/${this.version}`,
23
+ this.httpOptions
24
+ );
25
+ }
26
+ /**
27
+ *
28
+ * @name HealthCheck
29
+ * @summary Get the health of the service.
30
+ * @request GET:/${version}/health-check
31
+ * @response `200` `{ status?: string, info?: Record<string, { status?: string }>, error?: Record<string, { status?: string }>, details?: Record<string, { status?: string }> }` The Health Check is successful
32
+ * @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
33
+ */
34
+ healthCheck(
35
+ params: Record<string, any> = {},
36
+ customOptions: HttpOptions = {}
37
+ ) {
38
+ return this.httpClient.get<HealthStatusCheck>(
39
+ `/health-check`,
40
+ params,
41
+ customOptions
42
+ );
43
+ }
44
+
45
+ /**
46
+ * No description
47
+ *
48
+ * @name GetNativeBalance
49
+ * @summary Get native token balance of a wallet address for a given chain.
50
+ * @request GET:/v1/chains/{chainId}/addresses/{address}/balances:getNative
51
+ * @response `200` `NativeBalanceDto`
52
+ */
53
+ getNativeBalance(
54
+ chainId: string,
55
+ address: string,
56
+ query?: {
57
+ currency?: CurrencyCode;
58
+ },
59
+ params: Record<string, any> = {},
60
+ customOptions: HttpOptions = {}
61
+ ) {
62
+ return this.httpClient.get<NativeBalance>(
63
+ `/chains/${chainId}/addresses/${address}/balances:getNative`,
64
+ { ...query, ...params },
65
+ customOptions
66
+ );
67
+ }
68
+ /**
69
+ *
70
+ * @name ListErc20Balances
71
+ * @summary Get erc-20 token balances of a wallet address for a given chain.
72
+ * @request GET:/v1/chains/{chainId}/addresses/{address}/balances:listErc20
73
+ * @response `200` `Erc20BalancesDto`
74
+ */
75
+ listErc20Balances(
76
+ chainId: string,
77
+ address: string,
78
+ query?: {
79
+ pageSize?: number;
80
+ pageToken?: string;
81
+ currency?: CurrencyCode;
82
+ },
83
+ params: Record<string, any> = {},
84
+ customOptions: HttpOptions = {}
85
+ ) {
86
+ return this.httpClient.get<Erc20Balances>(
87
+ `/chains/${chainId}/addresses/${address}/balances:listErc20`,
88
+ { ...query, ...params },
89
+ customOptions
90
+ );
91
+ }
92
+ /**
93
+ * No description
94
+ *
95
+ * @name ListErc721Balances
96
+ * @summary Get erc-721 token balances of a wallet address for a given chain.
97
+ * @request GET:/v1/chains/{chainId}/addresses/{address}/balances:listErc721
98
+ * @response `200` `Erc721BalancesDto`
99
+ */
100
+ listErc721Balances(
101
+ chainId: string,
102
+ address: string,
103
+ query?: {
104
+ pageSize?: number;
105
+ pageToken?: string;
106
+ currency?: CurrencyCode;
107
+ },
108
+ params: Record<string, any> = {},
109
+ customOptions: HttpOptions = {}
110
+ ) {
111
+ return this.httpClient.get<Erc721Balances>(
112
+ `/chains/${chainId}/addresses/${address}/balances:listErc721`,
113
+ { ...query, ...params },
114
+ customOptions
115
+ );
116
+ }
117
+ /**
118
+ * @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.
119
+ *
120
+ * @name ListTransactions
121
+ * @summary Gets a list of transactions for a wallet address and chain.
122
+ * @request GET:/v1/chains/{chainId}/addresses/{address}/transactions
123
+ * @response `200` `ListTransactionDetailsDto`
124
+ */
125
+ listTransactions(
126
+ chainId: string,
127
+ address: string,
128
+ query?: { pageSize?: number; pageToken?: string },
129
+ params: Record<string, any> = {},
130
+ customOptions: HttpOptions = {}
131
+ ) {
132
+ return this.httpClient.get<ListTransactionDetails>(
133
+ `/chains/${chainId}/addresses/${address}/transactions`,
134
+ { ...query, ...params },
135
+ customOptions
136
+ );
137
+ }
138
+ /**
139
+ *
140
+ * @name GetTransaction
141
+ * @summary Gets the details of a single transaction.
142
+ * @request GET:/v1/chains/{chainId}/transactions/{txHash}
143
+ * @response `200` `TransactionDetailsDto`
144
+ */
145
+ getTransaction(
146
+ chainId: string,
147
+ txHash: string,
148
+ params: Record<string, any> = {},
149
+ customOptions: HttpOptions = {}
150
+ ) {
151
+ return this.httpClient.get<TransactionDetails>(
152
+ `/chains/${chainId}/transactions/${txHash}`,
153
+ params,
154
+ customOptions
155
+ );
156
+ }
157
+ /**
158
+ *
159
+ * @name SupportedChains
160
+ * @summary Gets the list of chains supported by the api.
161
+ * @request GET:/v1/chains
162
+ * @response `200` `ChainsDto`
163
+ */
164
+ supportedChains(
165
+ params: Record<string, any> = {},
166
+ customOptions: HttpOptions = {}
167
+ ) {
168
+ return this.httpClient.get<Chains>(`/chains`, params, customOptions);
169
+ }
170
+
171
+ /**
172
+ * No description
173
+ *
174
+ * @name GetChainInfo
175
+ * @summary Gets chain information by chain id.
176
+ * @request GET:/v1/chains/{chainId}
177
+ * @response `200` `ChainInfoDto`
178
+ */
179
+ getChainInfo(
180
+ chainId: string,
181
+ params: Record<string, any> = {},
182
+ customOptions: HttpOptions = {}
183
+ ) {
184
+ return this.httpClient.get<ChainInfo>(
185
+ `/chains/${chainId}`,
186
+ params,
187
+ customOptions
188
+ );
189
+ }
190
+ }
@@ -9,24 +9,21 @@
9
9
  * ---------------------------------------------------------------
10
10
  */
11
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
-
12
+ export type CurrencyCode =
13
+ | 'usd'
14
+ | 'eur'
15
+ | 'aud'
16
+ | 'cad'
17
+ | 'chf'
18
+ | 'clp'
19
+ | 'czk'
20
+ | 'dkk'
21
+ | 'gbp'
22
+ | 'hkd'
23
+ | 'huf';
24
+
25
+ export interface Money {
26
+ currencyCode: CurrencyCode;
30
27
  /**
31
28
  * Monetary value in base 10 decimals.
32
29
  * @example 42.42
@@ -34,22 +31,22 @@ export interface MoneyDto {
34
31
  value: number;
35
32
  }
36
33
 
37
- export interface NativeTokenBalanceDto {
34
+ export interface NativeTokenBalance {
38
35
  chainId: string;
39
36
  name: string;
40
37
  symbol: string;
41
38
  decimals: number;
42
39
  logoUri: string;
43
- price?: MoneyDto;
40
+ price?: Money;
44
41
  balance: string;
45
- balanceValue?: MoneyDto;
42
+ balanceValue?: Money;
46
43
  }
47
44
 
48
- export interface NativeBalanceDto {
49
- nativeTokenBalance: NativeTokenBalanceDto;
45
+ export interface NativeBalance {
46
+ nativeTokenBalance: NativeTokenBalance;
50
47
  }
51
48
 
52
- export interface Erc20TokenBalanceDto {
49
+ export interface Erc20TokenBalance {
53
50
  chainId: string;
54
51
  contractAddress: string;
55
52
  name: string;
@@ -57,18 +54,18 @@ export interface Erc20TokenBalanceDto {
57
54
  decimals: number;
58
55
  tags?: string[];
59
56
  logoUri?: string;
60
- price?: MoneyDto;
57
+ price?: Money;
61
58
  balance: string;
62
- balanceValue?: MoneyDto;
59
+ balanceValue?: Money;
63
60
  }
64
61
 
65
- export interface Erc20BalancesDto {
62
+ export interface Erc20Balances {
66
63
  /** 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
64
  nextPageToken?: string;
68
- erc20TokenBalances: Erc20TokenBalanceDto[];
65
+ erc20TokenBalances: Erc20TokenBalance[];
69
66
  }
70
67
 
71
- export interface Erc721TokenBalanceDto {
68
+ export interface Erc721TokenBalance {
72
69
  chainId: string;
73
70
  contractAddress: string;
74
71
  name: string;
@@ -77,13 +74,13 @@ export interface Erc721TokenBalanceDto {
77
74
  tokenUri: string;
78
75
  }
79
76
 
80
- export interface Erc721BalancesDto {
77
+ export interface Erc721Balances {
81
78
  /** 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
79
  nextPageToken?: string;
83
- erc721TokenBalances: Erc721TokenBalanceDto[];
80
+ erc721TokenBalances: Erc721TokenBalance[];
84
81
  }
85
82
 
86
- export interface AddressDto {
83
+ export interface Address {
87
84
  /** @example 0x71C7656EC7ab88b098defB751B7401B5f6d8976F */
88
85
  address: string;
89
86
  name?: string;
@@ -92,7 +89,7 @@ export interface AddressDto {
92
89
  logoUri?: string;
93
90
  }
94
91
 
95
- export interface MethodDto {
92
+ export interface Method {
96
93
  /**
97
94
  * The contract method hash identifier.
98
95
  * @example 0xa9059cbb
@@ -106,7 +103,7 @@ export interface MethodDto {
106
103
  methodName?: string;
107
104
  }
108
105
 
109
- export interface NativeTransactionDto {
106
+ export interface NativeTransaction {
110
107
  /**
111
108
  * The block number on the chain.
112
109
  * @example 339
@@ -172,33 +169,33 @@ export interface NativeTransactionDto {
172
169
  * @example 1
173
170
  */
174
171
  nonce: string;
175
- from: AddressDto;
176
- to: AddressDto;
177
- method?: MethodDto;
172
+ from: Address;
173
+ to: Address;
174
+ method?: Method;
178
175
 
179
176
  /** @example 10000000000000000000 */
180
177
  value: string;
181
178
  }
182
179
 
183
- export interface Erc20TokenDto {
180
+ export interface Erc20Token {
184
181
  /** @example 0x71C7656EC7ab88b098defB751B7401B5f6d8976F */
185
182
  contractAddress: string;
186
183
  tokenName: string;
187
184
  tokenSymbol: string;
188
185
  tokenDecimals: number;
189
- price?: MoneyDto;
186
+ price?: Money;
190
187
  }
191
188
 
192
- export interface Erc20TransferDetailsDto {
193
- from: AddressDto;
194
- to: AddressDto;
195
- erc20Token: Erc20TokenDto;
189
+ export interface Erc20TransferDetails {
190
+ from: Address;
191
+ to: Address;
192
+ erc20Token: Erc20Token;
196
193
 
197
194
  /** @example 10000000000000000000 */
198
195
  value: string;
199
196
  }
200
197
 
201
- export interface Erc721TokenDto {
198
+ export interface Erc721Token {
202
199
  /** @example 0x71C7656EC7ab88b098defB751B7401B5f6d8976F */
203
200
  contractAddress: string;
204
201
  tokenName: string;
@@ -207,15 +204,15 @@ export interface Erc721TokenDto {
207
204
  tokenUri: string;
208
205
  }
209
206
 
210
- export interface Erc721TransferDetailsDto {
211
- from: AddressDto;
212
- to: AddressDto;
213
- erc721Token: Erc721TokenDto;
207
+ export interface Erc721TransferDetails {
208
+ from: Address;
209
+ to: Address;
210
+ erc721Token: Erc721Token;
214
211
  }
215
212
 
216
- export interface InternalTransactionDetailsDto {
217
- from: AddressDto;
218
- to: AddressDto;
213
+ export interface InternalTransactionDetails {
214
+ from: Address;
215
+ to: Address;
219
216
  internalTxType:
220
217
  | 'UNKNOWN'
221
218
  | 'CALL'
@@ -230,17 +227,17 @@ export interface InternalTransactionDetailsDto {
230
227
  isReverted: boolean;
231
228
  }
232
229
 
233
- export interface TransactionDetailsDto {
234
- nativeTransaction: NativeTransactionDto;
235
- erc20Transfers?: Erc20TransferDetailsDto[];
236
- erc721Transfers?: Erc721TransferDetailsDto[];
237
- internalTransactions?: InternalTransactionDetailsDto[];
230
+ export interface TransactionDetails {
231
+ nativeTransaction: NativeTransaction;
232
+ erc20Transfers?: Erc20TransferDetails[];
233
+ erc721Transfers?: Erc721TransferDetails[];
234
+ internalTransactions?: InternalTransactionDetails[];
238
235
  }
239
236
 
240
- export interface ListTransactionDetailsDto {
237
+ export interface ListTransactionDetails {
241
238
  /** 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
239
  nextPageToken?: string;
243
- transactions: TransactionDetailsDto[];
240
+ transactions: TransactionDetails[];
244
241
  }
245
242
 
246
243
  export interface UtilityAddresses {
@@ -255,7 +252,7 @@ export interface NetworkToken {
255
252
  logoUri?: string;
256
253
  }
257
254
 
258
- export interface ChainInfoDto {
255
+ export interface ChainInfo {
259
256
  chainId: string;
260
257
  chainName: string;
261
258
  description: string;
@@ -272,6 +269,13 @@ export interface ChainInfoDto {
272
269
  chainLogoUri?: string;
273
270
  }
274
271
 
275
- export interface ChainsDto {
276
- chains: ChainInfoDto[];
272
+ export interface Chains {
273
+ chains: ChainInfo[];
274
+ }
275
+
276
+ export interface HealthStatusCheck {
277
+ status?: string;
278
+ info?: Record<string, { status?: string }>;
279
+ error?: Record<string, { status?: string }>;
280
+ details?: Record<string, { status?: string }>;
277
281
  }