@rabby-wallet/rabby-api 0.9.5 → 0.9.6-8.alpha.2

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,10 +1,12 @@
1
1
  import { AxiosAdapter, AxiosRequestConfig } from 'axios';
2
2
  import { RateLimitedAxiosInstance } from 'axios-rate-limit';
3
3
  import { InitOptions, RabbyApiPlugin } from './plugins/intf';
4
- import { AddrDescResponse, BridgeAggregator, ApprovalStatus, AssetItem, BasicDappInfo, CEXQuote, Cex, ChainListItem, ChainWithPendingCount, Collection, CollectionList, CollectionWithFloorPrice, ComplexProtocol, ContractCredit, DbkBridgeHistoryItem, ExplainTxResponse, ExplainTypedDataResponse, GasLevel, GetTxResponse, HistoryCurve, LatestExplainTxResponse, MempoolCheckDetail, NFTApprovalResponse, NFTItem, NodeStatus, NodeStatusDetail, ParseTextResponse, ParseTxResponse, ParseTypedDataResponse, PendingTxItem, Protocol, SecurityCheckResponse, ServerChain, SlippageStatus, Summary, SupportedChain, SwapTradeList, TokenApproval, TokenItem, TotalBalanceResponse, Tx, TxAllHistoryResult, TxHistoryResult, TxPushType, TxRequest, UsedChain, BridgeTokenPair, BridgeQuote, BridgeHistory, ContractInfo, GasAccountCheckResult, ParseCommonResponse } from './types';
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, PerpTopTokenV3, PerpTopTokenCategory, StakingFilterListParams, StakingFilterListResponse, StakingPoolCurveParams, StakingPoolCurveResponse, StakingPoolListParams, StakingPoolListResponse, StakingPoolParams, StakingPoolResponse } from './types';
5
5
  interface OpenApiStore {
6
6
  host: string;
7
7
  testnetHost?: string;
8
+ apiKey: string | null;
9
+ apiTime: number | null;
8
10
  }
9
11
  interface Options {
10
12
  store: OpenApiStore | Promise<OpenApiStore>;
@@ -21,6 +23,44 @@ declare type VersionPrefix = 'v1' | 'v2';
21
23
  declare type ApiOptions<V extends VersionPrefix | void = VersionPrefix> = {
22
24
  restfulPrefix?: V;
23
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
+ };
24
64
  export declare class OpenApiService {
25
65
  #private;
26
66
  store: OpenApiStore;
@@ -28,6 +68,9 @@ export declare class OpenApiService {
28
68
  constructor({ store, plugin, adapter, clientName, clientVersion, }: Options);
29
69
  setHost: (host: string) => Promise<void>;
30
70
  setHostSync: (host: string) => void;
71
+ setAPIKey: (apiKey: string) => Promise<void>;
72
+ setAPITime: (apiTime: number) => Promise<void>;
73
+ removeAPIKey: () => Promise<void>;
31
74
  getHost: () => string;
32
75
  setTestnetHost: (host: string) => Promise<void>;
33
76
  getTestnetHost: () => string | undefined;
@@ -38,6 +81,23 @@ export declare class OpenApiService {
38
81
  }) => Promise<any>) | (() => Promise<never>);
39
82
  init: (options?: string | InitOptions) => Promise<void>;
40
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>;
41
101
  asyncJob: <T = any>(url: string, options?: AxiosRequestConfig & {
42
102
  retryDelay?: number;
43
103
  }) => Promise<T>;
@@ -52,6 +112,9 @@ export declare class OpenApiService {
52
112
  excluded_protocol_ids: string[];
53
113
  excluded_chain_ids: string[];
54
114
  }) => Promise<TotalBalanceResponse>;
