@rabby-wallet/rabby-api 0.9.33 → 0.9.34-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 } 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 } from './types';
5
5
  interface OpenApiStore {
6
6
  host: string;
7
7
  testnetHost?: string;
@@ -874,10 +874,23 @@ export declare class OpenApiService {
874
874
  user_addr: string;
875
875
  start: number;
876
876
  limit: number;
877
+ is_all?: boolean;
877
878
  }) => Promise<{
878
879
  history_list: BridgeHistory[];
879
880
  total_cnt: number;
880
881
  }>;
882
+ buildBridgeTx: (params: {
883
+ aggregator_id: string;
884
+ bridge_id: string;
885
+ user_addr: string;
886
+ from_chain_id: string;
887
+ from_token_id: string;
888
+ from_token_raw_amount: string;
889
+ to_chain_id: string;
890
+ to_token_id: string;
891
+ slippage: string;
892
+ quote_key: string;
893
+ }) => Promise<Tx>;
881
894
  postBridgeHistory: (params: {
882
895
  aggregator_id: string;
883
896
  bridge_id: string;
@@ -936,6 +949,9 @@ export declare class OpenApiService {
936
949
  has_eligibility: boolean;
937
950
  can_claimed_usd_value: number;
938
951
  }>;
952
+ checkGasAccountGiftEligibilityBatch: (params: {
953
+ ids: string[];
954
+ }) => Promise<GiftEligibilityItem[]>;
939
955
  confirmIapOrder: (postData: {
940
956
  transaction_id: string;
941
957
  device_type: 'android' | 'ios';
@@ -1142,6 +1158,7 @@ export declare class OpenApiService {
1142
1158
  }) => Promise<TokenItem[]>;
1143
1159
  searchTokensV2: (params: {
1144
1160
  q: string;
1161
+ chain_id?: string;
1145
1162
  }) => Promise<TokenItemWithEntity[]>;
1146
1163
  getCopyTradingChainList: () => Promise<string[]>;
1147
1164
  getCopyTradingTokenList: (params: {
package/dist/index.js CHANGED
@@ -1251,6 +1251,12 @@ export class OpenApiService {
1251
1251
  });
1252
1252
  return data;
1253
1253
  });
1254
+ this.buildBridgeTx = (params) => __awaiter(this, void 0, void 0, function* () {
1255
+ const { data } = yield this.request.get('/v2/bridge/build_tx', {
1256
+ params,
1257
+ });
1258
+ return data;
1259
+ });
1254
1260
  this.postBridgeHistory = (params) => __awaiter(this, void 0, void 0, function* () {
1255
1261
  const { data } = yield this.request.post('/v1/bridge/history', params);
1256
1262
  return data;
@@ -1303,6 +1309,10 @@ export class OpenApiService {
1303
1309
  });
1304
1310
  return data;
1305
1311
  });
1312
+ this.checkGasAccountGiftEligibilityBatch = (params) => __awaiter(this, void 0, void 0, function* () {
1313
+ const { data } = yield this.request.post('/v1/gas_account/check_eligibility/batch', params);
1314
+ return data;
1315
+ });
1306
1316
  this.confirmIapOrder = (postData) => __awaiter(this, void 0, void 0, function* () {
1307
1317
  const { data } = yield this.request.post('/v1/gas_account/confirm_iap_order', postData);
1308
1318
  return data;
package/dist/types.d.ts CHANGED
@@ -1439,6 +1439,7 @@ export interface BridgeHistory {
1439
1439
  bridge: BridgeItem;
1440
1440
  from_token: TokenItem;
1441
1441
  to_token: TokenItem;
1442
+ to_actual_token: TokenItem;
1442
1443
  quote: {
1443
1444
  pay_token_amount: number;
1444
1445
  receive_token_amount: number;
@@ -1448,7 +1449,7 @@ export interface BridgeHistory {
1448
1449
  receive_token_amount: number;
1449
1450
  };
1450
1451
  detail_url: string;
1451
- status: 'pending' | 'completed';
1452
+ status: 'pending' | 'completed' | 'failed';
1452
1453
  create_at: number;
1453
1454
  from_tx: {
1454
1455
  tx_id: string;
@@ -1600,7 +1601,16 @@ export interface AppChainItem {
1600
1601
  }
1601
1602
  export interface AppChainListResponse {
1602
1603
  apps: AppChainItem[];
1603
- error_app_ids: string[];
1604
+ error_apps: {
1605
+ create_at: number;
1606
+ id: string;
1607
+ is_support_portfolio: boolean;
1608
+ is_visible: boolean;
1609
+ logo_url: string;
1610
+ name: string;
1611
+ site_url: string;
1612
+ update_at: number;
1613
+ }[];
1604
1614
  }
1605
1615
  export declare type DefaultRPCRes = {
1606
1616
  message: string;
@@ -1618,4 +1628,9 @@ export interface TokenDetailWithPriceCurve extends TokenItemWithEntity {
1618
1628
  price: number;
1619
1629
  }[];
1620
1630
  }
1631
+ export declare type GiftEligibilityItem = {
1632
+ id?: string;
1633
+ has_eligibility: boolean;
1634
+ can_claimed_usd_value: number;
1635
+ };
1621
1636
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/rabby-api",
3
- "version": "0.9.33",
3
+ "version": "0.9.34-beta.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [