@rabby-wallet/rabby-api 0.9.57 → 0.9.58-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, MarketSummary, MarketTradingHistoryItem, TokenHolderSummary, TokenHolderItem, CurrencyItem, PerpBridgeQuote, LiquidityPoolItem, LiquidityPoolHistoryItem, NFTDetail, NFTTradingConfig, PrepareAcceptNFTOfferResponse, PrepareListingNFTResponse, CreateListingNFTOfferResponse, NFTListingResponse, MemeListResponse, TokenMarketCategoryListResponse, TokenMarketTokenListResponse } 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, TokenPriceListResponse, TotalBalanceResponse, Tx, TxAllHistoryResult, TxHistoryResult, TxPushType, TxRequest, UsedChain, BridgeTokenPair, BridgeQuote, BridgeHistory, ContractInfo, GasAccountCheckResult, ParseCommonResponse, WithdrawListAddressItem, BuyCountryItem, BuyQuoteItem, BuyHistoryList, BuyPaymentMethod, GasAccountInfo, GasAccountBridgeSupportTokenList, GasAccountBridgeQuote, GasAccountBridgeCreateResponse, GasAccountRechargeStatus, 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, LiquidityPoolItem, LiquidityPoolHistoryItem, NFTDetail, NFTTradingConfig, PrepareAcceptNFTOfferResponse, PrepareListingNFTResponse, CreateListingNFTOfferResponse, NFTListingResponse, MemeListResponse, TokenMarketCategoryListResponse, TokenMarketTokenListResponse } from './types';
5
5
  interface OpenApiStore {
6
6
  host: string;
7
7
  testnetHost?: string;
@@ -139,6 +139,9 @@ export declare class OpenApiService {
139
139
  change_percent: number;
140
140
  last_price: number;
141
141
  }>;
142
+ getTokenPriceList: (params: {
143
+ uuids: string[];
144
+ }) => Promise<TokenPriceListResponse>;
142
145
  tokenAuthorizedList: <V extends VersionPrefix | undefined>(id: string, chain_id: string, options?: ApiOptions<V> | undefined) => Promise<TokenApproval[]>;
143
146
  userNFTAuthorizedList: (id: string, chain_id: string) => Promise<NFTApprovalResponse>;
144
147
  getDEXList: (chain_id: string) => Promise<{
@@ -1030,6 +1033,28 @@ export declare class OpenApiService {
1030
1033
  success: boolean;
1031
1034
  }>;
1032
1035
  getGasAccountTokenList: (id: string) => Promise<TokenItem[]>;
1036
+ getGasAccountBridgeSupportTokenList: () => Promise<GasAccountBridgeSupportTokenList>;
1037
+ getGasAccountBridgeQuote: (params: {
1038
+ user_addr: string;
1039
+ from_chain_id: string;
1040
+ from_token_id: string;
1041
+ from_token_raw_amount: string | number;
1042
+ slippage?: number;
1043
+ }) => Promise<GasAccountBridgeQuote>;
1044
+ createGasAccountBridgeRecharge: (p: {
1045
+ sig: string;
1046
+ gas_account_id: string;
1047
+ user_addr: string;
1048
+ from_chain_id: string;
1049
+ from_token_id: string;
1050
+ from_token_amount: number;
1051
+ from_usd_value: number;
1052
+ tx_id: string;
1053
+ }) => Promise<GasAccountBridgeCreateResponse>;
1054
+ getGasAccountBridgeStatus: (params: {
1055
+ from_chain_id: string;
1056
+ tx_id: string;
1057
+ }) => Promise<GasAccountRechargeStatus>;
1033
1058
  rechargeGasAccount: (p: {
1034
1059
  sig: string;
1035
1060
  account_id: string;
package/dist/index.js CHANGED
@@ -404,6 +404,10 @@ export class OpenApiService {
404
404
  });
405
405
  return data;
406
406
  });
407
+ this.getTokenPriceList = (params) => __awaiter(this, void 0, void 0, function* () {
408
+ const { data } = yield this.request.post('/v1/token/price_list', params);
409
+ return data;
410
+ });
407
411
  this.tokenAuthorizedList = (id, chain_id, options) => __awaiter(this, void 0, void 0, function* () {
408
412
  const { restfulPrefix = 'v1' } = options || {};
409
413
  const { data } = yield this.request.get(`/${restfulPrefix}/user/token_authorized_list`, {
@@ -1420,6 +1424,31 @@ export class OpenApiService {
1420
1424
  });
1421
1425
  return data;
1422
1426
  });
1427
+ this.getGasAccountBridgeSupportTokenList = () => __awaiter(this, void 0, void 0, function* () {
1428
+ const { data } = yield this.request.get('/v1/gas_account/bridge/support_token');
1429
+ return data;
1430
+ });
1431
+ this.getGasAccountBridgeQuote = (params) => __awaiter(this, void 0, void 0, function* () {
1432
+ const { data } = yield this.request.get('/v1/gas_account/bridge/quote', {
1433
+ params,
1434
+ });
1435
+ return data;
1436
+ });
1437
+ this.createGasAccountBridgeRecharge = (p) => __awaiter(this, void 0, void 0, function* () {
1438
+ const { sig } = p, params = __rest(p, ["sig"]);
1439
+ const { data } = yield this.request.post('/v1/gas_account/bridge/create', params, {
1440
+ headers: {
1441
+ sig,
1442
+ },
1443
+ });
1444
+ return data;
1445
+ });
1446
+ this.getGasAccountBridgeStatus = (params) => __awaiter(this, void 0, void 0, function* () {
1447
+ const { data } = yield this.request.get('/v1/gas_account/bridge/status', {
1448
+ params,
1449
+ });
1450
+ return data;
1451
+ });
1423
1452
  this.rechargeGasAccount = (p) => __awaiter(this, void 0, void 0, function* () {
1424
1453
  const { sig } = p, params = __rest(p, ["sig"]);
1425
1454
  const { data } = yield this.request.post('/v1/gas_account/recharge', params, {
package/dist/types.d.ts CHANGED
@@ -230,10 +230,19 @@ export interface TokenItem {
230
230
  cex_ids?: string[];
231
231
  fdv?: number | null;
232
232
  support_market_data?: boolean;
233
+ launchpad?: TokenMarketTokenRelatedItem | null;
234
+ asset?: TokenMarketTokenRelatedItem | null;
235
+ market_status?: string;
233
236
  }
234
237
  export interface TokenItemWithEntity extends TokenItem {
235
238
  identity?: TokenEntityDetail;
236
239
  }
240
+ export interface TokenPriceListItem {
241
+ price: number;
242
+ price_24h_change?: number | null;
243
+ price_update_at?: number | null;
244
+ }
245
+ export declare type TokenPriceListResponse = Record<string, TokenPriceListItem>;
237
246
  export interface TransferingNFTItem {
238
247
  chain: string;
239
248
  collection: {
@@ -1748,6 +1757,62 @@ export interface PerpBridgeQuote {
1748
1757
  };
1749
1758
  duration: number;
1750
1759
  }
1760
+ export interface GasAccountBridgeToken {
1761
+ chain_id: string;
1762
+ token_id: string;
1763
+ }
1764
+ export interface GasAccountBridgeSupportTokenList {
1765
+ wallet_tokens: GasAccountBridgeToken[];
1766
+ hyperliquid_tokens: GasAccountBridgeToken[];
1767
+ }
1768
+ export interface GasAccountBridgeFee {
1769
+ raw_amount_hex_str: string;
1770
+ usd_value: number;
1771
+ }
1772
+ export interface GasAccountBridgeInfo {
1773
+ logo_url: string;
1774
+ }
1775
+ export interface GasAccountBridgeQuote {
1776
+ bridge_id: string;
1777
+ bridge: GasAccountBridgeInfo;
1778
+ to_token_raw_amount: number;
1779
+ to_token_raw_amount_hex_str: string;
1780
+ to_token_amount: number;
1781
+ approve_contract_id: string;
1782
+ protocol_fee: GasAccountBridgeFee;
1783
+ rabby_fee: GasAccountBridgeFee;
1784
+ gas_fee: GasAccountBridgeFee;
1785
+ duration: number;
1786
+ tx: Tx;
1787
+ }
1788
+ export interface GasAccountBridgeCreateResponse {
1789
+ success: boolean;
1790
+ id: string;
1791
+ }
1792
+ interface GasAccountRechargeStatusBase {
1793
+ type: 'bridge' | 'wallet';
1794
+ status: 'pending' | 'success' | 'failed';
1795
+ chain_id: string;
1796
+ tx_id: string;
1797
+ user_addr: string;
1798
+ gas_account_id: string;
1799
+ amount: number;
1800
+ create_at: number;
1801
+ failed_reason: string | null;
1802
+ }
1803
+ export interface GasAccountBridgeRechargeStatus extends GasAccountRechargeStatusBase {
1804
+ type: 'bridge';
1805
+ from_token_id: string;
1806
+ from_token_amount: number;
1807
+ to_tx_id?: string | null;
1808
+ to_token_amount?: number | null;
1809
+ is_system_prepaid?: boolean | null;
1810
+ finished_at?: number | null;
1811
+ }
1812
+ export interface GasAccountWalletRechargeStatus extends GasAccountRechargeStatusBase {
1813
+ type: 'wallet';
1814
+ }
1815
+ export declare type GasAccountRechargeStatus = GasAccountBridgeRechargeStatus | GasAccountWalletRechargeStatus;
1751
1816
  export declare type MarketSummaryItem = {
1752
1817
  price?: {
1753
1818
  open?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/rabby-api",
3
- "version": "0.9.57",
3
+ "version": "0.9.58-beta.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [