@rabby-wallet/rabby-api 0.9.10 → 0.9.12-beta.0

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 } 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 } from './types';
5
5
  interface OpenApiStore {
6
6
  host: string;
7
7
  testnetHost?: string;
@@ -117,6 +117,7 @@ export declare class OpenApiService {
117
117
  getAllTxHistory: (params: {
118
118
  id: string;
119
119
  start_time?: number;
120
+ page_count?: number;
120
121
  }, options?: Parameters<typeof this.asyncJob>[1]) => Promise<TxAllHistoryResult>;
121
122
  tokenPrice: (tokenName: string) => Promise<{
122
123
  change_percent: number;
@@ -229,6 +230,11 @@ export declare class OpenApiService {
229
230
  start: string;
230
231
  limit: string;
231
232
  }) => Promise<SwapTradeList>;
233
+ getSwapTradeListV2: (params: {
234
+ user_addr: string;
235
+ limit: number;
236
+ start_time?: number;
237
+ }) => Promise<SwapTradeList>;
232
238
  postSwap: (params: {
233
239
  quote: {
234
240
  pay_token_id: string;
@@ -1053,5 +1059,30 @@ export declare class OpenApiService {
1053
1059
  q: string;
1054
1060
  }) => Promise<TokenItem[]>;
1055
1061
  batchQueryTokens: (uuids: string | string[]) => Promise<TokenItem[]>;
1062
+ getBuySupportedCountryList: () => Promise<BuyCountryItem[]>;
1063
+ getBuySupportedTokenList: () => Promise<(TokenItem & {
1064
+ currency_code: string;
1065
+ })[]>;
1066
+ getBuyQuote: (params: {
1067
+ country_code: string;
1068
+ user_addr: string;
1069
+ usd_amount: string;
1070
+ receive_token_uuid: string;
1071
+ }) => Promise<BuyQuoteItem[]>;
1072
+ getBuyWidgetUrl: (params: {
1073
+ country_code: string;
1074
+ user_addr: string;
1075
+ usd_amount: string;
1076
+ receive_token_uuid: string;
1077
+ service_provider: string;
1078
+ }) => Promise<{
1079
+ url: string;
1080
+ msg: number;
1081
+ }>;
1082
+ getBuyHistory: (params: {
1083
+ user_addr: string;
1084
+ start?: number;
1085
+ limit?: number;
1086
+ }) => Promise<BuyHistoryList>;
1056
1087
  }
1057
1088
  export {};
package/dist/index.js CHANGED
@@ -570,6 +570,12 @@ export class OpenApiService {
570
570
  });
571
571
  return data;
572
572
  });
573
+ this.getSwapTradeListV2 = (params) => __awaiter(this, void 0, void 0, function* () {
574
+ const { data } = yield this.request.get('/v2/wallet/swap_trade_list', {
575
+ params,
576
+ });
577
+ return data;
578
+ });
573
579
  this.postSwap = (params) => __awaiter(this, void 0, void 0, function* () {
574
580
  const { data } = yield this.request.post('/v1/wallet/swap_trade', params);
575
581
  return data;
@@ -1405,6 +1411,30 @@ export class OpenApiService {
1405
1411
  });
1406
1412
  return data;
1407
1413
  });
1414
+ this.getBuySupportedCountryList = () => __awaiter(this, void 0, void 0, function* () {
1415
+ const { data } = yield this.request.get('/v1/buy/supported_country_list');
1416
+ return data;
1417
+ });
1418
+ this.getBuySupportedTokenList = () => __awaiter(this, void 0, void 0, function* () {
1419
+ const { data } = yield this.request.get('/v1/buy/supported_token_list');
1420
+ return data;
1421
+ });
1422
+ this.getBuyQuote = (params) => __awaiter(this, void 0, void 0, function* () {
1423
+ const { data } = yield this.request.get('/v1/buy/quote', {
1424
+ params,
1425
+ });
1426
+ return data;
1427
+ });
1428
+ this.getBuyWidgetUrl = (params) => __awaiter(this, void 0, void 0, function* () {
1429
+ const { data } = yield this.request.get('/v1/buy/get_widget_url', { params });
1430
+ return data;
1431
+ });
1432
+ this.getBuyHistory = (params) => __awaiter(this, void 0, void 0, function* () {
1433
+ const { data } = yield this.request.get('/v1/buy/history', {
1434
+ params: Object.assign(Object.assign({}, params), { start: params.start || 0, limit: params.limit || 20 }),
1435
+ });
1436
+ return data;
1437
+ });
1408
1438
  if (store instanceof Promise) {
1409
1439
  store.then((resolvedStore) => {
1410
1440
  this.store = resolvedStore;
package/dist/types.d.ts CHANGED
@@ -265,6 +265,8 @@ export interface NFTItem {
265
265
  usd_price?: number;
266
266
  amount: number;
267
267
  collection_id?: string;
268
+ collection_name?: string;
269
+ is_core?: boolean;
268
270
  pay_token?: {
269
271
  id: string;
270
272
  name: string;
@@ -370,6 +372,7 @@ export interface TxHistoryResult {
370
372
  }
371
373
  export interface TxAllHistoryResult extends Omit<TxHistoryResult, 'token_dict'> {
372
374
  token_uuid_dict: Record<string, TokenItem>;
375
+ project_dict: TxHistoryResult['project_dict'];
373
376
  }
374
377
  export interface GasResult {
375
378
  estimated_gas_cost_usd_value: number;
@@ -1392,4 +1395,43 @@ export interface WithdrawListAddressItem {
1392
1395
  total_withdraw_limit: number;
1393
1396
  recharge_chain_list: RechargeChainItem[];
1394
1397
  }
1398
+ export interface BuyCountryItem {
1399
+ id: string;
1400
+ name: string;
1401
+ image_url: string;
1402
+ regions: null | {
1403
+ regionCode: string;
1404
+ name: string;
1405
+ };
1406
+ }
1407
+ export interface BuyQuoteItem {
1408
+ service_provider: {
1409
+ id: string;
1410
+ name: string;
1411
+ website_url: string;
1412
+ customer_support_url: string;
1413
+ image_url: string;
1414
+ logo_url: string;
1415
+ };
1416
+ token_amount: number;
1417
+ payment_method_type: string;
1418
+ }
1419
+ export interface BuyHistoryList {
1420
+ pagination: {
1421
+ start: number;
1422
+ limit: number;
1423
+ total: number;
1424
+ };
1425
+ histories: {
1426
+ user_addr: string;
1427
+ status: 'pending' | 'success' | 'failed';
1428
+ create_at: number;
1429
+ service_provider: string;
1430
+ pay_usd_amount: number;
1431
+ payment_type: string;
1432
+ receive_tx_id: string;
1433
+ receive_chain_id: string;
1434
+ receive_token: TokenItem;
1435
+ }[];
1436
+ }
1395
1437
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/rabby-api",
3
- "version": "0.9.10",
3
+ "version": "0.9.12-beta.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [