@rabby-wallet/rabby-api 0.9.41 → 0.9.42-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 +31 -1
- package/dist/index.js +28 -0
- package/dist/types.d.ts +48 -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 } 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 } from './types';
|
|
5
5
|
interface OpenApiStore {
|
|
6
6
|
host: string;
|
|
7
7
|
testnetHost?: string;
|
|
@@ -1276,6 +1276,7 @@ export declare class OpenApiService {
|
|
|
1276
1276
|
chain_id: string;
|
|
1277
1277
|
token_id: string;
|
|
1278
1278
|
interval: string;
|
|
1279
|
+
after_time_at?: number;
|
|
1279
1280
|
}) => Promise<{
|
|
1280
1281
|
data_list: KlineDataItem[];
|
|
1281
1282
|
}>;
|
|
@@ -1299,5 +1300,34 @@ export declare class OpenApiService {
|
|
|
1299
1300
|
}) => Promise<UserFeedbackItem>;
|
|
1300
1301
|
getUserFeedback: (id: string) => Promise<UserFeedbackItem>;
|
|
1301
1302
|
getUserFeedbackList: (id: string | string[]) => Promise<UserFeedbackItem[]>;
|
|
1303
|
+
getMarketSummary: ({ token_id, chain_id, }: {
|
|
1304
|
+
token_id: string;
|
|
1305
|
+
chain_id: string;
|
|
1306
|
+
}) => Promise<MarketSummary>;
|
|
1307
|
+
getMarketTradingHistory: (params: {
|
|
1308
|
+
token_id: string;
|
|
1309
|
+
chain_id: string;
|
|
1310
|
+
action: 'buy' | 'sell';
|
|
1311
|
+
after_time_at?: number;
|
|
1312
|
+
limit?: number;
|
|
1313
|
+
cursor?: string;
|
|
1314
|
+
}) => Promise<{
|
|
1315
|
+
page: {
|
|
1316
|
+
limit: number;
|
|
1317
|
+
has_next: boolean;
|
|
1318
|
+
next_cursor?: string;
|
|
1319
|
+
};
|
|
1320
|
+
data_list: MarketTradingHistoryItem[];
|
|
1321
|
+
}>;
|
|
1322
|
+
getTokenHolderSummary: (params: {
|
|
1323
|
+
token_id: string;
|
|
1324
|
+
chain_id: string;
|
|
1325
|
+
}) => Promise<TokenHolderSummary>;
|
|
1326
|
+
getTokenHolderList: (params: {
|
|
1327
|
+
token_id: string;
|
|
1328
|
+
chain_id: string;
|
|
1329
|
+
}) => Promise<{
|
|
1330
|
+
data_list: TokenHolderItem[];
|
|
1331
|
+
}>;
|
|
1302
1332
|
}
|
|
1303
1333
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -1686,6 +1686,34 @@ export class OpenApiService {
|
|
|
1686
1686
|
});
|
|
1687
1687
|
return data;
|
|
1688
1688
|
});
|
|
1689
|
+
this.getMarketSummary = ({ token_id, chain_id, }) => __awaiter(this, void 0, void 0, function* () {
|
|
1690
|
+
const { data } = yield this.request.get('/v1/token/market/summary', {
|
|
1691
|
+
params: {
|
|
1692
|
+
token_id,
|
|
1693
|
+
chain_id,
|
|
1694
|
+
},
|
|
1695
|
+
});
|
|
1696
|
+
return data;
|
|
1697
|
+
});
|
|
1698
|
+
this.getMarketTradingHistory = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1699
|
+
const { data } = yield this.request.get('/v1/token/market/trading_history/list', {
|
|
1700
|
+
params,
|
|
1701
|
+
});
|
|
1702
|
+
return data;
|
|
1703
|
+
});
|
|
1704
|
+
this.getTokenHolderSummary = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1705
|
+
const { data } = yield this.request.get('/v1/token/market/holders/summary', {
|
|
1706
|
+
params,
|
|
1707
|
+
});
|
|
1708
|
+
return data;
|
|
1709
|
+
});
|
|
1710
|
+
// top 10 holders
|
|
1711
|
+
this.getTokenHolderList = (params) => __awaiter(this, void 0, void 0, function* () {
|
|
1712
|
+
const { data } = yield this.request.get('/v1/token/market/holders/list', {
|
|
1713
|
+
params,
|
|
1714
|
+
});
|
|
1715
|
+
return data;
|
|
1716
|
+
});
|
|
1689
1717
|
if (store instanceof Promise) {
|
|
1690
1718
|
store.then((resolvedStore) => {
|
|
1691
1719
|
this.store = resolvedStore;
|
package/dist/types.d.ts
CHANGED
|
@@ -1691,4 +1691,52 @@ export declare type UserFeedbackItem = {
|
|
|
1691
1691
|
comment_at: number | null;
|
|
1692
1692
|
extra?: any | null;
|
|
1693
1693
|
};
|
|
1694
|
+
export declare type MarketSummaryItem = {
|
|
1695
|
+
price?: {
|
|
1696
|
+
open?: number;
|
|
1697
|
+
close?: number;
|
|
1698
|
+
change?: number;
|
|
1699
|
+
};
|
|
1700
|
+
summary: {
|
|
1701
|
+
buy?: {
|
|
1702
|
+
count?: number;
|
|
1703
|
+
volume_amount?: number;
|
|
1704
|
+
};
|
|
1705
|
+
sell?: {
|
|
1706
|
+
count?: number;
|
|
1707
|
+
volume_amount?: number;
|
|
1708
|
+
};
|
|
1709
|
+
totals?: {
|
|
1710
|
+
trading_count?: number;
|
|
1711
|
+
volume_amount?: number;
|
|
1712
|
+
volume_usd_value?: number;
|
|
1713
|
+
addresses?: number;
|
|
1714
|
+
};
|
|
1715
|
+
};
|
|
1716
|
+
};
|
|
1717
|
+
export declare type MarketSummary = {
|
|
1718
|
+
'5m'?: MarketSummaryItem | null;
|
|
1719
|
+
'1h'?: MarketSummaryItem | null;
|
|
1720
|
+
'6h'?: MarketSummaryItem | null;
|
|
1721
|
+
'24h'?: MarketSummaryItem | null;
|
|
1722
|
+
};
|
|
1723
|
+
export declare type MarketTradingHistoryItem = {
|
|
1724
|
+
id: string;
|
|
1725
|
+
time_at?: number;
|
|
1726
|
+
action?: 'buy' | 'sell';
|
|
1727
|
+
price?: number;
|
|
1728
|
+
amount?: number;
|
|
1729
|
+
usd_value?: number;
|
|
1730
|
+
tx_id?: string;
|
|
1731
|
+
user_addr?: string;
|
|
1732
|
+
};
|
|
1733
|
+
export declare type TokenHolderSummary = {
|
|
1734
|
+
ratio_top10?: number;
|
|
1735
|
+
ratio_top100?: number;
|
|
1736
|
+
};
|
|
1737
|
+
export declare type TokenHolderItem = {
|
|
1738
|
+
user_addr?: string;
|
|
1739
|
+
amount?: number;
|
|
1740
|
+
ratio?: number;
|
|
1741
|
+
};
|
|
1694
1742
|
export {};
|