@rabby-wallet/rabby-api 0.9.42-alpha.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, CurrencyItem } 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
  }>;
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;
package/dist/types.d.ts CHANGED
@@ -1697,4 +1697,35 @@ export declare type CurrencyItem = {
1697
1697
  logo_url: string;
1698
1698
  usd_rate: number;
1699
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
+ }
1700
1731
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/rabby-api",
3
- "version": "0.9.42-alpha.0",
3
+ "version": "0.9.42",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [