@rabby-wallet/rabby-api 0.9.42-beta.0 → 0.9.42

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, 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, 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
  }>;
@@ -1276,7 +1298,6 @@ export declare class OpenApiService {
1276
1298
  chain_id: string;
1277
1299
  token_id: string;
1278
1300
  interval: string;
1279
- after_time_at?: number;
1280
1301
  }) => Promise<{
1281
1302
  data_list: KlineDataItem[];
1282
1303
  }>;
@@ -1300,34 +1321,6 @@ export declare class OpenApiService {
1300
1321
  }) => Promise<UserFeedbackItem>;
1301
1322
  getUserFeedback: (id: string) => Promise<UserFeedbackItem>;
1302
1323
  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
- }>;
1324
+ getCurrencyList: () => Promise<CurrencyItem[]>;
1332
1325
  }
1333
1326
  export {};
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,32 +1702,8 @@ export class OpenApiService {
1686
1702
  });
1687
1703
  return data;
1688
1704
  });
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
- });
1705
+ this.getCurrencyList = () => __awaiter(this, void 0, void 0, function* () {
1706
+ const { data } = yield this.request.get('/v1/currency/exchange_list');
1715
1707
  return data;
1716
1708
  });
1717
1709
  if (store instanceof Promise) {
package/dist/types.d.ts CHANGED
@@ -1691,52 +1691,41 @@ 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;
1694
+ export declare type CurrencyItem = {
1695
+ symbol: string;
1696
+ code: string;
1697
+ logo_url: string;
1698
+ usd_rate: number;
1741
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
+ }
1742
1731
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/rabby-api",
3
- "version": "0.9.42-beta.0",
3
+ "version": "0.9.42",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [