@rabby-wallet/rabby-api 0.9.20 → 0.9.22
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 +11 -1
- package/dist/index.js +10 -0
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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, WithdrawListAddressItem, BuyCountryItem, BuyQuoteItem, BuyHistoryList, BuyPaymentMethod, GasAccountInfo, TokenEntityDetail, TokenItemWithEntity } 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 } from './types';
|
|
5
5
|
interface OpenApiStore {
|
|
6
6
|
host: string;
|
|
7
7
|
testnetHost?: string;
|
|
@@ -254,6 +254,15 @@ export declare class OpenApiService {
|
|
|
254
254
|
from_token_id: string;
|
|
255
255
|
to_token_id: string;
|
|
256
256
|
}) => Promise<SlippageStatus>;
|
|
257
|
+
suggestSlippage: (params: {
|
|
258
|
+
chain_id: string;
|
|
259
|
+
slippage: string;
|
|
260
|
+
from_token_id: string;
|
|
261
|
+
to_token_id: string;
|
|
262
|
+
from_token_amount: string;
|
|
263
|
+
}) => Promise<{
|
|
264
|
+
suggest_slippage: number;
|
|
265
|
+
}>;
|
|
257
266
|
getOriginPopularityLevel: (origin: string) => Promise<{
|
|
258
267
|
level: 'very_low' | 'low' | 'medium' | 'high';
|
|
259
268
|
}>;
|
|
@@ -1136,5 +1145,6 @@ export declare class OpenApiService {
|
|
|
1136
1145
|
gas_used?: number;
|
|
1137
1146
|
safe_gas_used?: number;
|
|
1138
1147
|
}>;
|
|
1148
|
+
getCexSupportList: () => Promise<ProjectItem[]>;
|
|
1139
1149
|
}
|
|
1140
1150
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -595,6 +595,12 @@ export class OpenApiService {
|
|
|
595
595
|
});
|
|
596
596
|
return data;
|
|
597
597
|
});
|
|
598
|
+
this.suggestSlippage = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
599
|
+
const { data } = yield this.request.get('v1/wallet/suggest_slippage', {
|
|
600
|
+
params,
|
|
601
|
+
});
|
|
602
|
+
return data;
|
|
603
|
+
});
|
|
598
604
|
this.getOriginPopularityLevel = (origin) => __awaiter(this, void 0, void 0, function* () {
|
|
599
605
|
const { data } = yield this.request.get('/v1/engine/origin/popularity_level', {
|
|
600
606
|
params: {
|
|
@@ -1511,6 +1517,10 @@ export class OpenApiService {
|
|
|
1511
1517
|
});
|
|
1512
1518
|
return data;
|
|
1513
1519
|
});
|
|
1520
|
+
this.getCexSupportList = () => __awaiter(this, void 0, void 0, function* () {
|
|
1521
|
+
const { data } = yield this.request.get('/v1/cex/supported_list');
|
|
1522
|
+
return data;
|
|
1523
|
+
});
|
|
1514
1524
|
if (store instanceof Promise) {
|
|
1515
1525
|
store.then((resolvedStore) => {
|
|
1516
1526
|
this.store = resolvedStore;
|
package/dist/types.d.ts
CHANGED