@rabby-wallet/rabby-api 0.9.4 → 0.9.5-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
@@ -44,6 +44,14 @@ export declare class OpenApiService {
44
44
  private _mountMethods;
45
45
  getRecommendChains: (address: string, origin: string) => Promise<ServerChain[]>;
46
46
  getTotalBalance: (address: string, isCore?: boolean) => Promise<TotalBalanceResponse>;
47
+ getTotalBalanceV2: ({ address, isCore, included_token_uuids, excluded_token_uuids, excluded_protocol_ids, excluded_chain_ids, }: {
48
+ address: string;
49
+ isCore: boolean;
50
+ included_token_uuids: string[];
51
+ excluded_token_uuids: string[];
52
+ excluded_protocol_ids: string[];
53
+ excluded_chain_ids: string[];
54
+ }) => Promise<TotalBalanceResponse>;
47
55
  getPendingCount: (address: string) => Promise<{
48
56
  total_count: number;
49
57
  chains: ChainWithPendingCount[];
@@ -94,7 +102,7 @@ export declare class OpenApiService {
94
102
  }) => Promise<TokenItem[]>;
95
103
  customListToken: (uuids: string[], id: string) => Promise<TokenItem[]>;
96
104
  listChainAssets: (id: string) => Promise<AssetItem[]>;
97
- listNFT: (id: string, isAll?: boolean) => Promise<NFTItem[]>;
105
+ listNFT: (id: string, isAll?: boolean, sortByCredit?: boolean) => Promise<NFTItem[]>;
98
106
  listCollection: (params: {
99
107
  collection_ids: string;
100
108
  }) => Promise<Collection[]>;
package/dist/index.js CHANGED
@@ -123,6 +123,19 @@ export class OpenApiService {
123
123
  });
124
124
  return data;
125
125
  });
126
+ this.getTotalBalanceV2 = ({ address, isCore = false, included_token_uuids = [], excluded_token_uuids = [], excluded_protocol_ids = [], excluded_chain_ids = [], }) => __awaiter(this, void 0, void 0, function* () {
127
+ const { data } = yield this.request.get('/v2/user/total_balance', {
128
+ params: {
129
+ id: address,
130
+ is_core: isCore,
131
+ included_token_uuids: included_token_uuids,
132
+ excluded_token_uuids: excluded_token_uuids,
133
+ excluded_protocol_ids: excluded_protocol_ids,
134
+ excluded_chain_ids: excluded_chain_ids,
135
+ },
136
+ });
137
+ return data;
138
+ });
126
139
  this.getPendingCount = (address) => __awaiter(this, void 0, void 0, function* () {
127
140
  const { data } = yield this.request.get('/v1/wallet/pending_tx_count', {
128
141
  params: {
@@ -316,12 +329,16 @@ export class OpenApiService {
316
329
  });
317
330
  return data;
318
331
  });
319
- this.listNFT = (id, isAll = true) => __awaiter(this, void 0, void 0, function* () {
332
+ this.listNFT = (id, isAll = true, sortByCredit) => __awaiter(this, void 0, void 0, function* () {
320
333
  const { data } = yield this.request.get('/v1/user/nft_list', {
321
- params: {
334
+ params: Object.assign({
322
335
  id,
323
336
  is_all: isAll,
324
- },
337
+ }, sortByCredit
338
+ ? {
339
+ sort_by: 'credit_score',
340
+ }
341
+ : {}),
325
342
  });
326
343
  return data;
327
344
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/rabby-api",
3
- "version": "0.9.4",
3
+ "version": "0.9.5-beta.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [