@rabby-wallet/rabby-api 0.9.42-beta.0 → 0.9.43-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 +24 -1
- package/dist/index.js +20 -0
- package/dist/types.d.ts +37 -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, ProjectItem, CopyTradeTokenListResponse, CopyTradeRecentBuyListResponse, CopyTradePnlListResponse, AppChainListResponse, CopyTradeTokenListV2Response, CopyTradeRecentBuyListV2Response, CopyTradeTokenItemV2, CopyTradeSameToken, DefaultRPCRes, TokenDetailWithPriceCurve, GiftEligibilityItem, UserFeedbackItem, PerpTopToken, KlineDataItem, TokenMarketInfo, TokenHolderInfo, TokenSupplyInfo, MarketSummary, MarketTradingHistoryItem, TokenHolderSummary, TokenHolderItem } 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 } from './types';
|
|
5
5
|
interface OpenApiStore {
|
|
6
6
|
host: string;
|
|
7
7
|
testnetHost?: string;
|
|
@@ -915,6 +915,28 @@ export declare class OpenApiService {
|
|
|
915
915
|
has_permission: boolean;
|
|
916
916
|
}>;
|
|
917
917
|
getPerpTopTokenList: () => Promise<PerpTopToken[]>;
|
|
918
|
+
getPerpsBridgeIsSupportToken: (params: {
|
|
919
|
+
token_id: string;
|
|
920
|
+
chain_id: string;
|
|
921
|
+
}) => Promise<{
|
|
922
|
+
success: boolean;
|
|
923
|
+
}>;
|
|
924
|
+
getPerpBridgeQuote: (params: {
|
|
925
|
+
user_addr: string;
|
|
926
|
+
from_chain_id: string;
|
|
927
|
+
from_token_id: string;
|
|
928
|
+
from_token_raw_amount: string;
|
|
929
|
+
}) => Promise<PerpBridgeQuote>;
|
|
930
|
+
postPerpBridgeHistory: (params: {
|
|
931
|
+
from_chain_id: string;
|
|
932
|
+
from_token_id: string;
|
|
933
|
+
from_token_amount: number;
|
|
934
|
+
to_token_amount: number;
|
|
935
|
+
tx_id: string;
|
|
936
|
+
tx: Tx;
|
|
937
|
+
}) => Promise<{
|
|
938
|
+
success: boolean;
|
|
939
|
+
}>;
|
|
918
940
|
getSupportedDEXList: () => Promise<{
|
|
919
941
|
dex_list: string[];
|
|
920
942
|
}>;
|
|
@@ -1300,6 +1322,7 @@ export declare class OpenApiService {
|
|
|
1300
1322
|
}) => Promise<UserFeedbackItem>;
|
|
1301
1323
|
getUserFeedback: (id: string) => Promise<UserFeedbackItem>;
|
|
1302
1324
|
getUserFeedbackList: (id: string | string[]) => Promise<UserFeedbackItem[]>;
|
|
1325
|
+
getCurrencyList: () => Promise<CurrencyItem[]>;
|
|
1303
1326
|
getMarketSummary: ({ token_id, chain_id, }: {
|
|
1304
1327
|
token_id: string;
|
|
1305
1328
|
chain_id: string;
|
package/dist/index.js
CHANGED
|
@@ -1274,6 +1274,22 @@ export class OpenApiService {
|
|
|
1274
1274
|
const { data } = yield this.request.get('/v1/token/hyperliquid_top');
|
|
1275
1275
|
return data;
|
|
1276
1276
|
});
|
|
1277
|
+
this.getPerpsBridgeIsSupportToken = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1278
|
+
const { data } = yield this.request.get('/v2/bridge/hyperliquid/support_token', {
|
|
1279
|
+
params,
|
|
1280
|
+
});
|
|
1281
|
+
return data;
|
|
1282
|
+
});
|
|
1283
|
+
this.getPerpBridgeQuote = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1284
|
+
const { data } = yield this.request.get('/v2/bridge/hyperliquid/quote', {
|
|
1285
|
+
params,
|
|
1286
|
+
});
|
|
1287
|
+
return data;
|
|
1288
|
+
});
|
|
1289
|
+
this.postPerpBridgeHistory = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1290
|
+
const { data } = yield this.request.post('/v2/bridge/hyperliquid', params);
|
|
1291
|
+
return data;
|
|
1292
|
+
});
|
|
1277
1293
|
this.getSupportedDEXList = () => __awaiter(this, void 0, void 0, function* () {
|
|
1278
1294
|
const { data } = yield this.request.get('/v1/wallet/supported_dex_list');
|
|
1279
1295
|
return data;
|
|
@@ -1686,6 +1702,10 @@ export class OpenApiService {
|
|
|
1686
1702
|
});
|
|
1687
1703
|
return data;
|
|
1688
1704
|
});
|
|
1705
|
+
this.getCurrencyList = () => __awaiter(this, void 0, void 0, function* () {
|
|
1706
|
+
const { data } = yield this.request.get('/v1/currency/exchange_list');
|
|
1707
|
+
return data;
|
|
1708
|
+
});
|
|
1689
1709
|
this.getMarketSummary = ({ token_id, chain_id, }) => __awaiter(this, void 0, void 0, function* () {
|
|
1690
1710
|
const { data } = yield this.request.get('/v1/token/market/summary', {
|
|
1691
1711
|
params: {
|
package/dist/types.d.ts
CHANGED
|
@@ -1691,6 +1691,43 @@ export declare type UserFeedbackItem = {
|
|
|
1691
1691
|
comment_at: number | null;
|
|
1692
1692
|
extra?: any | null;
|
|
1693
1693
|
};
|
|
1694
|
+
export declare type CurrencyItem = {
|
|
1695
|
+
symbol: string;
|
|
1696
|
+
code: string;
|
|
1697
|
+
logo_url: string;
|
|
1698
|
+
usd_rate: number;
|
|
1699
|
+
};
|
|
1700
|
+
export interface PerpBridgeQuote {
|
|
1701
|
+
tx: {
|
|
1702
|
+
chainId: number;
|
|
1703
|
+
data: string;
|
|
1704
|
+
from: string;
|
|
1705
|
+
gas: string;
|
|
1706
|
+
gasPrice: string;
|
|
1707
|
+
nonce: string;
|
|
1708
|
+
to: string;
|
|
1709
|
+
value: string;
|
|
1710
|
+
};
|
|
1711
|
+
bridge_id: string;
|
|
1712
|
+
bridge: BridgeItem | null;
|
|
1713
|
+
to_token_raw_amount: number;
|
|
1714
|
+
to_token_raw_amount_hex_str: string;
|
|
1715
|
+
to_token_amount: number;
|
|
1716
|
+
approve_contract_id: string;
|
|
1717
|
+
protocol_fee: {
|
|
1718
|
+
raw_amount_hex_str: string;
|
|
1719
|
+
usd_value: number;
|
|
1720
|
+
};
|
|
1721
|
+
rabby_fee: {
|
|
1722
|
+
raw_amount_hex_str: string;
|
|
1723
|
+
usd_value: number;
|
|
1724
|
+
};
|
|
1725
|
+
gas_fee: {
|
|
1726
|
+
raw_amount_hex_str: string;
|
|
1727
|
+
usd_value: number;
|
|
1728
|
+
};
|
|
1729
|
+
duration: number;
|
|
1730
|
+
}
|
|
1694
1731
|
export declare type MarketSummaryItem = {
|
|
1695
1732
|
price?: {
|
|
1696
1733
|
open?: number;
|