@keplr-wallet/router 0.12.114-rc.0 → 0.12.115-rc.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/build/error.d.ts CHANGED
@@ -3,3 +3,8 @@ export declare class KeplrError extends Error {
3
3
  readonly code: number;
4
4
  constructor(module: string, code: number, message?: string);
5
5
  }
6
+ export declare class EthereumProviderRpcError extends Error {
7
+ readonly code: number;
8
+ readonly data?: unknown;
9
+ constructor(code: number, message: string, data?: unknown);
10
+ }
package/build/error.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.KeplrError = void 0;
3
+ exports.EthereumProviderRpcError = exports.KeplrError = void 0;
4
4
  class KeplrError extends Error {
5
5
  constructor(module, code, message) {
6
6
  super(message);
@@ -10,4 +10,13 @@ class KeplrError extends Error {
10
10
  }
11
11
  }
12
12
  exports.KeplrError = KeplrError;
13
+ class EthereumProviderRpcError extends Error {
14
+ constructor(code, message, data) {
15
+ super(message);
16
+ this.code = code;
17
+ this.data = data;
18
+ Object.setPrototypeOf(this, EthereumProviderRpcError.prototype);
19
+ }
20
+ }
21
+ exports.EthereumProviderRpcError = EthereumProviderRpcError;
13
22
  //# sourceMappingURL=error.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";;;AAAA,MAAa,UAAW,SAAQ,KAAK;IAInC,YAAY,MAAc,EAAE,IAAY,EAAE,OAAgB;QACxD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAEjB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;CACF;AAXD,gCAWC"}
1
+ {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":";;;AAAA,MAAa,UAAW,SAAQ,KAAK;IAInC,YAAY,MAAc,EAAE,IAAY,EAAE,OAAgB;QACxD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAEjB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC;IACpD,CAAC;CACF;AAXD,gCAWC;AAED,MAAa,wBAAyB,SAAQ,KAAK;IAIjD,YAAY,IAAY,EAAE,OAAe,EAAE,IAAc;QACvD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QAEjB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,wBAAwB,CAAC,SAAS,CAAC,CAAC;IAClE,CAAC;CACF;AAXD,4DAWC"}
@@ -1,12 +1,18 @@
1
1
  export interface Result {
2
2
  /**
3
- * NOTE: If `error` is of type `{ module:string; code: number; message: string }`,
3
+ * NOTE: If `error` is of type `{ module: string; code: number; message: string }`,
4
4
  * it should be considered and processed as `KeplrError`.
5
+ * Also, if `error` is of type `{ code: number; message: string; data: unknown }`,
6
+ * it should be considered and processed as `EthereumProviderRpcError`.
5
7
  */
6
8
  error?: string | {
7
9
  module: string;
8
10
  code: number;
9
11
  message: string;
12
+ } | {
13
+ code: number;
14
+ message: string;
15
+ data: unknown;
10
16
  };
11
17
  return?: any;
12
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@keplr-wallet/router",
3
- "version": "0.12.114-rc.0",
3
+ "version": "0.12.115-rc.0",
4
4
  "main": "build/index.js",
5
5
  "author": "chainapsis",
6
6
  "license": "Apache-2.0",
@@ -15,5 +15,5 @@
15
15
  "lint-test": "eslint \"src/**/*\" && prettier --check \"src/**/*\"",
16
16
  "lint-fix": "eslint --fix \"src/**/*\" && prettier --write \"src/**/*\""
17
17
  },
18
- "gitHead": "4cb7741d19ff12540f1dbce21735c51ccb3ad36c"
18
+ "gitHead": "7ca33dd8744560426aac4ffdf19dd63b255df91b"
19
19
  }
package/src/error.ts CHANGED
@@ -10,3 +10,16 @@ export class KeplrError extends Error {
10
10
  Object.setPrototypeOf(this, KeplrError.prototype);
11
11
  }
12
12
  }
13
+
14
+ export class EthereumProviderRpcError extends Error {
15
+ public readonly code: number;
16
+ public readonly data?: unknown;
17
+
18
+ constructor(code: number, message: string, data?: unknown) {
19
+ super(message);
20
+ this.code = code;
21
+ this.data = data;
22
+
23
+ Object.setPrototypeOf(this, EthereumProviderRpcError.prototype);
24
+ }
25
+ }
package/src/interfaces.ts CHANGED
@@ -1,8 +1,21 @@
1
1
  export interface Result {
2
2
  /**
3
- * NOTE: If `error` is of type `{ module:string; code: number; message: string }`,
3
+ * NOTE: If `error` is of type `{ module: string; code: number; message: string }`,
4
4
  * it should be considered and processed as `KeplrError`.
5
+ * Also, if `error` is of type `{ code: number; message: string; data: unknown }`,
6
+ * it should be considered and processed as `EthereumProviderRpcError`.
5
7
  */
6
- error?: string | { module: string; code: number; message: string };
8
+ error?:
9
+ | string
10
+ | {
11
+ module: string;
12
+ code: number;
13
+ message: string;
14
+ }
15
+ | {
16
+ code: number;
17
+ message: string;
18
+ data: unknown;
19
+ };
7
20
  return?: any;
8
21
  }