@injectivelabs/wallet-trezor 1.14.57 → 1.15.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.
Files changed (91) hide show
  1. package/package.json +6 -6
  2. package/dist/cjs/index.d.ts +0 -4
  3. package/dist/cjs/index.d.ts.map +0 -1
  4. package/dist/cjs/index.js +0 -23
  5. package/dist/cjs/index.js.map +0 -1
  6. package/dist/cjs/package.json +0 -3
  7. package/dist/cjs/strategy/Base.d.ts +0 -43
  8. package/dist/cjs/strategy/Base.d.ts.map +0 -1
  9. package/dist/cjs/strategy/Base.js +0 -281
  10. package/dist/cjs/strategy/Base.js.map +0 -1
  11. package/dist/cjs/strategy/TrezorBip32.d.ts +0 -6
  12. package/dist/cjs/strategy/TrezorBip32.d.ts.map +0 -1
  13. package/dist/cjs/strategy/TrezorBip32.js +0 -18
  14. package/dist/cjs/strategy/TrezorBip32.js.map +0 -1
  15. package/dist/cjs/strategy/TrezorBip44.d.ts +0 -6
  16. package/dist/cjs/strategy/TrezorBip44.d.ts.map +0 -1
  17. package/dist/cjs/strategy/TrezorBip44.js +0 -18
  18. package/dist/cjs/strategy/TrezorBip44.js.map +0 -1
  19. package/dist/cjs/strategy/hw/AccountManager.d.ts +0 -20
  20. package/dist/cjs/strategy/hw/AccountManager.d.ts.map +0 -1
  21. package/dist/cjs/strategy/hw/AccountManager.js +0 -107
  22. package/dist/cjs/strategy/hw/AccountManager.js.map +0 -1
  23. package/dist/cjs/strategy/hw/index.d.ts +0 -5
  24. package/dist/cjs/strategy/hw/index.d.ts.map +0 -1
  25. package/dist/cjs/strategy/hw/index.js +0 -13
  26. package/dist/cjs/strategy/hw/index.js.map +0 -1
  27. package/dist/cjs/strategy/hw/transport/base.d.ts +0 -7
  28. package/dist/cjs/strategy/hw/transport/base.d.ts.map +0 -1
  29. package/dist/cjs/strategy/hw/transport/base.js +0 -20
  30. package/dist/cjs/strategy/hw/transport/base.js.map +0 -1
  31. package/dist/cjs/strategy/hw/transport/transport-init.d.ts +0 -5
  32. package/dist/cjs/strategy/hw/transport/transport-init.d.ts.map +0 -1
  33. package/dist/cjs/strategy/hw/transport/transport-init.js +0 -28
  34. package/dist/cjs/strategy/hw/transport/transport-init.js.map +0 -1
  35. package/dist/cjs/strategy/hw/transport/transport-no-init.d.ts +0 -5
  36. package/dist/cjs/strategy/hw/transport/transport-no-init.d.ts.map +0 -1
  37. package/dist/cjs/strategy/hw/transport/transport-no-init.js +0 -13
  38. package/dist/cjs/strategy/hw/transport/transport-no-init.js.map +0 -1
  39. package/dist/cjs/types.d.ts +0 -12
  40. package/dist/cjs/types.d.ts.map +0 -1
  41. package/dist/cjs/types.js +0 -10
  42. package/dist/cjs/types.js.map +0 -1
  43. package/dist/cjs/utils.d.ts +0 -17
  44. package/dist/cjs/utils.d.ts.map +0 -1
  45. package/dist/cjs/utils.js +0 -35
  46. package/dist/cjs/utils.js.map +0 -1
  47. package/dist/esm/index.d.ts +0 -4
  48. package/dist/esm/index.d.ts.map +0 -1
  49. package/dist/esm/index.js +0 -4
  50. package/dist/esm/index.js.map +0 -1
  51. package/dist/esm/package.json +0 -3
  52. package/dist/esm/strategy/Base.d.ts +0 -43
  53. package/dist/esm/strategy/Base.d.ts.map +0 -1
  54. package/dist/esm/strategy/Base.js +0 -278
  55. package/dist/esm/strategy/Base.js.map +0 -1
  56. package/dist/esm/strategy/TrezorBip32.d.ts +0 -6
  57. package/dist/esm/strategy/TrezorBip32.d.ts.map +0 -1
  58. package/dist/esm/strategy/TrezorBip32.js +0 -11
  59. package/dist/esm/strategy/TrezorBip32.js.map +0 -1
  60. package/dist/esm/strategy/TrezorBip44.d.ts +0 -6
  61. package/dist/esm/strategy/TrezorBip44.d.ts.map +0 -1
  62. package/dist/esm/strategy/TrezorBip44.js +0 -11
  63. package/dist/esm/strategy/TrezorBip44.js.map +0 -1
  64. package/dist/esm/strategy/hw/AccountManager.d.ts +0 -20
  65. package/dist/esm/strategy/hw/AccountManager.d.ts.map +0 -1
  66. package/dist/esm/strategy/hw/AccountManager.js +0 -101
  67. package/dist/esm/strategy/hw/AccountManager.js.map +0 -1
  68. package/dist/esm/strategy/hw/index.d.ts +0 -5
  69. package/dist/esm/strategy/hw/index.d.ts.map +0 -1
  70. package/dist/esm/strategy/hw/index.js +0 -5
  71. package/dist/esm/strategy/hw/index.js.map +0 -1
  72. package/dist/esm/strategy/hw/transport/base.d.ts +0 -7
  73. package/dist/esm/strategy/hw/transport/base.d.ts.map +0 -1
  74. package/dist/esm/strategy/hw/transport/base.js +0 -14
  75. package/dist/esm/strategy/hw/transport/base.js.map +0 -1
  76. package/dist/esm/strategy/hw/transport/transport-init.d.ts +0 -5
  77. package/dist/esm/strategy/hw/transport/transport-init.d.ts.map +0 -1
  78. package/dist/esm/strategy/hw/transport/transport-init.js +0 -22
  79. package/dist/esm/strategy/hw/transport/transport-init.js.map +0 -1
  80. package/dist/esm/strategy/hw/transport/transport-no-init.d.ts +0 -5
  81. package/dist/esm/strategy/hw/transport/transport-no-init.d.ts.map +0 -1
  82. package/dist/esm/strategy/hw/transport/transport-no-init.js +0 -7
  83. package/dist/esm/strategy/hw/transport/transport-no-init.js.map +0 -1
  84. package/dist/esm/types.d.ts +0 -12
  85. package/dist/esm/types.d.ts.map +0 -1
  86. package/dist/esm/types.js +0 -7
  87. package/dist/esm/types.js.map +0 -1
  88. package/dist/esm/utils.d.ts +0 -17
  89. package/dist/esm/utils.d.ts.map +0 -1
  90. package/dist/esm/utils.js +0 -31
  91. package/dist/esm/utils.js.map +0 -1
