@rabby-wallet/rabby-api 0.6.21 → 0.6.22-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,329 +1,349 @@
1
- import { AxiosAdapter } from 'axios';
2
- import { RateLimitedAxiosInstance } from 'axios-rate-limit';
3
- import { AddrDescResponse, ApprovalStatus, AssetItem, CEXQuote, Cex, ChainWithPendingCount, Collection, CollectionList, CollectionWithFloorPrice, ComplexProtocol, ContractCredit, ExplainTxResponse, ExplainTypedDataResponse, GasLevel, GetTxResponse, NFTApprovalResponse, NFTItem, ParseTextResponse, ParseTxResponse, ParseTypedDataResponse, Protocol, SecurityCheckResponse, ServerChain, SlippageStatus, Summary, SwapTradeList, TokenApproval, TokenItem, TotalBalanceResponse, Tx, TxHistoryResult, UsedChain } from './types';
4
- interface OpenApiStore {
5
- host: string;
6
- testnetHost?: string;
7
- }
8
- interface Options {
9
- store: OpenApiStore;
10
- adapter?: AxiosAdapter;
11
- }
12
- export declare class OpenApiService {
13
- store: OpenApiStore;
14
- request: RateLimitedAxiosInstance;
15
- setHost: (host: string) => Promise<void>;
16
- getHost: () => string;
17
- setTestnetHost: (host: string) => Promise<void>;
18
- getTestnetHost: () => string | undefined;
19
- ethRpc: ((chainId: string, arg: {
20
- method: string;
21
- params: Array<any>;
22
- origin?: string;
23
- }) => Promise<any>) | (() => Promise<never>);
24
- adapter?: AxiosAdapter;
25
- constructor({ store, adapter }: Options);
26
- init: (hf?: string) => Promise<void>;
27
- private _getRequestOptions;
28
- private _mountMethods;
29
- getRecommendChains: (address: string, origin: string) => Promise<ServerChain[]>;
30
- getTotalBalance: (address: string) => Promise<TotalBalanceResponse>;
31
- getPendingCount: (address: string) => Promise<{
32
- total_count: number;
33
- chains: ChainWithPendingCount[];
34
- }>;
35
- checkOrigin: (address: string, origin: string) => Promise<SecurityCheckResponse>;
36
- checkText: (address: string, origin: string, text: string) => Promise<SecurityCheckResponse>;
37
- checkTx: (tx: Tx, origin: string, address: string, update_nonce?: boolean) => Promise<SecurityCheckResponse>;
38
- preExecTx: ({ tx, origin, address, updateNonce, pending_tx_list, }: {
39
- tx: Tx;
40
- origin: string;
41
- address: string;
42
- updateNonce: boolean;
43
- pending_tx_list: Tx[];
44
- }) => Promise<ExplainTxResponse>;
45
- historyGasUsed: (params: {
46
- tx: Tx;
47
- user_addr: string;
48
- }) => Promise<{
49
- gas_used: number;
50
- }>;
51
- pendingTxList: (tx: Tx, origin: string, address: string, update_nonce?: boolean) => Promise<Tx[]>;
52
- traceTx: (txId: string, traceId: string, chainId: string) => Promise<void>;
53
- pushTx: (tx: Tx, traceId?: string) => Promise<any>;
54
- explainText: (origin: string, address: string, text: string) => Promise<{
55
- comment: string;
56
- }>;
57
- gasMarket: (chainId: string, customGas?: number) => Promise<GasLevel[]>;
58
- getTx: (chainId: string, hash: string, gasPrice: number) => Promise<GetTxResponse>;
59
- getEnsAddressByName: (name: string) => Promise<{
60
- addr: string;
61
- name: string;
62
- }>;
63
- searchToken: (id: string, q: string, chainId?: string, is_all?: boolean) => Promise<TokenItem[]>;
64
- searchSwapToken: (id: string, chainId: string, q: string, is_all?: boolean) => Promise<any>;
65
- getToken: (id: string, chainId: string, tokenId: string) => Promise<TokenItem>;
66
- getCachedTokenList: (id: string) => Promise<TokenItem[]>;
67
- listToken: (id: string, chainId?: string, isAll?: boolean) => Promise<TokenItem[]>;
68
- getHistoryTokenList: (params: {
69
- id: string;
70
- chainId?: string;
71
- timeAt?: number;
72
- dateAt?: string;
73
- }) => Promise<TokenItem[]>;
74
- _customListToken: (uuids: string[], id: string, isTestnet?: boolean) => Promise<TokenItem[]>;
75
- customListToken: (uuids: string[], id: string) => Promise<TokenItem[]>;
76
- listChainAssets: (id: string) => Promise<AssetItem[]>;
77
- listNFT: (id: string, isAll?: boolean) => Promise<NFTItem[]>;
78
- listCollection: (params: {
79
- collection_ids: string;
80
- }) => Promise<Collection[]>;
81
- listTxHisotry: (params: {
82
- id?: string;
83
- chain_id?: string;
84
- token_id?: string;
85
- coin_id?: string;
86
- start_time?: number;
87
- page_count?: number;
88
- }) => Promise<TxHistoryResult>;
89
- tokenPrice: (tokenName: string) => Promise<{
90
- change_percent: number;
91
- last_price: number;
92
- }>;
93
- tokenAuthorizedList: (id: string, chain_id: string) => Promise<TokenApproval[]>;
94
- userNFTAuthorizedList: (id: string, chain_id: string) => Promise<NFTApprovalResponse>;
95
- getDEXList: (chain_id: string) => Promise<{
96
- id: string;
97
- name: string;
98
- logo_url: string;
99
- site_url: string;
100
- type: string;
101
- }[]>;
102
- getSwapQuote: (params: {
103
- id: string;
104
- chain_id: string;
105
- dex_id: string;
106
- pay_token_id: string;
107
- pay_token_raw_amount: string;
108
- receive_token_id: string;
109
- slippage?: string | number;
110
- }) => Promise<{
111
- receive_token_raw_amount: number;
112
- dex_approve_to: string;
113
- dex_swap_to: string;
114
- dex_swap_calldata: string;
115
- is_wrapped: boolean;
116
- gas: {
117
- gas_used: number;
118
- gas_price: number;
119
- gas_cost_value: number;
120
- gas_cost_usd_value: number;
121
- };
122
- pay_token: TokenItem;
123
- receive_token: TokenItem;
124
- }>;
125
- getSwapTokenList: (id: string, chainId?: string) => Promise<TokenItem[]>;
126
- postGasStationOrder: (params: {
127
- userAddr: string;
128
- fromChainId: string;
129
- fromTxId: string;
130
- toChainId: string;
131
- toTokenAmount: string;
132
- fromTokenId: string;
133
- fromTokenAmount: string;
134
- fromUsdValue: number;
135
- }) => Promise<any>;
136
- getGasStationChainBalance: (chain_id: string, addr: string) => Promise<{
137
- usd_value: number;
138
- }>;
139
- getGasStationTokenList: () => Promise<TokenItem[]>;
140
- explainTypedData: (user_addr: string, origin: string, data: any) => Promise<ExplainTypedDataResponse>;
141
- checkTypedData: (user_addr: string, origin: string, data: any) => Promise<SecurityCheckResponse>;
142
- approvalStatus: (id: string) => Promise<ApprovalStatus[]>;
143
- usedChainList: (id: string) => Promise<UsedChain[]>;
144
- getLatestVersion: () => Promise<{
145
- version_tag: string;
146
- }>;
147
- addOriginFeedback: (params: {
148
- user_addr: string;
149
- origin: string;
150
- is_safe: boolean;
151
- }) => Promise<{
152
- is_success: boolean;
153
- }>;
154
- getProtocolList: (addr: string) => Promise<Protocol[]>;
155
- getComplexProtocolList: (addr: string) => Promise<ComplexProtocol[]>;
156
- getProtocol: ({ addr, id, }: {
157
- addr: string;
158
- id: string;
159
- }) => Promise<ComplexProtocol>;
160
- getHistoryProtocol: ({ addr, id, timeAt, dateAt, }: {
161
- addr: string;
162
- id: string;
163
- timeAt?: number | undefined;
164
- dateAt?: number | undefined;
165
- }) => Promise<ComplexProtocol>;
166
- getTokenHistoryPrice: ({ chainId, id, timeAt, }: {
167
- chainId: string;
168
- id: string;
169
- timeAt: number;
170
- }) => Promise<{
171
- price: number;
172
- }>;
173
- getTokenHistoryDict: ({ chainId, ids, timeAt, }: {
174
- chainId: string;
175
- ids: string;
176
- timeAt: number;
177
- }) => Promise<Record<string, number>>;
178
- getNetCurve: (addr: string) => Promise<{
179
- timestamp: number;
180
- usd_value: number;
181
- }[]>;
182
- getChainList: () => Promise<ServerChain[]>;
183
- getCEXSwapQuote: (params: {
184
- cex_id: string;
185
- pay_token_id: string;
186
- pay_token_amount: string;
187
- receive_token_id: string;
188
- chain_id: string;
189
- }) => Promise<CEXQuote>;
190
- getSwapTradeList: (params: {
191
- user_addr: string;
192
- start: string;
193
- limit: string;
194
- }) => Promise<SwapTradeList>;
195
- postSwap: (params: {
196
- quote: {
197
- pay_token_id: string;
198
- pay_token_amount: number;
199
- receive_token_id: string;
200
- receive_token_amount: number;
201
- slippage: number;
202
- };
203
- dex_id: string;
204
- tx_id: string;
205
- tx: Tx;
206
- }) => Promise<any>;
207
- checkSlippage: (params: {
208
- chain_id: string;
209
- slippage: string;
210
- from_token_id: string;
211
- to_token_id: string;
212
- }) => Promise<SlippageStatus>;
213
- getOriginPopularityLevel: (origin: string) => Promise<{
214
- level: 'very_low' | 'low' | 'medium' | 'high';
215
- }>;
216
- getOriginIsScam: (origin: string, source: string) => Promise<{
217
- is_scam: boolean;
218
- }>;
219
- getOriginThirdPartyCollectList: (origin: string) => Promise<{
220
- collect_list: {
221
- name: string;
222
- logo_url: string;
223
- }[];
224
- }>;
225
- getSummarizedAssetList: (id: string, chain_id?: string) => Promise<Summary>;
226
- parseTx: ({ chainId, tx, origin, addr, }: {
227
- chainId: string;
228
- tx: Tx;
229
- origin: string;
230
- addr: string;
231
- }) => Promise<ParseTxResponse>;
232
- isSuspiciousToken: (id: string, chainId: string) => Promise<{
233
- is_suspicious: boolean;
234
- }>;
235
- depositCexSupport: (id: string, chainId: string, cexId: string) => Promise<{
236
- support: boolean;
237
- }>;
238
- depositCexList: (id: string, chainId: string) => Promise<{
239
- cex_list: Cex[];
240
- }>;
241
- getContractCredit: (id: string, chainId: string) => Promise<ContractCredit>;
242
- hasInteraction: (addr: string, chainId: string, contractId: string) => Promise<{
243
- has_interaction: boolean;
244
- }>;
245
- tokenApproveExposure: (id: string, chainId: string) => Promise<{
246
- usd_value: number;
247
- }>;
248
- addrDesc: (id: string) => Promise<AddrDescResponse>;
249
- hasTransfer: (chainId: string, from: string, to: string) => Promise<{
250
- has_transfer: boolean;
251
- }>;
252
- isTokenContract: (chainId: string, id: string) => Promise<{
253
- is_token: boolean;
254
- }>;
255
- addrUsedChainList: (id: string) => Promise<UsedChain[]>;
256
- getTokenNFTExposure: (chainId: string, id: string) => Promise<{
257
- usd_value: number;
258
- }>;
259
- getCollection: (chainId: string, id: string) => Promise<{
260
- collection: CollectionWithFloorPrice;
261
- }>;
262
- isSuspiciousCollection: (chainId: string, id: string) => Promise<{
263
- is_suspicious: boolean;
264
- }>;
265
- isOriginVerified: (origin: string) => Promise<{
266
- is_verified: boolean | null;
267
- }>;
268
- parseTypedData: ({ typedData, origin, address, }: {
269
- typedData: Record<string, any>;
270
- origin: string;
271
- address: string;
272
- }) => Promise<ParseTypedDataResponse>;
273
- parseText: ({ text, origin, address, }: {
274
- text: string;
275
- origin: string;
276
- address: string;
277
- }) => Promise<ParseTextResponse>;
278
- collectionList: ({ id, chainId, isAll, }: {
279
- id: string;
280
- chainId?: string | undefined;
281
- isAll: boolean;
282
- }) => Promise<CollectionList[]>;
283
- gasPriceStats: (chainId: string) => Promise<{
284
- median: number;
285
- }>;
286
- badgeHasClaimed: (id: string) => Promise<{
287
- id: string;
288
- badge_id: number;
289
- user_id: string;
290
- inner_id: number;
291
- create_at: number;
292
- update_at: number;
293
- has_claimed: true;
294
- } | {
295
- has_claimed: false;
296
- }>;
297
- badgeHasMinted: (id: string) => Promise<{
298
- id: string;
299
- badge_id: number;
300
- user_id: string;
301
- inner_id: number;
302
- usd_value: number;
303
- tvf: number;
304
- mint_at: number;
305
- has_minted: true;
306
- } | {
307
- has_minted: false;
308
- }>;
309
- mintBadge: (params: {
310
- code: string;
311
- userAddr: string;
312
- }) => Promise<{
313
- is_success: boolean;
314
- inner_id: number;
315
- }>;
316
- userHasRequestedFaucet: (params: {
317
- chain_id: string;
318
- user_addr: string;
319
- }) => Promise<{
320
- has_requested: boolean;
321
- }>;
322
- requestFaucet: (params: {
323
- chain_id: string;
324
- user_addr: string;
325
- }) => Promise<{
326
- is_success: boolean;
327
- }>;
328
- }
329
- export {};
1
+ import { AxiosAdapter } from 'axios';
2
+ import { RateLimitedAxiosInstance } from 'axios-rate-limit';
3
+ import { AddrDescResponse, ApprovalStatus, AssetItem, CEXQuote, Cex, ChainWithPendingCount, Collection, CollectionList, CollectionWithFloorPrice, ComplexProtocol, ContractCredit, ExplainTxResponse, ExplainTypedDataResponse, GasLevel, GetTxResponse, MempoolCheckDetail, NFTApprovalResponse, NFTItem, ParseTextResponse, ParseTxResponse, ParseTypedDataResponse, Protocol, SecurityCheckResponse, ServerChain, SlippageStatus, Summary, SwapTradeList, TokenApproval, TokenItem, TotalBalanceResponse, Tx, TxHistoryResult, TxPushType, TxRequest, UsedChain } from './types';
4
+ interface OpenApiStore {
5
+ host: string;
6
+ testnetHost?: string;
7
+ }
8
+ interface Options {
9
+ store: OpenApiStore;
10
+ adapter?: AxiosAdapter;
11
+ }
12
+ export declare class OpenApiService {
13
+ store: OpenApiStore;
14
+ request: RateLimitedAxiosInstance;
15
+ setHost: (host: string) => Promise<void>;
16
+ getHost: () => string;
17
+ setTestnetHost: (host: string) => Promise<void>;
18
+ getTestnetHost: () => string | undefined;
19
+ ethRpc: ((chainId: string, arg: {
20
+ method: string;
21
+ params: Array<any>;
22
+ origin?: string;
23
+ }) => Promise<any>) | (() => Promise<never>);
24
+ adapter?: AxiosAdapter;
25
+ constructor({ store, adapter }: Options);
26
+ init: (hf?: string) => Promise<void>;
27
+ private _getRequestOptions;
28
+ private _mountMethods;
29
+ getRecommendChains: (address: string, origin: string) => Promise<ServerChain[]>;
30
+ getTotalBalance: (address: string) => Promise<TotalBalanceResponse>;
31
+ getPendingCount: (address: string) => Promise<{
32
+ total_count: number;
33
+ chains: ChainWithPendingCount[];
34
+ }>;
35
+ checkOrigin: (address: string, origin: string) => Promise<SecurityCheckResponse>;
36
+ checkText: (address: string, origin: string, text: string) => Promise<SecurityCheckResponse>;
37
+ checkTx: (tx: Tx, origin: string, address: string, update_nonce?: boolean) => Promise<SecurityCheckResponse>;
38
+ preExecTx: ({ tx, origin, address, updateNonce, pending_tx_list, }: {
39
+ tx: Tx;
40
+ origin: string;
41
+ address: string;
42
+ updateNonce: boolean;
43
+ pending_tx_list: Tx[];
44
+ }) => Promise<ExplainTxResponse>;
45
+ historyGasUsed: (params: {
46
+ tx: Tx;
47
+ user_addr: string;
48
+ }) => Promise<{
49
+ gas_used: number;
50
+ }>;
51
+ pendingTxList: (tx: Tx, origin: string, address: string, update_nonce?: boolean) => Promise<Tx[]>;
52
+ traceTx: (txId: string, traceId: string, chainId: string) => Promise<void>;
53
+ pushTx: (tx: Tx, traceId?: string) => Promise<any>;
54
+ explainText: (origin: string, address: string, text: string) => Promise<{
55
+ comment: string;
56
+ }>;
57
+ gasMarket: (chainId: string, customGas?: number) => Promise<GasLevel[]>;
58
+ getTx: (chainId: string, hash: string, gasPrice: number) => Promise<GetTxResponse>;
59
+ getEnsAddressByName: (name: string) => Promise<{
60
+ addr: string;
61
+ name: string;
62
+ }>;
63
+ searchToken: (id: string, q: string, chainId?: string, is_all?: boolean) => Promise<TokenItem[]>;
64
+ searchSwapToken: (id: string, chainId: string, q: string, is_all?: boolean) => Promise<any>;
65
+ getToken: (id: string, chainId: string, tokenId: string) => Promise<TokenItem>;
66
+ getCachedTokenList: (id: string) => Promise<TokenItem[]>;
67
+ listToken: (id: string, chainId?: string, isAll?: boolean) => Promise<TokenItem[]>;
68
+ getHistoryTokenList: (params: {
69
+ id: string;
70
+ chainId?: string;
71
+ timeAt?: number;
72
+ dateAt?: string;
73
+ }) => Promise<TokenItem[]>;
74
+ _customListToken: (uuids: string[], id: string, isTestnet?: boolean) => Promise<TokenItem[]>;
75
+ customListToken: (uuids: string[], id: string) => Promise<TokenItem[]>;
76
+ listChainAssets: (id: string) => Promise<AssetItem[]>;
77
+ listNFT: (id: string, isAll?: boolean) => Promise<NFTItem[]>;
78
+ listCollection: (params: {
79
+ collection_ids: string;
80
+ }) => Promise<Collection[]>;
81
+ listTxHisotry: (params: {
82
+ id?: string;
83
+ chain_id?: string;
84
+ token_id?: string;
85
+ coin_id?: string;
86
+ start_time?: number;
87
+ page_count?: number;
88
+ }) => Promise<TxHistoryResult>;
89
+ tokenPrice: (tokenName: string) => Promise<{
90
+ change_percent: number;
91
+ last_price: number;
92
+ }>;
93
+ tokenAuthorizedList: (id: string, chain_id: string) => Promise<TokenApproval[]>;
94
+ userNFTAuthorizedList: (id: string, chain_id: string) => Promise<NFTApprovalResponse>;
95
+ getDEXList: (chain_id: string) => Promise<{
96
+ id: string;
97
+ name: string;
98
+ logo_url: string;
99
+ site_url: string;
100
+ type: string;
101
+ }[]>;
102
+ getSwapQuote: (params: {
103
+ id: string;
104
+ chain_id: string;
105
+ dex_id: string;
106
+ pay_token_id: string;
107
+ pay_token_raw_amount: string;
108
+ receive_token_id: string;
109
+ slippage?: string | number;
110
+ }) => Promise<{
111
+ receive_token_raw_amount: number;
112
+ dex_approve_to: string;
113
+ dex_swap_to: string;
114
+ dex_swap_calldata: string;
115
+ is_wrapped: boolean;
116
+ gas: {
117
+ gas_used: number;
118
+ gas_price: number;
119
+ gas_cost_value: number;
120
+ gas_cost_usd_value: number;
121
+ };
122
+ pay_token: TokenItem;
123
+ receive_token: TokenItem;
124
+ }>;
125
+ getSwapTokenList: (id: string, chainId?: string) => Promise<TokenItem[]>;
126
+ postGasStationOrder: (params: {
127
+ userAddr: string;
128
+ fromChainId: string;
129
+ fromTxId: string;
130
+ toChainId: string;
131
+ toTokenAmount: string;
132
+ fromTokenId: string;
133
+ fromTokenAmount: string;
134
+ fromUsdValue: number;
135
+ }) => Promise<any>;
136
+ getGasStationChainBalance: (chain_id: string, addr: string) => Promise<{
137
+ usd_value: number;
138
+ }>;
139
+ getGasStationTokenList: () => Promise<TokenItem[]>;
140
+ explainTypedData: (user_addr: string, origin: string, data: any) => Promise<ExplainTypedDataResponse>;
141
+ checkTypedData: (user_addr: string, origin: string, data: any) => Promise<SecurityCheckResponse>;
142
+ approvalStatus: (id: string) => Promise<ApprovalStatus[]>;
143
+ usedChainList: (id: string) => Promise<UsedChain[]>;
144
+ getLatestVersion: () => Promise<{
145
+ version_tag: string;
146
+ }>;
147
+ addOriginFeedback: (params: {
148
+ user_addr: string;
149
+ origin: string;
150
+ is_safe: boolean;
151
+ }) => Promise<{
152
+ is_success: boolean;
153
+ }>;
154
+ getProtocolList: (addr: string) => Promise<Protocol[]>;
155
+ getComplexProtocolList: (addr: string) => Promise<ComplexProtocol[]>;
156
+ getProtocol: ({ addr, id, }: {
157
+ addr: string;
158
+ id: string;
159
+ }) => Promise<ComplexProtocol>;
160
+ getHistoryProtocol: ({ addr, id, timeAt, dateAt, }: {
161
+ addr: string;
162
+ id: string;
163
+ timeAt?: number | undefined;
164
+ dateAt?: number | undefined;
165
+ }) => Promise<ComplexProtocol>;
166
+ getTokenHistoryPrice: ({ chainId, id, timeAt, }: {
167
+ chainId: string;
168
+ id: string;
169
+ timeAt: number;
170
+ }) => Promise<{
171
+ price: number;
172
+ }>;
173
+ getTokenHistoryDict: ({ chainId, ids, timeAt, }: {
174
+ chainId: string;
175
+ ids: string;
176
+ timeAt: number;
177
+ }) => Promise<Record<string, number>>;
178
+ getNetCurve: (addr: string) => Promise<{
179
+ timestamp: number;
180
+ usd_value: number;
181
+ }[]>;
182
+ getChainList: () => Promise<ServerChain[]>;
183
+ getCEXSwapQuote: (params: {
184
+ cex_id: string;
185
+ pay_token_id: string;
186
+ pay_token_amount: string;
187
+ receive_token_id: string;
188
+ chain_id: string;
189
+ }) => Promise<CEXQuote>;
190
+ getSwapTradeList: (params: {
191
+ user_addr: string;
192
+ start: string;
193
+ limit: string;
194
+ }) => Promise<SwapTradeList>;
195
+ postSwap: (params: {
196
+ quote: {
197
+ pay_token_id: string;
198
+ pay_token_amount: number;
199
+ receive_token_id: string;
200
+ receive_token_amount: number;
201
+ slippage: number;
202
+ };
203
+ dex_id: string;
204
+ tx_id: string;
205
+ tx: Tx;
206
+ }) => Promise<any>;
207
+ checkSlippage: (params: {
208
+ chain_id: string;
209
+ slippage: string;
210
+ from_token_id: string;
211
+ to_token_id: string;
212
+ }) => Promise<SlippageStatus>;
213
+ getOriginPopularityLevel: (origin: string) => Promise<{
214
+ level: 'very_low' | 'low' | 'medium' | 'high';
215
+ }>;
216
+ getOriginIsScam: (origin: string, source: string) => Promise<{
217
+ is_scam: boolean;
218
+ }>;
219
+ getOriginThirdPartyCollectList: (origin: string) => Promise<{
220
+ collect_list: {
221
+ name: string;
222
+ logo_url: string;
223
+ }[];
224
+ }>;
225
+ getSummarizedAssetList: (id: string, chain_id?: string) => Promise<Summary>;
226
+ parseTx: ({ chainId, tx, origin, addr, }: {
227
+ chainId: string;
228
+ tx: Tx;
229
+ origin: string;
230
+ addr: string;
231
+ }) => Promise<ParseTxResponse>;
232
+ isSuspiciousToken: (id: string, chainId: string) => Promise<{
233
+ is_suspicious: boolean;
234
+ }>;
235
+ depositCexSupport: (id: string, chainId: string, cexId: string) => Promise<{
236
+ support: boolean;
237
+ }>;
238
+ depositCexList: (id: string, chainId: string) => Promise<{
239
+ cex_list: Cex[];
240
+ }>;
241
+ getContractCredit: (id: string, chainId: string) => Promise<ContractCredit>;
242
+ hasInteraction: (addr: string, chainId: string, contractId: string) => Promise<{
243
+ has_interaction: boolean;
244
+ }>;
245
+ tokenApproveExposure: (id: string, chainId: string) => Promise<{
246
+ usd_value: number;
247
+ }>;
248
+ addrDesc: (id: string) => Promise<AddrDescResponse>;
249
+ hasTransfer: (chainId: string, from: string, to: string) => Promise<{
250
+ has_transfer: boolean;
251
+ }>;
252
+ isTokenContract: (chainId: string, id: string) => Promise<{
253
+ is_token: boolean;
254
+ }>;
255
+ addrUsedChainList: (id: string) => Promise<UsedChain[]>;
256
+ getTokenNFTExposure: (chainId: string, id: string) => Promise<{
257
+ usd_value: number;
258
+ }>;
259
+ getCollection: (chainId: string, id: string) => Promise<{
260
+ collection: CollectionWithFloorPrice;
261
+ }>;
262
+ isSuspiciousCollection: (chainId: string, id: string) => Promise<{
263
+ is_suspicious: boolean;
264
+ }>;
265
+ isOriginVerified: (origin: string) => Promise<{
266
+ is_verified: boolean | null;
267
+ }>;
268
+ parseTypedData: ({ typedData, origin, address, }: {
269
+ typedData: Record<string, any>;
270
+ origin: string;
271
+ address: string;
272
+ }) => Promise<ParseTypedDataResponse>;
273
+ parseText: ({ text, origin, address, }: {
274
+ text: string;
275
+ origin: string;
276
+ address: string;
277
+ }) => Promise<ParseTextResponse>;
278
+ collectionList: ({ id, chainId, isAll, }: {
279
+ id: string;
280
+ chainId?: string | undefined;
281
+ isAll: boolean;
282
+ }) => Promise<CollectionList[]>;
283
+ gasPriceStats: (chainId: string) => Promise<{
284
+ median: number;
285
+ }>;
286
+ badgeHasClaimed: (id: string) => Promise<{
287
+ id: string;
288
+ badge_id: number;
289
+ user_id: string;
290
+ inner_id: number;
291
+ create_at: number;
292
+ update_at: number;
293
+ has_claimed: true;
294
+ } | {
295
+ has_claimed: false;
296
+ }>;
297
+ badgeHasMinted: (id: string) => Promise<{
298
+ id: string;
299
+ badge_id: number;
300
+ user_id: string;
301
+ inner_id: number;
302
+ usd_value: number;
303
+ tvf: number;
304
+ mint_at: number;
305
+ has_minted: true;
306
+ } | {
307
+ has_minted: false;
308
+ }>;
309
+ mintBadge: (params: {
310
+ code: string;
311
+ userAddr: string;
312
+ }) => Promise<{
313
+ is_success: boolean;
314
+ inner_id: number;
315
+ }>;
316
+ userHasRequestedFaucet: (params: {
317
+ chain_id: string;
318
+ user_addr: string;
319
+ }) => Promise<{
320
+ has_requested: boolean;
321
+ }>;
322
+ requestFaucet: (params: {
323
+ chain_id: string;
324
+ user_addr: string;
325
+ }) => Promise<{
326
+ is_success: boolean;
327
+ }>;
328
+ gasSupportedPushType: (chainId: string) => Promise<{
329
+ low_gas: boolean;
330
+ mev: boolean;
331
+ }>;
332
+ submitTx: (postData: {
333
+ req_id?: string;
334
+ tx: Tx;
335
+ push_type: TxPushType;
336
+ low_gas_deadline?: number;
337
+ }) => Promise<{
338
+ req: TxRequest;
339
+ }>;
340
+ getTxRequests: (ids: string | string[]) => Promise<TxRequest[]>;
341
+ withdrawTx: (reqId: string) => Promise<{
342
+ req: TxRequest;
343
+ }>;
344
+ retryPushTx: (reqId: string) => Promise<{
345
+ req: TxRequest;
346
+ }>;
347
+ mempoolChecks: (txId: string, chainId: string) => Promise<MempoolCheckDetail[]>;
348
+ }
349
+ export {};