@rabby-wallet/rabby-api 0.9.42 → 0.9.43-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 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, CurrencyItem, PerpBridgeQuote } 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;
@@ -1298,6 +1298,7 @@ export declare class OpenApiService {
1298
1298
  chain_id: string;
1299
1299
  token_id: string;
1300
1300
  interval: string;
1301
+ after_time_at?: number;
1301
1302
  }) => Promise<{
1302
1303
  data_list: KlineDataItem[];
1303
1304
  }>;
@@ -1322,5 +1323,34 @@ export declare class OpenApiService {
1322
1323
  getUserFeedback: (id: string) => Promise<UserFeedbackItem>;
1323
1324
  getUserFeedbackList: (id: string | string[]) => Promise<UserFeedbackItem[]>;
1324
1325
  getCurrencyList: () => Promise<CurrencyItem[]>;
1326
+ getMarketSummary: ({ token_id, chain_id, }: {
1327
+ token_id: string;
1328
+ chain_id: string;
1329
+ }) => Promise<MarketSummary>;
1330
+ getMarketTradingHistory: (params: {
1331
+ token_id: string;
1332
+ chain_id: string;
1333
+ action: 'buy' | 'sell';
1334
+ after_time_at?: number;
1335
+ limit?: number;
1336
+ cursor?: string;
1337
+ }) => Promise<{
1338
+ pagination: {
1339
+ limit: number;
1340
+ has_next: boolean;
1341
+ next_cursor?: string;
1342
+ };
1343
+ data_list: MarketTradingHistoryItem[];
1344
+ }>;
1345
+ getTokenHolderSummary: (params: {
1346
+ token_id: string;
1347
+ chain_id: string;
1348
+ }) => Promise<TokenHolderSummary>;
1349
+ getTokenHolderList: (params: {
1350
+ token_id: string;
1351
+ chain_id: string;
1352
+ }) => Promise<{
1353
+ data_list: TokenHolderItem[];
1354
+ }>;
1325
1355
  }
1326
1356
  export {};
package/dist/index.js CHANGED
@@ -1706,6 +1706,34 @@ export class OpenApiService {
1706
1706
  const { data } = yield this.request.get('/v1/currency/exchange_list');
1707
1707
  return data;
1708
1708
  });
1709
+ this.getMarketSummary = ({ token_id, chain_id, }) => __awaiter(this, void 0, void 0, function* () {
1710
+ const { data } = yield this.request.get('/v1/token/market/summary', {
1711
+ params: {
1712
+ token_id,
1713
+ chain_id,
1714
+ },
1715
+ });
1716
+ return data;
1717
+ });
1718
+ this.getMarketTradingHistory = (params) => __awaiter(this, void 0, void 0, function* () {
1719
+ const { data } = yield this.request.get('/v1/token/market/trading_history/list', {
1720
+ params,
1721
+ });
1722
+ return data;
1723
+ });
1724
+ this.getTokenHolderSummary = (params) => __awaiter(this, void 0, void 0, function* () {
1725
+ const { data } = yield this.request.get('/v1/token/market/holders/summary', {
1726
+ params,
1727
+ });
1728
+ return data;
1729
+ });
1730
+ // top 10 holders
1731
+ this.getTokenHolderList = (params) => __awaiter(this, void 0, void 0, function* () {
1732
+ const { data } = yield this.request.get('/v1/token/market/holders/list', {
1733
+ params,
1734
+ });
1735
+ return data;
1736
+ });
1709
1737
  if (store instanceof Promise) {
1710
1738
  store.then((resolvedStore) => {
1711
1739
  this.store = resolvedStore;
package/dist/types.d.ts CHANGED
@@ -1728,4 +1728,52 @@ export interface PerpBridgeQuote {
1728
1728
  };
1729
1729
  duration: number;
1730
1730
  }
1731
+ export declare type MarketSummaryItem = {
1732
+ price?: {
1733
+ open?: number;
1734
+ close?: number;
1735
+ change?: number;
1736
+ };
1737
+ summary: {
1738
+ buy?: {
1739
+ count?: number;
1740
+ volume_amount?: number;
1741
+ };
1742
+ sell?: {
1743
+ count?: number;
1744
+ volume_amount?: number;
1745
+ };
1746
+ totals?: {
1747
+ trading_count?: number;
1748
+ volume_amount?: number;
1749
+ volume_usd_value?: number;
1750
+ addresses?: number;
1751
+ };
1752
+ };
1753
+ };
1754
+ export declare type MarketSummary = {
1755
+ '5m'?: MarketSummaryItem | null;
1756
+ '1h'?: MarketSummaryItem | null;
1757
+ '6h'?: MarketSummaryItem | null;
1758
+ '24h'?: MarketSummaryItem | null;
1759
+ };
1760
+ export declare type MarketTradingHistoryItem = {
1761
+ id: string;
1762
+ time_at?: number;
1763
+ action?: 'buy' | 'sell';
1764
+ price?: number;
1765
+ amount?: number;
1766
+ usd_value?: number;
1767
+ tx_id?: string;
1768
+ user_addr?: string;
1769
+ };
1770
+ export declare type TokenHolderSummary = {
1771
+ ratio_top10?: number;
1772
+ ratio_top100?: number;
1773
+ };
1774
+ export declare type TokenHolderItem = {
1775
+ user_addr?: string;
1776
+ amount?: number;
1777
+ ratio?: number;
1778
+ };
1731
1779
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/rabby-api",
3
- "version": "0.9.42",
3
+ "version": "0.9.43-beta.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [