@rabby-wallet/rabby-api 0.7.0-alpha.4 → 0.7.0-alpha.7

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/README.md CHANGED
@@ -9,8 +9,8 @@ npm install @rabby-wallet/rabby-api @debank/common
9
9
  ## Usage
10
10
 
11
11
  ```ts
12
- import { OpenApiService } from 'rabby-api';
13
- import { WebSignApiPlugin } from 'rabby-api/dist/plugins/web-sign.ts';
12
+ import { OpenApiService } from '@rabby-wallet/rabby-api';
13
+ import { WebSignApiPlugin } from '@rabby-wallet/rabby-api/dist/plugins/web-sign.ts';
14
14
 
15
15
  const service = new OpenApiService({
16
16
  store: {
package/dist/index.d.ts CHANGED
@@ -393,9 +393,19 @@ export declare class OpenApiService {
393
393
  is_success: boolean;
394
394
  count: number;
395
395
  }>;
396
- searchDapp: (params: {
397
- q: string;
398
- }) => Promise<BasicDappInfo[]>;
396
+ searchDapp: (params?: {
397
+ q?: string;
398
+ chain_id?: string;
399
+ start?: number;
400
+ limit?: number;
401
+ }) => Promise<{
402
+ page: {
403
+ limit: number;
404
+ start: number;
405
+ total: number;
406
+ };
407
+ dapps: BasicDappInfo[];
408
+ }>;
399
409
  getDappsInfo: (params: {
400
410
  ids: string[];
401
411
  }) => Promise<BasicDappInfo[]>;
package/dist/index.js CHANGED
@@ -811,7 +811,12 @@ export class OpenApiService {
811
811
  return data;
812
812
  });
813
813
  this.getDappsInfo = (params) => __awaiter(this, void 0, void 0, function* () {
814
- const { data } = yield this.request.get('/v1/dapp/list', { params });
814
+ var _s;
815
+ const { data } = yield this.request.get('/v1/dapp/list', {
816
+ params: {
817
+ ids: (_s = params === null || params === void 0 ? void 0 : params.ids) === null || _s === void 0 ? void 0 : _s.join(','),
818
+ },
819
+ });
815
820
  return data;
816
821
  });
817
822
  this.getHotDapps = (params) => __awaiter(this, void 0, void 0, function* () {
@@ -867,7 +872,9 @@ export class OpenApiService {
867
872
  }
868
873
  throw err;
869
874
  }
870
- throw new Error(response.data);
875
+ throw new Error(typeof response.data === 'string'
876
+ ? response.data
877
+ : JSON.stringify(response.data));
871
878
  }
872
879
  return response;
873
880
  });
package/dist/types.d.ts CHANGED
@@ -90,6 +90,8 @@ export interface Eip1559Tx {
90
90
  export interface TotalBalanceResponse {
91
91
  total_usd_value: number;
92
92
  chain_list: ChainWithBalance[];
93
+ error_code?: number;
94
+ err_chain_ids?: string[];
93
95
  }
94
96
  export interface TokenItem {
95
97
  content_type?: 'image' | 'image_url' | 'video_url' | 'audio_url' | undefined;
@@ -1114,5 +1116,6 @@ export interface BasicDappInfo {
1114
1116
  description: string;
1115
1117
  user_range: string;
1116
1118
  tags: string[];
1119
+ chain_ids: string[];
1117
1120
  }
1118
1121
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabby-wallet/rabby-api",
3
- "version": "0.7.0-alpha.4",
3
+ "version": "0.7.0-alpha.7",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [