@rabby-wallet/rabby-api 0.9.60-beta.2 → 0.9.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,1601 +1,1601 @@
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, PerpTopTokenCategory } 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
- * @param params.lang - The translations in item.category
1000
- * @returns A list of top tokens for the given DEX.
1001
- */
1002
- getPerpTopTokenListV3: (params: {
1003
- dex_id?: string;
1004
- lang?: string;
1005
- }) => Promise<PerpTopTokenV3[]>;
1006
- getPerpTokenDetail: (params: {
1007
- name: string;
1008
- lang: string;
1009
- }) => Promise<PerpTopTokenV3>;
1010
- getPerpTokenCategories: (params: {
1011
- lang?: string;
1012
- }) => Promise<PerpTopTokenCategory[]>;
1013
- getPerpsBridgeIsSupportToken: (params: {
1014
- token_id: string;
1015
- chain_id: string;
1016
- }) => Promise<{
1017
- success: boolean;
1018
- }>;
1019
- getPerpBridgeQuote: (params: {
1020
- user_addr: string;
1021
- from_chain_id: string;
1022
- from_token_id: string;
1023
- from_token_raw_amount: string;
1024
- }) => Promise<PerpBridgeQuote>;
1025
- postPerpBridgeHistory: (params: {
1026
- from_chain_id: string;
1027
- from_token_id: string;
1028
- from_token_amount: number;
1029
- to_token_amount: number;
1030
- tx_id: string;
1031
- tx: Tx;
1032
- }) => Promise<{
1033
- success: boolean;
1034
- }>;
1035
- getSupportedDEXList: () => Promise<{
1036
- dex_list: string[];
1037
- }>;
1038
- createDbkBridgeHistory: (postData: Pick<DbkBridgeHistoryItem, 'user_addr' | 'from_chain_id' | 'to_chain_id' | 'tx_id' | 'from_token_amount'>) => Promise<{
1039
- success: boolean;
1040
- }>;
1041
- getDbkBridgeHistoryList: (params: {
1042
- user_addr: string;
1043
- start?: number;
1044
- limit?: number;
1045
- }) => Promise<{
1046
- page: {
1047
- total: number;
1048
- limit: number;
1049
- start: number;
1050
- };
1051
- data: DbkBridgeHistoryItem[];
1052
- }>;
1053
- getGasAccountSignText: (account_id: string) => Promise<{
1054
- text: string;
1055
- }>;
1056
- getGasAccountInfo: (params: {
1057
- sig: string;
1058
- id: string;
1059
- }) => Promise<{
1060
- account: GasAccountInfo;
1061
- }>;
1062
- getGasAccountInfoV2: (params: {
1063
- id: string;
1064
- }) => Promise<{
1065
- account: GasAccountInfo;
1066
- }>;
1067
- createGasAccountPayInfo: (postData: {
1068
- id: string;
1069
- }) => Promise<{
1070
- account: GasAccountInfo;
1071
- }>;
1072
- checkGasAccountGiftEligibility: (params: {
1073
- id: string;
1074
- }) => Promise<{
1075
- has_eligibility: boolean;
1076
- can_claimed_usd_value: number;
1077
- }>;
1078
- checkGasAccountGiftEligibilityBatch: (params: {
1079
- ids: string[];
1080
- }) => Promise<GiftEligibilityItem[]>;
1081
- confirmIapOrder: (postData: {
1082
- transaction_id: string;
1083
- device_type: 'android' | 'ios';
1084
- product_id: string;
1085
- }) => Promise<{
1086
- req: TxRequest;
1087
- }>;
1088
- claimGasAccountGift: (params: {
1089
- sig: string;
1090
- id: string;
1091
- }) => Promise<{
1092
- success: boolean;
1093
- }>;
1094
- loginGasAccount: (params: {
1095
- sig: string;
1096
- account_id: string;
1097
- }) => Promise<{
1098
- success: boolean;
1099
- }>;
1100
- logoutGasAccount: (params: {
1101
- sig: string;
1102
- account_id: string;
1103
- }) => Promise<{
1104
- success: boolean;
1105
- }>;
1106
- getGasAccountTokenList: (id: string) => Promise<TokenItem[]>;
1107
- getGasAccountBridgeSupportTokenList: () => Promise<GasAccountBridgeSupportTokenList>;
1108
- getGasAccountBridgeQuote: (params: {
1109
- user_addr: string;
1110
- from_chain_id: string;
1111
- from_token_id: string;
1112
- from_token_raw_amount: string | number;
1113
- slippage?: number;
1114
- }) => Promise<GasAccountBridgeQuote>;
1115
- createGasAccountBridgeRecharge: (p: {
1116
- sig: string;
1117
- gas_account_id: string;
1118
- user_addr: string;
1119
- from_chain_id: string;
1120
- from_token_id: string;
1121
- from_token_amount: number;
1122
- from_usd_value: number;
1123
- tx_id: string;
1124
- scene: 'in_tx_flow' | 'recharge';
1125
- }) => Promise<GasAccountBridgeCreateResponse>;
1126
- getGasAccountBridgeStatus: (params: {
1127
- from_chain_id: string;
1128
- tx_id: string;
1129
- } | {
1130
- transaction_id: string;
1131
- product_id: string;
1132
- device_type: 'android' | 'ios';
1133
- }) => Promise<GasAccountRechargeStatus>;
1134
- rechargeGasAccount: (p: {
1135
- sig: string;
1136
- account_id: string;
1137
- tx_id: string;
1138
- chain_id: string;
1139
- amount: number;
1140
- user_addr: string;
1141
- nonce: number;
1142
- }) => Promise<{
1143
- success: boolean;
1144
- }>;
1145
- withdrawGasAccount: (p: {
1146
- sig: string;
1147
- amount: number;
1148
- account_id: string;
1149
- user_addr: string;
1150
- chain_id: string;
1151
- fee: number;
1152
- }) => Promise<{
1153
- success: boolean;
1154
- }>;
1155
- getWithdrawList: (p: {
1156
- sig: string;
1157
- id: string;
1158
- }) => Promise<WithdrawListAddressItem[]>;
1159
- getGasAccountHistory: (p: {
1160
- sig: string;
1161
- account_id: string;
1162
- start: number;
1163
- limit: number;
1164
- }) => Promise<{
1165
- recharge_list: {
1166
- amount: number;
1167
- chain_id: string;
1168
- create_at: number;
1169
- gas_account_id: string;
1170
- tx_id: string;
1171
- user_addr: string;
1172
- }[];
1173
- withdraw_list: {
1174
- amount: number;
1175
- chain_id: string;
1176
- create_at: number;
1177
- gas_account_id: string;
1178
- tx_id: string;
1179
- user_addr: string;
1180
- }[];
1181
- history_list: {
1182
- id: string;
1183
- chain_id: string;
1184
- create_at: number;
1185
- gas_cost_usd_value: number;
1186
- gas_account_id: string;
1187
- tx_id: string;
1188
- usd_value: number;
1189
- user_addr: string;
1190
- history_type: 'tx' | 'recharge' | 'withdraw';
1191
- source: string;
1192
- }[];
1193
- pagination: {
1194
- limit: number;
1195
- start: number;
1196
- total: number;
1197
- };
1198
- }>;
1199
- checkGasAccountTxs: (p: {
1200
- sig?: string;
1201
- account_id: string;
1202
- tx_list: Tx[];
1203
- }) => Promise<GasAccountCheckResult>;
1204
- getGasAccountAml: (id: string) => Promise<{
1205
- is_risk: boolean;
1206
- }>;
1207
- parseCommon: (params: {
1208
- typed_data: Record<string, any>;
1209
- origin: string;
1210
- user_addr: string;
1211
- }) => Promise<ParseCommonResponse>;
1212
- getRecommendBridgeToChain: (params: {
1213
- from_chain_id: string;
1214
- }) => Promise<{
1215
- to_chain_id: string;
1216
- }>;
1217
- getRecommendFromToken: (params: {
1218
- user_addr: string;
1219
- from_chain_id: string;
1220
- from_token_id: string;
1221
- from_token_amount: string;
1222
- to_chain_id: string;
1223
- to_token_id: string;
1224
- }) => Promise<{
1225
- token_list: TokenItem[];
1226
- }>;
1227
- getBridgeToTokenList: (params: {
1228
- from_chain_id: string;
1229
- to_chain_id: string;
1230
- from_token_id?: string;
1231
- q?: string;
1232
- user_addr?: string;
1233
- }) => Promise<{
1234
- token_list: (TokenItem & {
1235
- trade_volume_24h: 'low' | 'middle' | 'high';
1236
- })[];
1237
- }>;
1238
- getBridgeQuoteV2: (params: {
1239
- aggregator_id: string;
1240
- user_addr: string;
1241
- from_chain_id: string;
1242
- from_token_id: string;
1243
- from_token_raw_amount: string;
1244
- to_chain_id: string;
1245
- to_token_id: string;
1246
- slippage: string;
1247
- }) => Promise<Omit<BridgeQuote, 'tx'>[]>;
1248
- getBridgeQuoteTxV2: (params: {
1249
- aggregator_id: string;
1250
- bridge_id: string;
1251
- user_addr: string;
1252
- from_chain_id: string;
1253
- from_token_id: string;
1254
- from_token_raw_amount: string;
1255
- to_chain_id: string;
1256
- to_token_id: string;
1257
- slippage: string;
1258
- }) => Promise<BridgeQuote>;
1259
- isSameBridgeToken: (params: {
1260
- from_chain_id: string;
1261
- from_token_id: string;
1262
- to_chain_id: string;
1263
- to_token_id: string;
1264
- }) => Promise<{
1265
- is_same: boolean;
1266
- aggregator_id: string;
1267
- }[]>;
1268
- getBridgeSupportChainV2: () => Promise<string[]>;
1269
- submitFeedback: ({ text, usage, }: {
1270
- text: string;
1271
- /**
1272
- * @description 'usage' is used to submit feedback on rating scene.
1273
- * by default, it means 'uninstall' scene.
1274
- */
1275
- usage?: "rating" | undefined;
1276
- }) => Promise<{
1277
- success: boolean;
1278
- }>;
1279
- uninstalledFeedback: ({ text, }: {
1280
- text: string;
1281
- }) => Promise<{
1282
- success: boolean;
1283
- }>;
1284
- /**
1285
- * @deprecated
1286
- */
1287
- getToken24hPrice: (params: {
1288
- chain_id: string;
1289
- id: string;
1290
- }) => Promise<{
1291
- time_at: number;
1292
- price: number;
1293
- }[]>;
1294
- getTokenPriceCurve: (params: {
1295
- chain_id: string;
1296
- id: string;
1297
- days: number | 1 | 7;
1298
- }) => Promise<{
1299
- time_at: number;
1300
- price: number;
1301
- }[]>;
1302
- getTokenDatePrice: (params: {
1303
- chain_id: string;
1304
- id: string;
1305
- }) => Promise<{
1306
- date_at: string;
1307
- price: number;
1308
- }[]>;
1309
- searchTokens: (params: {
1310
- q: string;
1311
- }) => Promise<TokenItem[]>;
1312
- searchTokensV2: (params: {
1313
- q: string;
1314
- chain_id?: string;
1315
- }) => Promise<TokenItemWithEntity[]>;
1316
- getCopyTradingChainList: () => Promise<string[]>;
1317
- getCopyTradingTokenList: (params: {
1318
- chain_id: string;
1319
- limit: number;
1320
- start_time: number;
1321
- }) => Promise<CopyTradeTokenListResponse>;
1322
- getCopyTradingTokenListV2: (params: {
1323
- chain_id: string;
1324
- limit: number;
1325
- cursor: string;
1326
- order_by: 'price_change' | 'buy_address_count' | 'token_create_at';
1327
- order?: 'asc' | 'desc';
1328
- time_range?: '24h' | '7d' | '30d';
1329
- }) => Promise<CopyTradeTokenListV2Response>;
1330
- getCopyTradingRecentBuyList: (params: {
1331
- chain_id: string;
1332
- token_id: string;
1333
- limit: number;
1334
- }) => Promise<CopyTradeRecentBuyListResponse>;
1335
- getCopyTradingRecentBuyListV2: (params: {
1336
- chain_id: string;
1337
- token_id: string;
1338
- limit: number;
1339
- cursor: string;
1340
- }) => Promise<CopyTradeRecentBuyListV2Response>;
1341
- getCopyTradingDetail: (params: {
1342
- chain_id: string;
1343
- token_id: string;
1344
- }) => Promise<CopyTradeTokenItemV2>;
1345
- getCopyTradingSameName: (params: {
1346
- chain_id: string;
1347
- token_id: string;
1348
- }) => Promise<CopyTradeSameToken[]>;
1349
- getCopyTradingPnlList: (params: {
1350
- user_addr: string;
1351
- }) => Promise<CopyTradePnlListResponse>;
1352
- batchQueryTokens: (uuids: string | string[]) => Promise<TokenItem[]>;
1353
- getBuySupportedCountryList: () => Promise<BuyCountryItem[]>;
1354
- getBuySupportedTokenList: () => Promise<(TokenItem & {
1355
- currency_code: string;
1356
- })[]>;
1357
- getBuyQuote: (params: {
1358
- country_code: string;
1359
- user_addr: string;
1360
- usd_amount: string;
1361
- currency_code: string;
1362
- receive_token_uuid: string;
1363
- }) => Promise<BuyQuoteItem[]>;
1364
- getBuyWidgetUrl: (params: {
1365
- country_code: string;
1366
- user_addr: string;
1367
- usd_amount: string;
1368
- receive_token_uuid: string;
1369
- service_provider: string;
1370
- currency_code: string;
1371
- redirect_url?: string;
1372
- }) => Promise<{
1373
- url: string;
1374
- msg: number;
1375
- }>;
1376
- getBuyHistory: (params: {
1377
- user_addr: string;
1378
- start?: number;
1379
- limit?: number;
1380
- }) => Promise<BuyHistoryList>;
1381
- getBuyPaymentMethods: (params: {
1382
- currency_code: string;
1383
- country_code: string;
1384
- service_provider: string;
1385
- }) => Promise<BuyPaymentMethod[]>;
1386
- getBuyCurrencyList: () => Promise<{
1387
- id: string;
1388
- name: string;
1389
- image_url: string;
1390
- }[]>;
1391
- getOfflineChainList: () => Promise<{
1392
- id: string;
1393
- offline_at: number;
1394
- }[]>;
1395
- isBlockedAddress: (id: string) => Promise<{
1396
- is_blocked: boolean;
1397
- }>;
1398
- estimateGasUsd: ({ tx, origin, address, updateNonce, pending_tx_list, }: {
1399
- tx: Tx;
1400
- origin: string;
1401
- address: string;
1402
- updateNonce: boolean;
1403
- pending_tx_list: Tx[];
1404
- }) => Promise<{
1405
- gas_used?: number;
1406
- safe_gas_used?: number;
1407
- }>;
1408
- getCexSupportList: () => Promise<ProjectItem[]>;
1409
- getAppChainList: (id: string) => Promise<AppChainListResponse>;
1410
- checkCex: (postData: {
1411
- chain_id: string;
1412
- id: string;
1413
- cex_id: string;
1414
- }) => Promise<{
1415
- success: boolean;
1416
- }>;
1417
- getHotTokenList: () => Promise<TokenDetailWithPriceCurve[]>;
1418
- getTokensDetailByUuids: (uuids: string[]) => Promise<TokenDetailWithPriceCurve[]>;
1419
- getTokenKlineData: (params: {
1420
- chain_id: string;
1421
- token_id: string;
1422
- interval: string;
1423
- after_time_at?: number;
1424
- }) => Promise<{
1425
- data_list: KlineDataItem[];
1426
- }>;
1427
- getTokenMarketInfo: (params: {
1428
- chain_id: string;
1429
- token_id: string;
1430
- }) => Promise<TokenMarketInfo>;
1431
- getTokenHolderInfo: (params: {
1432
- chain_id: string;
1433
- token_id: string;
1434
- }) => Promise<TokenHolderInfo>;
1435
- getTokenSupplyInfo: (params: {
1436
- chain_id: string;
1437
- token_id: string;
1438
- }) => Promise<TokenSupplyInfo>;
1439
- postUserFeedback: (data: {
1440
- title: string;
1441
- image_url_list: string[];
1442
- content: string;
1443
- extra?: UserFeedbackItem['extra'];
1444
- }) => Promise<UserFeedbackItem>;
1445
- getUserFeedback: (id: string) => Promise<UserFeedbackItem>;
1446
- getUserFeedbackList: (id: string | string[]) => Promise<UserFeedbackItem[]>;
1447
- getCurrencyList: () => Promise<CurrencyItem[]>;
1448
- getMarketSummary: ({ token_id, chain_id, }: {
1449
- token_id: string;
1450
- chain_id: string;
1451
- }) => Promise<MarketSummary>;
1452
- getMarketTradingHistory: (params: {
1453
- token_id: string;
1454
- chain_id: string;
1455
- action?: 'buy' | 'sell';
1456
- after_time_at?: number;
1457
- limit?: number;
1458
- cursor?: string;
1459
- }) => Promise<{
1460
- pagination: {
1461
- limit: number;
1462
- has_next: boolean;
1463
- next_cursor?: string;
1464
- };
1465
- data_list: MarketTradingHistoryItem[];
1466
- }>;
1467
- getTokenHolderSummary: (params: {
1468
- token_id: string;
1469
- chain_id: string;
1470
- }) => Promise<TokenHolderSummary>;
1471
- getTokenHolderList: (params: {
1472
- token_id: string;
1473
- chain_id: string;
1474
- }) => Promise<{
1475
- data_list: TokenHolderItem[];
1476
- }>;
1477
- getLiquidityPoolList: (params: {
1478
- token_id: string;
1479
- chain_id: string;
1480
- }) => Promise<LiquidityPoolItem[]>;
1481
- getLiquidityPoolHistoryList: (params: {
1482
- token_id: string;
1483
- chain_id: string;
1484
- action?: 'add' | 'remove';
1485
- limit?: number;
1486
- cursor?: string;
1487
- }) => Promise<{
1488
- pagination: {
1489
- limit: number;
1490
- has_next: boolean;
1491
- next_cursor?: string;
1492
- };
1493
- data_list: LiquidityPoolHistoryItem[];
1494
- }>;
1495
- getTokenMarketCategoryList: () => Promise<TokenMarketCategoryListResponse>;
1496
- getNFTTradingConfig: () => Promise<NFTTradingConfig>;
1497
- getNFTDetail: (params: {
1498
- chain_id: string;
1499
- id: string;
1500
- user_addr: string;
1501
- }) => Promise<NFTDetail>;
1502
- getNFTListingOrders: (params: {
1503
- maker: string;
1504
- chain_id: string;
1505
- collection_id: string;
1506
- inner_id: string;
1507
- limit?: number;
1508
- cursor?: string;
1509
- }) => Promise<NFTListingResponse>;
1510
- getNFTFees: (params: {
1511
- chain_id: string;
1512
- collection_id: string;
1513
- inner_id: string;
1514
- }) => Promise<{
1515
- marketplace_fees: {
1516
- recipient: string;
1517
- fee: number;
1518
- required: boolean;
1519
- }[];
1520
- custom_royalties: {
1521
- recipient: string;
1522
- fee: number;
1523
- required: boolean;
1524
- }[];
1525
- }>;
1526
- prepareListingNFT: (postData: {
1527
- maker: string;
1528
- chain_id: string;
1529
- collection_id: string;
1530
- inner_id: string;
1531
- wei_price: string;
1532
- quantity?: number;
1533
- marketplace_fees: {
1534
- recipient: string;
1535
- fee: number;
1536
- }[];
1537
- custom_royalties: {
1538
- recipient: string;
1539
- fee: number;
1540
- }[];
1541
- listing_time_at?: number;
1542
- expiration_time_at?: number;
1543
- currency: string;
1544
- salt?: string;
1545
- }) => Promise<PrepareListingNFTResponse>;
1546
- createListingNFT: (postData: {
1547
- chain_id: string;
1548
- order: PrepareListingNFTResponse['data']['post']['body']['order'];
1549
- signature: string;
1550
- protocol_address?: string;
1551
- }) => Promise<CreateListingNFTOfferResponse>;
1552
- prepareAcceptNFTOffer: (postData: {
1553
- chain_id: string;
1554
- order_hash: string;
1555
- fulfiller: string;
1556
- collection_id: string;
1557
- inner_id: string;
1558
- quantity?: number;
1559
- include_optional_creator_fees?: boolean;
1560
- }) => Promise<PrepareAcceptNFTOfferResponse>;
1561
- submitAcceptNFTOfferTx: (postData: {
1562
- tx_id: string;
1563
- data: Tx;
1564
- }) => Promise<{
1565
- success: boolean;
1566
- }>;
1567
- checkTokenDepositForbidden: (params: {
1568
- chain_id: string;
1569
- id: string;
1570
- user_addr: string;
1571
- to_addr: string;
1572
- }) => Promise<{
1573
- msg: string;
1574
- }>;
1575
- getPolyMarketPermission: (params: {
1576
- id?: string;
1577
- }) => Promise<{
1578
- has_permission: boolean;
1579
- }>;
1580
- getDappPermission: (params: {
1581
- id?: string;
1582
- dapp: string;
1583
- }) => Promise<{
1584
- has_permission: boolean;
1585
- }>;
1586
- getMemeList: (params: {
1587
- order_by?: 'fdv' | 'volume_24h' | 'price_change_24h';
1588
- order?: 'asc' | 'desc';
1589
- limit?: number;
1590
- cursor?: string;
1591
- }) => Promise<MemeListResponse>;
1592
- getTokenMarketTokenList: (params: {
1593
- category_id: string;
1594
- order_by?: string;
1595
- order?: 'asc' | 'desc';
1596
- limit?: number;
1597
- cursor?: string;
1598
- version?: string;
1599
- }) => Promise<TokenMarketTokenListResponse>;
1600
- }
1601
- 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, PerpTopTokenCategory } 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
+ * @param params.lang - The translations in item.category
1000
+ * @returns A list of top tokens for the given DEX.
1001
+ */
1002
+ getPerpTopTokenListV3: (params: {
1003
+ dex_id?: string;
1004
+ lang?: string;
1005
+ }) => Promise<PerpTopTokenV3[]>;
1006
+ getPerpTokenDetail: (params: {
1007
+ name: string;
1008
+ lang: string;
1009
+ }) => Promise<PerpTopTokenV3>;
1010
+ getPerpTokenCategories: (params: {
1011
+ lang?: string;
1012
+ }) => Promise<PerpTopTokenCategory[]>;
1013
+ getPerpsBridgeIsSupportToken: (params: {
1014
+ token_id: string;
1015
+ chain_id: string;
1016
+ }) => Promise<{
1017
+ success: boolean;
1018
+ }>;
1019
+ getPerpBridgeQuote: (params: {
1020
+ user_addr: string;
1021
+ from_chain_id: string;
1022
+ from_token_id: string;
1023
+ from_token_raw_amount: string;
1024
+ }) => Promise<PerpBridgeQuote>;
1025
+ postPerpBridgeHistory: (params: {
1026
+ from_chain_id: string;
1027
+ from_token_id: string;
1028
+ from_token_amount: number;
1029
+ to_token_amount: number;
1030
+ tx_id: string;
1031
+ tx: Tx;
1032
+ }) => Promise<{
1033
+ success: boolean;
1034
+ }>;
1035
+ getSupportedDEXList: () => Promise<{
1036
+ dex_list: string[];
1037
+ }>;
1038
+ createDbkBridgeHistory: (postData: Pick<DbkBridgeHistoryItem, 'user_addr' | 'from_chain_id' | 'to_chain_id' | 'tx_id' | 'from_token_amount'>) => Promise<{
1039
+ success: boolean;
1040
+ }>;
1041
+ getDbkBridgeHistoryList: (params: {
1042
+ user_addr: string;
1043
+ start?: number;
1044
+ limit?: number;
1045
+ }) => Promise<{
1046
+ page: {
1047
+ total: number;
1048
+ limit: number;
1049
+ start: number;
1050
+ };
1051
+ data: DbkBridgeHistoryItem[];
1052
+ }>;
1053
+ getGasAccountSignText: (account_id: string) => Promise<{
1054
+ text: string;
1055
+ }>;
1056
+ getGasAccountInfo: (params: {
1057
+ sig: string;
1058
+ id: string;
1059
+ }) => Promise<{
1060
+ account: GasAccountInfo;
1061
+ }>;
1062
+ getGasAccountInfoV2: (params: {
1063
+ id: string;
1064
+ }) => Promise<{
1065
+ account: GasAccountInfo;
1066
+ }>;
1067
+ createGasAccountPayInfo: (postData: {
1068
+ id: string;
1069
+ }) => Promise<{
1070
+ account: GasAccountInfo;
1071
+ }>;
1072
+ checkGasAccountGiftEligibility: (params: {
1073
+ id: string;
1074
+ }) => Promise<{
1075
+ has_eligibility: boolean;
1076
+ can_claimed_usd_value: number;
1077
+ }>;
1078
+ checkGasAccountGiftEligibilityBatch: (params: {
1079
+ ids: string[];
1080
+ }) => Promise<GiftEligibilityItem[]>;
1081
+ confirmIapOrder: (postData: {
1082
+ transaction_id: string;
1083
+ device_type: 'android' | 'ios';
1084
+ product_id: string;
1085
+ }) => Promise<{
1086
+ req: TxRequest;
1087
+ }>;
1088
+ claimGasAccountGift: (params: {
1089
+ sig: string;
1090
+ id: string;
1091
+ }) => Promise<{
1092
+ success: boolean;
1093
+ }>;
1094
+ loginGasAccount: (params: {
1095
+ sig: string;
1096
+ account_id: string;
1097
+ }) => Promise<{
1098
+ success: boolean;
1099
+ }>;
1100
+ logoutGasAccount: (params: {
1101
+ sig: string;
1102
+ account_id: string;
1103
+ }) => Promise<{
1104
+ success: boolean;
1105
+ }>;
1106
+ getGasAccountTokenList: (id: string) => Promise<TokenItem[]>;
1107
+ getGasAccountBridgeSupportTokenList: () => Promise<GasAccountBridgeSupportTokenList>;
1108
+ getGasAccountBridgeQuote: (params: {
1109
+ user_addr: string;
1110
+ from_chain_id: string;
1111
+ from_token_id: string;
1112
+ from_token_raw_amount: string | number;
1113
+ slippage?: number;
1114
+ }) => Promise<GasAccountBridgeQuote>;
1115
+ createGasAccountBridgeRecharge: (p: {
1116
+ sig: string;
1117
+ gas_account_id: string;
1118
+ user_addr: string;
1119
+ from_chain_id: string;
1120
+ from_token_id: string;
1121
+ from_token_amount: number;
1122
+ from_usd_value: number;
1123
+ tx_id: string;
1124
+ scene: 'in_tx_flow' | 'recharge';
1125
+ }) => Promise<GasAccountBridgeCreateResponse>;
1126
+ getGasAccountBridgeStatus: (params: {
1127
+ from_chain_id: string;
1128
+ tx_id: string;
1129
+ } | {
1130
+ transaction_id: string;
1131
+ product_id: string;
1132
+ device_type: 'android' | 'ios';
1133
+ }) => Promise<GasAccountRechargeStatus>;
1134
+ rechargeGasAccount: (p: {
1135
+ sig: string;
1136
+ account_id: string;
1137
+ tx_id: string;
1138
+ chain_id: string;
1139
+ amount: number;
1140
+ user_addr: string;
1141
+ nonce: number;
1142
+ }) => Promise<{
1143
+ success: boolean;
1144
+ }>;
1145
+ withdrawGasAccount: (p: {
1146
+ sig: string;
1147
+ amount: number;
1148
+ account_id: string;
1149
+ user_addr: string;
1150
+ chain_id: string;
1151
+ fee: number;
1152
+ }) => Promise<{
1153
+ success: boolean;
1154
+ }>;
1155
+ getWithdrawList: (p: {
1156
+ sig: string;
1157
+ id: string;
1158
+ }) => Promise<WithdrawListAddressItem[]>;
1159
+ getGasAccountHistory: (p: {
1160
+ sig: string;
1161
+ account_id: string;
1162
+ start: number;
1163
+ limit: number;
1164
+ }) => Promise<{
1165
+ recharge_list: {
1166
+ amount: number;
1167
+ chain_id: string;
1168
+ create_at: number;
1169
+ gas_account_id: string;
1170
+ tx_id: string;
1171
+ user_addr: string;
1172
+ }[];
1173
+ withdraw_list: {
1174
+ amount: number;
1175
+ chain_id: string;
1176
+ create_at: number;
1177
+ gas_account_id: string;
1178
+ tx_id: string;
1179
+ user_addr: string;
1180
+ }[];
1181
+ history_list: {
1182
+ id: string;
1183
+ chain_id: string;
1184
+ create_at: number;
1185
+ gas_cost_usd_value: number;
1186
+ gas_account_id: string;
1187
+ tx_id: string;
1188
+ usd_value: number;
1189
+ user_addr: string;
1190
+ history_type: 'tx' | 'recharge' | 'withdraw';
1191
+ source: string;
1192
+ }[];
1193
+ pagination: {
1194
+ limit: number;
1195
+ start: number;
1196
+ total: number;
1197
+ };
1198
+ }>;
1199
+ checkGasAccountTxs: (p: {
1200
+ sig?: string;
1201
+ account_id: string;
1202
+ tx_list: Tx[];
1203
+ }) => Promise<GasAccountCheckResult>;
1204
+ getGasAccountAml: (id: string) => Promise<{
1205
+ is_risk: boolean;
1206
+ }>;
1207
+ parseCommon: (params: {
1208
+ typed_data: Record<string, any>;
1209
+ origin: string;
1210
+ user_addr: string;
1211
+ }) => Promise<ParseCommonResponse>;
1212
+ getRecommendBridgeToChain: (params: {
1213
+ from_chain_id: string;
1214
+ }) => Promise<{
1215
+ to_chain_id: string;
1216
+ }>;
1217
+ getRecommendFromToken: (params: {
1218
+ user_addr: string;
1219
+ from_chain_id: string;
1220
+ from_token_id: string;
1221
+ from_token_amount: string;
1222
+ to_chain_id: string;
1223
+ to_token_id: string;
1224
+ }) => Promise<{
1225
+ token_list: TokenItem[];
1226
+ }>;
1227
+ getBridgeToTokenList: (params: {
1228
+ from_chain_id: string;
1229
+ to_chain_id: string;
1230
+ from_token_id?: string;
1231
+ q?: string;
1232
+ user_addr?: string;
1233
+ }) => Promise<{
1234
+ token_list: (TokenItem & {
1235
+ trade_volume_24h: 'low' | 'middle' | 'high';
1236
+ })[];
1237
+ }>;
1238
+ getBridgeQuoteV2: (params: {
1239
+ aggregator_id: string;
1240
+ user_addr: string;
1241
+ from_chain_id: string;
1242
+ from_token_id: string;
1243
+ from_token_raw_amount: string;
1244
+ to_chain_id: string;
1245
+ to_token_id: string;
1246
+ slippage: string;
1247
+ }) => Promise<Omit<BridgeQuote, 'tx'>[]>;
1248
+ getBridgeQuoteTxV2: (params: {
1249
+ aggregator_id: string;
1250
+ bridge_id: string;
1251
+ user_addr: string;
1252
+ from_chain_id: string;
1253
+ from_token_id: string;
1254
+ from_token_raw_amount: string;
1255
+ to_chain_id: string;
1256
+ to_token_id: string;
1257
+ slippage: string;
1258
+ }) => Promise<BridgeQuote>;
1259
+ isSameBridgeToken: (params: {
1260
+ from_chain_id: string;
1261
+ from_token_id: string;
1262
+ to_chain_id: string;
1263
+ to_token_id: string;
1264
+ }) => Promise<{
1265
+ is_same: boolean;
1266
+ aggregator_id: string;
1267
+ }[]>;
1268
+ getBridgeSupportChainV2: () => Promise<string[]>;
1269
+ submitFeedback: ({ text, usage, }: {
1270
+ text: string;
1271
+ /**
1272
+ * @description 'usage' is used to submit feedback on rating scene.
1273
+ * by default, it means 'uninstall' scene.
1274
+ */
1275
+ usage?: "rating" | undefined;
1276
+ }) => Promise<{
1277
+ success: boolean;
1278
+ }>;
1279
+ uninstalledFeedback: ({ text, }: {
1280
+ text: string;
1281
+ }) => Promise<{
1282
+ success: boolean;
1283
+ }>;
1284
+ /**
1285
+ * @deprecated
1286
+ */
1287
+ getToken24hPrice: (params: {
1288
+ chain_id: string;
1289
+ id: string;
1290
+ }) => Promise<{
1291
+ time_at: number;
1292
+ price: number;
1293
+ }[]>;
1294
+ getTokenPriceCurve: (params: {
1295
+ chain_id: string;
1296
+ id: string;
1297
+ days: number | 1 | 7;
1298
+ }) => Promise<{
1299
+ time_at: number;
1300
+ price: number;
1301
+ }[]>;
1302
+ getTokenDatePrice: (params: {
1303
+ chain_id: string;
1304
+ id: string;
1305
+ }) => Promise<{
1306
+ date_at: string;
1307
+ price: number;
1308
+ }[]>;
1309
+ searchTokens: (params: {
1310
+ q: string;
1311
+ }) => Promise<TokenItem[]>;
1312
+ searchTokensV2: (params: {
1313
+ q: string;
1314
+ chain_id?: string;
1315
+ }) => Promise<TokenItemWithEntity[]>;
1316
+ getCopyTradingChainList: () => Promise<string[]>;
1317
+ getCopyTradingTokenList: (params: {
1318
+ chain_id: string;
1319
+ limit: number;
1320
+ start_time: number;
1321
+ }) => Promise<CopyTradeTokenListResponse>;
1322
+ getCopyTradingTokenListV2: (params: {
1323
+ chain_id: string;
1324
+ limit: number;
1325
+ cursor: string;
1326
+ order_by: 'price_change' | 'buy_address_count' | 'token_create_at';
1327
+ order?: 'asc' | 'desc';
1328
+ time_range?: '24h' | '7d' | '30d';
1329
+ }) => Promise<CopyTradeTokenListV2Response>;
1330
+ getCopyTradingRecentBuyList: (params: {
1331
+ chain_id: string;
1332
+ token_id: string;
1333
+ limit: number;
1334
+ }) => Promise<CopyTradeRecentBuyListResponse>;
1335
+ getCopyTradingRecentBuyListV2: (params: {
1336
+ chain_id: string;
1337
+ token_id: string;
1338
+ limit: number;
1339
+ cursor: string;
1340
+ }) => Promise<CopyTradeRecentBuyListV2Response>;
1341
+ getCopyTradingDetail: (params: {
1342
+ chain_id: string;
1343
+ token_id: string;
1344
+ }) => Promise<CopyTradeTokenItemV2>;
1345
+ getCopyTradingSameName: (params: {
1346
+ chain_id: string;
1347
+ token_id: string;
1348
+ }) => Promise<CopyTradeSameToken[]>;
1349
+ getCopyTradingPnlList: (params: {
1350
+ user_addr: string;
1351
+ }) => Promise<CopyTradePnlListResponse>;
1352
+ batchQueryTokens: (uuids: string | string[]) => Promise<TokenItem[]>;
1353
+ getBuySupportedCountryList: () => Promise<BuyCountryItem[]>;
1354
+ getBuySupportedTokenList: () => Promise<(TokenItem & {
1355
+ currency_code: string;
1356
+ })[]>;
1357
+ getBuyQuote: (params: {
1358
+ country_code: string;
1359
+ user_addr: string;
1360
+ usd_amount: string;
1361
+ currency_code: string;
1362
+ receive_token_uuid: string;
1363
+ }) => Promise<BuyQuoteItem[]>;
1364
+ getBuyWidgetUrl: (params: {
1365
+ country_code: string;
1366
+ user_addr: string;
1367
+ usd_amount: string;
1368
+ receive_token_uuid: string;
1369
+ service_provider: string;
1370
+ currency_code: string;
1371
+ redirect_url?: string;
1372
+ }) => Promise<{
1373
+ url: string;
1374
+ msg: number;
1375
+ }>;
1376
+ getBuyHistory: (params: {
1377
+ user_addr: string;
1378
+ start?: number;
1379
+ limit?: number;
1380
+ }) => Promise<BuyHistoryList>;
1381
+ getBuyPaymentMethods: (params: {
1382
+ currency_code: string;
1383
+ country_code: string;
1384
+ service_provider: string;
1385
+ }) => Promise<BuyPaymentMethod[]>;
1386
+ getBuyCurrencyList: () => Promise<{
1387
+ id: string;
1388
+ name: string;
1389
+ image_url: string;
1390
+ }[]>;
1391
+ getOfflineChainList: () => Promise<{
1392
+ id: string;
1393
+ offline_at: number;
1394
+ }[]>;
1395
+ isBlockedAddress: (id: string) => Promise<{
1396
+ is_blocked: boolean;
1397
+ }>;
1398
+ estimateGasUsd: ({ tx, origin, address, updateNonce, pending_tx_list, }: {
1399
+ tx: Tx;
1400
+ origin: string;
1401
+ address: string;
1402
+ updateNonce: boolean;
1403
+ pending_tx_list: Tx[];
1404
+ }) => Promise<{
1405
+ gas_used?: number;
1406
+ safe_gas_used?: number;
1407
+ }>;
1408
+ getCexSupportList: () => Promise<ProjectItem[]>;
1409
+ getAppChainList: (id: string) => Promise<AppChainListResponse>;
1410
+ checkCex: (postData: {
1411
+ chain_id: string;
1412
+ id: string;
1413
+ cex_id: string;
1414
+ }) => Promise<{
1415
+ success: boolean;
1416
+ }>;
1417
+ getHotTokenList: () => Promise<TokenDetailWithPriceCurve[]>;
1418
+ getTokensDetailByUuids: (uuids: string[]) => Promise<TokenDetailWithPriceCurve[]>;
1419
+ getTokenKlineData: (params: {
1420
+ chain_id: string;
1421
+ token_id: string;
1422
+ interval: string;
1423
+ after_time_at?: number;
1424
+ }) => Promise<{
1425
+ data_list: KlineDataItem[];
1426
+ }>;
1427
+ getTokenMarketInfo: (params: {
1428
+ chain_id: string;
1429
+ token_id: string;
1430
+ }) => Promise<TokenMarketInfo>;
1431
+ getTokenHolderInfo: (params: {
1432
+ chain_id: string;
1433
+ token_id: string;
1434
+ }) => Promise<TokenHolderInfo>;
1435
+ getTokenSupplyInfo: (params: {
1436
+ chain_id: string;
1437
+ token_id: string;
1438
+ }) => Promise<TokenSupplyInfo>;
1439
+ postUserFeedback: (data: {
1440
+ title: string;
1441
+ image_url_list: string[];
1442
+ content: string;
1443
+ extra?: UserFeedbackItem['extra'];
1444
+ }) => Promise<UserFeedbackItem>;
1445
+ getUserFeedback: (id: string) => Promise<UserFeedbackItem>;
1446
+ getUserFeedbackList: (id: string | string[]) => Promise<UserFeedbackItem[]>;
1447
+ getCurrencyList: () => Promise<CurrencyItem[]>;
1448
+ getMarketSummary: ({ token_id, chain_id, }: {
1449
+ token_id: string;
1450
+ chain_id: string;
1451
+ }) => Promise<MarketSummary>;
1452
+ getMarketTradingHistory: (params: {
1453
+ token_id: string;
1454
+ chain_id: string;
1455
+ action?: 'buy' | 'sell';
1456
+ after_time_at?: number;
1457
+ limit?: number;
1458
+ cursor?: string;
1459
+ }) => Promise<{
1460
+ pagination: {
1461
+ limit: number;
1462
+ has_next: boolean;
1463
+ next_cursor?: string;
1464
+ };
1465
+ data_list: MarketTradingHistoryItem[];
1466
+ }>;
1467
+ getTokenHolderSummary: (params: {
1468
+ token_id: string;
1469
+ chain_id: string;
1470
+ }) => Promise<TokenHolderSummary>;
1471
+ getTokenHolderList: (params: {
1472
+ token_id: string;
1473
+ chain_id: string;
1474
+ }) => Promise<{
1475
+ data_list: TokenHolderItem[];
1476
+ }>;
1477
+ getLiquidityPoolList: (params: {
1478
+ token_id: string;
1479
+ chain_id: string;
1480
+ }) => Promise<LiquidityPoolItem[]>;
1481
+ getLiquidityPoolHistoryList: (params: {
1482
+ token_id: string;
1483
+ chain_id: string;
1484
+ action?: 'add' | 'remove';
1485
+ limit?: number;
1486
+ cursor?: string;
1487
+ }) => Promise<{
1488
+ pagination: {
1489
+ limit: number;
1490
+ has_next: boolean;
1491
+ next_cursor?: string;
1492
+ };
1493
+ data_list: LiquidityPoolHistoryItem[];
1494
+ }>;
1495
+ getTokenMarketCategoryList: () => Promise<TokenMarketCategoryListResponse>;
1496
+ getNFTTradingConfig: () => Promise<NFTTradingConfig>;
1497
+ getNFTDetail: (params: {
1498
+ chain_id: string;
1499
+ id: string;
1500
+ user_addr: string;
1501
+ }) => Promise<NFTDetail>;
1502
+ getNFTListingOrders: (params: {
1503
+ maker: string;
1504
+ chain_id: string;
1505
+ collection_id: string;
1506
+ inner_id: string;
1507
+ limit?: number;
1508
+ cursor?: string;
1509
+ }) => Promise<NFTListingResponse>;
1510
+ getNFTFees: (params: {
1511
+ chain_id: string;
1512
+ collection_id: string;
1513
+ inner_id: string;
1514
+ }) => Promise<{
1515
+ marketplace_fees: {
1516
+ recipient: string;
1517
+ fee: number;
1518
+ required: boolean;
1519
+ }[];
1520
+ custom_royalties: {
1521
+ recipient: string;
1522
+ fee: number;
1523
+ required: boolean;
1524
+ }[];
1525
+ }>;
1526
+ prepareListingNFT: (postData: {
1527
+ maker: string;
1528
+ chain_id: string;
1529
+ collection_id: string;
1530
+ inner_id: string;
1531
+ wei_price: string;
1532
+ quantity?: number;
1533
+ marketplace_fees: {
1534
+ recipient: string;
1535
+ fee: number;
1536
+ }[];
1537
+ custom_royalties: {
1538
+ recipient: string;
1539
+ fee: number;
1540
+ }[];
1541
+ listing_time_at?: number;
1542
+ expiration_time_at?: number;
1543
+ currency: string;
1544
+ salt?: string;
1545
+ }) => Promise<PrepareListingNFTResponse>;
1546
+ createListingNFT: (postData: {
1547
+ chain_id: string;
1548
+ order: PrepareListingNFTResponse['data']['post']['body']['order'];
1549
+ signature: string;
1550
+ protocol_address?: string;
1551
+ }) => Promise<CreateListingNFTOfferResponse>;
1552
+ prepareAcceptNFTOffer: (postData: {
1553
+ chain_id: string;
1554
+ order_hash: string;
1555
+ fulfiller: string;
1556
+ collection_id: string;
1557
+ inner_id: string;
1558
+ quantity?: number;
1559
+ include_optional_creator_fees?: boolean;
1560
+ }) => Promise<PrepareAcceptNFTOfferResponse>;
1561
+ submitAcceptNFTOfferTx: (postData: {
1562
+ tx_id: string;
1563
+ data: Tx;
1564
+ }) => Promise<{
1565
+ success: boolean;
1566
+ }>;
1567
+ checkTokenDepositForbidden: (params: {
1568
+ chain_id: string;
1569
+ id: string;
1570
+ user_addr: string;
1571
+ to_addr: string;
1572
+ }) => Promise<{
1573
+ msg: string;
1574
+ }>;
1575
+ getPolyMarketPermission: (params: {
1576
+ id?: string;
1577
+ }) => Promise<{
1578
+ has_permission: boolean;
1579
+ }>;
1580
+ getDappPermission: (params: {
1581
+ id?: string;
1582
+ dapp: string;
1583
+ }) => Promise<{
1584
+ has_permission: boolean;
1585
+ }>;
1586
+ getMemeList: (params: {
1587
+ order_by?: 'fdv' | 'volume_24h' | 'price_change_24h';
1588
+ order?: 'asc' | 'desc';
1589
+ limit?: number;
1590
+ cursor?: string;
1591
+ }) => Promise<MemeListResponse>;
1592
+ getTokenMarketTokenList: (params: {
1593
+ category_id: string;
1594
+ order_by?: string;
1595
+ order?: 'asc' | 'desc';
1596
+ limit?: number;
1597
+ cursor?: string;
1598
+ version?: string;
1599
+ }) => Promise<TokenMarketTokenListResponse>;
1600
+ }
1601
+ export {};