@rabby-wallet/rabby-api 0.9.69-beta.0 → 0.9.70-alpha.0

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