@rabby-wallet/rabby-api 0.9.34-beta.0 → 0.9.34-beta.2

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
@@ -1433,12 +1433,14 @@ export interface BridgeQuote {
1433
1433
  to: string;
1434
1434
  value: string;
1435
1435
  };
1436
+ quote_key: Record<string, any>;
1436
1437
  }
1437
1438
  export interface BridgeHistory {
1438
1439
  aggregator: Exclude<BridgeAggregator, 'bridge_list'>;
1439
1440
  bridge: BridgeItem;
1440
1441
  from_token: TokenItem;
1441
1442
  to_token: TokenItem;
1443
+ to_actual_token: TokenItem;
1442
1444
  quote: {
1443
1445
  pay_token_amount: number;
1444
1446
  receive_token_amount: number;
@@ -1448,7 +1450,7 @@ export interface BridgeHistory {
1448
1450
  receive_token_amount: number;
1449
1451
  };
1450
1452
  detail_url: string;
1451
- status: 'pending' | 'completed';
1453
+ status: 'pending' | 'completed' | 'failed';
1452
1454
  create_at: number;
1453
1455
  from_tx: {
1454
1456
  tx_id: string;
@@ -1627,4 +1629,9 @@ export interface TokenDetailWithPriceCurve extends TokenItemWithEntity {
1627
1629
  price: number;
1628
1630
  }[];
1629
1631
  }
1632
+ export declare type GiftEligibilityItem = {
1633
+ id?: string;
1634
+ has_eligibility: boolean;
1635
+ can_claimed_usd_value: number;
1636
+ };
1630
1637
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/rabby-api",
3
- "version": "0.9.34-beta.0",
3
+ "version": "0.9.34-beta.2",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [