@rabby-wallet/rabby-api 0.9.38-alpha.0 → 0.9.38-beta.1
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 +12 -1
- package/dist/index.js +12 -0
- package/dist/types.d.ts +28 -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 } 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 } from './types';
|
|
5
5
|
interface OpenApiStore {
|
|
6
6
|
host: string;
|
|
7
7
|
testnetHost?: string;
|
|
@@ -1280,5 +1280,16 @@ export declare class OpenApiService {
|
|
|
1280
1280
|
}) => Promise<UserFeedbackItem>;
|
|
1281
1281
|
getUserFeedback: (id: string) => Promise<UserFeedbackItem>;
|
|
1282
1282
|
getUserFeedbackList: (id: string | string[]) => Promise<UserFeedbackItem[]>;
|
|
1283
|
+
getTokenKlineData: (params: {
|
|
1284
|
+
chain_id: string;
|
|
1285
|
+
token_id: string;
|
|
1286
|
+
interval: string;
|
|
1287
|
+
}) => Promise<{
|
|
1288
|
+
data_list: KlineDataItem[];
|
|
1289
|
+
}>;
|
|
1290
|
+
getTokenMarketInfo: (params: {
|
|
1291
|
+
chain_id: string;
|
|
1292
|
+
token_id: string;
|
|
1293
|
+
}) => Promise<TokenMarketInfo>;
|
|
1283
1294
|
}
|
|
1284
1295
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -1662,6 +1662,18 @@ export class OpenApiService {
|
|
|
1662
1662
|
});
|
|
1663
1663
|
return data;
|
|
1664
1664
|
});
|
|
1665
|
+
this.getTokenKlineData = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1666
|
+
const { data } = yield this.request.get('/v1/token/market/kline', {
|
|
1667
|
+
params,
|
|
1668
|
+
});
|
|
1669
|
+
return data;
|
|
1670
|
+
});
|
|
1671
|
+
this.getTokenMarketInfo = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1672
|
+
const { data } = yield this.request.get('/v1/token/market/info', {
|
|
1673
|
+
params,
|
|
1674
|
+
});
|
|
1675
|
+
return data;
|
|
1676
|
+
});
|
|
1665
1677
|
if (store instanceof Promise) {
|
|
1666
1678
|
store.then((resolvedStore) => {
|
|
1667
1679
|
this.store = resolvedStore;
|
package/dist/types.d.ts
CHANGED
|
@@ -1651,4 +1651,32 @@ export declare type UserFeedbackItem = {
|
|
|
1651
1651
|
comment_at: number | null;
|
|
1652
1652
|
extra?: any | null;
|
|
1653
1653
|
};
|
|
1654
|
+
export declare type KlineDataItem = [
|
|
1655
|
+
time_at: number,
|
|
1656
|
+
open: number,
|
|
1657
|
+
high: number,
|
|
1658
|
+
low: number,
|
|
1659
|
+
close: number,
|
|
1660
|
+
volume_amount: number,
|
|
1661
|
+
volume_usd_value: number
|
|
1662
|
+
];
|
|
1663
|
+
export declare type TokenMarketInfo = {
|
|
1664
|
+
id: string;
|
|
1665
|
+
chain: string;
|
|
1666
|
+
price: number;
|
|
1667
|
+
price_24h_change: number;
|
|
1668
|
+
support_market_data: boolean;
|
|
1669
|
+
market: {
|
|
1670
|
+
market_cap_usd_value: number | null;
|
|
1671
|
+
total_supply: number | null;
|
|
1672
|
+
volume_amount_24h: number | null;
|
|
1673
|
+
volume_usd_value_24h: number | null;
|
|
1674
|
+
txns_24h: number | null;
|
|
1675
|
+
holder_count: number | null;
|
|
1676
|
+
max_supply: number | null;
|
|
1677
|
+
};
|
|
1678
|
+
name: string;
|
|
1679
|
+
symbol: string;
|
|
1680
|
+
logo_url: string;
|
|
1681
|
+
};
|
|
1654
1682
|
export {};
|