@rabby-wallet/rabby-api 0.9.59 → 0.9.60-beta.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,1585 +1,1596 @@
1
- import { AxiosAdapter, AxiosRequestConfig } from 'axios';
2
- import { RateLimitedAxiosInstance } from 'axios-rate-limit';
3
- import { InitOptions, RabbyApiPlugin } from './plugins/intf';
4
- import { AddrDescResponse, BridgeAggregator, ApprovalStatus, AssetItem, BasicDappInfo, CEXQuote, Cex, ChainListItem, ChainWithPendingCount, Collection, CollectionList, CollectionWithFloorPrice, ComplexProtocol, ContractCredit, DbkBridgeHistoryItem, ExplainTxResponse, ExplainTypedDataResponse, GasLevel, GetTxResponse, HistoryCurve, LatestExplainTxResponse, MempoolCheckDetail, NFTApprovalResponse, NFTItem, NodeStatus, NodeStatusDetail, ParseTextResponse, ParseTxResponse, ParseTypedDataResponse, PendingTxItem, Protocol, SecurityCheckResponse, ServerChain, SlippageStatus, Summary, SupportedChain, SwapTradeList, TokenApproval, TokenItem, TokenPriceListResponse, TotalBalanceResponse, Tx, TxAllHistoryResult, TxHistoryResult, TxPushType, TxRequest, UsedChain, BridgeTokenPair, BridgeQuote, BridgeHistory, ContractInfo, GasAccountCheckResult, ParseCommonResponse, WithdrawListAddressItem, BuyCountryItem, BuyQuoteItem, BuyHistoryList, BuyPaymentMethod, GasAccountInfo, GasAccountBridgeSupportTokenList, GasAccountBridgeQuote, GasAccountBridgeCreateResponse, GasAccountRechargeStatus, TokenEntityDetail, TokenItemWithEntity, ProjectItem, CopyTradeTokenListResponse, CopyTradeRecentBuyListResponse, CopyTradePnlListResponse, AppChainListResponse, CopyTradeTokenListV2Response, CopyTradeRecentBuyListV2Response, CopyTradeTokenItemV2, CopyTradeSameToken, DefaultRPCRes, TokenDetailWithPriceCurve, GiftEligibilityItem, UserFeedbackItem, PerpTopToken, KlineDataItem, TokenMarketInfo, TokenHolderInfo, TokenSupplyInfo, MarketSummary, MarketTradingHistoryItem, TokenHolderSummary, TokenHolderItem, CurrencyItem, PerpBridgeQuote, LiquidityPoolItem, LiquidityPoolHistoryItem, NFTDetail, NFTTradingConfig, PrepareAcceptNFTOfferResponse, PrepareListingNFTResponse, CreateListingNFTOfferResponse, NFTListingResponse, MemeListResponse, TokenMarketCategoryListResponse, TokenMarketTokenListResponse } from './types';
5
- interface OpenApiStore {
6
- host: string;
7
- testnetHost?: string;
8
- apiKey: string | null;
9
- apiTime: number | null;
10
- }
11
- interface Options {
12
- store: OpenApiStore | Promise<OpenApiStore>;
13
- plugin: RabbyApiPlugin;
14
- adapter?: AxiosAdapter;
15
- clientName?: string;
16
- clientVersion?: string;
17
- }
18
- declare enum CurveDayType {
19
- DAY = 1,
20
- WEEK = 7
21
- }
22
- declare type VersionPrefix = 'v1' | 'v2';
23
- declare type ApiOptions<V extends VersionPrefix | void = VersionPrefix> = {
24
- restfulPrefix?: V;
25
- };
26
- declare type GnosisRequestOptions = {
27
- txServiceUrl: string;
28
- };
29
- declare type GnosisSafeRequestOptions = GnosisRequestOptions & {
30
- safeAddress: string;
31
- };
32
- declare type GnosisPostTransactionOptions = GnosisSafeRequestOptions & {
33
- data: Record<string, any>;
34
- };
35
- declare type GnosisConfirmTransactionOptions = GnosisRequestOptions & {
36
- safeTransactionHash: string;
37
- data: Record<string, any>;
38
- };
39
- declare type GnosisSafeTxGasOptions = GnosisSafeRequestOptions & {
40
- safeTxData: {
41
- to: string;
42
- value?: string;
43
- data?: string | null;
44
- operation?: number;
45
- };
46
- };
47
- declare type GnosisGetSafeMessagesOptions = GnosisSafeRequestOptions & {
48
- options?: Record<string, any>;
49
- };
50
- declare type GnosisAddSafeMessageOptions = GnosisSafeRequestOptions & {
51
- data: {
52
- message: string | Record<string, any>;
53
- signature: string;
54
- safeAppId?: number;
55
- };
56
- };
57
- declare type GnosisGetSafeMessageOptions = GnosisRequestOptions & {
58
- messageHash: string;
59
- };
60
- declare type GnosisAddSafeMessageSignatureOptions = GnosisRequestOptions & {
61
- messageHash: string;
62
- signature: string;
63
- };
64
- export declare class OpenApiService {
65
- #private;
66
- store: OpenApiStore;
67
- request: RateLimitedAxiosInstance;
68
- constructor({ store, plugin, adapter, clientName, clientVersion, }: Options);
69
- setHost: (host: string) => Promise<void>;
70
- setHostSync: (host: string) => void;
71
- setAPIKey: (apiKey: string) => Promise<void>;
72
- setAPITime: (apiTime: number) => Promise<void>;
73
- removeAPIKey: () => Promise<void>;
74
- getHost: () => string;
75
- setTestnetHost: (host: string) => Promise<void>;
76
- getTestnetHost: () => string | undefined;
77
- ethRpc: ((chainId: string, arg: {
78
- method: string;
79
- params: Array<any>;
80
- origin?: string;
81
- }) => Promise<any>) | (() => Promise<never>);
82
- init: (options?: string | InitOptions) => Promise<void>;
83
- initSync(options?: InitOptions): void;
84
- getSafePendingTransactions: ({ txServiceUrl, safeAddress, nonce, }: GnosisRequestOptions & {
85
- safeAddress: string;
86
- } & {
87
- nonce: number;
88
- }) => Promise<{
89
- results: any[];
90
- }>;
91
- postSafeTransactions: ({ txServiceUrl, safeAddress, data, }: GnosisPostTransactionOptions) => Promise<void>;
92
- getSafeInfo: ({ txServiceUrl, safeAddress, }: GnosisSafeRequestOptions) => Promise<any>;
93
- confirmSafeTransaction: ({ txServiceUrl, safeTransactionHash, data, }: GnosisConfirmTransactionOptions) => Promise<void>;
94
- getSafeTxGas: ({ txServiceUrl, safeAddress, safeTxData, }: GnosisSafeTxGasOptions) => Promise<string | undefined>;
95
- getSafeMessages: ({ txServiceUrl, safeAddress, options, }: GnosisGetSafeMessagesOptions) => Promise<{
96
- results: any[];
97
- }>;
98
- addSafeMessage: ({ txServiceUrl, safeAddress, data, }: GnosisAddSafeMessageOptions) => Promise<void>;
99
- getSafeMessage: ({ txServiceUrl, messageHash, }: GnosisGetSafeMessageOptions) => Promise<any>;
100
- addSafeMessageSignature: ({ txServiceUrl, messageHash, signature, }: GnosisAddSafeMessageSignatureOptions) => Promise<void>;
101
- asyncJob: <T = any>(url: string, options?: AxiosRequestConfig & {
102
- retryDelay?: number;
103
- }) => Promise<T>;
104
- private _mountMethods;
105
- getRecommendChains: (address: string, origin: string) => Promise<ServerChain[]>;
106
- getTotalBalance: (address: string, isCore?: boolean) => Promise<TotalBalanceResponse>;
107
- getTotalBalanceV2: ({ address, isCore, included_token_uuids, excluded_token_uuids, excluded_protocol_ids, excluded_chain_ids, }: {
108
- address: string;
109
- isCore: boolean;
110
- included_token_uuids: string[];
111
- excluded_token_uuids: string[];
112
- excluded_protocol_ids: string[];
113
- excluded_chain_ids: string[];
114
- }) => Promise<TotalBalanceResponse>;
115
- get24hTotalBalance: (address: string) => Promise<{
116
- total_usd_value: number;
117
- }>;
118
- getPendingCount: (address: string) => Promise<{
119
- total_count: number;
120
- chains: ChainWithPendingCount[];
121
- }>;
122
- checkOrigin: (address: string, origin: string) => Promise<SecurityCheckResponse>;
123
- checkText: (address: string, origin: string, text: string) => Promise<SecurityCheckResponse>;
124
- checkTx: (tx: Tx, origin: string, address: string, update_nonce?: boolean) => Promise<SecurityCheckResponse>;
125
- preExecTx: ({ tx, origin, address, updateNonce, pending_tx_list, delegate_call, }: {
126
- tx: Tx;
127
- origin: string;
128
- address: string;
129
- updateNonce: boolean;
130
- pending_tx_list: Tx[];
131
- delegate_call?: boolean | undefined;
132
- }) => Promise<ExplainTxResponse>;
133
- historyGasUsed: (params: {
134
- tx: Tx;
135
- user_addr: string;
136
- }) => Promise<{
137
- gas_used: number;
138
- }>;
139
- pendingTxList: (tx: Tx, origin: string, address: string, update_nonce?: boolean) => Promise<Tx[]>;
140
- traceTx: (txId: string, traceId: string, chainId: string) => Promise<void>;
141
- pushTx: (tx: Tx, traceId?: string) => Promise<any>;
142
- explainText: (origin: string, address: string, text: string) => Promise<{
143
- comment: string;
144
- }>;
145
- gasMarket: (chainId: string, customGas?: number) => Promise<GasLevel[]>;
146
- gasMarketV2: (options: {
147
- chainId: string;
148
- tx?: Tx;
149
- customGas?: number;
150
- }) => Promise<GasLevel[]>;
151
- getTx: (chainId: string, hash: string, gasPrice: number) => Promise<GetTxResponse>;
152
- getEnsAddressByName: (name: string) => Promise<{
153
- addr: string;
154
- name: string;
155
- }>;
156
- searchToken: (id: string, q: string, chainId?: string, is_all?: boolean) => Promise<TokenItem[]>;
157
- searchSwapToken: (id: string, chainId: string, q: string, is_all?: boolean) => Promise<any>;
158
- getToken: (id: string, chainId: string, tokenId: string) => Promise<TokenItem>;
159
- getCachedTokenList: (id: string) => Promise<TokenItem[]>;
160
- listToken: (id: string, chainId?: string, isAll?: boolean) => Promise<TokenItem[]>;
161
- getTokenEntity: (id: string, chainId?: string) => Promise<TokenEntityDetail>;
162
- getHistoryTokenList: (params: {
163
- id: string;
164
- chainId?: string;
165
- timeAt?: number;
166
- dateAt?: string;
167
- }) => Promise<TokenItem[]>;
168
- customListToken: (uuids: string[], id: string) => Promise<TokenItem[]>;
169
- listChainAssets: (id: string) => Promise<AssetItem[]>;
170
- listNFT: (id: string, isAll?: boolean, sortByCredit?: boolean) => Promise<NFTItem[]>;
171
- listCollection: (params: {
172
- collection_ids: string;
173
- }) => Promise<Collection[]>;
174
- hasNewTxFrom: (params: {
175
- address: string;
176
- startTime: number;
177
- }) => Promise<{
178
- has_new_tx: boolean;
179
- }>;
180
- listTxHisotry: (params: {
181
- id?: string;
182
- chain_id?: string;
183
- token_id?: string;
184
- coin_id?: string;
185
- start_time?: number;
186
- page_count?: number;
187
- }) => Promise<TxHistoryResult>;
188
- getAllTxHistory: (params: {
189
- id: string;
190
- start_time?: number;
191
- page_count?: number;
192
- }, options?: Parameters<typeof this.asyncJob>[1]) => Promise<TxAllHistoryResult>;
193
- tokenPrice: (tokenName: string) => Promise<{
194
- change_percent: number;
195
- last_price: number;
196
- }>;
197
- getTokenPriceList: (params: {
198
- uuids: string[];
199
- }) => Promise<TokenPriceListResponse>;
200
- tokenAuthorizedList: <V extends VersionPrefix | undefined>(id: string, chain_id: string, options?: ApiOptions<V> | undefined) => Promise<TokenApproval[]>;
201
- userNFTAuthorizedList: (id: string, chain_id: string) => Promise<NFTApprovalResponse>;
202
- getDEXList: (chain_id: string) => Promise<{
203
- id: string;
204
- name: string;
205
- logo_url: string;
206
- site_url: string;
207
- type: string;
208
- }[]>;
209
- getSwapQuote: (params: {
210
- id: string;
211
- chain_id: string;
212
- dex_id: string;
213
- pay_token_id: string;
214
- pay_token_raw_amount: string;
215
- receive_token_id: string;
216
- slippage?: string | number;
217
- fee?: boolean;
218
- }) => Promise<{
219
- receive_token_raw_amount: number;
220
- dex_approve_to: string;
221
- dex_swap_to: string;
222
- dex_swap_calldata: string;
223
- is_wrapped: boolean;
224
- gas: {
225
- gas_used: number;
226
- gas_price: number;
227
- gas_cost_value: number;
228
- gas_cost_usd_value: number;
229
- };
230
- pay_token: TokenItem;
231
- receive_token: TokenItem;
232
- dex_fee_desc?: string | null | undefined;
233
- }>;
234
- getSwapTokenList: (id: string, chainId?: string) => Promise<TokenItem[]>;
235
- postGasStationOrder: (params: {
236
- userAddr: string;
237
- fromChainId: string;
238
- fromTxId: string;
239
- toChainId: string;
240
- toTokenAmount: string;
241
- fromTokenId: string;
242
- fromTokenAmount: string;
243
- fromUsdValue: number;
244
- }) => Promise<any>;
245
- getGasStationChainBalance: (chain_id: string, addr: string) => Promise<{
246
- usd_value: number;
247
- }>;
248
- getApprovalCount: (address: string) => Promise<{
249
- total_asset_cnt: number;
250
- }>;
251
- getGasStationTokenList: () => Promise<TokenItem[]>;
252
- explainTypedData: (user_addr: string, origin: string, data: any) => Promise<ExplainTypedDataResponse>;
253
- checkTypedData: (user_addr: string, origin: string, data: any) => Promise<SecurityCheckResponse>;
254
- approvalStatus: (id: string, options?: ApiOptions) => Promise<ApprovalStatus[]>;
255
- usedChainList: (id: string) => Promise<UsedChain[]>;
256
- getLatestVersion: () => Promise<{
257
- version_tag: string;
258
- }>;
259
- addOriginFeedback: (params: {
260
- user_addr: string;
261
- origin: string;
262
- is_safe: boolean;
263
- }) => Promise<{
264
- is_success: boolean;
265
- }>;
266
- getProtocolList: (addr: string) => Promise<Protocol[]>;
267
- getComplexProtocolList: (addr: string) => Promise<ComplexProtocol[]>;
268
- getProtocol: ({ addr, id, }: {
269
- addr: string;
270
- id: string;
271
- }) => Promise<ComplexProtocol>;
272
- getHistoryProtocol: ({ addr, id, timeAt, dateAt, }: {
273
- addr: string;
274
- id: string;
275
- timeAt?: number | undefined;
276
- dateAt?: number | undefined;
277
- }) => Promise<ComplexProtocol>;
278
- getTokenHistoryPrice: ({ chainId, id, timeAt, }: {
279
- chainId: string;
280
- id: string;
281
- timeAt: number;
282
- }) => Promise<{
283
- price: number;
284
- }>;
285
- getTokenHistoryDict: ({ chainId, ids, timeAt, }: {
286
- chainId: string;
287
- ids: string;
288
- timeAt: number;
289
- }) => Promise<Record<string, number>>;
290
- getNetCurve: (addr: string, days?: CurveDayType) => Promise<{
291
- timestamp: number;
292
- usd_value: number;
293
- }[]>;
294
- getChainList: () => Promise<ServerChain[]>;
295
- getCEXSwapQuote: (params: {
296
- cex_id: string;
297
- pay_token_id: string;
298
- pay_token_amount: string;
299
- receive_token_id: string;
300
- chain_id: string;
301
- }) => Promise<CEXQuote>;
302
- getSwapTradeList: (params: {
303
- user_addr: string;
304
- start: string;
305
- limit: string;
306
- }) => Promise<SwapTradeList>;
307
- getSwapTradeListV2: (params: {
308
- user_addr: string;
309
- limit: number;
310
- start_time?: number;
311
- }) => Promise<SwapTradeList>;
312
- postSwap: (params: {
313
- quote: {
314
- pay_token_id: string;
315
- pay_token_amount: number;
316
- receive_token_id: string;
317
- receive_token_amount: number;
318
- slippage: number;
319
- };
320
- dex_id: string;
321
- tx_id: string;
322
- tx: Tx;
323
- }) => Promise<any>;
324
- checkSlippage: (params: {
325
- chain_id: string;
326
- slippage: string;
327
- from_token_id: string;
328
- to_token_id: string;
329
- }) => Promise<SlippageStatus>;
330
- suggestSlippage: (params: {
331
- chain_id: string;
332
- slippage: string;
333
- from_token_id: string;
334
- to_token_id: string;
335
- from_token_amount: string;
336
- }) => Promise<{
337
- suggest_slippage: number;
338
- }>;
339
- getOriginPopularityLevel: (origin: string) => Promise<{
340
- level: 'very_low' | 'low' | 'medium' | 'high';
341
- }>;
342
- getOriginIsScam: (origin: string, source: string) => Promise<{
343
- is_scam: boolean;
344
- }>;
345
- getOriginThirdPartyCollectList: (origin: string) => Promise<{
346
- collect_list: {
347
- name: string;
348
- logo_url: string;
349
- }[];
350
- }>;
351
- getSummarizedAssetList: (id: string, chain_id?: string) => Promise<Summary>;
352
- unexpectedAddrList: ({ chainId, tx, origin, addr, }: {
353
- chainId: string;
354
- tx: Tx;
355
- origin: string;
356
- addr: string;
357
- }) => Promise<{
358
- id: string;
359
- }[]>;
360
- gasLessTxCheck: ({ tx, usdValue, preExecSuccess, gasUsed, }: {
361
- gasUsed: number;
362
- preExecSuccess: boolean;
363
- tx: Tx;
364
- usdValue: number;
365
- }) => Promise<{
366
- is_gasless: boolean;
367
- desc?: string;
368
- promotion?: {
369
- id: string;
370
- contract_id: string;
371
- chain_id: string;
372
- config: {
373
- button_text: string;
374
- before_click_text: string;
375
- after_click_text: string;
376
- logo: string;
377
- theme_color: string;
378
- dark_color: string;
379
- };
380
- };
381
- }>;
382
- gasLessTxsCheck: (postData: {
383
- tx_list: Tx[];
384
- }) => Promise<{
385
- is_gasless: boolean;
386
- desc?: string;
387
- promotion?: {
388
- id: string;
389
- contract_id: string;
390
- chain_id: string;
391
- config: {
392
- button_text: string;
393
- before_click_text: string;
394
- after_click_text: string;
395
- logo: string;
396
- theme_color: string;
397
- dark_color: string;
398
- };
399
- };
400
- }>;
401
- parseTx: ({ chainId, tx, origin, addr, }: {
402
- chainId: string;
403
- tx: Tx;
404
- origin: string;
405
- addr: string;
406
- }) => Promise<ParseTxResponse>;
407
- isSuspiciousToken: (id: string, chainId: string) => Promise<{
408
- is_suspicious: boolean;
409
- }>;
410
- depositCexSupport: (id: string, chainId: string, cexId: string) => Promise<{
411
- support: boolean;
412
- }>;
413
- depositCexList: (id: string, chainId: string) => Promise<{
414
- cex_list: Cex[];
415
- }>;
416
- getContractCredit: (id: string, chainId: string) => Promise<ContractCredit>;
417
- hasInteraction: (addr: string, chainId: string, contractId: string) => Promise<{
418
- has_interaction: boolean;
419
- }>;
420
- /**
421
- * @deprecated
422
- * 授权风险敞口
423
- */
424
- tokenApproveExposure: (id: string, chainId: string) => Promise<{
425
- usd_value: number;
426
- }>;
427
- tokenApproveTrustValue: (id: string, chainId: string) => Promise<{
428
- usd_value: number;
429
- }>;
430
- getContractInfo: (id: string, chainId: string) => Promise<ContractInfo | null>;
431
- addrDesc: (id: string) => Promise<AddrDescResponse>;
432
- hasTransfer: (chainId: string, from: string, to: string) => Promise<{
433
- has_transfer: boolean;
434
- }>;
435
- hasTransferAllChain: (from: string, to: string) => Promise<{
436
- has_transfer: boolean;
437
- }>;
438
- isTokenContract: (chainId: string, id: string) => Promise<{
439
- is_token: boolean;
440
- }>;
441
- addrUsedChainList: (id: string) => Promise<UsedChain[]>;
442
- /**
443
- * @deprecated
444
- */
445
- getTokenNFTExposure: (chainId: string, id: string) => Promise<{
446
- usd_value: number;
447
- }>;
448
- getTokenNFTTrustValue: (chainId: string, id: string) => Promise<{
449
- usd_value: number;
450
- }>;
451
- getCollection: (chainId: string, id: string) => Promise<{
452
- collection: CollectionWithFloorPrice;
453
- }>;
454
- isSuspiciousCollection: (chainId: string, id: string) => Promise<{
455
- is_suspicious: boolean;
456
- }>;
457
- isOriginVerified: (origin: string) => Promise<{
458
- is_verified: boolean | null;
459
- }>;
460
- parseTypedData: ({ typedData, origin, address, }: {
461
- typedData: Record<string, any>;
462
- origin: string;
463
- address: string;
464
- }) => Promise<ParseTypedDataResponse>;
465
- parseText: ({ text, origin, address, }: {
466
- text: string;
467
- origin: string;
468
- address: string;
469
- }) => Promise<ParseTextResponse>;
470
- collectionList: ({ id, chainId, isAll, }: {
471
- id: string;
472
- chainId?: string | undefined;
473
- isAll: boolean;
474
- }) => Promise<CollectionList[]>;
475
- gasPriceStats: (chainId: string) => Promise<{
476
- median: number;
477
- }>;
478
- badgeHasClaimed: (id: string) => Promise<{
479
- id: string;
480
- badge_id: number;
481
- user_id: string;
482
- inner_id: number;
483
- create_at: number;
484
- update_at: number;
485
- has_claimed: true;
486
- } | {
487
- has_claimed: false;
488
- }>;
489
- badgeHasMinted: (id: string) => Promise<{
490
- id: string;
491
- badge_id: number;
492
- user_id: string;
493
- inner_id: number;
494
- usd_value: number;
495
- tvf: number;
496
- mint_at: number;
497
- has_minted: true;
498
- } | {
499
- has_minted: false;
500
- }>;
501
- mintBadge: (params: {
502
- code: string;
503
- userAddr: string;
504
- }) => Promise<{
505
- is_success: boolean;
506
- inner_id: number;
507
- }>;
508
- badgeHasClaimedByName: ({ id, name, }: {
509
- id: string;
510
- name: string;
511
- }) => Promise<{
512
- id: string;
513
- badge_id: number;
514
- user_id: string;
515
- inner_id: number;
516
- create_at: number;
517
- update_at: number;
518
- has_claimed: true;
519
- } | {
520
- has_claimed: false;
521
- }>;
522
- badgeHasMintedByName: ({ id, name, }: {
523
- id: string;
524
- name: string;
525
- }) => Promise<{
526
- id: string;
527
- badge_id: number;
528
- user_id: string;
529
- inner_id: number;
530
- usd_value: number;
531
- tvf: number;
532
- mint_at: number;
533
- has_minted: true;
534
- } | {
535
- has_minted: false;
536
- }>;
537
- mintBadgeByName: (params: {
538
- name: string;
539
- code: string;
540
- userAddr: string;
541
- }) => Promise<{
542
- is_success: boolean;
543
- inner_id: number;
544
- }>;
545
- userHasRequestedFaucet: (params: {
546
- chain_id: string;
547
- user_addr: string;
548
- }) => Promise<{
549
- has_requested: boolean;
550
- }>;
551
- requestFaucet: (params: {
552
- chain_id: string;
553
- user_addr: string;
554
- }) => Promise<{
555
- is_success: boolean;
556
- }>;
557
- gasSupportedPushType: (chainId: string) => Promise<{
558
- low_gas: boolean;
559
- mev: boolean;
560
- }>;
561
- submitTx: (postData: {
562
- req_id?: string;
563
- tx: Tx;
564
- push_type: TxPushType;
565
- is_gasless?: boolean;
566
- is_gas_account?: boolean;
567
- log_id: string;
568
- low_gas_deadline?: number;
569
- origin?: string;
570
- sig?: string;
571
- }) => Promise<{
572
- req: TxRequest;
573
- access_token?: string;
574
- }>;
575
- submitTxV2: (postData: {
576
- frontend_push_result?: {
577
- success: true;
578
- has_pushed: true;
579
- raw_tx: string;
580
- url: string;
581
- return_tx_id: string;
582
- } | {
583
- success: false;
584
- has_pushed: true;
585
- url: string;
586
- error_msg: string;
587
- };
588
- backend_push_require: {
589
- gas_type: 'gas_account' | 'gasless' | null;
590
- };
591
- context: {
592
- tx: Tx;
593
- origin?: string;
594
- log_id: string;
595
- };
596
- mev_share_model: 'user' | 'rabby';
597
- sig?: string;
598
- }) => Promise<{
599
- tx_id?: string;
600
- access_token?: string;
601
- err?: string;
602
- }>;
603
- getDefaultRPCs: () => Promise<DefaultRPCRes>;
604
- getTxRequests: (ids: string | string[]) => Promise<TxRequest[]>;
605
- getTxRequest: (id: string) => Promise<TxRequest>;
606
- withdrawTx: (reqId: string) => Promise<{
607
- req: TxRequest;
608
- }>;
609
- retryPushTx: (reqId: string) => Promise<{
610
- req: TxRequest;
611
- }>;
612
- mempoolChecks: (txId: string, chainId: string, node_info?: boolean) => Promise<MempoolCheckDetail[]>;
613
- getPendingTxList: (params: {
614
- chain_id: string;
615
- }, options?: Parameters<typeof this.asyncJob>[1]) => Promise<{
616
- pending_tx_list: PendingTxItem[];
617
- token_dict: Record<string, TokenItem | NFTItem>;
618
- }>;
619
- getLatestPreExec: (params: {
620
- id: string;
621
- }) => Promise<LatestExplainTxResponse>;
622
- walletSupportChain: (params: {
623
- chain_id: string;
624
- user_addr: string;
625
- }) => Promise<{
626
- is_success: boolean;
627
- count: number;
628
- }>;
629
- walletSupportOrigin: (params: {
630
- origin: string;
631
- user_addr: string;
632
- text: string;
633
- }) => Promise<{
634
- is_success: boolean;
635
- count: number;
636
- }>;
637
- walletSupportSelector: (params: {
638
- selector: string;
639
- user_addr: string;
640
- chain_id: string;
641
- contract_id: string;
642
- }) => Promise<{
643
- is_success: boolean;
644
- count: number;
645
- }>;
646
- searchDapp: (params?: {
647
- q?: string;
648
- chain_id?: string;
649
- start?: number;
650
- limit?: number;
651
- match_id?: boolean;
652
- }) => Promise<{
653
- page: {
654
- limit: number;
655
- start: number;
656
- total: number;
657
- };
658
- dapps: BasicDappInfo[];
659
- }>;
660
- getDappsInfo: (params: {
661
- ids: string[];
662
- }) => Promise<BasicDappInfo[]>;
663
- getDappHotTags: (params?: {
664
- limit: number;
665
- }) => Promise<string[]>;
666
- getHotDapps: (params?: {
667
- limit: number;
668
- order_by: string;
669
- }) => Promise<BasicDappInfo[]>;
670
- getRabbyClaimText: (params: {
671
- id: string;
672
- invite_code?: string;
673
- }) => Promise<{
674
- id: string;
675
- text: string;
676
- }>;
677
- getRabbySignatureText: (params: {
678
- id: string;
679
- }) => Promise<{
680
- id: string;
681
- text: string;
682
- }>;
683
- getRabbyPoints: (params: {
684
- id: string;
685
- }) => Promise<{
686
- id: string;
687
- invite_code?: string;
688
- logo_url: string;
689
- logo_thumbnail_url: string;
690
- web3_id: string;
691
- claimed_points: number;
692
- total_claimed_points: number;
693
- }>;
694
- checkRabbyPointsInviteCode: (params: {
695
- code: string;
696
- }) => Promise<{
697
- invite_code_exist: boolean;
698
- }>;
699
- setRabbyPointsInviteCode: (params: {
700
- id: string;
701
- signature: string;
702
- invite_code: string;
703
- }) => Promise<{
704
- code: number;
705
- }>;
706
- checkRabbyPointClaimable: (params: {
707
- id: string;
708
- }) => Promise<{
709
- claimable: boolean;
710
- }>;
711
- getRabbyPointsSnapshot: (params: {
712
- id: string;
713
- }) => Promise<{
714
- id: string;
715
- address_balance: number;
716
- metamask_swap: number;
717
- rabby_old_user: number;
718
- rabby_nadge: number;
719
- rabby_nft: number;
720
- extra_bouns: number;
721
- claimed: boolean;
722
- snapshot_at: number;
723
- }>;
724
- claimRabbyPointsSnapshot: (params: {
725
- id: string;
726
- signature: string;
727
- invite_code?: string;
728
- }) => Promise<{
729
- error_code: number;
730
- error_msg?: string;
731
- }>;
732
- getRabbyPointsTopUsers: (params: {
733
- id: string;
734
- }) => Promise<{
735
- id: string;
736
- logo_url: string;
737
- logo_thumbnail_url: string;
738
- web3_id: string;
739
- claimed_points: number;
740
- }[]>;
741
- getRabbyPointsList: (params: {
742
- id: string;
743
- }) => Promise<{
744
- id: number;
745
- title: string;
746
- description: string;
747
- start_at: number;
748
- end_at: number;
749
- claimable_points: number;
750
- }[]>;
751
- getRabbyPointsCampaignIsEnded: () => Promise<{
752
- campaign_is_ended: boolean;
753
- }>;
754
- claimRabbyPointsById: (params: {
755
- campaign_id: number;
756
- user_id: string;
757
- signature: string;
758
- }) => Promise<{
759
- error_code: number;
760
- }>;
761
- getRabbyPointsV2: (params: {
762
- id: string;
763
- }) => Promise<{
764
- id: string;
765
- invite_code?: string;
766
- logo_url: string;
767
- logo_thumbnail_url: string;
768
- web3_id: string;
769
- claimed_points: number;
770
- total_claimed_points: number;
771
- }>;
772
- getRabbySignatureTextV2: (params: {
773
- id: string;
774
- }) => Promise<{
775
- id: string;
776
- text: string;
777
- }>;
778
- getRabbyClaimTextV2: (params: {
779
- id: string;
780
- invite_code?: string;
781
- }) => Promise<{
782
- id: string;
783
- text: string;
784
- }>;
785
- setRabbyPointsInviteCodeV2: (params: {
786
- id: string;
787
- signature: string;
788
- invite_code: string;
789
- }) => Promise<{
790
- code: number;
791
- }>;
792
- checkRabbyPointsInviteCodeV2: (params: {
793
- code: string;
794
- }) => Promise<{
795
- invite_code_exist: boolean;
796
- }>;
797
- claimRabbyPointsSnapshotV2: (params: {
798
- id: string;
799
- signature: string;
800
- invite_code?: string;
801
- }) => Promise<{
802
- error_code: number;
803
- error_msg?: string;
804
- }>;
805
- getRabbyPointsTopUsersV2: (params: {
806
- id: string;
807
- }) => Promise<{
808
- id: string;
809
- logo_url: string;
810
- logo_thumbnail_url: string;
811
- web3_id: string;
812
- claimed_points: number;
813
- }[]>;
814
- getRabbyPointsListV2: (params: {
815
- id: string;
816
- }) => Promise<{
817
- id: number;
818
- title: string;
819
- description: string;
820
- start_at: number;
821
- end_at: number;
822
- claimable_points: number;
823
- }[]>;
824
- claimRabbyPointsByIdV2: (params: {
825
- campaign_id: number;
826
- user_id: string;
827
- signature: string;
828
- }) => Promise<{
829
- error_code: number;
830
- }>;
831
- getRabbyPointsSnapshotV2: (params: {
832
- id: string;
833
- }) => Promise<{
834
- id: string;
835
- wallet_balance_reward: number;
836
- active_stats_reward: number;
837
- extra_bouns: number;
838
- claimed: boolean;
839
- snapshot_at: number;
840
- claimed_points: number;
841
- }>;
842
- checkRabbyPointClaimableV2: (params: {
843
- id: string;
844
- }) => Promise<{
845
- claimable: boolean;
846
- }>;
847
- checkClaimInfoV2: (params: {
848
- id: string;
849
- }) => Promise<{
850
- claimable_points: number;
851
- claimed_points: number;
852
- }>;
853
- getRabbyPointsCampaignIsEndedV2: () => Promise<{
854
- campaign_is_ended: boolean;
855
- }>;
856
- getSupportedChains: () => Promise<SupportedChain[]>;
857
- searchChainList: (params?: {
858
- limit?: number;
859
- start?: number;
860
- q?: string;
861
- }) => Promise<{
862
- page: {
863
- start: number;
864
- limit: number;
865
- total: number;
866
- };
867
- chain_list: ChainListItem[];
868
- }>;
869
- getChainListByIds: (params: {
870
- ids: string;
871
- }) => Promise<ChainListItem[]>;
872
- getHistoryCurve: (addr: string) => Promise<HistoryCurve>;
873
- getHistoryCurveSupportedList: () => Promise<{
874
- supported_chains: string[];
875
- }>;
876
- getHistoryCurveStatus: (params: {
877
- id: string;
878
- }) => Promise<{
879
- failed_msg: Record<string, string>;
880
- id: string;
881
- status: 'pending' | 'running' | 'finished' | 'failed';
882
- update_at: number;
883
- }>;
884
- initHistoryCurve: (params: {
885
- id: string;
886
- }) => Promise<{
887
- success: boolean;
888
- }>;
889
- getNodeStatusList: () => Promise<NodeStatus[]>;
890
- getNodeStatusDetail: (params: {
891
- chain_id: string;
892
- }) => Promise<NodeStatusDetail>;
893
- postActionLog: (body: {
894
- id: string;
895
- type: 'tx' | 'typed_data' | 'text';
896
- rules: {
897
- id: string;
898
- level: string | null;
899
- }[];
900
- }) => Promise<any>;
901
- checkSpoofing: ({ from, to, }: {
902
- from: string;
903
- to: string;
904
- }) => Promise<{
905
- is_spoofing: boolean;
906
- }>;
907
- getAddressByDeBankId: (name: string) => Promise<{
908
- addr: string;
909
- web3_id: string;
910
- }>;
911
- getBridgeSupportChain: () => Promise<string[]>;
912
- getBridgeAggregatorList: () => Promise<BridgeAggregator[]>;
913
- getBridgePairList: (params: {
914
- aggregator_ids: string[];
915
- to_chain_id: string;
916
- user_addr: string;
917
- }) => Promise<BridgeTokenPair[]>;
918
- getBridgeQuoteList: (params: {
919
- aggregator_ids: string;
920
- user_addr: string;
921
- from_chain_id: string;
922
- from_token_id: string;
923
- from_token_raw_amount: string;
924
- to_chain_id: string;
925
- to_token_id: string;
926
- }) => Promise<Omit<BridgeQuote, 'tx'>[]>;
927
- getBridgeQuoteListV2: (params: {
928
- aggregator_id: string;
929
- user_addr: string;
930
- from_chain_id: string;
931
- from_token_id: string;
932
- from_token_raw_amount: string;
933
- to_chain_id: string;
934
- to_token_id: string;
935
- }) => Promise<Omit<BridgeQuote, 'tx'>[]>;
936
- getBridgeQuote: (params: {
937
- aggregator_id: string;
938
- bridge_id: string;
939
- user_addr: string;
940
- from_chain_id: string;
941
- from_token_id: string;
942
- from_token_raw_amount: string;
943
- to_chain_id: string;
944
- to_token_id: string;
945
- }) => Promise<BridgeQuote>;
946
- getBridgeHistoryList: (params: {
947
- user_addr: string;
948
- start: number;
949
- limit: number;
950
- is_all?: boolean;
951
- }) => Promise<{
952
- history_list: BridgeHistory[];
953
- total_cnt: number;
954
- }>;
955
- buildBridgeTx: (params: {
956
- aggregator_id: string;
957
- bridge_id: string;
958
- user_addr: string;
959
- from_chain_id: string;
960
- from_token_id: string;
961
- from_token_raw_amount: string;
962
- to_chain_id: string;
963
- to_token_id: string;
964
- slippage: string;
965
- quote_key: string;
966
- }) => Promise<Tx>;
967
- postBridgeHistory: (params: {
968
- aggregator_id: string;
969
- bridge_id: string;
970
- from_chain_id: string;
971
- from_token_id: string;
972
- from_token_amount: string | number;
973
- to_chain_id: string;
974
- to_token_id: string;
975
- to_token_amount: string | number;
976
- tx_id: string;
977
- tx: Tx;
978
- rabby_fee: number;
979
- }) => Promise<{
980
- success: boolean;
981
- }>;
982
- /**
983
- * no id just no check address
984
- */
985
- getPerpPermission: (params: {
986
- id?: string;
987
- }) => Promise<{
988
- has_permission: boolean;
989
- }>;
990
- /**
991
- * @param params.dex_id - The ID of the DEX to get the top tokens for. If not provided, hyperliquid default DEXs will be included. if all is provided, all DEXs will be included. and xyz is xyz dex tokens
992
- * @returns A list of top tokens for the given DEX.
993
- */
994
- getPerpTopTokenList: (params: {
995
- dex_id?: string;
996
- }) => Promise<PerpTopToken[]>;
997
- getPerpsBridgeIsSupportToken: (params: {
998
- token_id: string;
999
- chain_id: string;
1000
- }) => Promise<{
1001
- success: boolean;
1002
- }>;
1003
- getPerpBridgeQuote: (params: {
1004
- user_addr: string;
1005
- from_chain_id: string;
1006
- from_token_id: string;
1007
- from_token_raw_amount: string;
1008
- }) => Promise<PerpBridgeQuote>;
1009
- postPerpBridgeHistory: (params: {
1010
- from_chain_id: string;
1011
- from_token_id: string;
1012
- from_token_amount: number;
1013
- to_token_amount: number;
1014
- tx_id: string;
1015
- tx: Tx;
1016
- }) => Promise<{
1017
- success: boolean;
1018
- }>;
1019
- getSupportedDEXList: () => Promise<{
1020
- dex_list: string[];
1021
- }>;
1022
- createDbkBridgeHistory: (postData: Pick<DbkBridgeHistoryItem, 'user_addr' | 'from_chain_id' | 'to_chain_id' | 'tx_id' | 'from_token_amount'>) => Promise<{
1023
- success: boolean;
1024
- }>;
1025
- getDbkBridgeHistoryList: (params: {
1026
- user_addr: string;
1027
- start?: number;
1028
- limit?: number;
1029
- }) => Promise<{
1030
- page: {
1031
- total: number;
1032
- limit: number;
1033
- start: number;
1034
- };
1035
- data: DbkBridgeHistoryItem[];
1036
- }>;
1037
- getGasAccountSignText: (account_id: string) => Promise<{
1038
- text: string;
1039
- }>;
1040
- getGasAccountInfo: (params: {
1041
- sig: string;
1042
- id: string;
1043
- }) => Promise<{
1044
- account: GasAccountInfo;
1045
- }>;
1046
- getGasAccountInfoV2: (params: {
1047
- id: string;
1048
- }) => Promise<{
1049
- account: GasAccountInfo;
1050
- }>;
1051
- createGasAccountPayInfo: (postData: {
1052
- id: string;
1053
- }) => Promise<{
1054
- account: GasAccountInfo;
1055
- }>;
1056
- checkGasAccountGiftEligibility: (params: {
1057
- id: string;
1058
- }) => Promise<{
1059
- has_eligibility: boolean;
1060
- can_claimed_usd_value: number;
1061
- }>;
1062
- checkGasAccountGiftEligibilityBatch: (params: {
1063
- ids: string[];
1064
- }) => Promise<GiftEligibilityItem[]>;
1065
- confirmIapOrder: (postData: {
1066
- transaction_id: string;
1067
- device_type: 'android' | 'ios';
1068
- product_id: string;
1069
- }) => Promise<{
1070
- req: TxRequest;
1071
- }>;
1072
- claimGasAccountGift: (params: {
1073
- sig: string;
1074
- id: string;
1075
- }) => Promise<{
1076
- success: boolean;
1077
- }>;
1078
- loginGasAccount: (params: {
1079
- sig: string;
1080
- account_id: string;
1081
- }) => Promise<{
1082
- success: boolean;
1083
- }>;
1084
- logoutGasAccount: (params: {
1085
- sig: string;
1086
- account_id: string;
1087
- }) => Promise<{
1088
- success: boolean;
1089
- }>;
1090
- getGasAccountTokenList: (id: string) => Promise<TokenItem[]>;
1091
- getGasAccountBridgeSupportTokenList: () => Promise<GasAccountBridgeSupportTokenList>;
1092
- getGasAccountBridgeQuote: (params: {
1093
- user_addr: string;
1094
- from_chain_id: string;
1095
- from_token_id: string;
1096
- from_token_raw_amount: string | number;
1097
- slippage?: number;
1098
- }) => Promise<GasAccountBridgeQuote>;
1099
- createGasAccountBridgeRecharge: (p: {
1100
- sig: string;
1101
- gas_account_id: string;
1102
- user_addr: string;
1103
- from_chain_id: string;
1104
- from_token_id: string;
1105
- from_token_amount: number;
1106
- from_usd_value: number;
1107
- tx_id: string;
1108
- scene: 'in_tx_flow' | 'recharge';
1109
- }) => Promise<GasAccountBridgeCreateResponse>;
1110
- getGasAccountBridgeStatus: (params: {
1111
- from_chain_id: string;
1112
- tx_id: string;
1113
- } | {
1114
- transaction_id: string;
1115
- product_id: string;
1116
- device_type: 'android' | 'ios';
1117
- }) => Promise<GasAccountRechargeStatus>;
1118
- rechargeGasAccount: (p: {
1119
- sig: string;
1120
- account_id: string;
1121
- tx_id: string;
1122
- chain_id: string;
1123
- amount: number;
1124
- user_addr: string;
1125
- nonce: number;
1126
- }) => Promise<{
1127
- success: boolean;
1128
- }>;
1129
- withdrawGasAccount: (p: {
1130
- sig: string;
1131
- amount: number;
1132
- account_id: string;
1133
- user_addr: string;
1134
- chain_id: string;
1135
- fee: number;
1136
- }) => Promise<{
1137
- success: boolean;
1138
- }>;
1139
- getWithdrawList: (p: {
1140
- sig: string;
1141
- id: string;
1142
- }) => Promise<WithdrawListAddressItem[]>;
1143
- getGasAccountHistory: (p: {
1144
- sig: string;
1145
- account_id: string;
1146
- start: number;
1147
- limit: number;
1148
- }) => Promise<{
1149
- recharge_list: {
1150
- amount: number;
1151
- chain_id: string;
1152
- create_at: number;
1153
- gas_account_id: string;
1154
- tx_id: string;
1155
- user_addr: string;
1156
- }[];
1157
- withdraw_list: {
1158
- amount: number;
1159
- chain_id: string;
1160
- create_at: number;
1161
- gas_account_id: string;
1162
- tx_id: string;
1163
- user_addr: string;
1164
- }[];
1165
- history_list: {
1166
- id: string;
1167
- chain_id: string;
1168
- create_at: number;
1169
- gas_cost_usd_value: number;
1170
- gas_account_id: string;
1171
- tx_id: string;
1172
- usd_value: number;
1173
- user_addr: string;
1174
- history_type: 'tx' | 'recharge' | 'withdraw';
1175
- source: string;
1176
- }[];
1177
- pagination: {
1178
- limit: number;
1179
- start: number;
1180
- total: number;
1181
- };
1182
- }>;
1183
- checkGasAccountTxs: (p: {
1184
- sig?: string;
1185
- account_id: string;
1186
- tx_list: Tx[];
1187
- }) => Promise<GasAccountCheckResult>;
1188
- getGasAccountAml: (id: string) => Promise<{
1189
- is_risk: boolean;
1190
- }>;
1191
- parseCommon: (params: {
1192
- typed_data: Record<string, any>;
1193
- origin: string;
1194
- user_addr: string;
1195
- }) => Promise<ParseCommonResponse>;
1196
- getRecommendBridgeToChain: (params: {
1197
- from_chain_id: string;
1198
- }) => Promise<{
1199
- to_chain_id: string;
1200
- }>;
1201
- getRecommendFromToken: (params: {
1202
- user_addr: string;
1203
- from_chain_id: string;
1204
- from_token_id: string;
1205
- from_token_amount: string;
1206
- to_chain_id: string;
1207
- to_token_id: string;
1208
- }) => Promise<{
1209
- token_list: TokenItem[];
1210
- }>;
1211
- getBridgeToTokenList: (params: {
1212
- from_chain_id: string;
1213
- to_chain_id: string;
1214
- from_token_id?: string;
1215
- q?: string;
1216
- user_addr?: string;
1217
- }) => Promise<{
1218
- token_list: (TokenItem & {
1219
- trade_volume_24h: 'low' | 'middle' | 'high';
1220
- })[];
1221
- }>;
1222
- getBridgeQuoteV2: (params: {
1223
- aggregator_id: string;
1224
- user_addr: string;
1225
- from_chain_id: string;
1226
- from_token_id: string;
1227
- from_token_raw_amount: string;
1228
- to_chain_id: string;
1229
- to_token_id: string;
1230
- slippage: string;
1231
- }) => Promise<Omit<BridgeQuote, 'tx'>[]>;
1232
- getBridgeQuoteTxV2: (params: {
1233
- aggregator_id: string;
1234
- bridge_id: string;
1235
- user_addr: string;
1236
- from_chain_id: string;
1237
- from_token_id: string;
1238
- from_token_raw_amount: string;
1239
- to_chain_id: string;
1240
- to_token_id: string;
1241
- slippage: string;
1242
- }) => Promise<BridgeQuote>;
1243
- isSameBridgeToken: (params: {
1244
- from_chain_id: string;
1245
- from_token_id: string;
1246
- to_chain_id: string;
1247
- to_token_id: string;
1248
- }) => Promise<{
1249
- is_same: boolean;
1250
- aggregator_id: string;
1251
- }[]>;
1252
- getBridgeSupportChainV2: () => Promise<string[]>;
1253
- submitFeedback: ({ text, usage, }: {
1254
- text: string;
1255
- /**
1256
- * @description 'usage' is used to submit feedback on rating scene.
1257
- * by default, it means 'uninstall' scene.
1258
- */
1259
- usage?: "rating" | undefined;
1260
- }) => Promise<{
1261
- success: boolean;
1262
- }>;
1263
- uninstalledFeedback: ({ text, }: {
1264
- text: string;
1265
- }) => Promise<{
1266
- success: boolean;
1267
- }>;
1268
- /**
1269
- * @deprecated
1270
- */
1271
- getToken24hPrice: (params: {
1272
- chain_id: string;
1273
- id: string;
1274
- }) => Promise<{
1275
- time_at: number;
1276
- price: number;
1277
- }[]>;
1278
- getTokenPriceCurve: (params: {
1279
- chain_id: string;
1280
- id: string;
1281
- days: number | 1 | 7;
1282
- }) => Promise<{
1283
- time_at: number;
1284
- price: number;
1285
- }[]>;
1286
- getTokenDatePrice: (params: {
1287
- chain_id: string;
1288
- id: string;
1289
- }) => Promise<{
1290
- date_at: string;
1291
- price: number;
1292
- }[]>;
1293
- searchTokens: (params: {
1294
- q: string;
1295
- }) => Promise<TokenItem[]>;
1296
- searchTokensV2: (params: {
1297
- q: string;
1298
- chain_id?: string;
1299
- }) => Promise<TokenItemWithEntity[]>;
1300
- getCopyTradingChainList: () => Promise<string[]>;
1301
- getCopyTradingTokenList: (params: {
1302
- chain_id: string;
1303
- limit: number;
1304
- start_time: number;
1305
- }) => Promise<CopyTradeTokenListResponse>;
1306
- getCopyTradingTokenListV2: (params: {
1307
- chain_id: string;
1308
- limit: number;
1309
- cursor: string;
1310
- order_by: 'price_change' | 'buy_address_count' | 'token_create_at';
1311
- order?: 'asc' | 'desc';
1312
- time_range?: '24h' | '7d' | '30d';
1313
- }) => Promise<CopyTradeTokenListV2Response>;
1314
- getCopyTradingRecentBuyList: (params: {
1315
- chain_id: string;
1316
- token_id: string;
1317
- limit: number;
1318
- }) => Promise<CopyTradeRecentBuyListResponse>;
1319
- getCopyTradingRecentBuyListV2: (params: {
1320
- chain_id: string;
1321
- token_id: string;
1322
- limit: number;
1323
- cursor: string;
1324
- }) => Promise<CopyTradeRecentBuyListV2Response>;
1325
- getCopyTradingDetail: (params: {
1326
- chain_id: string;
1327
- token_id: string;
1328
- }) => Promise<CopyTradeTokenItemV2>;
1329
- getCopyTradingSameName: (params: {
1330
- chain_id: string;
1331
- token_id: string;
1332
- }) => Promise<CopyTradeSameToken[]>;
1333
- getCopyTradingPnlList: (params: {
1334
- user_addr: string;
1335
- }) => Promise<CopyTradePnlListResponse>;
1336
- batchQueryTokens: (uuids: string | string[]) => Promise<TokenItem[]>;
1337
- getBuySupportedCountryList: () => Promise<BuyCountryItem[]>;
1338
- getBuySupportedTokenList: () => Promise<(TokenItem & {
1339
- currency_code: string;
1340
- })[]>;
1341
- getBuyQuote: (params: {
1342
- country_code: string;
1343
- user_addr: string;
1344
- usd_amount: string;
1345
- currency_code: string;
1346
- receive_token_uuid: string;
1347
- }) => Promise<BuyQuoteItem[]>;
1348
- getBuyWidgetUrl: (params: {
1349
- country_code: string;
1350
- user_addr: string;
1351
- usd_amount: string;
1352
- receive_token_uuid: string;
1353
- service_provider: string;
1354
- currency_code: string;
1355
- redirect_url?: string;
1356
- }) => Promise<{
1357
- url: string;
1358
- msg: number;
1359
- }>;
1360
- getBuyHistory: (params: {
1361
- user_addr: string;
1362
- start?: number;
1363
- limit?: number;
1364
- }) => Promise<BuyHistoryList>;
1365
- getBuyPaymentMethods: (params: {
1366
- currency_code: string;
1367
- country_code: string;
1368
- service_provider: string;
1369
- }) => Promise<BuyPaymentMethod[]>;
1370
- getBuyCurrencyList: () => Promise<{
1371
- id: string;
1372
- name: string;
1373
- image_url: string;
1374
- }[]>;
1375
- getOfflineChainList: () => Promise<{
1376
- id: string;
1377
- offline_at: number;
1378
- }[]>;
1379
- isBlockedAddress: (id: string) => Promise<{
1380
- is_blocked: boolean;
1381
- }>;
1382
- estimateGasUsd: ({ tx, origin, address, updateNonce, pending_tx_list, }: {
1383
- tx: Tx;
1384
- origin: string;
1385
- address: string;
1386
- updateNonce: boolean;
1387
- pending_tx_list: Tx[];
1388
- }) => Promise<{
1389
- gas_used?: number;
1390
- safe_gas_used?: number;
1391
- }>;
1392
- getCexSupportList: () => Promise<ProjectItem[]>;
1393
- getAppChainList: (id: string) => Promise<AppChainListResponse>;
1394
- checkCex: (postData: {
1395
- chain_id: string;
1396
- id: string;
1397
- cex_id: string;
1398
- }) => Promise<{
1399
- success: boolean;
1400
- }>;
1401
- getHotTokenList: () => Promise<TokenDetailWithPriceCurve[]>;
1402
- getTokensDetailByUuids: (uuids: string[]) => Promise<TokenDetailWithPriceCurve[]>;
1403
- getTokenKlineData: (params: {
1404
- chain_id: string;
1405
- token_id: string;
1406
- interval: string;
1407
- after_time_at?: number;
1408
- }) => Promise<{
1409
- data_list: KlineDataItem[];
1410
- }>;
1411
- getTokenMarketInfo: (params: {
1412
- chain_id: string;
1413
- token_id: string;
1414
- }) => Promise<TokenMarketInfo>;
1415
- getTokenHolderInfo: (params: {
1416
- chain_id: string;
1417
- token_id: string;
1418
- }) => Promise<TokenHolderInfo>;
1419
- getTokenSupplyInfo: (params: {
1420
- chain_id: string;
1421
- token_id: string;
1422
- }) => Promise<TokenSupplyInfo>;
1423
- postUserFeedback: (data: {
1424
- title: string;
1425
- image_url_list: string[];
1426
- content: string;
1427
- extra?: UserFeedbackItem['extra'];
1428
- }) => Promise<UserFeedbackItem>;
1429
- getUserFeedback: (id: string) => Promise<UserFeedbackItem>;
1430
- getUserFeedbackList: (id: string | string[]) => Promise<UserFeedbackItem[]>;
1431
- getCurrencyList: () => Promise<CurrencyItem[]>;
1432
- getMarketSummary: ({ token_id, chain_id, }: {
1433
- token_id: string;
1434
- chain_id: string;
1435
- }) => Promise<MarketSummary>;
1436
- getMarketTradingHistory: (params: {
1437
- token_id: string;
1438
- chain_id: string;
1439
- action?: 'buy' | 'sell';
1440
- after_time_at?: number;
1441
- limit?: number;
1442
- cursor?: string;
1443
- }) => Promise<{
1444
- pagination: {
1445
- limit: number;
1446
- has_next: boolean;
1447
- next_cursor?: string;
1448
- };
1449
- data_list: MarketTradingHistoryItem[];
1450
- }>;
1451
- getTokenHolderSummary: (params: {
1452
- token_id: string;
1453
- chain_id: string;
1454
- }) => Promise<TokenHolderSummary>;
1455
- getTokenHolderList: (params: {
1456
- token_id: string;
1457
- chain_id: string;
1458
- }) => Promise<{
1459
- data_list: TokenHolderItem[];
1460
- }>;
1461
- getLiquidityPoolList: (params: {
1462
- token_id: string;
1463
- chain_id: string;
1464
- }) => Promise<LiquidityPoolItem[]>;
1465
- getLiquidityPoolHistoryList: (params: {
1466
- token_id: string;
1467
- chain_id: string;
1468
- action?: 'add' | 'remove';
1469
- limit?: number;
1470
- cursor?: string;
1471
- }) => Promise<{
1472
- pagination: {
1473
- limit: number;
1474
- has_next: boolean;
1475
- next_cursor?: string;
1476
- };
1477
- data_list: LiquidityPoolHistoryItem[];
1478
- }>;
1479
- getTokenMarketCategoryList: () => Promise<TokenMarketCategoryListResponse>;
1480
- getNFTTradingConfig: () => Promise<NFTTradingConfig>;
1481
- getNFTDetail: (params: {
1482
- chain_id: string;
1483
- id: string;
1484
- user_addr: string;
1485
- }) => Promise<NFTDetail>;
1486
- getNFTListingOrders: (params: {
1487
- maker: string;
1488
- chain_id: string;
1489
- collection_id: string;
1490
- inner_id: string;
1491
- limit?: number;
1492
- cursor?: string;
1493
- }) => Promise<NFTListingResponse>;
1494
- getNFTFees: (params: {
1495
- chain_id: string;
1496
- collection_id: string;
1497
- inner_id: string;
1498
- }) => Promise<{
1499
- marketplace_fees: {
1500
- recipient: string;
1501
- fee: number;
1502
- required: boolean;
1503
- }[];
1504
- custom_royalties: {
1505
- recipient: string;
1506
- fee: number;
1507
- required: boolean;
1508
- }[];
1509
- }>;
1510
- prepareListingNFT: (postData: {
1511
- maker: string;
1512
- chain_id: string;
1513
- collection_id: string;
1514
- inner_id: string;
1515
- wei_price: string;
1516
- quantity?: number;
1517
- marketplace_fees: {
1518
- recipient: string;
1519
- fee: number;
1520
- }[];
1521
- custom_royalties: {
1522
- recipient: string;
1523
- fee: number;
1524
- }[];
1525
- listing_time_at?: number;
1526
- expiration_time_at?: number;
1527
- currency: string;
1528
- salt?: string;
1529
- }) => Promise<PrepareListingNFTResponse>;
1530
- createListingNFT: (postData: {
1531
- chain_id: string;
1532
- order: PrepareListingNFTResponse['data']['post']['body']['order'];
1533
- signature: string;
1534
- protocol_address?: string;
1535
- }) => Promise<CreateListingNFTOfferResponse>;
1536
- prepareAcceptNFTOffer: (postData: {
1537
- chain_id: string;
1538
- order_hash: string;
1539
- fulfiller: string;
1540
- collection_id: string;
1541
- inner_id: string;
1542
- quantity?: number;
1543
- include_optional_creator_fees?: boolean;
1544
- }) => Promise<PrepareAcceptNFTOfferResponse>;
1545
- submitAcceptNFTOfferTx: (postData: {
1546
- tx_id: string;
1547
- data: Tx;
1548
- }) => Promise<{
1549
- success: boolean;
1550
- }>;
1551
- checkTokenDepositForbidden: (params: {
1552
- chain_id: string;
1553
- id: string;
1554
- user_addr: string;
1555
- to_addr: string;
1556
- }) => Promise<{
1557
- msg: string;
1558
- }>;
1559
- getPolyMarketPermission: (params: {
1560
- id?: string;
1561
- }) => Promise<{
1562
- has_permission: boolean;
1563
- }>;
1564
- getDappPermission: (params: {
1565
- id?: string;
1566
- dapp: string;
1567
- }) => Promise<{
1568
- has_permission: boolean;
1569
- }>;
1570
- getMemeList: (params: {
1571
- order_by?: 'fdv' | 'volume_24h' | 'price_change_24h';
1572
- order?: 'asc' | 'desc';
1573
- limit?: number;
1574
- cursor?: string;
1575
- }) => Promise<MemeListResponse>;
1576
- getTokenMarketTokenList: (params: {
1577
- category_id: string;
1578
- order_by?: string;
1579
- order?: 'asc' | 'desc';
1580
- limit?: number;
1581
- cursor?: string;
1582
- version?: string;
1583
- }) => Promise<TokenMarketTokenListResponse>;
1584
- }
1585
- export {};
1
+ import { AxiosAdapter, AxiosRequestConfig } from 'axios';
2
+ import { RateLimitedAxiosInstance } from 'axios-rate-limit';
3
+ import { InitOptions, RabbyApiPlugin } from './plugins/intf';
4
+ import { AddrDescResponse, BridgeAggregator, ApprovalStatus, AssetItem, BasicDappInfo, CEXQuote, Cex, ChainListItem, ChainWithPendingCount, Collection, CollectionList, CollectionWithFloorPrice, ComplexProtocol, ContractCredit, DbkBridgeHistoryItem, ExplainTxResponse, ExplainTypedDataResponse, GasLevel, GetTxResponse, HistoryCurve, LatestExplainTxResponse, MempoolCheckDetail, NFTApprovalResponse, NFTItem, NodeStatus, NodeStatusDetail, ParseTextResponse, ParseTxResponse, ParseTypedDataResponse, PendingTxItem, Protocol, SecurityCheckResponse, ServerChain, SlippageStatus, Summary, SupportedChain, SwapTradeList, TokenApproval, TokenItem, TokenPriceListResponse, TotalBalanceResponse, Tx, TxAllHistoryResult, TxHistoryResult, TxPushType, TxRequest, UsedChain, BridgeTokenPair, BridgeQuote, BridgeHistory, ContractInfo, GasAccountCheckResult, ParseCommonResponse, WithdrawListAddressItem, BuyCountryItem, BuyQuoteItem, BuyHistoryList, BuyPaymentMethod, GasAccountInfo, GasAccountBridgeSupportTokenList, GasAccountBridgeQuote, GasAccountBridgeCreateResponse, GasAccountRechargeStatus, TokenEntityDetail, TokenItemWithEntity, ProjectItem, CopyTradeTokenListResponse, CopyTradeRecentBuyListResponse, CopyTradePnlListResponse, AppChainListResponse, CopyTradeTokenListV2Response, CopyTradeRecentBuyListV2Response, CopyTradeTokenItemV2, CopyTradeSameToken, DefaultRPCRes, TokenDetailWithPriceCurve, GiftEligibilityItem, UserFeedbackItem, PerpTopToken, KlineDataItem, TokenMarketInfo, TokenHolderInfo, TokenSupplyInfo, MarketSummary, MarketTradingHistoryItem, TokenHolderSummary, TokenHolderItem, CurrencyItem, PerpBridgeQuote, LiquidityPoolItem, LiquidityPoolHistoryItem, NFTDetail, NFTTradingConfig, PrepareAcceptNFTOfferResponse, PrepareListingNFTResponse, CreateListingNFTOfferResponse, NFTListingResponse, MemeListResponse, TokenMarketCategoryListResponse, TokenMarketTokenListResponse, PerpTopTokenV3 } from './types';
5
+ interface OpenApiStore {
6
+ host: string;
7
+ testnetHost?: string;
8
+ apiKey: string | null;
9
+ apiTime: number | null;
10
+ }
11
+ interface Options {
12
+ store: OpenApiStore | Promise<OpenApiStore>;
13
+ plugin: RabbyApiPlugin;
14
+ adapter?: AxiosAdapter;
15
+ clientName?: string;
16
+ clientVersion?: string;
17
+ }
18
+ declare enum CurveDayType {
19
+ DAY = 1,
20
+ WEEK = 7
21
+ }
22
+ declare type VersionPrefix = 'v1' | 'v2';
23
+ declare type ApiOptions<V extends VersionPrefix | void = VersionPrefix> = {
24
+ restfulPrefix?: V;
25
+ };
26
+ declare type GnosisRequestOptions = {
27
+ txServiceUrl: string;
28
+ };
29
+ declare type GnosisSafeRequestOptions = GnosisRequestOptions & {
30
+ safeAddress: string;
31
+ };
32
+ declare type GnosisPostTransactionOptions = GnosisSafeRequestOptions & {
33
+ data: Record<string, any>;
34
+ };
35
+ declare type GnosisConfirmTransactionOptions = GnosisRequestOptions & {
36
+ safeTransactionHash: string;
37
+ data: Record<string, any>;
38
+ };
39
+ declare type GnosisSafeTxGasOptions = GnosisSafeRequestOptions & {
40
+ safeTxData: {
41
+ to: string;
42
+ value?: string;
43
+ data?: string | null;
44
+ operation?: number;
45
+ };
46
+ };
47
+ declare type GnosisGetSafeMessagesOptions = GnosisSafeRequestOptions & {
48
+ options?: Record<string, any>;
49
+ };
50
+ declare type GnosisAddSafeMessageOptions = GnosisSafeRequestOptions & {
51
+ data: {
52
+ message: string | Record<string, any>;
53
+ signature: string;
54
+ safeAppId?: number;
55
+ };
56
+ };
57
+ declare type GnosisGetSafeMessageOptions = GnosisRequestOptions & {
58
+ messageHash: string;
59
+ };
60
+ declare type GnosisAddSafeMessageSignatureOptions = GnosisRequestOptions & {
61
+ messageHash: string;
62
+ signature: string;
63
+ };
64
+ export declare class OpenApiService {
65
+ #private;
66
+ store: OpenApiStore;
67
+ request: RateLimitedAxiosInstance;
68
+ constructor({ store, plugin, adapter, clientName, clientVersion, }: Options);
69
+ setHost: (host: string) => Promise<void>;
70
+ setHostSync: (host: string) => void;
71
+ setAPIKey: (apiKey: string) => Promise<void>;
72
+ setAPITime: (apiTime: number) => Promise<void>;
73
+ removeAPIKey: () => Promise<void>;
74
+ getHost: () => string;
75
+ setTestnetHost: (host: string) => Promise<void>;
76
+ getTestnetHost: () => string | undefined;
77
+ ethRpc: ((chainId: string, arg: {
78
+ method: string;
79
+ params: Array<any>;
80
+ origin?: string;
81
+ }) => Promise<any>) | (() => Promise<never>);
82
+ init: (options?: string | InitOptions) => Promise<void>;
83
+ initSync(options?: InitOptions): void;
84
+ getSafePendingTransactions: ({ txServiceUrl, safeAddress, nonce, }: GnosisRequestOptions & {
85
+ safeAddress: string;
86
+ } & {
87
+ nonce: number;
88
+ }) => Promise<{
89
+ results: any[];
90
+ }>;
91
+ postSafeTransactions: ({ txServiceUrl, safeAddress, data, }: GnosisPostTransactionOptions) => Promise<void>;
92
+ getSafeInfo: ({ txServiceUrl, safeAddress, }: GnosisSafeRequestOptions) => Promise<any>;
93
+ confirmSafeTransaction: ({ txServiceUrl, safeTransactionHash, data, }: GnosisConfirmTransactionOptions) => Promise<void>;
94
+ getSafeTxGas: ({ txServiceUrl, safeAddress, safeTxData, }: GnosisSafeTxGasOptions) => Promise<string | undefined>;
95
+ getSafeMessages: ({ txServiceUrl, safeAddress, options, }: GnosisGetSafeMessagesOptions) => Promise<{
96
+ results: any[];
97
+ }>;
98
+ addSafeMessage: ({ txServiceUrl, safeAddress, data, }: GnosisAddSafeMessageOptions) => Promise<void>;
99
+ getSafeMessage: ({ txServiceUrl, messageHash, }: GnosisGetSafeMessageOptions) => Promise<any>;
100
+ addSafeMessageSignature: ({ txServiceUrl, messageHash, signature, }: GnosisAddSafeMessageSignatureOptions) => Promise<void>;
101
+ asyncJob: <T = any>(url: string, options?: AxiosRequestConfig & {
102
+ retryDelay?: number;
103
+ }) => Promise<T>;
104
+ private _mountMethods;
105
+ getRecommendChains: (address: string, origin: string) => Promise<ServerChain[]>;
106
+ getTotalBalance: (address: string, isCore?: boolean) => Promise<TotalBalanceResponse>;
107
+ getTotalBalanceV2: ({ address, isCore, included_token_uuids, excluded_token_uuids, excluded_protocol_ids, excluded_chain_ids, }: {
108
+ address: string;
109
+ isCore: boolean;
110
+ included_token_uuids: string[];
111
+ excluded_token_uuids: string[];
112
+ excluded_protocol_ids: string[];
113
+ excluded_chain_ids: string[];
114
+ }) => Promise<TotalBalanceResponse>;
115
+ get24hTotalBalance: (address: string) => Promise<{
116
+ total_usd_value: number;
117
+ }>;
118
+ getPendingCount: (address: string) => Promise<{
119
+ total_count: number;
120
+ chains: ChainWithPendingCount[];
121
+ }>;
122
+ checkOrigin: (address: string, origin: string) => Promise<SecurityCheckResponse>;
123
+ checkText: (address: string, origin: string, text: string) => Promise<SecurityCheckResponse>;
124
+ checkTx: (tx: Tx, origin: string, address: string, update_nonce?: boolean) => Promise<SecurityCheckResponse>;
125
+ preExecTx: ({ tx, origin, address, updateNonce, pending_tx_list, delegate_call, }: {
126
+ tx: Tx;
127
+ origin: string;
128
+ address: string;
129
+ updateNonce: boolean;
130
+ pending_tx_list: Tx[];
131
+ delegate_call?: boolean | undefined;
132
+ }) => Promise<ExplainTxResponse>;
133
+ historyGasUsed: (params: {
134
+ tx: Tx;
135
+ user_addr: string;
136
+ }) => Promise<{
137
+ gas_used: number;
138
+ }>;
139
+ pendingTxList: (tx: Tx, origin: string, address: string, update_nonce?: boolean) => Promise<Tx[]>;
140
+ traceTx: (txId: string, traceId: string, chainId: string) => Promise<void>;
141
+ pushTx: (tx: Tx, traceId?: string) => Promise<any>;
142
+ explainText: (origin: string, address: string, text: string) => Promise<{
143
+ comment: string;
144
+ }>;
145
+ gasMarket: (chainId: string, customGas?: number) => Promise<GasLevel[]>;
146
+ gasMarketV2: (options: {
147
+ chainId: string;
148
+ tx?: Tx;
149
+ customGas?: number;
150
+ }) => Promise<GasLevel[]>;
151
+ getTx: (chainId: string, hash: string, gasPrice: number) => Promise<GetTxResponse>;
152
+ getEnsAddressByName: (name: string) => Promise<{
153
+ addr: string;
154
+ name: string;
155
+ }>;
156
+ searchToken: (id: string, q: string, chainId?: string, is_all?: boolean) => Promise<TokenItem[]>;
157
+ searchSwapToken: (id: string, chainId: string, q: string, is_all?: boolean) => Promise<any>;
158
+ getToken: (id: string, chainId: string, tokenId: string) => Promise<TokenItem>;
159
+ getCachedTokenList: (id: string) => Promise<TokenItem[]>;
160
+ listToken: (id: string, chainId?: string, isAll?: boolean) => Promise<TokenItem[]>;
161
+ getTokenEntity: (id: string, chainId?: string) => Promise<TokenEntityDetail>;
162
+ getHistoryTokenList: (params: {
163
+ id: string;
164
+ chainId?: string;
165
+ timeAt?: number;
166
+ dateAt?: string;
167
+ }) => Promise<TokenItem[]>;
168
+ customListToken: (uuids: string[], id: string) => Promise<TokenItem[]>;
169
+ listChainAssets: (id: string) => Promise<AssetItem[]>;
170
+ listNFT: (id: string, isAll?: boolean, sortByCredit?: boolean) => Promise<NFTItem[]>;
171
+ listCollection: (params: {
172
+ collection_ids: string;
173
+ }) => Promise<Collection[]>;
174
+ hasNewTxFrom: (params: {
175
+ address: string;
176
+ startTime: number;
177
+ }) => Promise<{
178
+ has_new_tx: boolean;
179
+ }>;
180
+ listTxHisotry: (params: {
181
+ id?: string;
182
+ chain_id?: string;
183
+ token_id?: string;
184
+ coin_id?: string;
185
+ start_time?: number;
186
+ page_count?: number;
187
+ }) => Promise<TxHistoryResult>;
188
+ getAllTxHistory: (params: {
189
+ id: string;
190
+ start_time?: number;
191
+ page_count?: number;
192
+ }, options?: Parameters<typeof this.asyncJob>[1]) => Promise<TxAllHistoryResult>;
193
+ tokenPrice: (tokenName: string) => Promise<{
194
+ change_percent: number;
195
+ last_price: number;
196
+ }>;
197
+ getTokenPriceList: (params: {
198
+ uuids: string[];
199
+ }) => Promise<TokenPriceListResponse>;
200
+ tokenAuthorizedList: <V extends VersionPrefix | undefined>(id: string, chain_id: string, options?: ApiOptions<V> | undefined) => Promise<TokenApproval[]>;
201
+ userNFTAuthorizedList: (id: string, chain_id: string) => Promise<NFTApprovalResponse>;
202
+ getDEXList: (chain_id: string) => Promise<{
203
+ id: string;
204
+ name: string;
205
+ logo_url: string;
206
+ site_url: string;
207
+ type: string;
208
+ }[]>;
209
+ getSwapQuote: (params: {
210
+ id: string;
211
+ chain_id: string;
212
+ dex_id: string;
213
+ pay_token_id: string;
214
+ pay_token_raw_amount: string;
215
+ receive_token_id: string;
216
+ slippage?: string | number;
217
+ fee?: boolean;
218
+ }) => Promise<{
219
+ receive_token_raw_amount: number;
220
+ dex_approve_to: string;
221
+ dex_swap_to: string;
222
+ dex_swap_calldata: string;
223
+ is_wrapped: boolean;
224
+ gas: {
225
+ gas_used: number;
226
+ gas_price: number;
227
+ gas_cost_value: number;
228
+ gas_cost_usd_value: number;
229
+ };
230
+ pay_token: TokenItem;
231
+ receive_token: TokenItem;
232
+ dex_fee_desc?: string | null | undefined;
233
+ }>;
234
+ getSwapTokenList: (id: string, chainId?: string) => Promise<TokenItem[]>;
235
+ postGasStationOrder: (params: {
236
+ userAddr: string;
237
+ fromChainId: string;
238
+ fromTxId: string;
239
+ toChainId: string;
240
+ toTokenAmount: string;
241
+ fromTokenId: string;
242
+ fromTokenAmount: string;
243
+ fromUsdValue: number;
244
+ }) => Promise<any>;
245
+ getGasStationChainBalance: (chain_id: string, addr: string) => Promise<{
246
+ usd_value: number;
247
+ }>;
248
+ getApprovalCount: (address: string) => Promise<{
249
+ total_asset_cnt: number;
250
+ }>;
251
+ getGasStationTokenList: () => Promise<TokenItem[]>;
252
+ explainTypedData: (user_addr: string, origin: string, data: any) => Promise<ExplainTypedDataResponse>;
253
+ checkTypedData: (user_addr: string, origin: string, data: any) => Promise<SecurityCheckResponse>;
254
+ approvalStatus: (id: string, options?: ApiOptions) => Promise<ApprovalStatus[]>;
255
+ usedChainList: (id: string) => Promise<UsedChain[]>;
256
+ getLatestVersion: () => Promise<{
257
+ version_tag: string;
258
+ }>;
259
+ addOriginFeedback: (params: {
260
+ user_addr: string;
261
+ origin: string;
262
+ is_safe: boolean;
263
+ }) => Promise<{
264
+ is_success: boolean;
265
+ }>;
266
+ getProtocolList: (addr: string) => Promise<Protocol[]>;
267
+ getComplexProtocolList: (addr: string) => Promise<ComplexProtocol[]>;
268
+ getProtocol: ({ addr, id, }: {
269
+ addr: string;
270
+ id: string;
271
+ }) => Promise<ComplexProtocol>;
272
+ getHistoryProtocol: ({ addr, id, timeAt, dateAt, }: {
273
+ addr: string;
274
+ id: string;
275
+ timeAt?: number | undefined;
276
+ dateAt?: number | undefined;
277
+ }) => Promise<ComplexProtocol>;
278
+ getTokenHistoryPrice: ({ chainId, id, timeAt, }: {
279
+ chainId: string;
280
+ id: string;
281
+ timeAt: number;
282
+ }) => Promise<{
283
+ price: number;
284
+ }>;
285
+ getTokenHistoryDict: ({ chainId, ids, timeAt, }: {
286
+ chainId: string;
287
+ ids: string;
288
+ timeAt: number;
289
+ }) => Promise<Record<string, number>>;
290
+ getNetCurve: (addr: string, days?: CurveDayType) => Promise<{
291
+ timestamp: number;
292
+ usd_value: number;
293
+ }[]>;
294
+ getChainList: () => Promise<ServerChain[]>;
295
+ getCEXSwapQuote: (params: {
296
+ cex_id: string;
297
+ pay_token_id: string;
298
+ pay_token_amount: string;
299
+ receive_token_id: string;
300
+ chain_id: string;
301
+ }) => Promise<CEXQuote>;
302
+ getSwapTradeList: (params: {
303
+ user_addr: string;
304
+ start: string;
305
+ limit: string;
306
+ }) => Promise<SwapTradeList>;
307
+ getSwapTradeListV2: (params: {
308
+ user_addr: string;
309
+ limit: number;
310
+ start_time?: number;
311
+ }) => Promise<SwapTradeList>;
312
+ postSwap: (params: {
313
+ quote: {
314
+ pay_token_id: string;
315
+ pay_token_amount: number;
316
+ receive_token_id: string;
317
+ receive_token_amount: number;
318
+ slippage: number;
319
+ };
320
+ dex_id: string;
321
+ tx_id: string;
322
+ tx: Tx;
323
+ }) => Promise<any>;
324
+ checkSlippage: (params: {
325
+ chain_id: string;
326
+ slippage: string;
327
+ from_token_id: string;
328
+ to_token_id: string;
329
+ }) => Promise<SlippageStatus>;
330
+ suggestSlippage: (params: {
331
+ chain_id: string;
332
+ slippage: string;
333
+ from_token_id: string;
334
+ to_token_id: string;
335
+ from_token_amount: string;
336
+ }) => Promise<{
337
+ suggest_slippage: number;
338
+ }>;
339
+ getOriginPopularityLevel: (origin: string) => Promise<{
340
+ level: 'very_low' | 'low' | 'medium' | 'high';
341
+ }>;
342
+ getOriginIsScam: (origin: string, source: string) => Promise<{
343
+ is_scam: boolean;
344
+ }>;
345
+ getOriginThirdPartyCollectList: (origin: string) => Promise<{
346
+ collect_list: {
347
+ name: string;
348
+ logo_url: string;
349
+ }[];
350
+ }>;
351
+ getSummarizedAssetList: (id: string, chain_id?: string) => Promise<Summary>;
352
+ unexpectedAddrList: ({ chainId, tx, origin, addr, }: {
353
+ chainId: string;
354
+ tx: Tx;
355
+ origin: string;
356
+ addr: string;
357
+ }) => Promise<{
358
+ id: string;
359
+ }[]>;
360
+ gasLessTxCheck: ({ tx, usdValue, preExecSuccess, gasUsed, }: {
361
+ gasUsed: number;
362
+ preExecSuccess: boolean;
363
+ tx: Tx;
364
+ usdValue: number;
365
+ }) => Promise<{
366
+ is_gasless: boolean;
367
+ desc?: string;
368
+ promotion?: {
369
+ id: string;
370
+ contract_id: string;
371
+ chain_id: string;
372
+ config: {
373
+ button_text: string;
374
+ before_click_text: string;
375
+ after_click_text: string;
376
+ logo: string;
377
+ theme_color: string;
378
+ dark_color: string;
379
+ };
380
+ };
381
+ }>;
382
+ gasLessTxsCheck: (postData: {
383
+ tx_list: Tx[];
384
+ }) => Promise<{
385
+ is_gasless: boolean;
386
+ desc?: string;
387
+ promotion?: {
388
+ id: string;
389
+ contract_id: string;
390
+ chain_id: string;
391
+ config: {
392
+ button_text: string;
393
+ before_click_text: string;
394
+ after_click_text: string;
395
+ logo: string;
396
+ theme_color: string;
397
+ dark_color: string;
398
+ };
399
+ };
400
+ }>;
401
+ parseTx: ({ chainId, tx, origin, addr, }: {
402
+ chainId: string;
403
+ tx: Tx;
404
+ origin: string;
405
+ addr: string;
406
+ }) => Promise<ParseTxResponse>;
407
+ isSuspiciousToken: (id: string, chainId: string) => Promise<{
408
+ is_suspicious: boolean;
409
+ }>;
410
+ depositCexSupport: (id: string, chainId: string, cexId: string) => Promise<{
411
+ support: boolean;
412
+ }>;
413
+ depositCexList: (id: string, chainId: string) => Promise<{
414
+ cex_list: Cex[];
415
+ }>;
416
+ getContractCredit: (id: string, chainId: string) => Promise<ContractCredit>;
417
+ hasInteraction: (addr: string, chainId: string, contractId: string) => Promise<{
418
+ has_interaction: boolean;
419
+ }>;
420
+ /**
421
+ * @deprecated
422
+ * 授权风险敞口
423
+ */
424
+ tokenApproveExposure: (id: string, chainId: string) => Promise<{
425
+ usd_value: number;
426
+ }>;
427
+ tokenApproveTrustValue: (id: string, chainId: string) => Promise<{
428
+ usd_value: number;
429
+ }>;
430
+ getContractInfo: (id: string, chainId: string) => Promise<ContractInfo | null>;
431
+ addrDesc: (id: string) => Promise<AddrDescResponse>;
432
+ hasTransfer: (chainId: string, from: string, to: string) => Promise<{
433
+ has_transfer: boolean;
434
+ }>;
435
+ hasTransferAllChain: (from: string, to: string) => Promise<{
436
+ has_transfer: boolean;
437
+ }>;
438
+ isTokenContract: (chainId: string, id: string) => Promise<{
439
+ is_token: boolean;
440
+ }>;
441
+ addrUsedChainList: (id: string) => Promise<UsedChain[]>;
442
+ /**
443
+ * @deprecated
444
+ */
445
+ getTokenNFTExposure: (chainId: string, id: string) => Promise<{
446
+ usd_value: number;
447
+ }>;
448
+ getTokenNFTTrustValue: (chainId: string, id: string) => Promise<{
449
+ usd_value: number;
450
+ }>;
451
+ getCollection: (chainId: string, id: string) => Promise<{
452
+ collection: CollectionWithFloorPrice;
453
+ }>;
454
+ isSuspiciousCollection: (chainId: string, id: string) => Promise<{
455
+ is_suspicious: boolean;
456
+ }>;
457
+ isOriginVerified: (origin: string) => Promise<{
458
+ is_verified: boolean | null;
459
+ }>;
460
+ parseTypedData: ({ typedData, origin, address, }: {
461
+ typedData: Record<string, any>;
462
+ origin: string;
463
+ address: string;
464
+ }) => Promise<ParseTypedDataResponse>;
465
+ parseText: ({ text, origin, address, }: {
466
+ text: string;
467
+ origin: string;
468
+ address: string;
469
+ }) => Promise<ParseTextResponse>;
470
+ collectionList: ({ id, chainId, isAll, }: {
471
+ id: string;
472
+ chainId?: string | undefined;
473
+ isAll: boolean;
474
+ }) => Promise<CollectionList[]>;
475
+ gasPriceStats: (chainId: string) => Promise<{
476
+ median: number;
477
+ }>;
478
+ badgeHasClaimed: (id: string) => Promise<{
479
+ id: string;
480
+ badge_id: number;
481
+ user_id: string;
482
+ inner_id: number;
483
+ create_at: number;
484
+ update_at: number;
485
+ has_claimed: true;
486
+ } | {
487
+ has_claimed: false;
488
+ }>;
489
+ badgeHasMinted: (id: string) => Promise<{
490
+ id: string;
491
+ badge_id: number;
492
+ user_id: string;
493
+ inner_id: number;
494
+ usd_value: number;
495
+ tvf: number;
496
+ mint_at: number;
497
+ has_minted: true;
498
+ } | {
499
+ has_minted: false;
500
+ }>;
501
+ mintBadge: (params: {
502
+ code: string;
503
+ userAddr: string;
504
+ }) => Promise<{
505
+ is_success: boolean;
506
+ inner_id: number;
507
+ }>;
508
+ badgeHasClaimedByName: ({ id, name, }: {
509
+ id: string;
510
+ name: string;
511
+ }) => Promise<{
512
+ id: string;
513
+ badge_id: number;
514
+ user_id: string;
515
+ inner_id: number;
516
+ create_at: number;
517
+ update_at: number;
518
+ has_claimed: true;
519
+ } | {
520
+ has_claimed: false;
521
+ }>;
522
+ badgeHasMintedByName: ({ id, name, }: {
523
+ id: string;
524
+ name: string;
525
+ }) => Promise<{
526
+ id: string;
527
+ badge_id: number;
528
+ user_id: string;
529
+ inner_id: number;
530
+ usd_value: number;
531
+ tvf: number;
532
+ mint_at: number;
533
+ has_minted: true;
534
+ } | {
535
+ has_minted: false;
536
+ }>;
537
+ mintBadgeByName: (params: {
538
+ name: string;
539
+ code: string;
540
+ userAddr: string;
541
+ }) => Promise<{
542
+ is_success: boolean;
543
+ inner_id: number;
544
+ }>;
545
+ userHasRequestedFaucet: (params: {
546
+ chain_id: string;
547
+ user_addr: string;
548
+ }) => Promise<{
549
+ has_requested: boolean;
550
+ }>;
551
+ requestFaucet: (params: {
552
+ chain_id: string;
553
+ user_addr: string;
554
+ }) => Promise<{
555
+ is_success: boolean;
556
+ }>;
557
+ gasSupportedPushType: (chainId: string) => Promise<{
558
+ low_gas: boolean;
559
+ mev: boolean;
560
+ }>;
561
+ submitTx: (postData: {
562
+ req_id?: string;
563
+ tx: Tx;
564
+ push_type: TxPushType;
565
+ is_gasless?: boolean;
566
+ is_gas_account?: boolean;
567
+ log_id: string;
568
+ low_gas_deadline?: number;
569
+ origin?: string;
570
+ sig?: string;
571
+ }) => Promise<{
572
+ req: TxRequest;
573
+ access_token?: string;
574
+ }>;
575
+ submitTxV2: (postData: {
576
+ frontend_push_result?: {
577
+ success: true;
578
+ has_pushed: true;
579
+ raw_tx: string;
580
+ url: string;
581
+ return_tx_id: string;
582
+ } | {
583
+ success: false;
584
+ has_pushed: true;
585
+ url: string;
586
+ error_msg: string;
587
+ };
588
+ backend_push_require: {
589
+ gas_type: 'gas_account' | 'gasless' | null;
590
+ };
591
+ context: {
592
+ tx: Tx;
593
+ origin?: string;
594
+ log_id: string;
595
+ };
596
+ mev_share_model: 'user' | 'rabby';
597
+ sig?: string;
598
+ }) => Promise<{
599
+ tx_id?: string;
600
+ access_token?: string;
601
+ err?: string;
602
+ }>;
603
+ getDefaultRPCs: () => Promise<DefaultRPCRes>;
604
+ getTxRequests: (ids: string | string[]) => Promise<TxRequest[]>;
605
+ getTxRequest: (id: string) => Promise<TxRequest>;
606
+ withdrawTx: (reqId: string) => Promise<{
607
+ req: TxRequest;
608
+ }>;
609
+ retryPushTx: (reqId: string) => Promise<{
610
+ req: TxRequest;
611
+ }>;
612
+ mempoolChecks: (txId: string, chainId: string, node_info?: boolean) => Promise<MempoolCheckDetail[]>;
613
+ getPendingTxList: (params: {
614
+ chain_id: string;
615
+ }, options?: Parameters<typeof this.asyncJob>[1]) => Promise<{
616
+ pending_tx_list: PendingTxItem[];
617
+ token_dict: Record<string, TokenItem | NFTItem>;
618
+ }>;
619
+ getLatestPreExec: (params: {
620
+ id: string;
621
+ }) => Promise<LatestExplainTxResponse>;
622
+ walletSupportChain: (params: {
623
+ chain_id: string;
624
+ user_addr: string;
625
+ }) => Promise<{
626
+ is_success: boolean;
627
+ count: number;
628
+ }>;
629
+ walletSupportOrigin: (params: {
630
+ origin: string;
631
+ user_addr: string;
632
+ text: string;
633
+ }) => Promise<{
634
+ is_success: boolean;
635
+ count: number;
636
+ }>;
637
+ walletSupportSelector: (params: {
638
+ selector: string;
639
+ user_addr: string;
640
+ chain_id: string;
641
+ contract_id: string;
642
+ }) => Promise<{
643
+ is_success: boolean;
644
+ count: number;
645
+ }>;
646
+ searchDapp: (params?: {
647
+ q?: string;
648
+ chain_id?: string;
649
+ start?: number;
650
+ limit?: number;
651
+ match_id?: boolean;
652
+ }) => Promise<{
653
+ page: {
654
+ limit: number;
655
+ start: number;
656
+ total: number;
657
+ };
658
+ dapps: BasicDappInfo[];
659
+ }>;
660
+ getDappsInfo: (params: {
661
+ ids: string[];
662
+ }) => Promise<BasicDappInfo[]>;
663
+ getDappHotTags: (params?: {
664
+ limit: number;
665
+ }) => Promise<string[]>;
666
+ getHotDapps: (params?: {
667
+ limit: number;
668
+ order_by: string;
669
+ }) => Promise<BasicDappInfo[]>;
670
+ getRabbyClaimText: (params: {
671
+ id: string;
672
+ invite_code?: string;
673
+ }) => Promise<{
674
+ id: string;
675
+ text: string;
676
+ }>;
677
+ getRabbySignatureText: (params: {
678
+ id: string;
679
+ }) => Promise<{
680
+ id: string;
681
+ text: string;
682
+ }>;
683
+ getRabbyPoints: (params: {
684
+ id: string;
685
+ }) => Promise<{
686
+ id: string;
687
+ invite_code?: string;
688
+ logo_url: string;
689
+ logo_thumbnail_url: string;
690
+ web3_id: string;
691
+ claimed_points: number;
692
+ total_claimed_points: number;
693
+ }>;
694
+ checkRabbyPointsInviteCode: (params: {
695
+ code: string;
696
+ }) => Promise<{
697
+ invite_code_exist: boolean;
698
+ }>;
699
+ setRabbyPointsInviteCode: (params: {
700
+ id: string;
701
+ signature: string;
702
+ invite_code: string;
703
+ }) => Promise<{
704
+ code: number;
705
+ }>;
706
+ checkRabbyPointClaimable: (params: {
707
+ id: string;
708
+ }) => Promise<{
709
+ claimable: boolean;
710
+ }>;
711
+ getRabbyPointsSnapshot: (params: {
712
+ id: string;
713
+ }) => Promise<{
714
+ id: string;
715
+ address_balance: number;
716
+ metamask_swap: number;
717
+ rabby_old_user: number;
718
+ rabby_nadge: number;
719
+ rabby_nft: number;
720
+ extra_bouns: number;
721
+ claimed: boolean;
722
+ snapshot_at: number;
723
+ }>;
724
+ claimRabbyPointsSnapshot: (params: {
725
+ id: string;
726
+ signature: string;
727
+ invite_code?: string;
728
+ }) => Promise<{
729
+ error_code: number;
730
+ error_msg?: string;
731
+ }>;
732
+ getRabbyPointsTopUsers: (params: {
733
+ id: string;
734
+ }) => Promise<{
735
+ id: string;
736
+ logo_url: string;
737
+ logo_thumbnail_url: string;
738
+ web3_id: string;
739
+ claimed_points: number;
740
+ }[]>;
741
+ getRabbyPointsList: (params: {
742
+ id: string;
743
+ }) => Promise<{
744
+ id: number;
745
+ title: string;
746
+ description: string;
747
+ start_at: number;
748
+ end_at: number;
749
+ claimable_points: number;
750
+ }[]>;
751
+ getRabbyPointsCampaignIsEnded: () => Promise<{
752
+ campaign_is_ended: boolean;
753
+ }>;
754
+ claimRabbyPointsById: (params: {
755
+ campaign_id: number;
756
+ user_id: string;
757
+ signature: string;
758
+ }) => Promise<{
759
+ error_code: number;
760
+ }>;
761
+ getRabbyPointsV2: (params: {
762
+ id: string;
763
+ }) => Promise<{
764
+ id: string;
765
+ invite_code?: string;
766
+ logo_url: string;
767
+ logo_thumbnail_url: string;
768
+ web3_id: string;
769
+ claimed_points: number;
770
+ total_claimed_points: number;
771
+ }>;
772
+ getRabbySignatureTextV2: (params: {
773
+ id: string;
774
+ }) => Promise<{
775
+ id: string;
776
+ text: string;
777
+ }>;
778
+ getRabbyClaimTextV2: (params: {
779
+ id: string;
780
+ invite_code?: string;
781
+ }) => Promise<{
782
+ id: string;
783
+ text: string;
784
+ }>;
785
+ setRabbyPointsInviteCodeV2: (params: {
786
+ id: string;
787
+ signature: string;
788
+ invite_code: string;
789
+ }) => Promise<{
790
+ code: number;
791
+ }>;
792
+ checkRabbyPointsInviteCodeV2: (params: {
793
+ code: string;
794
+ }) => Promise<{
795
+ invite_code_exist: boolean;
796
+ }>;
797
+ claimRabbyPointsSnapshotV2: (params: {
798
+ id: string;
799
+ signature: string;
800
+ invite_code?: string;
801
+ }) => Promise<{
802
+ error_code: number;
803
+ error_msg?: string;
804
+ }>;
805
+ getRabbyPointsTopUsersV2: (params: {
806
+ id: string;
807
+ }) => Promise<{
808
+ id: string;
809
+ logo_url: string;
810
+ logo_thumbnail_url: string;
811
+ web3_id: string;
812
+ claimed_points: number;
813
+ }[]>;
814
+ getRabbyPointsListV2: (params: {
815
+ id: string;
816
+ }) => Promise<{
817
+ id: number;
818
+ title: string;
819
+ description: string;
820
+ start_at: number;
821
+ end_at: number;
822
+ claimable_points: number;
823
+ }[]>;
824
+ claimRabbyPointsByIdV2: (params: {
825
+ campaign_id: number;
826
+ user_id: string;
827
+ signature: string;
828
+ }) => Promise<{
829
+ error_code: number;
830
+ }>;
831
+ getRabbyPointsSnapshotV2: (params: {
832
+ id: string;
833
+ }) => Promise<{
834
+ id: string;
835
+ wallet_balance_reward: number;
836
+ active_stats_reward: number;
837
+ extra_bouns: number;
838
+ claimed: boolean;
839
+ snapshot_at: number;
840
+ claimed_points: number;
841
+ }>;
842
+ checkRabbyPointClaimableV2: (params: {
843
+ id: string;
844
+ }) => Promise<{
845
+ claimable: boolean;
846
+ }>;
847
+ checkClaimInfoV2: (params: {
848
+ id: string;
849
+ }) => Promise<{
850
+ claimable_points: number;
851
+ claimed_points: number;
852
+ }>;
853
+ getRabbyPointsCampaignIsEndedV2: () => Promise<{
854
+ campaign_is_ended: boolean;
855
+ }>;
856
+ getSupportedChains: () => Promise<SupportedChain[]>;
857
+ searchChainList: (params?: {
858
+ limit?: number;
859
+ start?: number;
860
+ q?: string;
861
+ }) => Promise<{
862
+ page: {
863
+ start: number;
864
+ limit: number;
865
+ total: number;
866
+ };
867
+ chain_list: ChainListItem[];
868
+ }>;
869
+ getChainListByIds: (params: {
870
+ ids: string;
871
+ }) => Promise<ChainListItem[]>;
872
+ getHistoryCurve: (addr: string) => Promise<HistoryCurve>;
873
+ getHistoryCurveSupportedList: () => Promise<{
874
+ supported_chains: string[];
875
+ }>;
876
+ getHistoryCurveStatus: (params: {
877
+ id: string;
878
+ }) => Promise<{
879
+ failed_msg: Record<string, string>;
880
+ id: string;
881
+ status: 'pending' | 'running' | 'finished' | 'failed';
882
+ update_at: number;
883
+ }>;
884
+ initHistoryCurve: (params: {
885
+ id: string;
886
+ }) => Promise<{
887
+ success: boolean;
888
+ }>;
889
+ getNodeStatusList: () => Promise<NodeStatus[]>;
890
+ getNodeStatusDetail: (params: {
891
+ chain_id: string;
892
+ }) => Promise<NodeStatusDetail>;
893
+ postActionLog: (body: {
894
+ id: string;
895
+ type: 'tx' | 'typed_data' | 'text';
896
+ rules: {
897
+ id: string;
898
+ level: string | null;
899
+ }[];
900
+ }) => Promise<any>;
901
+ checkSpoofing: ({ from, to, }: {
902
+ from: string;
903
+ to: string;
904
+ }) => Promise<{
905
+ is_spoofing: boolean;
906
+ }>;
907
+ getAddressByDeBankId: (name: string) => Promise<{
908
+ addr: string;
909
+ web3_id: string;
910
+ }>;
911
+ getBridgeSupportChain: () => Promise<string[]>;
912
+ getBridgeAggregatorList: () => Promise<BridgeAggregator[]>;
913
+ getBridgePairList: (params: {
914
+ aggregator_ids: string[];
915
+ to_chain_id: string;
916
+ user_addr: string;
917
+ }) => Promise<BridgeTokenPair[]>;
918
+ getBridgeQuoteList: (params: {
919
+ aggregator_ids: string;
920
+ user_addr: string;
921
+ from_chain_id: string;
922
+ from_token_id: string;
923
+ from_token_raw_amount: string;
924
+ to_chain_id: string;
925
+ to_token_id: string;
926
+ }) => Promise<Omit<BridgeQuote, 'tx'>[]>;
927
+ getBridgeQuoteListV2: (params: {
928
+ aggregator_id: string;
929
+ user_addr: string;
930
+ from_chain_id: string;
931
+ from_token_id: string;
932
+ from_token_raw_amount: string;
933
+ to_chain_id: string;
934
+ to_token_id: string;
935
+ }) => Promise<Omit<BridgeQuote, 'tx'>[]>;
936
+ getBridgeQuote: (params: {
937
+ aggregator_id: string;
938
+ bridge_id: string;
939
+ user_addr: string;
940
+ from_chain_id: string;
941
+ from_token_id: string;
942
+ from_token_raw_amount: string;
943
+ to_chain_id: string;
944
+ to_token_id: string;
945
+ }) => Promise<BridgeQuote>;
946
+ getBridgeHistoryList: (params: {
947
+ user_addr: string;
948
+ start: number;
949
+ limit: number;
950
+ is_all?: boolean;
951
+ }) => Promise<{
952
+ history_list: BridgeHistory[];
953
+ total_cnt: number;
954
+ }>;
955
+ buildBridgeTx: (params: {
956
+ aggregator_id: string;
957
+ bridge_id: string;
958
+ user_addr: string;
959
+ from_chain_id: string;
960
+ from_token_id: string;
961
+ from_token_raw_amount: string;
962
+ to_chain_id: string;
963
+ to_token_id: string;
964
+ slippage: string;
965
+ quote_key: string;
966
+ }) => Promise<Tx>;
967
+ postBridgeHistory: (params: {
968
+ aggregator_id: string;
969
+ bridge_id: string;
970
+ from_chain_id: string;
971
+ from_token_id: string;
972
+ from_token_amount: string | number;
973
+ to_chain_id: string;
974
+ to_token_id: string;
975
+ to_token_amount: string | number;
976
+ tx_id: string;
977
+ tx: Tx;
978
+ rabby_fee: number;
979
+ }) => Promise<{
980
+ success: boolean;
981
+ }>;
982
+ /**
983
+ * no id just no check address
984
+ */
985
+ getPerpPermission: (params: {
986
+ id?: string;
987
+ }) => Promise<{
988
+ has_permission: boolean;
989
+ }>;
990
+ /**
991
+ * @param params.dex_id - The ID of the DEX to get the top tokens for. If not provided, hyperliquid default DEXs will be included. if all is provided, all DEXs will be included. and xyz is xyz dex tokens
992
+ * @returns A list of top tokens for the given DEX.
993
+ */
994
+ getPerpTopTokenList: (params: {
995
+ dex_id?: string;
996
+ }) => Promise<PerpTopToken[]>;
997
+ /**
998
+ * @param params.dex_id - The ID of the DEX to get the top tokens for. If not provided, hyperliquid default DEXs will be included. if all is provided, all DEXs will be included. and xyz is xyz dex tokens
999
+ * @returns A list of top tokens for the given DEX.
1000
+ */
1001
+ getPerpTopTokenListV3: (params: {
1002
+ dex_id?: string;
1003
+ }) => Promise<PerpTopTokenV3[]>;
1004
+ getPerpTokenDetail: (params: {
1005
+ name: string;
1006
+ lang: string;
1007
+ }) => Promise<PerpTopTokenV3[]>;
1008
+ getPerpsBridgeIsSupportToken: (params: {
1009
+ token_id: string;
1010
+ chain_id: string;
1011
+ }) => Promise<{
1012
+ success: boolean;
1013
+ }>;
1014
+ getPerpBridgeQuote: (params: {
1015
+ user_addr: string;
1016
+ from_chain_id: string;
1017
+ from_token_id: string;
1018
+ from_token_raw_amount: string;
1019
+ }) => Promise<PerpBridgeQuote>;
1020
+ postPerpBridgeHistory: (params: {
1021
+ from_chain_id: string;
1022
+ from_token_id: string;
1023
+ from_token_amount: number;
1024
+ to_token_amount: number;
1025
+ tx_id: string;
1026
+ tx: Tx;
1027
+ }) => Promise<{
1028
+ success: boolean;
1029
+ }>;
1030
+ getSupportedDEXList: () => Promise<{
1031
+ dex_list: string[];
1032
+ }>;
1033
+ createDbkBridgeHistory: (postData: Pick<DbkBridgeHistoryItem, 'user_addr' | 'from_chain_id' | 'to_chain_id' | 'tx_id' | 'from_token_amount'>) => Promise<{
1034
+ success: boolean;
1035
+ }>;
1036
+ getDbkBridgeHistoryList: (params: {
1037
+ user_addr: string;
1038
+ start?: number;
1039
+ limit?: number;
1040
+ }) => Promise<{
1041
+ page: {
1042
+ total: number;
1043
+ limit: number;
1044
+ start: number;
1045
+ };
1046
+ data: DbkBridgeHistoryItem[];
1047
+ }>;
1048
+ getGasAccountSignText: (account_id: string) => Promise<{
1049
+ text: string;
1050
+ }>;
1051
+ getGasAccountInfo: (params: {
1052
+ sig: string;
1053
+ id: string;
1054
+ }) => Promise<{
1055
+ account: GasAccountInfo;
1056
+ }>;
1057
+ getGasAccountInfoV2: (params: {
1058
+ id: string;
1059
+ }) => Promise<{
1060
+ account: GasAccountInfo;
1061
+ }>;
1062
+ createGasAccountPayInfo: (postData: {
1063
+ id: string;
1064
+ }) => Promise<{
1065
+ account: GasAccountInfo;
1066
+ }>;
1067
+ checkGasAccountGiftEligibility: (params: {
1068
+ id: string;
1069
+ }) => Promise<{
1070
+ has_eligibility: boolean;
1071
+ can_claimed_usd_value: number;
1072
+ }>;
1073
+ checkGasAccountGiftEligibilityBatch: (params: {
1074
+ ids: string[];
1075
+ }) => Promise<GiftEligibilityItem[]>;
1076
+ confirmIapOrder: (postData: {
1077
+ transaction_id: string;
1078
+ device_type: 'android' | 'ios';
1079
+ product_id: string;
1080
+ }) => Promise<{
1081
+ req: TxRequest;
1082
+ }>;
1083
+ claimGasAccountGift: (params: {
1084
+ sig: string;
1085
+ id: string;
1086
+ }) => Promise<{
1087
+ success: boolean;
1088
+ }>;
1089
+ loginGasAccount: (params: {
1090
+ sig: string;
1091
+ account_id: string;
1092
+ }) => Promise<{
1093
+ success: boolean;
1094
+ }>;
1095
+ logoutGasAccount: (params: {
1096
+ sig: string;
1097
+ account_id: string;
1098
+ }) => Promise<{
1099
+ success: boolean;
1100
+ }>;
1101
+ getGasAccountTokenList: (id: string) => Promise<TokenItem[]>;
1102
+ getGasAccountBridgeSupportTokenList: () => Promise<GasAccountBridgeSupportTokenList>;
1103
+ getGasAccountBridgeQuote: (params: {
1104
+ user_addr: string;
1105
+ from_chain_id: string;
1106
+ from_token_id: string;
1107
+ from_token_raw_amount: string | number;
1108
+ slippage?: number;
1109
+ }) => Promise<GasAccountBridgeQuote>;
1110
+ createGasAccountBridgeRecharge: (p: {
1111
+ sig: string;
1112
+ gas_account_id: string;
1113
+ user_addr: string;
1114
+ from_chain_id: string;
1115
+ from_token_id: string;
1116
+ from_token_amount: number;
1117
+ from_usd_value: number;
1118
+ tx_id: string;
1119
+ scene: 'in_tx_flow' | 'recharge';
1120
+ }) => Promise<GasAccountBridgeCreateResponse>;
1121
+ getGasAccountBridgeStatus: (params: {
1122
+ from_chain_id: string;
1123
+ tx_id: string;
1124
+ } | {
1125
+ transaction_id: string;
1126
+ product_id: string;
1127
+ device_type: 'android' | 'ios';
1128
+ }) => Promise<GasAccountRechargeStatus>;
1129
+ rechargeGasAccount: (p: {
1130
+ sig: string;
1131
+ account_id: string;
1132
+ tx_id: string;
1133
+ chain_id: string;
1134
+ amount: number;
1135
+ user_addr: string;
1136
+ nonce: number;
1137
+ }) => Promise<{
1138
+ success: boolean;
1139
+ }>;
1140
+ withdrawGasAccount: (p: {
1141
+ sig: string;
1142
+ amount: number;
1143
+ account_id: string;
1144
+ user_addr: string;
1145
+ chain_id: string;
1146
+ fee: number;
1147
+ }) => Promise<{
1148
+ success: boolean;
1149
+ }>;
1150
+ getWithdrawList: (p: {
1151
+ sig: string;
1152
+ id: string;
1153
+ }) => Promise<WithdrawListAddressItem[]>;
1154
+ getGasAccountHistory: (p: {
1155
+ sig: string;
1156
+ account_id: string;
1157
+ start: number;
1158
+ limit: number;
1159
+ }) => Promise<{
1160
+ recharge_list: {
1161
+ amount: number;
1162
+ chain_id: string;
1163
+ create_at: number;
1164
+ gas_account_id: string;
1165
+ tx_id: string;
1166
+ user_addr: string;
1167
+ }[];
1168
+ withdraw_list: {
1169
+ amount: number;
1170
+ chain_id: string;
1171
+ create_at: number;
1172
+ gas_account_id: string;
1173
+ tx_id: string;
1174
+ user_addr: string;
1175
+ }[];
1176
+ history_list: {
1177
+ id: string;
1178
+ chain_id: string;
1179
+ create_at: number;
1180
+ gas_cost_usd_value: number;
1181
+ gas_account_id: string;
1182
+ tx_id: string;
1183
+ usd_value: number;
1184
+ user_addr: string;
1185
+ history_type: 'tx' | 'recharge' | 'withdraw';
1186
+ source: string;
1187
+ }[];
1188
+ pagination: {
1189
+ limit: number;
1190
+ start: number;
1191
+ total: number;
1192
+ };
1193
+ }>;
1194
+ checkGasAccountTxs: (p: {
1195
+ sig?: string;
1196
+ account_id: string;
1197
+ tx_list: Tx[];
1198
+ }) => Promise<GasAccountCheckResult>;
1199
+ getGasAccountAml: (id: string) => Promise<{
1200
+ is_risk: boolean;
1201
+ }>;
1202
+ parseCommon: (params: {
1203
+ typed_data: Record<string, any>;
1204
+ origin: string;
1205
+ user_addr: string;
1206
+ }) => Promise<ParseCommonResponse>;
1207
+ getRecommendBridgeToChain: (params: {
1208
+ from_chain_id: string;
1209
+ }) => Promise<{
1210
+ to_chain_id: string;
1211
+ }>;
1212
+ getRecommendFromToken: (params: {
1213
+ user_addr: string;
1214
+ from_chain_id: string;
1215
+ from_token_id: string;
1216
+ from_token_amount: string;
1217
+ to_chain_id: string;
1218
+ to_token_id: string;
1219
+ }) => Promise<{
1220
+ token_list: TokenItem[];
1221
+ }>;
1222
+ getBridgeToTokenList: (params: {
1223
+ from_chain_id: string;
1224
+ to_chain_id: string;
1225
+ from_token_id?: string;
1226
+ q?: string;
1227
+ user_addr?: string;
1228
+ }) => Promise<{
1229
+ token_list: (TokenItem & {
1230
+ trade_volume_24h: 'low' | 'middle' | 'high';
1231
+ })[];
1232
+ }>;
1233
+ getBridgeQuoteV2: (params: {
1234
+ aggregator_id: string;
1235
+ user_addr: string;
1236
+ from_chain_id: string;
1237
+ from_token_id: string;
1238
+ from_token_raw_amount: string;
1239
+ to_chain_id: string;
1240
+ to_token_id: string;
1241
+ slippage: string;
1242
+ }) => Promise<Omit<BridgeQuote, 'tx'>[]>;
1243
+ getBridgeQuoteTxV2: (params: {
1244
+ aggregator_id: string;
1245
+ bridge_id: string;
1246
+ user_addr: string;
1247
+ from_chain_id: string;
1248
+ from_token_id: string;
1249
+ from_token_raw_amount: string;
1250
+ to_chain_id: string;
1251
+ to_token_id: string;
1252
+ slippage: string;
1253
+ }) => Promise<BridgeQuote>;
1254
+ isSameBridgeToken: (params: {
1255
+ from_chain_id: string;
1256
+ from_token_id: string;
1257
+ to_chain_id: string;
1258
+ to_token_id: string;
1259
+ }) => Promise<{
1260
+ is_same: boolean;
1261
+ aggregator_id: string;
1262
+ }[]>;
1263
+ getBridgeSupportChainV2: () => Promise<string[]>;
1264
+ submitFeedback: ({ text, usage, }: {
1265
+ text: string;
1266
+ /**
1267
+ * @description 'usage' is used to submit feedback on rating scene.
1268
+ * by default, it means 'uninstall' scene.
1269
+ */
1270
+ usage?: "rating" | undefined;
1271
+ }) => Promise<{
1272
+ success: boolean;
1273
+ }>;
1274
+ uninstalledFeedback: ({ text, }: {
1275
+ text: string;
1276
+ }) => Promise<{
1277
+ success: boolean;
1278
+ }>;
1279
+ /**
1280
+ * @deprecated
1281
+ */
1282
+ getToken24hPrice: (params: {
1283
+ chain_id: string;
1284
+ id: string;
1285
+ }) => Promise<{
1286
+ time_at: number;
1287
+ price: number;
1288
+ }[]>;
1289
+ getTokenPriceCurve: (params: {
1290
+ chain_id: string;
1291
+ id: string;
1292
+ days: number | 1 | 7;
1293
+ }) => Promise<{
1294
+ time_at: number;
1295
+ price: number;
1296
+ }[]>;
1297
+ getTokenDatePrice: (params: {
1298
+ chain_id: string;
1299
+ id: string;
1300
+ }) => Promise<{
1301
+ date_at: string;
1302
+ price: number;
1303
+ }[]>;
1304
+ searchTokens: (params: {
1305
+ q: string;
1306
+ }) => Promise<TokenItem[]>;
1307
+ searchTokensV2: (params: {
1308
+ q: string;
1309
+ chain_id?: string;
1310
+ }) => Promise<TokenItemWithEntity[]>;
1311
+ getCopyTradingChainList: () => Promise<string[]>;
1312
+ getCopyTradingTokenList: (params: {
1313
+ chain_id: string;
1314
+ limit: number;
1315
+ start_time: number;
1316
+ }) => Promise<CopyTradeTokenListResponse>;
1317
+ getCopyTradingTokenListV2: (params: {
1318
+ chain_id: string;
1319
+ limit: number;
1320
+ cursor: string;
1321
+ order_by: 'price_change' | 'buy_address_count' | 'token_create_at';
1322
+ order?: 'asc' | 'desc';
1323
+ time_range?: '24h' | '7d' | '30d';
1324
+ }) => Promise<CopyTradeTokenListV2Response>;
1325
+ getCopyTradingRecentBuyList: (params: {
1326
+ chain_id: string;
1327
+ token_id: string;
1328
+ limit: number;
1329
+ }) => Promise<CopyTradeRecentBuyListResponse>;
1330
+ getCopyTradingRecentBuyListV2: (params: {
1331
+ chain_id: string;
1332
+ token_id: string;
1333
+ limit: number;
1334
+ cursor: string;
1335
+ }) => Promise<CopyTradeRecentBuyListV2Response>;
1336
+ getCopyTradingDetail: (params: {
1337
+ chain_id: string;
1338
+ token_id: string;
1339
+ }) => Promise<CopyTradeTokenItemV2>;
1340
+ getCopyTradingSameName: (params: {
1341
+ chain_id: string;
1342
+ token_id: string;
1343
+ }) => Promise<CopyTradeSameToken[]>;
1344
+ getCopyTradingPnlList: (params: {
1345
+ user_addr: string;
1346
+ }) => Promise<CopyTradePnlListResponse>;
1347
+ batchQueryTokens: (uuids: string | string[]) => Promise<TokenItem[]>;
1348
+ getBuySupportedCountryList: () => Promise<BuyCountryItem[]>;
1349
+ getBuySupportedTokenList: () => Promise<(TokenItem & {
1350
+ currency_code: string;
1351
+ })[]>;
1352
+ getBuyQuote: (params: {
1353
+ country_code: string;
1354
+ user_addr: string;
1355
+ usd_amount: string;
1356
+ currency_code: string;
1357
+ receive_token_uuid: string;
1358
+ }) => Promise<BuyQuoteItem[]>;
1359
+ getBuyWidgetUrl: (params: {
1360
+ country_code: string;
1361
+ user_addr: string;
1362
+ usd_amount: string;
1363
+ receive_token_uuid: string;
1364
+ service_provider: string;
1365
+ currency_code: string;
1366
+ redirect_url?: string;
1367
+ }) => Promise<{
1368
+ url: string;
1369
+ msg: number;
1370
+ }>;
1371
+ getBuyHistory: (params: {
1372
+ user_addr: string;
1373
+ start?: number;
1374
+ limit?: number;
1375
+ }) => Promise<BuyHistoryList>;
1376
+ getBuyPaymentMethods: (params: {
1377
+ currency_code: string;
1378
+ country_code: string;
1379
+ service_provider: string;
1380
+ }) => Promise<BuyPaymentMethod[]>;
1381
+ getBuyCurrencyList: () => Promise<{
1382
+ id: string;
1383
+ name: string;
1384
+ image_url: string;
1385
+ }[]>;
1386
+ getOfflineChainList: () => Promise<{
1387
+ id: string;
1388
+ offline_at: number;
1389
+ }[]>;
1390
+ isBlockedAddress: (id: string) => Promise<{
1391
+ is_blocked: boolean;
1392
+ }>;
1393
+ estimateGasUsd: ({ tx, origin, address, updateNonce, pending_tx_list, }: {
1394
+ tx: Tx;
1395
+ origin: string;
1396
+ address: string;
1397
+ updateNonce: boolean;
1398
+ pending_tx_list: Tx[];
1399
+ }) => Promise<{
1400
+ gas_used?: number;
1401
+ safe_gas_used?: number;
1402
+ }>;
1403
+ getCexSupportList: () => Promise<ProjectItem[]>;
1404
+ getAppChainList: (id: string) => Promise<AppChainListResponse>;
1405
+ checkCex: (postData: {
1406
+ chain_id: string;
1407
+ id: string;
1408
+ cex_id: string;
1409
+ }) => Promise<{
1410
+ success: boolean;
1411
+ }>;
1412
+ getHotTokenList: () => Promise<TokenDetailWithPriceCurve[]>;
1413
+ getTokensDetailByUuids: (uuids: string[]) => Promise<TokenDetailWithPriceCurve[]>;
1414
+ getTokenKlineData: (params: {
1415
+ chain_id: string;
1416
+ token_id: string;
1417
+ interval: string;
1418
+ after_time_at?: number;
1419
+ }) => Promise<{
1420
+ data_list: KlineDataItem[];
1421
+ }>;
1422
+ getTokenMarketInfo: (params: {
1423
+ chain_id: string;
1424
+ token_id: string;
1425
+ }) => Promise<TokenMarketInfo>;
1426
+ getTokenHolderInfo: (params: {
1427
+ chain_id: string;
1428
+ token_id: string;
1429
+ }) => Promise<TokenHolderInfo>;
1430
+ getTokenSupplyInfo: (params: {
1431
+ chain_id: string;
1432
+ token_id: string;
1433
+ }) => Promise<TokenSupplyInfo>;
1434
+ postUserFeedback: (data: {
1435
+ title: string;
1436
+ image_url_list: string[];
1437
+ content: string;
1438
+ extra?: UserFeedbackItem['extra'];
1439
+ }) => Promise<UserFeedbackItem>;
1440
+ getUserFeedback: (id: string) => Promise<UserFeedbackItem>;
1441
+ getUserFeedbackList: (id: string | string[]) => Promise<UserFeedbackItem[]>;
1442
+ getCurrencyList: () => Promise<CurrencyItem[]>;
1443
+ getMarketSummary: ({ token_id, chain_id, }: {
1444
+ token_id: string;
1445
+ chain_id: string;
1446
+ }) => Promise<MarketSummary>;
1447
+ getMarketTradingHistory: (params: {
1448
+ token_id: string;
1449
+ chain_id: string;
1450
+ action?: 'buy' | 'sell';
1451
+ after_time_at?: number;
1452
+ limit?: number;
1453
+ cursor?: string;
1454
+ }) => Promise<{
1455
+ pagination: {
1456
+ limit: number;
1457
+ has_next: boolean;
1458
+ next_cursor?: string;
1459
+ };
1460
+ data_list: MarketTradingHistoryItem[];
1461
+ }>;
1462
+ getTokenHolderSummary: (params: {
1463
+ token_id: string;
1464
+ chain_id: string;
1465
+ }) => Promise<TokenHolderSummary>;
1466
+ getTokenHolderList: (params: {
1467
+ token_id: string;
1468
+ chain_id: string;
1469
+ }) => Promise<{
1470
+ data_list: TokenHolderItem[];
1471
+ }>;
1472
+ getLiquidityPoolList: (params: {
1473
+ token_id: string;
1474
+ chain_id: string;
1475
+ }) => Promise<LiquidityPoolItem[]>;
1476
+ getLiquidityPoolHistoryList: (params: {
1477
+ token_id: string;
1478
+ chain_id: string;
1479
+ action?: 'add' | 'remove';
1480
+ limit?: number;
1481
+ cursor?: string;
1482
+ }) => Promise<{
1483
+ pagination: {
1484
+ limit: number;
1485
+ has_next: boolean;
1486
+ next_cursor?: string;
1487
+ };
1488
+ data_list: LiquidityPoolHistoryItem[];
1489
+ }>;
1490
+ getTokenMarketCategoryList: () => Promise<TokenMarketCategoryListResponse>;
1491
+ getNFTTradingConfig: () => Promise<NFTTradingConfig>;
1492
+ getNFTDetail: (params: {
1493
+ chain_id: string;
1494
+ id: string;
1495
+ user_addr: string;
1496
+ }) => Promise<NFTDetail>;
1497
+ getNFTListingOrders: (params: {
1498
+ maker: string;
1499
+ chain_id: string;
1500
+ collection_id: string;
1501
+ inner_id: string;
1502
+ limit?: number;
1503
+ cursor?: string;
1504
+ }) => Promise<NFTListingResponse>;
1505
+ getNFTFees: (params: {
1506
+ chain_id: string;
1507
+ collection_id: string;
1508
+ inner_id: string;
1509
+ }) => Promise<{
1510
+ marketplace_fees: {
1511
+ recipient: string;
1512
+ fee: number;
1513
+ required: boolean;
1514
+ }[];
1515
+ custom_royalties: {
1516
+ recipient: string;
1517
+ fee: number;
1518
+ required: boolean;
1519
+ }[];
1520
+ }>;
1521
+ prepareListingNFT: (postData: {
1522
+ maker: string;
1523
+ chain_id: string;
1524
+ collection_id: string;
1525
+ inner_id: string;
1526
+ wei_price: string;
1527
+ quantity?: number;
1528
+ marketplace_fees: {
1529
+ recipient: string;
1530
+ fee: number;
1531
+ }[];
1532
+ custom_royalties: {
1533
+ recipient: string;
1534
+ fee: number;
1535
+ }[];
1536
+ listing_time_at?: number;
1537
+ expiration_time_at?: number;
1538
+ currency: string;
1539
+ salt?: string;
1540
+ }) => Promise<PrepareListingNFTResponse>;
1541
+ createListingNFT: (postData: {
1542
+ chain_id: string;
1543
+ order: PrepareListingNFTResponse['data']['post']['body']['order'];
1544
+ signature: string;
1545
+ protocol_address?: string;
1546
+ }) => Promise<CreateListingNFTOfferResponse>;
1547
+ prepareAcceptNFTOffer: (postData: {
1548
+ chain_id: string;
1549
+ order_hash: string;
1550
+ fulfiller: string;
1551
+ collection_id: string;
1552
+ inner_id: string;
1553
+ quantity?: number;
1554
+ include_optional_creator_fees?: boolean;
1555
+ }) => Promise<PrepareAcceptNFTOfferResponse>;
1556
+ submitAcceptNFTOfferTx: (postData: {
1557
+ tx_id: string;
1558
+ data: Tx;
1559
+ }) => Promise<{
1560
+ success: boolean;
1561
+ }>;
1562
+ checkTokenDepositForbidden: (params: {
1563
+ chain_id: string;
1564
+ id: string;
1565
+ user_addr: string;
1566
+ to_addr: string;
1567
+ }) => Promise<{
1568
+ msg: string;
1569
+ }>;
1570
+ getPolyMarketPermission: (params: {
1571
+ id?: string;
1572
+ }) => Promise<{
1573
+ has_permission: boolean;
1574
+ }>;
1575
+ getDappPermission: (params: {
1576
+ id?: string;
1577
+ dapp: string;
1578
+ }) => Promise<{
1579
+ has_permission: boolean;
1580
+ }>;
1581
+ getMemeList: (params: {
1582
+ order_by?: 'fdv' | 'volume_24h' | 'price_change_24h';
1583
+ order?: 'asc' | 'desc';
1584
+ limit?: number;
1585
+ cursor?: string;
1586
+ }) => Promise<MemeListResponse>;
1587
+ getTokenMarketTokenList: (params: {
1588
+ category_id: string;
1589
+ order_by?: string;
1590
+ order?: 'asc' | 'desc';
1591
+ limit?: number;
1592
+ cursor?: string;
1593
+ version?: string;
1594
+ }) => Promise<TokenMarketTokenListResponse>;
1595
+ }
1596
+ export {};