115
+ get24hTotalBalance: (address: string) => Promise<{
116
+ total_usd_value: number;
117
+ }>;
55
118
  getPendingCount: (address: string) => Promise<{
56
119
  total_count: number;
57
120
  chains: ChainWithPendingCount[];
@@ -59,12 +122,13 @@ export declare class OpenApiService {
59
122
  checkOrigin: (address: string, origin: string) => Promise<SecurityCheckResponse>;
60
123
  checkText: (address: string, origin: string, text: string) => Promise<SecurityCheckResponse>;
61
124
  checkTx: (tx: Tx, origin: string, address: string, update_nonce?: boolean) => Promise<SecurityCheckResponse>;
62
- preExecTx: ({ tx, origin, address, updateNonce, pending_tx_list, }: {
125
+ preExecTx: ({ tx, origin, address, updateNonce, pending_tx_list, delegate_call, }: {
63
126
  tx: Tx;
64
127
  origin: string;
65
128
  address: string;
66
129
  updateNonce: boolean;
67
130
  pending_tx_list: Tx[];
131
+ delegate_call?: boolean | undefined;
68
132
  }) => Promise<ExplainTxResponse>;
69
133
  historyGasUsed: (params: {
70
134
  tx: Tx;
@@ -94,6 +158,7 @@ export declare class OpenApiService {
94
158
  getToken: (id: string, chainId: string, tokenId: string) => Promise<TokenItem>;
95
159
  getCachedTokenList: (id: string) => Promise<TokenItem[]>;
96
160
  listToken: (id: string, chainId?: string, isAll?: boolean) => Promise<TokenItem[]>;
161
+ getTokenEntity: (id: string, chainId?: string) => Promise<TokenEntityDetail>;
97
162
  getHistoryTokenList: (params: {
98
163
  id: string;
99
164
  chainId?: string;
@@ -106,6 +171,31 @@ export declare class OpenApiService {
106
171
  listCollection: (params: {
107
172
  collection_ids: string;
108
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
+ */
109
199
  listTxHisotry: (params: {
110
200
  id?: string;
111
201
  chain_id?: string;
@@ -117,11 +207,15 @@ export declare class OpenApiService {
117
207
  getAllTxHistory: (params: {
118
208
  id: string;
119
209
  start_time?: number;
210
+ page_count?: number;
120
211
  }, options?: Parameters<typeof this.asyncJob>[1]) => Promise<TxAllHistoryResult>;
121
212
  tokenPrice: (tokenName: string) => Promise<{
122
213
  change_percent: number;
123
214
  last_price: number;
124
215
  }>;
216
+ getTokenPriceList: (params: {
217
+ uuids: string[];
218
+ }) => Promise<TokenPriceListResponse>;
125
219
  tokenAuthorizedList: <V extends VersionPrefix | undefined>(id: string, chain_id: string, options?: ApiOptions<V> | undefined) => Promise<TokenApproval[]>;
126
220
  userNFTAuthorizedList: (id: string, chain_id: string) => Promise<NFTApprovalResponse>;
127
221
  getDEXList: (chain_id: string) => Promise<{
@@ -140,6 +234,7 @@ export declare class OpenApiService {
140
234
  receive_token_id: string;
141
235
  slippage?: string | number;
142
236
  fee?: boolean;
237
+ fee_rate?: number;
143
238
  }) => Promise<{
144
239
  receive_token_raw_amount: number;
145
240
  dex_approve_to: string;
@@ -181,6 +276,9 @@ export declare class OpenApiService {
181
276
  getLatestVersion: () => Promise<{
182
277
  version_tag: string;
183
278
  }>;
279
+ getVersionInfo: (params: {
280
+ version_id: string;
281
+ }) => Promise<WalletVersionInfoResponse>;
184
282
  addOriginFeedback: (params: {
185
283
  user_addr: string;
186
284
  origin: string;
@@ -229,6 +327,11 @@ export declare class OpenApiService {
229
327
  start: string;
230
328
  limit: string;
231
329
  }) => Promise<SwapTradeList>;
330
+ getSwapTradeListV2: (params: {
331
+ user_addr: string;
332
+ limit: number;
333
+ start_time?: number;
334
+ }) => Promise<SwapTradeList>;
232
335
  postSwap: (params: {
233
336
  quote: {
234
337
  pay_token_id: string;
@@ -238,6 +341,7 @@ export declare class OpenApiService {
238
341
  slippage: number;
239
342
  };
240
343
  dex_id: string;
344
+ fee_rate?: number;
241
345
  tx_id: string;
242
346
  tx: Tx;
243
347
  }) => Promise<any>;
@@ -247,6 +351,15 @@ export declare class OpenApiService {
247
351
  from_token_id: string;
248
352
  to_token_id: string;
249
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
+ }>;
250
363
  getOriginPopularityLevel: (origin: string) => Promise<{
251
364
  level: 'very_low' | 'low' | 'medium' | 'high';
252
365
  }>;
@@ -343,6 +456,9 @@ export declare class OpenApiService {
343
456
  hasTransfer: (chainId: string, from: string, to: string) => Promise<{
344
457
  has_transfer: boolean;
345
458
  }>;
459
+ hasTransferAllChain: (from: string, to: string) => Promise<{
460
+ has_transfer: boolean;
461
+ }>;
346
462
  isTokenContract: (chainId: string, id: string) => Promise<{
347
463
  is_token: boolean;
348
464
  }>;
@@ -475,9 +591,40 @@ export declare class OpenApiService {
475
591
  log_id: string;
476
592
  low_gas_deadline?: number;
477
593
  origin?: string;
594
+ sig?: string;
478
595
  }) => Promise<{
479
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;
480
626
  }>;
627
+ getDefaultRPCs: () => Promise<DefaultRPCRes>;
481
628
  getTxRequests: (ids: string | string[]) => Promise<TxRequest[]>;
482
629
  getTxRequest: (id: string) => Promise<TxRequest>;
483
630
  withdrawTx: (reqId: string) => Promise<{
@@ -525,6 +672,7 @@ export declare class OpenApiService {
525
672
  chain_id?: string;
526
673
  start?: number;
527
674
  limit?: number;
675
+ match_id?: boolean;
528
676
  }) => Promise<{
529
677
  page: {
530
678
  limit: number;
@@ -541,6 +689,7 @@ export declare class OpenApiService {
541
689
  }) => Promise<string[]>;
542
690
  getHotDapps: (params?: {
543
691
  limit: number;
692
+ order_by: string;
544
693
  }) => Promise<BasicDappInfo[]>;
545
694
  getRabbyClaimText: (params: {
546
695
  id: string;
@@ -783,6 +932,10 @@ export declare class OpenApiService {
783
932
  addr: string;
784
933
  web3_id: string;
785
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>;
786
939
  getBridgeSupportChain: () => Promise<string[]>;
787
940
  getBridgeAggregatorList: () => Promise<BridgeAggregator[]>;
788
941
  getBridgePairList: (params: {
@@ -807,6 +960,8 @@ export declare class OpenApiService {
807
960
  from_token_raw_amount: string;
808
961
  to_chain_id: string;
809
962
  to_token_id: string;
963
+ slippage?: string;
964
+ fee_rate?: number;
810
965
  }) => Promise<Omit<BridgeQuote, 'tx'>[]>;
811
966
  getBridgeQuote: (params: {
812
967
  aggregator_id: string;
@@ -822,10 +977,28 @@ export declare class OpenApiService {
822
977
  user_addr: string;
823
978
  start: number;
824
979
  limit: number;
980
+ is_all?: boolean;
825
981
  }) => Promise<{
826
982
  history_list: BridgeHistory[];
827
983
  total_cnt: number;
828
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>;
829
1002
  postBridgeHistory: (params: {
830
1003
  aggregator_id: string;
831
1004
  bridge_id: string;
@@ -838,6 +1011,61 @@ export declare class OpenApiService {
838
1011
  tx_id: string;
839
1012
  tx: Tx;
840
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;
841
1069
  }) => Promise<{
842
1070
  success: boolean;
843
1071
  }>;
@@ -866,12 +1094,39 @@ export declare class OpenApiService {
866
1094
  sig: string;
867
1095
  id: string;
868
1096
  }) => Promise<{
869
- account: {
870
- id: string;
871
- balance: number;
872
- create_at: number;
873
- nonce: number;
874
- };
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;
875
1130
  }>;
876
1131
  loginGasAccount: (params: {
877
1132
  sig: string;
@@ -886,6 +1141,33 @@ export declare class OpenApiService {
886
1141
  success: boolean;
887
1142
  }>;
888
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>;
889
1171
  rechargeGasAccount: (p: {
890
1172
  sig: string;
891
1173
  account_id: string;
@@ -901,9 +1183,16 @@ export declare class OpenApiService {
901
1183
  sig: string;
902
1184
  amount: number;
903
1185
  account_id: string;
1186
+ user_addr: string;
1187
+ chain_id: string;
1188
+ fee: number;
904
1189
  }) => Promise<{
905
1190
  success: boolean;
906
1191
  }>;
1192
+ getWithdrawList: (p: {
1193
+ sig: string;
1194
+ id: string;
1195
+ }) => Promise<WithdrawListAddressItem[]>;
907
1196
  getGasAccountHistory: (p: {
908
1197
  sig: string;
909
1198
  account_id: string;
@@ -918,6 +1207,14 @@ export declare class OpenApiService {
918
1207
  tx_id: string;
919
1208
  user_addr: string;
920
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
+ }[];
921
1218
  history_list: {
922
1219
  id: string;
923
1220
  chain_id: string;
@@ -928,6 +1225,7 @@ export declare class OpenApiService {
928
1225
  usd_value: number;
929
1226
  user_addr: string;
930
1227
  history_type: 'tx' | 'recharge' | 'withdraw';
1228
+ source: string;
931
1229
  }[];
932
1230
  pagination: {
933
1231
  limit: number;
@@ -936,7 +1234,7 @@ export declare class OpenApiService {
936
1234
  };
937
1235
  }>;
938
1236
  checkGasAccountTxs: (p: {
939
- sig: string;
1237
+ sig?: string;
940
1238
  account_id: string;
941
1239
  tx_list: Tx[];
942
1240
  }) => Promise<GasAccountCheckResult>;
@@ -968,6 +1266,7 @@ export declare class OpenApiService {
968
1266
  to_chain_id: string;
969
1267
  from_token_id?: string;
970
1268
  q?: string;
1269
+ user_addr?: string;
971
1270
  }) => Promise<{
972
1271
  token_list: (TokenItem & {
973
1272
  trade_volume_24h: 'low' | 'middle' | 'high';
@@ -982,6 +1281,7 @@ export declare class OpenApiService {
982
1281
  to_chain_id: string;
983
1282
  to_token_id: string;
984
1283
  slippage: string;
1284
+ fee_rate?: number;
985
1285
  }) => Promise<Omit<BridgeQuote, 'tx'>[]>;
986
1286
  getBridgeQuoteTxV2: (params: {
987
1287
  aggregator_id: string;
@@ -1004,11 +1304,28 @@ export declare class OpenApiService {
1004
1304
  aggregator_id: string;
1005
1305
  }[]>;
1006
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
+ }>;
1007
1317
  uninstalledFeedback: ({ text, }: {
1008
1318
  text: string;
1009
1319
  }) => Promise<{
1010
1320
  success: boolean;
1011
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
+ */
1012
1329
  getToken24hPrice: (params: {
1013
1330
  chain_id: string;
1014
1331
  id: string;
@@ -1016,6 +1333,14 @@ export declare class OpenApiService {
1016
1333
  time_at: number;
1017
1334
  price: number;
1018
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
+ }[]>;
1019
1344
  getTokenDatePrice: (params: {
1020
1345
  chain_id: string;
1021
1346
  id: string;
@@ -1023,5 +1348,296 @@ export declare class OpenApiService {
1023
1348
  date_at: string;
1024
1349
  price: number;
1025
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>;
1026
1642
  }
1027
1643
  export {};