@@ -1,13 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.BaseTrezorTransport = exports.TrezorTransportNoInit = exports.TrezorTransportInit = void 0;
7
- const transport_init_js_1 = __importDefault(require("./transport/transport-init.js"));
8
- exports.TrezorTransportInit = transport_init_js_1.default;
9
- const transport_no_init_js_1 = __importDefault(require("./transport/transport-no-init.js"));
10
- exports.TrezorTransportNoInit = transport_no_init_js_1.default;
11
- const base_js_1 = __importDefault(require("./transport/base.js"));
12
- exports.BaseTrezorTransport = base_js_1.default;
13
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/strategy/hw/index.ts"],"names":[],"mappings":";;;;;;AAAA,sFAA+D;AAItD,8BAJF,2BAAmB,CAIE;AAH5B,4FAAoE;AAGtC,gCAHvB,8BAAqB,CAGuB;AAFnD,kEAAqD;AAEA,8BAF9C,iBAAmB,CAE8C"}
@@ -1,7 +0,0 @@
1
- import AccountManager from './../AccountManager.js';
2
- export default class BaseTrezorTransport {
3
- private accountManager;
4
- connect(): Promise<void>;
5
- getAccountManager(): Promise<AccountManager>;
6
- }
7
- //# sourceMappingURL=base.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../../src/strategy/hw/transport/base.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,wBAAwB,CAAA;AAEnD,MAAM,CAAC,OAAO,OAAO,mBAAmB;IACtC,OAAO,CAAC,cAAc,CAA8B;IAE9C,OAAO;IAIP,iBAAiB,IAAI,OAAO,CAAC,cAAc,CAAC;CAOnD"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const AccountManager_js_1 = __importDefault(require("./../AccountManager.js"));
7
- class BaseTrezorTransport {
8
- accountManager = null;
9
- async connect() {
10
- return Promise.resolve();
11
- }
12
- async getAccountManager() {
13
- if (!this.accountManager) {
14
- this.accountManager = new AccountManager_js_1.default();
15
- }
16
- return this.accountManager;
17
- }
18
- }
19
- exports.default = BaseTrezorTransport;
20
- //# sourceMappingURL=base.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../src/strategy/hw/transport/base.ts"],"names":[],"mappings":";;;;;AAAA,+EAAmD;AAEnD,MAAqB,mBAAmB;IAC9B,cAAc,GAA0B,IAAI,CAAA;IAEpD,KAAK,CAAC,OAAO;QACX,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC;IAED,KAAK,CAAC,iBAAiB;QACrB,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YACzB,IAAI,CAAC,cAAc,GAAG,IAAI,2BAAc,EAAE,CAAA;QAC5C,CAAC;QAED,OAAO,IAAI,CAAC,cAAc,CAAA;IAC5B,CAAC;CACF;AAdD,sCAcC"}
@@ -1,5 +0,0 @@
1
- import BaseTrezorTransport from './base.js';
2
- export default class TrezorTransportInit extends BaseTrezorTransport {
3
- constructor();
4
- }
5
- //# sourceMappingURL=transport-init.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transport-init.d.ts","sourceRoot":"","sources":["../../../../../src/strategy/hw/transport/transport-init.ts"],"names":[],"mappings":"AAEA,OAAO,mBAAmB,MAAM,WAAW,CAAA;AAO3C,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,mBAAmB;;CAanE"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const trezor_connect_web_1 = require("@bangjelkoski/trezor-connect-web");
7
- const exceptions_1 = require("@injectivelabs/exceptions");
8
- const base_js_1 = __importDefault(require("./base.js"));
9
- const TREZOR_CONNECT_MANIFEST = {
10
- email: 'contact@injectivelabs.org',
11
- appUrl: 'https://injectivelabs.org',
12
- };
13
- class TrezorTransportInit extends base_js_1.default {
14
- constructor() {
15
- super();
16
- try {
17
- trezor_connect_web_1.TrezorConnect.init({
18
- lazyLoad: true,
19
- manifest: TREZOR_CONNECT_MANIFEST,
20
- });
21
- }
22
- catch (e) {
23
- throw new exceptions_1.WalletException(e);
24
- }
25
- }
26
- }
27
- exports.default = TrezorTransportInit;
28
- //# sourceMappingURL=transport-init.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transport-init.js","sourceRoot":"","sources":["../../../../../src/strategy/hw/transport/transport-init.ts"],"names":[],"mappings":";;;;;AAAA,yEAAgE;AAChE,0DAA2D;AAC3D,wDAA2C;AAE3C,MAAM,uBAAuB,GAAG;IAC9B,KAAK,EAAE,2BAA2B;IAClC,MAAM,EAAE,2BAA2B;CACpC,CAAA;AAED,MAAqB,mBAAoB,SAAQ,iBAAmB;IAClE;QACE,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC;YACH,kCAAa,CAAC,IAAI,CAAC;gBACjB,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,uBAAuB;aAClC,CAAC,CAAA;QACJ,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,IAAI,4BAAe,CAAC,CAAU,CAAC,CAAA;QACvC,CAAC;IACH,CAAC;CACF;AAbD,sCAaC"}
@@ -1,5 +0,0 @@
1
- import BaseTrezorTransport from './base.js';
2
- export default class TrezorTransportNoInit extends BaseTrezorTransport {
3
- constructor();
4
- }
5
- //# sourceMappingURL=transport-no-init.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transport-no-init.d.ts","sourceRoot":"","sources":["../../../../../src/strategy/hw/transport/transport-no-init.ts"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,MAAM,WAAW,CAAA;AAE3C,MAAM,CAAC,OAAO,OAAO,qBAAsB,SAAQ,mBAAmB;;CAIrE"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const base_js_1 = __importDefault(require("./base.js"));
7
- class TrezorTransportNoInit extends base_js_1.default {
8
- constructor() {
9
- super();
10
- }
11
- }
12
- exports.default = TrezorTransportNoInit;
13
- //# sourceMappingURL=transport-no-init.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"transport-no-init.js","sourceRoot":"","sources":["../../../../../src/strategy/hw/transport/transport-no-init.ts"],"names":[],"mappings":";;;;;AAAA,wDAA2C;AAE3C,MAAqB,qBAAsB,SAAQ,iBAAmB;IACpE;QACE,KAAK,EAAE,CAAA;IACT,CAAC;CACF;AAJD,wCAIC"}
@@ -1,12 +0,0 @@
1
- import type HDNode from 'hdkey';
2
- export declare enum TrezorDerivationPathType {
3
- Bip32 = "bip32",
4
- Bip44 = "bip44",
5
- Legacy = "legacy"
6
- }
7
- export interface TrezorWalletInfo {
8
- address: string;
9
- hdKey: HDNode;
10
- derivationPath: string;
11
- }
12
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,OAAO,CAAA;AAE/B,oBAAY,wBAAwB;IAClC,KAAK,UAAU;IACf,KAAK,UAAU;IACf,MAAM,WAAW;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,EAAE,MAAM,CAAA;CACvB"}
package/dist/cjs/types.js DELETED
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TrezorDerivationPathType = void 0;
4
- var TrezorDerivationPathType;
5
- (function (TrezorDerivationPathType) {
6
- TrezorDerivationPathType["Bip32"] = "bip32";
7
- TrezorDerivationPathType["Bip44"] = "bip44";
8
- TrezorDerivationPathType["Legacy"] = "legacy";
9
- })(TrezorDerivationPathType || (exports.TrezorDerivationPathType = TrezorDerivationPathType = {}));
10
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAEA,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,2CAAe,CAAA;IACf,2CAAe,CAAA;IACf,6CAAiB,CAAA;AACnB,CAAC,EAJW,wBAAwB,wCAAxB,wBAAwB,QAInC"}
@@ -1,17 +0,0 @@
1
- import { type TypedMessageV4 } from '@injectivelabs/sdk-ts';
2
- /**
3
- * Calculates the domain_separator_hash and message_hash from an EIP-712 Typed Data object.
4
- *
5
- * The Trezor Model 1 does not currently support constructing the hash on the device,
6
- * so this function pre-computes them.
7
- *
8
- * @template {TypedMessage} T
9
- * @param {T} data - The EIP-712 Typed Data object.
10
- * @param {boolean} metamask_v4_compat - Set to `true` for compatibility with Metamask's signTypedData_v4 function.
11
- * @returns {{domain_separator_hash: string, message_hash?: string} & T} The hashes.
12
- */
13
- export declare const transformTypedData: <T extends TypedMessageV4>(data: T, metamask_v4_compat?: boolean) => {
14
- domain_separator_hash: string;
15
- message_hash?: string;
16
- } & T;
17
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,cAAc,EAIpB,MAAM,uBAAuB,CAAA;AAE9B;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,cAAc,EACzD,MAAM,CAAC,EACP,qBAAoB,OAAc,KACjC;IAAE,qBAAqB,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,CAmC7D,CAAA"}
package/dist/cjs/utils.js DELETED
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.transformTypedData = void 0;
4
- const exceptions_1 = require("@injectivelabs/exceptions");
5
- const sdk_ts_1 = require("@injectivelabs/sdk-ts");
6
- /**
7
- * Calculates the domain_separator_hash and message_hash from an EIP-712 Typed Data object.
8
- *
9
- * The Trezor Model 1 does not currently support constructing the hash on the device,
10
- * so this function pre-computes them.
11
- *
12
- * @template {TypedMessage} T
13
- * @param {T} data - The EIP-712 Typed Data object.
14
- * @param {boolean} metamask_v4_compat - Set to `true` for compatibility with Metamask's signTypedData_v4 function.
15
- * @returns {{domain_separator_hash: string, message_hash?: string} & T} The hashes.
16
- */
17
- const transformTypedData = (data, metamask_v4_compat = true) => {
18
- if (!metamask_v4_compat) {
19
- throw new exceptions_1.TrezorException(new Error('Trezor: Only version 4 of typed data signing is supported'));
20
- }
21
- const version = sdk_ts_1.SignTypedDataVersionV4;
22
- const { types, primaryType, domain, message } = (0, sdk_ts_1.TypedDataUtilsSanitizeData)(data);
23
- const domainSeparatorHash = (0, sdk_ts_1.TypedDataUtilsHashStruct)('EIP712Domain', (0, sdk_ts_1.sanitizeTypedData)(domain), types, version).toString('hex');
24
- let messageHash = null;
25
- if (primaryType !== 'EIP712Domain') {
26
- messageHash = (0, sdk_ts_1.TypedDataUtilsHashStruct)(primaryType, (0, sdk_ts_1.sanitizeTypedData)(message), types, version).toString('hex');
27
- }
28
- return {
29
- domain_separator_hash: domainSeparatorHash,
30
- message_hash: messageHash,
31
- ...data,
32
- };
33
- };
34
- exports.transformTypedData = transformTypedData;
35
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;;AAAA,0DAA2D;AAC3D,kDAM8B;AAE9B;;;;;;;;;;GAUG;AACI,MAAM,kBAAkB,GAAG,CAChC,IAAO,EACP,qBAA8B,IAAI,EAC4B,EAAE;IAChE,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxB,MAAM,IAAI,4BAAe,CACvB,IAAI,KAAK,CAAC,2DAA2D,CAAC,CACvE,CAAA;IACH,CAAC;IAED,MAAM,OAAO,GAAG,+BAAsB,CAAA;IAEtC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,GAC3C,IAAA,mCAA0B,EAAC,IAAI,CAAC,CAAA;IAElC,MAAM,mBAAmB,GAAG,IAAA,iCAAwB,EAClD,cAAc,EACd,IAAA,0BAAiB,EAAC,MAAM,CAAC,EACzB,KAAK,EACL,OAAO,CACR,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IAEjB,IAAI,WAAW,GAAG,IAAI,CAAA;IAEtB,IAAI,WAAW,KAAK,cAAc,EAAE,CAAC;QACnC,WAAW,GAAG,IAAA,iCAAwB,EACpC,WAAqB,EACrB,IAAA,0BAAiB,EAAC,OAAO,CAAC,EAC1B,KAAK,EACL,OAAO,CACR,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;IACnB,CAAC;IAED,OAAO;QACL,qBAAqB,EAAE,mBAAmB;QAC1C,YAAY,EAAE,WAAqB;QACnC,GAAG,IAAI;KACR,CAAA;AACH,CAAC,CAAA;AAtCY,QAAA,kBAAkB,sBAsC9B"}
@@ -1,4 +0,0 @@
1
- export { TrezorBip32 as TrezorBip32Strategy } from './strategy/TrezorBip32.js';
2
- export { TrezorBip44 as TrezorBip44Strategy } from './strategy/TrezorBip44.js';
3
- export * from './types.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,EAAE,WAAW,IAAI,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAE9E,cAAc,YAAY,CAAA"}
package/dist/esm/index.js DELETED
@@ -1,4 +0,0 @@
1
- export { TrezorBip32 as TrezorBip32Strategy } from './strategy/TrezorBip32.js';
2
- export { TrezorBip44 as TrezorBip44Strategy } from './strategy/TrezorBip44.js';
3
- export * from './types.js';
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAC9E,OAAO,EAAE,WAAW,IAAI,mBAAmB,EAAE,MAAM,2BAA2B,CAAA;AAE9E,cAAc,YAAY,CAAA"}
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }
@@ -1,43 +0,0 @@
1
- import { AccountAddress, EthereumChainId } from '@injectivelabs/ts-types';
2
- import { TxRaw, TxResponse, DirectSignResponse, AminoSignResponse } from '@injectivelabs/sdk-ts';
3
- import { StdSignDoc, WalletDeviceType, BaseConcreteStrategy, ConcreteWalletStrategy, SendTransactionOptions, ConcreteEthereumWalletStrategyArgs } from '@injectivelabs/wallet-base';
4
- import { TrezorDerivationPathType } from '../types.js';
5
- export default class TrezorBase extends BaseConcreteStrategy implements ConcreteWalletStrategy {
6
- private baseDerivationPath;
7
- private trezor;
8
- private ethereumOptions;
9
- private alchemy;
10
- private derivationPathType;
11
- constructor(args: ConcreteEthereumWalletStrategyArgs & {
12
- derivationPathType: TrezorDerivationPathType;
13
- });
14
- getWalletDeviceType(): Promise<WalletDeviceType>;
15
- enable(): Promise<boolean>;
16
- disconnect(): Promise<void>;
17
- getAddresses(): Promise<string[]>;
18
- getSessionOrConfirm(address: AccountAddress): Promise<string>;
19
- sendEthereumTransaction(txData: any, options: {
20
- address: string;
21
- ethereumChainId: EthereumChainId;
22
- }): Promise<string>;
23
- sendTransaction(transaction: TxRaw, options: SendTransactionOptions): Promise<TxResponse>;
24
- signEip712TypedData(eip712json: string, address: AccountAddress): Promise<string>;
25
- signAminoCosmosTransaction(_transaction: {
26
- address: string;
27
- signDoc: StdSignDoc;
28
- }): Promise<AminoSignResponse>;
29
- signCosmosTransaction(_transaction: {
30
- txRaw: TxRaw;
31
- accountNumber: number;
32
- chainId: string;
33
- address: string;
34
- }): Promise<DirectSignResponse>;
35
- signArbitrary(signer: AccountAddress, data: string | Uint8Array): Promise<string>;
36
- getEthereumChainId(): Promise<string>;
37
- getEthereumTransactionReceipt(txHash: string): Promise<string>;
38
- getPubKey(): Promise<string>;
39
- private signEthereumTransaction;
40
- private getWalletForAddress;
41
- private getAlchemy;
42
- }
43
- //# sourceMappingURL=Base.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Base.d.ts","sourceRoot":"","sources":["../../../src/strategy/Base.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAczE,OAAO,EACL,KAAK,EAGL,UAAU,EACV,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,UAAU,EAIV,gBAAgB,EAChB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EAKtB,kCAAkC,EACnC,MAAM,4BAA4B,CAAA;AAGnC,OAAO,EAAE,wBAAwB,EAAoB,MAAM,aAAa,CAAA;AA8BxE,MAAM,CAAC,OAAO,OAAO,UACnB,SAAQ,oBACR,YAAW,sBAAsB;IAEjC,OAAO,CAAC,kBAAkB,CAAQ;IAElC,OAAO,CAAC,MAAM,CAAqB;IAEnC,OAAO,CAAC,eAAe,CAA+B;IAEtD,OAAO,CAAC,OAAO,CAAqB;IAEpC,OAAO,CAAC,kBAAkB,CAA0B;gBAGlD,IAAI,EAAE,kCAAkC,GAAG;QACzC,kBAAkB,EAAE,wBAAwB,CAAA;KAC7C;IAUG,mBAAmB,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAIhD,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC;IAInB,UAAU;IAIV,YAAY,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAqBxC,mBAAmB,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;IAQ7D,uBAAuB,CAC3B,MAAM,EAAE,GAAG,EACX,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,eAAe,EAAE,eAAe,CAAA;KAAE,GAC7D,OAAO,CAAC,MAAM,CAAC;IAsBZ,eAAe,CACnB,WAAW,EAAE,KAAK,EAClB,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,UAAU,CAAC;IAyBhB,mBAAmB,CACvB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,MAAM,CAAC;IAqDZ,0BAA0B,CAAC,YAAY,EAAE;QAC7C,OAAO,EAAE,MAAM,CAAA;QACf,OAAO,EAAE,UAAU,CAAA;KACpB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAYxB,qBAAqB,CAAC,YAAY,EAAE;QACxC,KAAK,EAAE,KAAK,CAAA;QACZ,aAAa,EAAE,MAAM,CAAA;QACrB,OAAO,EAAE,MAAM,CAAA;QACf,OAAO,EAAE,MAAM,CAAA;KAChB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAWzB,aAAa,CACjB,MAAM,EAAE,cAAc,EACtB,IAAI,EAAE,MAAM,GAAG,UAAU,GACxB,OAAO,CAAC,MAAM,CAAC;IA0BZ,kBAAkB,IAAI,OAAO,CAAC,MAAM,CAAC;IAOrC,6BAA6B,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAK9D,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;YAMpB,uBAAuB;YA+EvB,mBAAmB;YA2BnB,UAAU;CAuBzB"}
@@ -1,278 +0,0 @@
1
- /* eslint-disable camelcase */
2
- /* eslint-disable class-methods-use-this */
3
- import { EthereumChainId } from '@injectivelabs/ts-types';
4
- import { Alchemy, Network as AlchemyNetwork } from 'alchemy-sdk';
5
- import { addHexPrefix } from 'ethereumjs-util';
6
- import { FeeMarketEIP1559Transaction } from '@ethereumjs/tx';
7
- import { Common, Chain, Hardfork } from '@ethereumjs/common';
8
- import { TrezorConnect } from '@bangjelkoski/trezor-connect-web';
9
- import { ErrorType, WalletException, TrezorException, GeneralException, TransactionException, UnspecifiedErrorCode, } from '@injectivelabs/exceptions';
10
- import { toUtf8, TxGrpcApi, } from '@injectivelabs/sdk-ts';
11
- import { TIP_IN_GWEI, WalletAction, getKeyFromRpcUrl, WalletDeviceType, BaseConcreteStrategy, DEFAULT_BASE_DERIVATION_PATH, DEFAULT_ADDRESS_SEARCH_LIMIT, DEFAULT_NUM_ADDRESSES_TO_FETCH, } from '@injectivelabs/wallet-base';
12
- import { TrezorTransportInit } from './hw/index.js';
13
- import { transformTypedData } from '../utils.js';
14
- const getNetworkFromChainId = (chainId) => {
15
- if (chainId === EthereumChainId.Goerli) {
16
- return Chain.Goerli;
17
- }
18
- if (chainId === EthereumChainId.Sepolia) {
19
- return Chain.Sepolia;
20
- }
21
- if (chainId === EthereumChainId.Kovan) {
22
- return Chain.Goerli;
23
- }
24
- return Chain.Mainnet;
25
- };
26
- export default class TrezorBase extends BaseConcreteStrategy {
27
- baseDerivationPath;
28
- trezor;
29
- ethereumOptions;
30
- alchemy;
31
- derivationPathType;
32
- constructor(args) {
33
- super(args);
34
- this.baseDerivationPath = DEFAULT_BASE_DERIVATION_PATH;
35
- this.derivationPathType = args.derivationPathType;
36
- this.trezor = new TrezorTransportInit();
37
- this.ethereumOptions = args.ethereumOptions;
38
- }
39
- async getWalletDeviceType() {
40
- return Promise.resolve(WalletDeviceType.Hardware);
41
- }
42
- async enable() {
43
- return Promise.resolve(true);
44
- }
45
- async disconnect() {
46
- return Promise.resolve();
47
- }
48
- async getAddresses() {
49
- const { baseDerivationPath, derivationPathType } = this;
50
- try {
51
- await this.trezor.connect();
52
- const accountManager = await this.trezor.getAccountManager();
53
- const wallets = await accountManager.getWallets(baseDerivationPath, derivationPathType);
54
- return wallets.map((k) => k.address);
55
- }
56
- catch (e) {
57
- throw new TrezorException(new Error(e.message), {
58
- code: UnspecifiedErrorCode,
59
- type: ErrorType.WalletError,
60
- contextModule: WalletAction.GetAccounts,
61
- });
62
- }
63
- }
64
- async getSessionOrConfirm(address) {
65
- return Promise.resolve(`0x${Buffer.from(`Confirmation for ${address} at time: ${Date.now()}`).toString('hex')}`);
66
- }
67
- async sendEthereumTransaction(txData, options) {
68
- const signedTransaction = await this.signEthereumTransaction(txData, options);
69
- try {
70
- const alchemy = await this.getAlchemy();
71
- const txReceipt = await alchemy.core.sendTransaction(addHexPrefix(signedTransaction.serialize().toString('hex')));
72
- return txReceipt.hash;
73
- }
74
- catch (e) {
75
- throw new TrezorException(new Error(e.message), {
76
- code: UnspecifiedErrorCode,
77
- type: ErrorType.WalletError,
78
- contextModule: WalletAction.SendEthereumTransaction,
79
- });
80
- }
81
- }
82
- async sendTransaction(transaction, options) {
83
- const { endpoints, txTimeout } = options;
84
- if (!endpoints) {
85
- throw new WalletException(new Error('You have to pass endpoints.grpc within the options for using Ethereum native wallets'));
86
- }
87
- const txApi = new TxGrpcApi(endpoints.grpc);
88
- const response = await txApi.broadcast(transaction, { txTimeout });
89
- if (response.code !== 0) {
90
- throw new TransactionException(new Error(response.rawLog), {
91
- code: UnspecifiedErrorCode,
92
- contextCode: response.code,
93
- contextModule: response.codespace,
94
- });
95
- }
96
- return response;
97
- }
98
- async signEip712TypedData(eip712json, address) {
99
- const object = JSON.parse(eip712json);
100
- const compatibleObject = {
101
- ...object,
102
- domain: {
103
- ...object.domain,
104
- chainId: object.domain.chainId,
105
- salt: '0',
106
- },
107
- };
108
- const dataWithHashes = transformTypedData(compatibleObject);
109
- const { types: { EIP712Domain = [], ...otherTypes } = {}, message = {}, domain = {}, primaryType, domain_separator_hash, message_hash, } = dataWithHashes;
110
- try {
111
- await this.trezor.connect();
112
- const { derivationPath } = await this.getWalletForAddress(address);
113
- const response = await TrezorConnect.ethereumSignTypedData({
114
- path: derivationPath,
115
- data: {
116
- types: { EIP712Domain, ...otherTypes },
117
- message,
118
- domain,
119
- primaryType,
120
- },
121
- message_hash,
122
- domain_separator_hash,
123
- metamask_v4_compat: true,
124
- });
125
- if (!response.success) {
126
- // noinspection ExceptionCaughtLocallyJS
127
- throw new Error((response.payload && response.payload.error) || 'Unknown error');
128
- }
129
- return response.payload.signature;
130
- }
131
- catch (e) {
132
- throw new TrezorException(new Error(e.message), {
133
- code: UnspecifiedErrorCode,
134
- type: ErrorType.WalletError,
135
- contextModule: WalletAction.SignTransaction,
136
- });
137
- }
138
- }
139
- async signAminoCosmosTransaction(_transaction) {
140
- throw new WalletException(new Error('This wallet does not support signing Cosmos transactions'), {
141
- code: UnspecifiedErrorCode,
142
- type: ErrorType.WalletError,
143
- contextModule: WalletAction.SendTransaction,
144
- });
145
- }
146
- // eslint-disable-next-line class-methods-use-this
147
- async signCosmosTransaction(_transaction) {
148
- throw new WalletException(new Error('This wallet does not support signing Cosmos transactions'), {
149
- code: UnspecifiedErrorCode,
150
- type: ErrorType.WalletError,
151
- contextModule: WalletAction.SendTransaction,
152
- });
153
- }
154
- async signArbitrary(signer, data) {
155
- try {
156
- await this.trezor.connect();
157
- const { derivationPath } = await this.getWalletForAddress(signer);
158
- const response = await TrezorConnect.ethereumSignMessage({
159
- path: derivationPath,
160
- message: toUtf8(data),
161
- });
162
- if (!response.success) {
163
- throw new Error((response.payload && response.payload.error) || 'Unknown error');
164
- }
165
- return response.payload.signature;
166
- }
167
- catch (e) {
168
- throw new TrezorException(new Error(e.message), {
169
- code: UnspecifiedErrorCode,
170
- type: ErrorType.WalletError,
171
- contextModule: WalletAction.SignTransaction,
172
- });
173
- }
174
- }
175
- async getEthereumChainId() {
176
- const alchemy = await this.getAlchemy();
177
- const alchemyProvider = await alchemy.config.getProvider();
178
- return alchemyProvider.network.chainId.toString();
179
- }
180
- async getEthereumTransactionReceipt(txHash) {
181
- return Promise.resolve(txHash);
182
- }
183
- // eslint-disable-next-line class-methods-use-this
184
- async getPubKey() {
185
- throw new WalletException(new Error('You can only fetch PubKey from Cosmos native wallets'));
186
- }
187
- async signEthereumTransaction(txData, options) {
188
- const chainId = parseInt(options.ethereumChainId.toString(), 10);
189
- const alchemy = await this.getAlchemy();
190
- const nonce = await alchemy.core.getTransactionCount(options.address);
191
- const common = new Common({
192
- chain: getNetworkFromChainId(chainId),
193
- hardfork: Hardfork.London,
194
- });
195
- const eip1559TxData = {
196
- from: txData.from,
197
- data: txData.data,
198
- to: txData.to,
199
- nonce: addHexPrefix(nonce.toString(16)),
200
- gas: addHexPrefix(txData.gas),
201
- gasLimit: addHexPrefix(txData.gas),
202
- maxFeePerGas: addHexPrefix(txData.gasPrice || txData.maxFeePerGas),
203
- maxPriorityFeePerGas: addHexPrefix(txData.maxPriorityFeePerGas || TIP_IN_GWEI.toString(16)),
204
- };
205
- const tx = FeeMarketEIP1559Transaction.fromTxData(eip1559TxData, {
206
- common,
207
- });
208
- const transaction = {
209
- ...tx.toJSON(),
210
- chainId,
211
- };
212
- try {
213
- await this.trezor.connect();
214
- const { derivationPath } = await this.getWalletForAddress(options.address);
215
- const response = await TrezorConnect.ethereumSignTransaction({
216
- path: derivationPath,
217
- transaction,
218
- });
219
- if (!response.success) {
220
- throw new TrezorException(new Error((response.payload && response.payload.error) ||
221
- 'Something happened while signing with Trezor'), {
222
- code: UnspecifiedErrorCode,
223
- type: ErrorType.WalletError,
224
- contextModule: WalletAction.SignEthereumTransaction,
225
- });
226
- }
227
- const signedTxData = {
228
- ...eip1559TxData,
229
- v: `${response.payload.v}`,
230
- r: `${response.payload.r}`,
231
- s: `${response.payload.s}`,
232
- };
233
- return FeeMarketEIP1559Transaction.fromTxData(signedTxData, {
234
- common,
235
- });
236
- }
237
- catch (e) {
238
- if (e instanceof TrezorException) {
239
- throw e;
240
- }
241
- throw new TrezorException(new Error(e.message), {
242
- code: UnspecifiedErrorCode,
243
- type: ErrorType.WalletError,
244
- contextModule: WalletAction.SignEthereumTransaction,
245
- });
246
- }
247
- }
248
- async getWalletForAddress(address) {
249
- const { baseDerivationPath, derivationPathType } = this;
250
- const accountManager = await this.trezor.getAccountManager();
251
- if (!accountManager.hasWalletForAddress(address)) {
252
- for (let i = 0; i < DEFAULT_ADDRESS_SEARCH_LIMIT / DEFAULT_NUM_ADDRESSES_TO_FETCH; i += 1) {
253
- await accountManager.getWallets(baseDerivationPath, derivationPathType);
254
- if (accountManager.hasWalletForAddress(address)) {
255
- return (await accountManager.getWalletForAddress(address));
256
- }
257
- }
258
- }
259
- return (await accountManager.getWalletForAddress(address));
260
- }
261
- async getAlchemy() {
262
- if (this.alchemy) {
263
- return this.alchemy;
264
- }
265
- const { rpcUrl, ethereumChainId } = this.ethereumOptions;
266
- if (!rpcUrl) {
267
- throw new GeneralException(new Error('Please pass rpcUrl within the ethereumOptions'));
268
- }
269
- this.alchemy = new Alchemy({
270
- apiKey: getKeyFromRpcUrl(rpcUrl),
271
- network: ethereumChainId === EthereumChainId.Mainnet
272
- ? AlchemyNetwork.ETH_MAINNET
273
- : AlchemyNetwork.ETH_SEPOLIA,
274
- });
275
- return this.alchemy;
276
- }
277
- }
278
- //# sourceMappingURL=Base.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Base.js","sourceRoot":"","sources":["../../../src/strategy/Base.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAC9B,2CAA2C;AAC3C,OAAO,EAAkB,eAAe,EAAE,MAAM,yBAAyB,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAA;AAChE,OAAO,EACL,SAAS,EACT,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,GACrB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAEL,MAAM,EACN,SAAS,GAIV,MAAM,uBAAuB,CAAA;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AAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAC;oBAChD,OAAO,CAAC,MAAM,cAAc,CAAC,mBAAmB,CAC9C,OAAO,CACR,CAAqB,CAAA;gBACxB,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,CAAC,MAAM,cAAc,CAAC,mBAAmB,CAC9C,OAAO,CACR,CAAqB,CAAA;IACxB,CAAC;IAEO,KAAK,CAAC,UAAU;QACtB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjB,OAAO,IAAI,CAAC,OAAO,CAAA;QACrB,CAAC;QAED,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC,eAAe,CAAA;QAExD,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,IAAI,gBAAgB,CACxB,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAC3D,CAAA;QACH,CAAC;QAED,IAAI,CAAC,OAAO,GAAG,IAAI,OAAO,CAAC;YACzB,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC;YAChC,OAAO,EACL,eAAe,KAAK,eAAe,CAAC,OAAO;gBACzC,CAAC,CAAC,cAAc,CAAC,WAAW;gBAC5B,CAAC,CAAC,cAAc,CAAC,WAAW;SACjC,CAAC,CAAA;QAEF,OAAO,IAAI,CAAC,OAAO,CAAA;IACrB,CAAC;CACF"}
@@ -1,6 +0,0 @@
1
- import { ConcreteEthereumWalletStrategyArgs } from '@injectivelabs/wallet-base';
2
- import TrezorBase from './Base.js';
3
- export declare class TrezorBip32 extends TrezorBase {
4
- constructor(args: ConcreteEthereumWalletStrategyArgs);
5
- }
6
- //# sourceMappingURL=TrezorBip32.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TrezorBip32.d.ts","sourceRoot":"","sources":["../../../src/strategy/TrezorBip32.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kCAAkC,EAAE,MAAM,4BAA4B,CAAA;AAE/E,OAAO,UAAU,MAAM,WAAW,CAAA;AAElC,qBAAa,WAAY,SAAQ,UAAU;gBAC7B,IAAI,EAAE,kCAAkC;CAMrD"}
@@ -1,11 +0,0 @@
1
- import { TrezorDerivationPathType } from '../types.js';
2
- import TrezorBase from './Base.js';
3
- export class TrezorBip32 extends TrezorBase {
4
- constructor(args) {
5
- super({
6
- ...args,
7
- derivationPathType: TrezorDerivationPathType.Bip32,
8
- });
9
- }
10
- }
11
- //# sourceMappingURL=TrezorBip32.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TrezorBip32.js","sourceRoot":"","sources":["../../../src/strategy/TrezorBip32.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,UAAU,MAAM,WAAW,CAAA;AAElC,MAAM,OAAO,WAAY,SAAQ,UAAU;IACzC,YAAY,IAAwC;QAClD,KAAK,CAAC;YACJ,GAAG,IAAI;YACP,kBAAkB,EAAE,wBAAwB,CAAC,KAAK;SACnD,CAAC,CAAA;IACJ,CAAC;CACF"}
@@ -1,6 +0,0 @@
1
- import { ConcreteEthereumWalletStrategyArgs } from '@injectivelabs/wallet-base';
2
- import TrezorBase from './Base.js';
3
- export declare class TrezorBip44 extends TrezorBase {
4
- constructor(args: ConcreteEthereumWalletStrategyArgs);
5
- }
6
- //# sourceMappingURL=TrezorBip44.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TrezorBip44.d.ts","sourceRoot":"","sources":["../../../src/strategy/TrezorBip44.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kCAAkC,EAAE,MAAM,4BAA4B,CAAA;AAE/E,OAAO,UAAU,MAAM,WAAW,CAAA;AAElC,qBAAa,WAAY,SAAQ,UAAU;gBAC7B,IAAI,EAAE,kCAAkC;CAMrD"}