@rabby-wallet/rabby-api 0.9.4 → 0.9.5-1.beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +459 -10
- package/dist/index.js +499 -22
- package/dist/types.d.ts +1215 -11
- package/package.json +2 -2
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, 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, WithdrawListAddressItem, BuyCountryItem, BuyQuoteItem, BuyHistoryList, BuyPaymentMethod, GasAccountInfo, TokenEntityDetail, TokenItemWithEntity, ProjectItem, CopyTradeTokenListResponse, CopyTradeRecentBuyListResponse, CopyTradePnlListResponse, AppChainListResponse, CopyTradeTokenListV2Response, CopyTradeRecentBuyListV2Response, CopyTradeTokenItemV2, CopyTradeSameToken, DefaultRPCRes, TokenDetailWithPriceCurve, GiftEligibilityItem, UserFeedbackItem, PerpTopToken, KlineDataItem, TokenMarketInfo, TokenHolderInfo, TokenSupplyInfo, MarketSummary, MarketTradingHistoryItem, TokenHolderSummary, TokenHolderItem, CurrencyItem, PerpBridgeQuote, LiquidityPoolItem, LiquidityPoolHistoryItem, NFTDetail, NFTTradingConfig, PrepareAcceptNFTOfferResponse, PrepareListingNFTResponse, CreateListingNFTOfferResponse, NFTListingResponse } 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>;
|
|
@@ -28,6 +30,9 @@ export declare class OpenApiService {
|
|
|
28
30
|
constructor({ store, plugin, adapter, clientName, clientVersion, }: Options);
|
|
29
31
|
setHost: (host: string) => Promise<void>;
|
|
30
32
|
setHostSync: (host: string) => void;
|
|
33
|
+
setAPIKey: (apiKey: string) => Promise<void>;
|
|
34
|
+
setAPITime: (apiTime: number) => Promise<void>;
|
|
35
|
+
removeAPIKey: () => Promise<void>;
|
|
31
36
|
getHost: () => string;
|
|
32
37
|
setTestnetHost: (host: string) => Promise<void>;
|
|
33
38
|
getTestnetHost: () => string | undefined;
|
|
@@ -44,6 +49,17 @@ export declare class OpenApiService {
|
|
|
44
49
|
private _mountMethods;
|
|
45
50
|
getRecommendChains: (address: string, origin: string) => Promise<ServerChain[]>;
|
|
46
51
|
getTotalBalance: (address: string, isCore?: boolean) => Promise<TotalBalanceResponse>;
|
|
52
|
+
getTotalBalanceV2: ({ address, isCore, included_token_uuids, excluded_token_uuids, excluded_protocol_ids, excluded_chain_ids, }: {
|
|
53
|
+
address: string;
|
|
54
|
+
isCore: boolean;
|
|
55
|
+
included_token_uuids: string[];
|
|
56
|
+
excluded_token_uuids: string[];
|
|
57
|
+
excluded_protocol_ids: string[];
|
|
58
|
+
excluded_chain_ids: string[];
|
|
59
|
+
}) => Promise<TotalBalanceResponse>;
|
|
60
|
+
get24hTotalBalance: (address: string) => Promise<{
|
|
61
|
+
total_usd_value: number;
|
|
62
|
+
}>;
|
|
47
63
|
getPendingCount: (address: string) => Promise<{
|
|
48
64
|
total_count: number;
|
|
49
65
|
chains: ChainWithPendingCount[];
|
|
@@ -51,12 +67,13 @@ export declare class OpenApiService {
|
|
|
51
67
|
checkOrigin: (address: string, origin: string) => Promise<SecurityCheckResponse>;
|
|
52
68
|
checkText: (address: string, origin: string, text: string) => Promise<SecurityCheckResponse>;
|
|
53
69
|
checkTx: (tx: Tx, origin: string, address: string, update_nonce?: boolean) => Promise<SecurityCheckResponse>;
|
|
54
|
-
preExecTx: ({ tx, origin, address, updateNonce, pending_tx_list, }: {
|
|
70
|
+
preExecTx: ({ tx, origin, address, updateNonce, pending_tx_list, delegate_call, }: {
|
|
55
71
|
tx: Tx;
|
|
56
72
|
origin: string;
|
|
57
73
|
address: string;
|
|
58
74
|
updateNonce: boolean;
|
|
59
75
|
pending_tx_list: Tx[];
|
|
76
|
+
delegate_call?: boolean | undefined;
|
|
60
77
|
}) => Promise<ExplainTxResponse>;
|
|
61
78
|
historyGasUsed: (params: {
|
|
62
79
|
tx: Tx;
|
|
@@ -86,6 +103,7 @@ export declare class OpenApiService {
|
|
|
86
103
|
getToken: (id: string, chainId: string, tokenId: string) => Promise<TokenItem>;
|
|
87
104
|
getCachedTokenList: (id: string) => Promise<TokenItem[]>;
|
|
88
105
|
listToken: (id: string, chainId?: string, isAll?: boolean) => Promise<TokenItem[]>;
|
|
106
|
+
getTokenEntity: (id: string, chainId?: string) => Promise<TokenEntityDetail>;
|
|
89
107
|
getHistoryTokenList: (params: {
|
|
90
108
|
id: string;
|
|
91
109
|
chainId?: string;
|
|
@@ -94,10 +112,16 @@ export declare class OpenApiService {
|
|
|
94
112
|
}) => Promise<TokenItem[]>;
|
|
95
113
|
customListToken: (uuids: string[], id: string) => Promise<TokenItem[]>;
|
|
96
114
|
listChainAssets: (id: string) => Promise<AssetItem[]>;
|
|
97
|
-
listNFT: (id: string, isAll?: boolean) => Promise<NFTItem[]>;
|
|
115
|
+
listNFT: (id: string, isAll?: boolean, sortByCredit?: boolean) => Promise<NFTItem[]>;
|
|
98
116
|
listCollection: (params: {
|
|
99
117
|
collection_ids: string;
|
|
100
118
|
}) => Promise<Collection[]>;
|
|
119
|
+
hasNewTxFrom: (params: {
|
|
120
|
+
address: string;
|
|
121
|
+
startTime: number;
|
|
122
|
+
}) => Promise<{
|
|
123
|
+
has_new_tx: boolean;
|
|
124
|
+
}>;
|
|
101
125
|
listTxHisotry: (params: {
|
|
102
126
|
id?: string;
|
|
103
127
|
chain_id?: string;
|
|
@@ -109,6 +133,7 @@ export declare class OpenApiService {
|
|
|
109
133
|
getAllTxHistory: (params: {
|
|
110
134
|
id: string;
|
|
111
135
|
start_time?: number;
|
|
136
|
+
page_count?: number;
|
|
112
137
|
}, options?: Parameters<typeof this.asyncJob>[1]) => Promise<TxAllHistoryResult>;
|
|
113
138
|
tokenPrice: (tokenName: string) => Promise<{
|
|
114
139
|
change_percent: number;
|
|
@@ -221,6 +246,11 @@ export declare class OpenApiService {
|
|
|
221
246
|
start: string;
|
|
222
247
|
limit: string;
|
|
223
248
|
}) => Promise<SwapTradeList>;
|
|
249
|
+
getSwapTradeListV2: (params: {
|
|
250
|
+
user_addr: string;
|
|
251
|
+
limit: number;
|
|
252
|
+
start_time?: number;
|
|
253
|
+
}) => Promise<SwapTradeList>;
|
|
224
254
|
postSwap: (params: {
|
|
225
255
|
quote: {
|
|
226
256
|
pay_token_id: string;
|
|
@@ -239,6 +269,15 @@ export declare class OpenApiService {
|
|
|
239
269
|
from_token_id: string;
|
|
240
270
|
to_token_id: string;
|
|
241
271
|
}) => Promise<SlippageStatus>;
|
|
272
|
+
suggestSlippage: (params: {
|
|
273
|
+
chain_id: string;
|
|
274
|
+
slippage: string;
|
|
275
|
+
from_token_id: string;
|
|
276
|
+
to_token_id: string;
|
|
277
|
+
from_token_amount: string;
|
|
278
|
+
}) => Promise<{
|
|
279
|
+
suggest_slippage: number;
|
|
280
|
+
}>;
|
|
242
281
|
getOriginPopularityLevel: (origin: string) => Promise<{
|
|
243
282
|
level: 'very_low' | 'low' | 'medium' | 'high';
|
|
244
283
|
}>;
|
|
@@ -335,6 +374,9 @@ export declare class OpenApiService {
|
|
|
335
374
|
hasTransfer: (chainId: string, from: string, to: string) => Promise<{
|
|
336
375
|
has_transfer: boolean;
|
|
337
376
|
}>;
|
|
377
|
+
hasTransferAllChain: (from: string, to: string) => Promise<{
|
|
378
|
+
has_transfer: boolean;
|
|
379
|
+
}>;
|
|
338
380
|
isTokenContract: (chainId: string, id: string) => Promise<{
|
|
339
381
|
is_token: boolean;
|
|
340
382
|
}>;
|
|
@@ -467,9 +509,40 @@ export declare class OpenApiService {
|
|
|
467
509
|
log_id: string;
|
|
468
510
|
low_gas_deadline?: number;
|
|
469
511
|
origin?: string;
|
|
512
|
+
sig?: string;
|
|
470
513
|
}) => Promise<{
|
|
471
514
|
req: TxRequest;
|
|
515
|
+
access_token?: string;
|
|
516
|
+
}>;
|
|
517
|
+
submitTxV2: (postData: {
|
|
518
|
+
frontend_push_result?: {
|
|
519
|
+
success: true;
|
|
520
|
+
has_pushed: true;
|
|
521
|
+
raw_tx: string;
|
|
522
|
+
url: string;
|
|
523
|
+
return_tx_id: string;
|
|
524
|
+
} | {
|
|
525
|
+
success: false;
|
|
526
|
+
has_pushed: true;
|
|
527
|
+
url: string;
|
|
528
|
+
error_msg: string;
|
|
529
|
+
};
|
|
530
|
+
backend_push_require: {
|
|
531
|
+
gas_type: 'gas_account' | 'gasless' | null;
|
|
532
|
+
};
|
|
533
|
+
context: {
|
|
534
|
+
tx: Tx;
|
|
535
|
+
origin?: string;
|
|
536
|
+
log_id: string;
|
|
537
|
+
};
|
|
538
|
+
mev_share_model: 'user' | 'rabby';
|
|
539
|
+
sig?: string;
|
|
540
|
+
}) => Promise<{
|
|
541
|
+
tx_id?: string;
|
|
542
|
+
access_token?: string;
|
|
543
|
+
err?: string;
|
|
472
544
|
}>;
|
|
545
|
+
getDefaultRPCs: () => Promise<DefaultRPCRes>;
|
|
473
546
|
getTxRequests: (ids: string | string[]) => Promise<TxRequest[]>;
|
|
474
547
|
getTxRequest: (id: string) => Promise<TxRequest>;
|
|
475
548
|
withdrawTx: (reqId: string) => Promise<{
|
|
@@ -517,6 +590,7 @@ export declare class OpenApiService {
|
|
|
517
590
|
chain_id?: string;
|
|
518
591
|
start?: number;
|
|
519
592
|
limit?: number;
|
|
593
|
+
match_id?: boolean;
|
|
520
594
|
}) => Promise<{
|
|
521
595
|
page: {
|
|
522
596
|
limit: number;
|
|
@@ -533,6 +607,7 @@ export declare class OpenApiService {
|
|
|
533
607
|
}) => Promise<string[]>;
|
|
534
608
|
getHotDapps: (params?: {
|
|
535
609
|
limit: number;
|
|
610
|
+
order_by: string;
|
|
536
611
|
}) => Promise<BasicDappInfo[]>;
|
|
537
612
|
getRabbyClaimText: (params: {
|
|
538
613
|
id: string;
|
|
@@ -814,10 +889,23 @@ export declare class OpenApiService {
|
|
|
814
889
|
user_addr: string;
|
|
815
890
|
start: number;
|
|
816
891
|
limit: number;
|
|
892
|
+
is_all?: boolean;
|
|
817
893
|
}) => Promise<{
|
|
818
894
|
history_list: BridgeHistory[];
|
|
819
895
|
total_cnt: number;
|
|
820
896
|
}>;
|
|
897
|
+
buildBridgeTx: (params: {
|
|
898
|
+
aggregator_id: string;
|
|
899
|
+
bridge_id: string;
|
|
900
|
+
user_addr: string;
|
|
901
|
+
from_chain_id: string;
|
|
902
|
+
from_token_id: string;
|
|
903
|
+
from_token_raw_amount: string;
|
|
904
|
+
to_chain_id: string;
|
|
905
|
+
to_token_id: string;
|
|
906
|
+
slippage: string;
|
|
907
|
+
quote_key: string;
|
|
908
|
+
}) => Promise<Tx>;
|
|
821
909
|
postBridgeHistory: (params: {
|
|
822
910
|
aggregator_id: string;
|
|
823
911
|
bridge_id: string;
|
|
@@ -833,6 +921,37 @@ export declare class OpenApiService {
|
|
|
833
921
|
}) => Promise<{
|
|
834
922
|
success: boolean;
|
|
835
923
|
}>;
|
|
924
|
+
/**
|
|
925
|
+
* no id just no check address
|
|
926
|
+
*/
|
|
927
|
+
getPerpPermission: (params: {
|
|
928
|
+
id?: string;
|
|
929
|
+
}) => Promise<{
|
|
930
|
+
has_permission: boolean;
|
|
931
|
+
}>;
|
|
932
|
+
getPerpTopTokenList: () => Promise<PerpTopToken[]>;
|
|
933
|
+
getPerpsBridgeIsSupportToken: (params: {
|
|
934
|
+
token_id: string;
|
|
935
|
+
chain_id: string;
|
|
936
|
+
}) => Promise<{
|
|
937
|
+
success: boolean;
|
|
938
|
+
}>;
|
|
939
|
+
getPerpBridgeQuote: (params: {
|
|
940
|
+
user_addr: string;
|
|
941
|
+
from_chain_id: string;
|
|
942
|
+
from_token_id: string;
|
|
943
|
+
from_token_raw_amount: string;
|
|
944
|
+
}) => Promise<PerpBridgeQuote>;
|
|
945
|
+
postPerpBridgeHistory: (params: {
|
|
946
|
+
from_chain_id: string;
|
|
947
|
+
from_token_id: string;
|
|
948
|
+
from_token_amount: number;
|
|
949
|
+
to_token_amount: number;
|
|
950
|
+
tx_id: string;
|
|
951
|
+
tx: Tx;
|
|
952
|
+
}) => Promise<{
|
|
953
|
+
success: boolean;
|
|
954
|
+
}>;
|
|
836
955
|
getSupportedDEXList: () => Promise<{
|
|
837
956
|
dex_list: string[];
|
|
838
957
|
}>;
|
|
@@ -858,12 +977,39 @@ export declare class OpenApiService {
|
|
|
858
977
|
sig: string;
|
|
859
978
|
id: string;
|
|
860
979
|
}) => Promise<{
|
|
861
|
-
account:
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
980
|
+
account: GasAccountInfo;
|
|
981
|
+
}>;
|
|
982
|
+
getGasAccountInfoV2: (params: {
|
|
983
|
+
id: string;
|
|
984
|
+
}) => Promise<{
|
|
985
|
+
account: GasAccountInfo;
|
|
986
|
+
}>;
|
|
987
|
+
createGasAccountPayInfo: (postData: {
|
|
988
|
+
id: string;
|
|
989
|
+
}) => Promise<{
|
|
990
|
+
account: GasAccountInfo;
|
|
991
|
+
}>;
|
|
992
|
+
checkGasAccountGiftEligibility: (params: {
|
|
993
|
+
id: string;
|
|
994
|
+
}) => Promise<{
|
|
995
|
+
has_eligibility: boolean;
|
|
996
|
+
can_claimed_usd_value: number;
|
|
997
|
+
}>;
|
|
998
|
+
checkGasAccountGiftEligibilityBatch: (params: {
|
|
999
|
+
ids: string[];
|
|
1000
|
+
}) => Promise<GiftEligibilityItem[]>;
|
|
1001
|
+
confirmIapOrder: (postData: {
|
|
1002
|
+
transaction_id: string;
|
|
1003
|
+
device_type: 'android' | 'ios';
|
|
1004
|
+
product_id: string;
|
|
1005
|
+
}) => Promise<{
|
|
1006
|
+
req: TxRequest;
|
|
1007
|
+
}>;
|
|
1008
|
+
claimGasAccountGift: (params: {
|
|
1009
|
+
sig: string;
|
|
1010
|
+
id: string;
|
|
1011
|
+
}) => Promise<{
|
|
1012
|
+
success: boolean;
|
|
867
1013
|
}>;
|
|
868
1014
|
loginGasAccount: (params: {
|
|
869
1015
|
sig: string;
|
|
@@ -893,9 +1039,16 @@ export declare class OpenApiService {
|
|
|
893
1039
|
sig: string;
|
|
894
1040
|
amount: number;
|
|
895
1041
|
account_id: string;
|
|
1042
|
+
user_addr: string;
|
|
1043
|
+
chain_id: string;
|
|
1044
|
+
fee: number;
|
|
896
1045
|
}) => Promise<{
|
|
897
1046
|
success: boolean;
|
|
898
1047
|
}>;
|
|
1048
|
+
getWithdrawList: (p: {
|
|
1049
|
+
sig: string;
|
|
1050
|
+
id: string;
|
|
1051
|
+
}) => Promise<WithdrawListAddressItem[]>;
|
|
899
1052
|
getGasAccountHistory: (p: {
|
|
900
1053
|
sig: string;
|
|
901
1054
|
account_id: string;
|
|
@@ -910,6 +1063,14 @@ export declare class OpenApiService {
|
|
|
910
1063
|
tx_id: string;
|
|
911
1064
|
user_addr: string;
|
|
912
1065
|
}[];
|
|
1066
|
+
withdraw_list: {
|
|
1067
|
+
amount: number;
|
|
1068
|
+
chain_id: string;
|
|
1069
|
+
create_at: number;
|
|
1070
|
+
gas_account_id: string;
|
|
1071
|
+
tx_id: string;
|
|
1072
|
+
user_addr: string;
|
|
1073
|
+
}[];
|
|
913
1074
|
history_list: {
|
|
914
1075
|
id: string;
|
|
915
1076
|
chain_id: string;
|
|
@@ -920,6 +1081,7 @@ export declare class OpenApiService {
|
|
|
920
1081
|
usd_value: number;
|
|
921
1082
|
user_addr: string;
|
|
922
1083
|
history_type: 'tx' | 'recharge' | 'withdraw';
|
|
1084
|
+
source: string;
|
|
923
1085
|
}[];
|
|
924
1086
|
pagination: {
|
|
925
1087
|
limit: number;
|
|
@@ -928,7 +1090,7 @@ export declare class OpenApiService {
|
|
|
928
1090
|
};
|
|
929
1091
|
}>;
|
|
930
1092
|
checkGasAccountTxs: (p: {
|
|
931
|
-
sig
|
|
1093
|
+
sig?: string;
|
|
932
1094
|
account_id: string;
|
|
933
1095
|
tx_list: Tx[];
|
|
934
1096
|
}) => Promise<GasAccountCheckResult>;
|
|
@@ -960,6 +1122,7 @@ export declare class OpenApiService {
|
|
|
960
1122
|
to_chain_id: string;
|
|
961
1123
|
from_token_id?: string;
|
|
962
1124
|
q?: string;
|
|
1125
|
+
user_addr?: string;
|
|
963
1126
|
}) => Promise<{
|
|
964
1127
|
token_list: (TokenItem & {
|
|
965
1128
|
trade_volume_24h: 'low' | 'middle' | 'high';
|
|
@@ -996,11 +1159,24 @@ export declare class OpenApiService {
|
|
|
996
1159
|
aggregator_id: string;
|
|
997
1160
|
}[]>;
|
|
998
1161
|
getBridgeSupportChainV2: () => Promise<string[]>;
|
|
1162
|
+
submitFeedback: ({ text, usage, }: {
|
|
1163
|
+
text: string;
|
|
1164
|
+
/**
|
|
1165
|
+
* @description 'usage' is used to submit feedback on rating scene.
|
|
1166
|
+
* by default, it means 'uninstall' scene.
|
|
1167
|
+
*/
|
|
1168
|
+
usage?: "rating" | undefined;
|
|
1169
|
+
}) => Promise<{
|
|
1170
|
+
success: boolean;
|
|
1171
|
+
}>;
|
|
999
1172
|
uninstalledFeedback: ({ text, }: {
|
|
1000
1173
|
text: string;
|
|
1001
1174
|
}) => Promise<{
|
|
1002
1175
|
success: boolean;
|
|
1003
1176
|
}>;
|
|
1177
|
+
/**
|
|
1178
|
+
* @deprecated
|
|
1179
|
+
*/
|
|
1004
1180
|
getToken24hPrice: (params: {
|
|
1005
1181
|
chain_id: string;
|
|
1006
1182
|
id: string;
|
|
@@ -1008,6 +1184,14 @@ export declare class OpenApiService {
|
|
|
1008
1184
|
time_at: number;
|
|
1009
1185
|
price: number;
|
|
1010
1186
|
}[]>;
|
|
1187
|
+
getTokenPriceCurve: (params: {
|
|
1188
|
+
chain_id: string;
|
|
1189
|
+
id: string;
|
|
1190
|
+
days: number | 1 | 7;
|
|
1191
|
+
}) => Promise<{
|
|
1192
|
+
time_at: number;
|
|
1193
|
+
price: number;
|
|
1194
|
+
}[]>;
|
|
1011
1195
|
getTokenDatePrice: (params: {
|
|
1012
1196
|
chain_id: string;
|
|
1013
1197
|
id: string;
|
|
@@ -1015,5 +1199,270 @@ export declare class OpenApiService {
|
|
|
1015
1199
|
date_at: string;
|
|
1016
1200
|
price: number;
|
|
1017
1201
|
}[]>;
|
|
1202
|
+
searchTokens: (params: {
|
|
1203
|
+
q: string;
|
|
1204
|
+
}) => Promise<TokenItem[]>;
|
|
1205
|
+
searchTokensV2: (params: {
|
|
1206
|
+
q: string;
|
|
1207
|
+
chain_id?: string;
|
|
1208
|
+
}) => Promise<TokenItemWithEntity[]>;
|
|
1209
|
+
getCopyTradingChainList: () => Promise<string[]>;
|
|
1210
|
+
getCopyTradingTokenList: (params: {
|
|
1211
|
+
chain_id: string;
|
|
1212
|
+
limit: number;
|
|
1213
|
+
start_time: number;
|
|
1214
|
+
}) => Promise<CopyTradeTokenListResponse>;
|
|
1215
|
+
getCopyTradingTokenListV2: (params: {
|
|
1216
|
+
chain_id: string;
|
|
1217
|
+
limit: number;
|
|
1218
|
+
cursor: string;
|
|
1219
|
+
order_by: 'price_change' | 'buy_address_count' | 'token_create_at';
|
|
1220
|
+
order?: 'asc' | 'desc';
|
|
1221
|
+
time_range?: '24h' | '7d' | '30d';
|
|
1222
|
+
}) => Promise<CopyTradeTokenListV2Response>;
|
|
1223
|
+
getCopyTradingRecentBuyList: (params: {
|
|
1224
|
+
chain_id: string;
|
|
1225
|
+
token_id: string;
|
|
1226
|
+
limit: number;
|
|
1227
|
+
}) => Promise<CopyTradeRecentBuyListResponse>;
|
|
1228
|
+
getCopyTradingRecentBuyListV2: (params: {
|
|
1229
|
+
chain_id: string;
|
|
1230
|
+
token_id: string;
|
|
1231
|
+
limit: number;
|
|
1232
|
+
cursor: string;
|
|
1233
|
+
}) => Promise<CopyTradeRecentBuyListV2Response>;
|
|
1234
|
+
getCopyTradingDetail: (params: {
|
|
1235
|
+
chain_id: string;
|
|
1236
|
+
token_id: string;
|
|
1237
|
+
}) => Promise<CopyTradeTokenItemV2>;
|
|
1238
|
+
getCopyTradingSameName: (params: {
|
|
1239
|
+
chain_id: string;
|
|
1240
|
+
token_id: string;
|
|
1241
|
+
}) => Promise<CopyTradeSameToken[]>;
|
|
1242
|
+
getCopyTradingPnlList: (params: {
|
|
1243
|
+
user_addr: string;
|
|
1244
|
+
}) => Promise<CopyTradePnlListResponse>;
|
|
1245
|
+
batchQueryTokens: (uuids: string | string[]) => Promise<TokenItem[]>;
|
|
1246
|
+
getBuySupportedCountryList: () => Promise<BuyCountryItem[]>;
|
|
1247
|
+
getBuySupportedTokenList: () => Promise<(TokenItem & {
|
|
1248
|
+
currency_code: string;
|
|
1249
|
+
})[]>;
|
|
1250
|
+
getBuyQuote: (params: {
|
|
1251
|
+
country_code: string;
|
|
1252
|
+
user_addr: string;
|
|
1253
|
+
usd_amount: string;
|
|
1254
|
+
currency_code: string;
|
|
1255
|
+
receive_token_uuid: string;
|
|
1256
|
+
}) => Promise<BuyQuoteItem[]>;
|
|
1257
|
+
getBuyWidgetUrl: (params: {
|
|
1258
|
+
country_code: string;
|
|
1259
|
+
user_addr: string;
|
|
1260
|
+
usd_amount: string;
|
|
1261
|
+
receive_token_uuid: string;
|
|
1262
|
+
service_provider: string;
|
|
1263
|
+
currency_code: string;
|
|
1264
|
+
redirect_url?: string;
|
|
1265
|
+
}) => Promise<{
|
|
1266
|
+
url: string;
|
|
1267
|
+
msg: number;
|
|
1268
|
+
}>;
|
|
1269
|
+
getBuyHistory: (params: {
|
|
1270
|
+
user_addr: string;
|
|
1271
|
+
start?: number;
|
|
1272
|
+
limit?: number;
|
|
1273
|
+
}) => Promise<BuyHistoryList>;
|
|
1274
|
+
getBuyPaymentMethods: (params: {
|
|
1275
|
+
currency_code: string;
|
|
1276
|
+
country_code: string;
|
|
1277
|
+
service_provider: string;
|
|
1278
|
+
}) => Promise<BuyPaymentMethod[]>;
|
|
1279
|
+
getBuyCurrencyList: () => Promise<{
|
|
1280
|
+
id: string;
|
|
1281
|
+
name: string;
|
|
1282
|
+
image_url: string;
|
|
1283
|
+
}[]>;
|
|
1284
|
+
getOfflineChainList: () => Promise<{
|
|
1285
|
+
id: string;
|
|
1286
|
+
offline_at: number;
|
|
1287
|
+
}[]>;
|
|
1288
|
+
isBlockedAddress: (id: string) => Promise<{
|
|
1289
|
+
is_blocked: boolean;
|
|
1290
|
+
}>;
|
|
1291
|
+
estimateGasUsd: ({ tx, origin, address, updateNonce, pending_tx_list, }: {
|
|
1292
|
+
tx: Tx;
|
|
1293
|
+
origin: string;
|
|
1294
|
+
address: string;
|
|
1295
|
+
updateNonce: boolean;
|
|
1296
|
+
pending_tx_list: Tx[];
|
|
1297
|
+
}) => Promise<{
|
|
1298
|
+
gas_used?: number;
|
|
1299
|
+
safe_gas_used?: number;
|
|
1300
|
+
}>;
|
|
1301
|
+
getCexSupportList: () => Promise<ProjectItem[]>;
|
|
1302
|
+
getAppChainList: (id: string) => Promise<AppChainListResponse>;
|
|
1303
|
+
checkCex: (postData: {
|
|
1304
|
+
chain_id: string;
|
|
1305
|
+
id: string;
|
|
1306
|
+
cex_id: string;
|
|
1307
|
+
}) => Promise<{
|
|
1308
|
+
success: boolean;
|
|
1309
|
+
}>;
|
|
1310
|
+
getHotTokenList: () => Promise<TokenDetailWithPriceCurve[]>;
|
|
1311
|
+
getTokensDetailByUuids: (uuids: string[]) => Promise<TokenDetailWithPriceCurve[]>;
|
|
1312
|
+
getTokenKlineData: (params: {
|
|
1313
|
+
chain_id: string;
|
|
1314
|
+
token_id: string;
|
|
1315
|
+
interval: string;
|
|
1316
|
+
after_time_at?: number;
|
|
1317
|
+
}) => Promise<{
|
|
1318
|
+
data_list: KlineDataItem[];
|
|
1319
|
+
}>;
|
|
1320
|
+
getTokenMarketInfo: (params: {
|
|
1321
|
+
chain_id: string;
|
|
1322
|
+
token_id: string;
|
|
1323
|
+
}) => Promise<TokenMarketInfo>;
|
|
1324
|
+
getTokenHolderInfo: (params: {
|
|
1325
|
+
chain_id: string;
|
|
1326
|
+
token_id: string;
|
|
1327
|
+
}) => Promise<TokenHolderInfo>;
|
|
1328
|
+
getTokenSupplyInfo: (params: {
|
|
1329
|
+
chain_id: string;
|
|
1330
|
+
token_id: string;
|
|
1331
|
+
}) => Promise<TokenSupplyInfo>;
|
|
1332
|
+
postUserFeedback: (data: {
|
|
1333
|
+
title: string;
|
|
1334
|
+
image_url_list: string[];
|
|
1335
|
+
content: string;
|
|
1336
|
+
extra?: UserFeedbackItem['extra'];
|
|
1337
|
+
}) => Promise<UserFeedbackItem>;
|
|
1338
|
+
getUserFeedback: (id: string) => Promise<UserFeedbackItem>;
|
|
1339
|
+
getUserFeedbackList: (id: string | string[]) => Promise<UserFeedbackItem[]>;
|
|
1340
|
+
getCurrencyList: () => Promise<CurrencyItem[]>;
|
|
1341
|
+
getMarketSummary: ({ token_id, chain_id, }: {
|
|
1342
|
+
token_id: string;
|
|
1343
|
+
chain_id: string;
|
|
1344
|
+
}) => Promise<MarketSummary>;
|
|
1345
|
+
getMarketTradingHistory: (params: {
|
|
1346
|
+
token_id: string;
|
|
1347
|
+
chain_id: string;
|
|
1348
|
+
action?: 'buy' | 'sell';
|
|
1349
|
+
after_time_at?: number;
|
|
1350
|
+
limit?: number;
|
|
1351
|
+
cursor?: string;
|
|
1352
|
+
}) => Promise<{
|
|
1353
|
+
pagination: {
|
|
1354
|
+
limit: number;
|
|
1355
|
+
has_next: boolean;
|
|
1356
|
+
next_cursor?: string;
|
|
1357
|
+
};
|
|
1358
|
+
data_list: MarketTradingHistoryItem[];
|
|
1359
|
+
}>;
|
|
1360
|
+
getTokenHolderSummary: (params: {
|
|
1361
|
+
token_id: string;
|
|
1362
|
+
chain_id: string;
|
|
1363
|
+
}) => Promise<TokenHolderSummary>;
|
|
1364
|
+
getTokenHolderList: (params: {
|
|
1365
|
+
token_id: string;
|
|
1366
|
+
chain_id: string;
|
|
1367
|
+
}) => Promise<{
|
|
1368
|
+
data_list: TokenHolderItem[];
|
|
1369
|
+
}>;
|
|
1370
|
+
getLiquidityPoolList: (params: {
|
|
1371
|
+
token_id: string;
|
|
1372
|
+
chain_id: string;
|
|
1373
|
+
}) => Promise<LiquidityPoolItem[]>;
|
|
1374
|
+
getLiquidityPoolHistoryList: (params: {
|
|
1375
|
+
token_id: string;
|
|
1376
|
+
chain_id: string;
|
|
1377
|
+
action?: 'add' | 'remove';
|
|
1378
|
+
limit?: number;
|
|
1379
|
+
cursor?: string;
|
|
1380
|
+
}) => Promise<{
|
|
1381
|
+
pagination: {
|
|
1382
|
+
limit: number;
|
|
1383
|
+
has_next: boolean;
|
|
1384
|
+
next_cursor?: string;
|
|
1385
|
+
};
|
|
1386
|
+
data_list: LiquidityPoolHistoryItem[];
|
|
1387
|
+
}>;
|
|
1388
|
+
getNFTTradingConfig: () => Promise<NFTTradingConfig>;
|
|
1389
|
+
getNFTDetail: (params: {
|
|
1390
|
+
chain_id: string;
|
|
1391
|
+
id: string;
|
|
1392
|
+
user_addr: string;
|
|
1393
|
+
}) => Promise<NFTDetail>;
|
|
1394
|
+
getNFTListingOrders: (params: {
|
|
1395
|
+
maker: string;
|
|
1396
|
+
chain_id: string;
|
|
1397
|
+
collection_id: string;
|
|
1398
|
+
inner_id: string;
|
|
1399
|
+
limit?: number;
|
|
1400
|
+
cursor?: string;
|
|
1401
|
+
}) => Promise<NFTListingResponse>;
|
|
1402
|
+
getNFTFees: (params: {
|
|
1403
|
+
chain_id: string;
|
|
1404
|
+
collection_id: string;
|
|
1405
|
+
inner_id: string;
|
|
1406
|
+
}) => Promise<{
|
|
1407
|
+
marketplace_fees: {
|
|
1408
|
+
recipient: string;
|
|
1409
|
+
fee: number;
|
|
1410
|
+
required: boolean;
|
|
1411
|
+
}[];
|
|
1412
|
+
custom_royalties: {
|
|
1413
|
+
recipient: string;
|
|
1414
|
+
fee: number;
|
|
1415
|
+
required: boolean;
|
|
1416
|
+
}[];
|
|
1417
|
+
}>;
|
|
1418
|
+
prepareListingNFT: (postData: {
|
|
1419
|
+
maker: string;
|
|
1420
|
+
chain_id: string;
|
|
1421
|
+
collection_id: string;
|
|
1422
|
+
inner_id: string;
|
|
1423
|
+
wei_price: string;
|
|
1424
|
+
quantity?: number;
|
|
1425
|
+
marketplace_fees: {
|
|
1426
|
+
recipient: string;
|
|
1427
|
+
fee: number;
|
|
1428
|
+
}[];
|
|
1429
|
+
custom_royalties: {
|
|
1430
|
+
recipient: string;
|
|
1431
|
+
fee: number;
|
|
1432
|
+
}[];
|
|
1433
|
+
listing_time_at?: number;
|
|
1434
|
+
expiration_time_at?: number;
|
|
1435
|
+
currency: string;
|
|
1436
|
+
salt?: string;
|
|
1437
|
+
}) => Promise<PrepareListingNFTResponse>;
|
|
1438
|
+
createListingNFT: (postData: {
|
|
1439
|
+
chain_id: string;
|
|
1440
|
+
order: PrepareListingNFTResponse['data']['post']['body']['order'];
|
|
1441
|
+
signature: string;
|
|
1442
|
+
protocol_address?: string;
|
|
1443
|
+
}) => Promise<CreateListingNFTOfferResponse>;
|
|
1444
|
+
prepareAcceptNFTOffer: (postData: {
|
|
1445
|
+
chain_id: string;
|
|
1446
|
+
order_hash: string;
|
|
1447
|
+
fulfiller: string;
|
|
1448
|
+
collection_id: string;
|
|
1449
|
+
inner_id: string;
|
|
1450
|
+
quantity?: number;
|
|
1451
|
+
include_optional_creator_fees?: boolean;
|
|
1452
|
+
}) => Promise<PrepareAcceptNFTOfferResponse>;
|
|
1453
|
+
submitAcceptNFTOfferTx: (postData: {
|
|
1454
|
+
tx_id: string;
|
|
1455
|
+
data: Tx;
|
|
1456
|
+
}) => Promise<{
|
|
1457
|
+
success: boolean;
|
|
1458
|
+
}>;
|
|
1459
|
+
checkTokenDepositForbidden: (params: {
|
|
1460
|
+
chain_id: string;
|
|
1461
|
+
id: string;
|
|
1462
|
+
user_addr: string;
|
|
1463
|
+
to_addr: string;
|
|
1464
|
+
}) => Promise<{
|
|
1465
|
+
msg: string;
|
|
1466
|
+
}>;
|
|
1018
1467
|
}
|
|
1019
1468
|
export {};
|