@rabby-wallet/rabby-api 0.6.1 → 0.6.3

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,6 +1,6 @@
1
1
  import { AxiosAdapter } from 'axios';
2
2
  import { RateLimitedAxiosInstance } from 'axios-rate-limit';
3
- import { ServerChain, TotalBalanceResponse, ChainWithPendingCount, SecurityCheckResponse, Tx, ExplainTxResponse, GasLevel, GetTxResponse, TokenItem, AssetItem, NFTItem, Collection, TxHistoryResult, TokenApproval, NFTApprovalResponse, ApprovalStatus, UsedChain, Protocol, ComplexProtocol, ExplainTypedDataResponse, SwapTradeList, SlippageStatus, CEXQuote, Summary, Cex, ContractCredit, AddrDescResponse, ParseTxResponse, CollectionWithFloorPrice, ParseTypedDataResponse, ParseTextResponse } from './types';
3
+ import { ServerChain, TotalBalanceResponse, ChainWithPendingCount, SecurityCheckResponse, Tx, ExplainTxResponse, GasLevel, GetTxResponse, TokenItem, AssetItem, NFTItem, Collection, TxHistoryResult, TokenApproval, NFTApprovalResponse, ApprovalStatus, UsedChain, Protocol, ComplexProtocol, ExplainTypedDataResponse, SwapTradeList, SlippageStatus, CEXQuote, Summary, Cex, ContractCredit, AddrDescResponse, ParseTxResponse, CollectionWithFloorPrice, ParseTypedDataResponse, ParseTextResponse, CollectionList } from './types';
4
4
  interface OpenApiStore {
5
5
  host: string;
6
6
  }
@@ -56,7 +56,7 @@ export declare class OpenApiService {
56
56
  addr: string;
57
57
  name: string;
58
58
  }>;
59
- searchToken: (id: string, q: string) => Promise<TokenItem[]>;
59
+ searchToken: (id: string, q: string, chainId?: string, is_all?: boolean) => Promise<TokenItem[]>;
60
60
  searchSwapToken: (id: string, chainId: string, q: string, is_all?: boolean) => Promise<any>;
61
61
  getToken: (id: string, chainId: string, tokenId: string) => Promise<TokenItem>;
62
62
  getCachedTokenList: (id: string) => Promise<TokenItem[]>;
@@ -269,5 +269,10 @@ export declare class OpenApiService {
269
269
  origin: string;
270
270
  address: string;
271
271
  }) => Promise<ParseTextResponse>;
272
+ collectionList: ({ id, chainId, isAll, }: {
273
+ id: string;
274
+ chainId?: string | undefined;
275
+ isAll: boolean;
276
+ }) => Promise<CollectionList[]>;
272
277
  }
273
278
  export {};
package/dist/index.js CHANGED
@@ -218,12 +218,14 @@ export class OpenApiService {
218
218
  });
219
219
  return data;
220
220
  });
221
- this.searchToken = (id, q) => __awaiter(this, void 0, void 0, function* () {
221
+ this.searchToken = (id, q, chainId, is_all = false) => __awaiter(this, void 0, void 0, function* () {
222
222
  const { data } = yield this.request.get('/v1/user/token_search', {
223
223
  params: {
224
224
  id,
225
225
  q,
226
226
  has_balance: false,
227
+ is_all,
228
+ chain_id: chainId,
227
229
  },
228
230
  });
229
231
  return data === null || data === void 0 ? void 0 : data.filter((token) => getChain(token.chain));
@@ -704,6 +706,16 @@ export class OpenApiService {
704
706
  });
705
707
  return data;
706
708
  });
709
+ this.collectionList = ({ id, chainId, isAll, }) => __awaiter(this, void 0, void 0, function* () {
710
+ const { data } = yield this.request.get('/v1/user/collection_list', {
711
+ params: {
712
+ id,
713
+ chain_id: chainId,
714
+ is_all: isAll,
715
+ },
716
+ });
717
+ return data;
718
+ });
707
719
  this.store = store;
708
720
  this.adapter = adapter;
709
721
  }
package/dist/types.d.ts CHANGED
@@ -279,6 +279,21 @@ export interface Collection {
279
279
  floor_price: number;
280
280
  is_scam: boolean;
281
281
  }
282
+ export interface CollectionList {
283
+ id: string;
284
+ chain: string;
285
+ name: string;
286
+ description: string;
287
+ logo_url: string;
288
+ is_verified: boolean;
289
+ credit_score: number;
290
+ receive_addr_count: number;
291
+ is_scam: boolean;
292
+ is_suspicious: boolean;
293
+ is_core: boolean;
294
+ floor_price: number;
295
+ nft_list: NFTItem[];
296
+ }
282
297
  export interface TxDisplayItem extends TxHistoryItem {
283
298
  projectDict: TxHistoryResult['project_dict'];
284
299
  cateDict: TxHistoryResult['cate_dict'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/rabby-api",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "main": "dist/index.js",
5
5
  "files": [
6
6
  "dist"