@injectivelabs/wallet-trezor 1.16.34 → 1.16.35-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.
@@ -113,6 +113,7 @@ class TrezorBase extends wallet_base_1.BaseConcreteStrategy {
113
113
  domain_separator_hash,
114
114
  metamask_v4_compat: true,
115
115
  });
116
+ console.log('🪵response', response);
116
117
  if (!response.success) {
117
118
  // noinspection ExceptionCaughtLocallyJS
118
119
  throw new Error((response.payload && response.payload.error) || 'Unknown error');
@@ -3,11 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const lib_js_1 = require("../../lib.js");
7
6
  const AccountManager_js_1 = __importDefault(require("../AccountManager.js"));
7
+ const lib_js_1 = require("../../lib.js");
8
8
  const TREZOR_CONNECT_MANIFEST = {
9
9
  email: 'contact@injectivelabs.org',
10
10
  appUrl: 'https://injectivelabs.org',
11
+ appName: 'Injective Labs',
11
12
  };
12
13
  class BaseTrezorTransport {
13
14
  accountManager = null;
@@ -15,9 +16,12 @@ class BaseTrezorTransport {
15
16
  const TrezorConnect = await (0, lib_js_1.loadTrezorConnect)();
16
17
  const settings = await TrezorConnect.getSettings();
17
18
  if (!settings.success) {
18
- TrezorConnect.init({
19
+ await TrezorConnect.init({
19
20
  lazyLoad: true,
20
21
  manifest: TREZOR_CONNECT_MANIFEST,
22
+ debug: true,
23
+ // 'auto', 'popup', 'iframe'
24
+ coreMode: 'popup',
21
25
  });
22
26
  }
23
27
  return Promise.resolve();
@@ -1,3 +1,41 @@
1
- type TrezorConnectType = typeof import('@bangjelkoski/trezor-connect-web').TrezorConnect;
2
- export declare function loadTrezorConnect(): Promise<TrezorConnectType>;
3
- export {};
1
+ type Manifest = {
2
+ appName: string;
3
+ appIcon?: string;
4
+ appUrl: string;
5
+ email: string;
6
+ };
7
+ type ConnectSettingsWeb = {
8
+ hostLabel?: string;
9
+ coreMode?: 'auto' | 'popup' | 'iframe';
10
+ };
11
+ type ConnectSettingsPublic = {
12
+ manifest?: Manifest;
13
+ connectSrc?: string;
14
+ debug?: boolean;
15
+ popup?: boolean;
16
+ transportReconnect?: boolean;
17
+ transports?: Array<'BridgeTransport' | 'WebUsbTransport' | 'NodeUsbTransport'>;
18
+ pendingTransportEvent?: boolean;
19
+ lazyLoad?: boolean;
20
+ interactionTimeout?: number;
21
+ trustedHost: boolean;
22
+ binFilesBaseUrl?: string;
23
+ enableFirmwareHashCheck?: boolean;
24
+ firmwareHashCheckTimeouts?: Record<string, number>;
25
+ thp?: {
26
+ hostName?: string;
27
+ appName?: string;
28
+ staticKey?: string;
29
+ knownCredentials?: unknown[];
30
+ pairingMethods: unknown[];
31
+ };
32
+ };
33
+ type InitSettingsWithWeb = {
34
+ manifest: Manifest;
35
+ } & Partial<Omit<ConnectSettingsPublic, 'manifest'> & ConnectSettingsWeb>;
36
+ export type { Manifest };
37
+ export type TrezorConnectWithWebSettings = {
38
+ init: (settings: InitSettingsWithWeb) => Promise<void>;
39
+ [key: string]: any;
40
+ };
41
+ export declare function loadTrezorConnect(): Promise<TrezorConnectWithWebSettings>;
@@ -1,4 +1,7 @@
1
1
  "use strict";
2
+ // We avoid importing types from @trezor/connect because it triggers a syntax error
3
+ // in the underlying @trezor/connect type definitions (there's a typo: comma instead of space).
4
+ // Instead, we define the minimal types we need inline.
2
5
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
6
  if (k2 === undefined) k2 = k;
4
7
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -34,12 +37,8 @@ var __importStar = (this && this.__importStar) || (function () {
34
37
  })();
35
38
  Object.defineProperty(exports, "__esModule", { value: true });
36
39
  exports.loadTrezorConnect = loadTrezorConnect;
37
- let TrezorConnect;
38
40
  async function loadTrezorConnect() {
39
- if (!TrezorConnect) {
40
- const module = await Promise.resolve().then(() => __importStar(require('@bangjelkoski/trezor-connect-web')));
41
- TrezorConnect = (module.TrezorConnect ||
42
- module.default.TrezorConnect);
43
- }
44
- return TrezorConnect;
41
+ const module = await Promise.resolve().then(() => __importStar(require('@trezor/connect-web')));
42
+ return (module?.default
43
+ ?.default || module.default);
45
44
  }
@@ -111,6 +111,7 @@ export default class TrezorBase extends BaseConcreteStrategy {
111
111
  domain_separator_hash,
112
112
  metamask_v4_compat: true,
113
113
  });
114
+ console.log('🪵response', response);
114
115
  if (!response.success) {
115
116
  // noinspection ExceptionCaughtLocallyJS
116
117
  throw new Error((response.payload && response.payload.error) || 'Unknown error');
@@ -1,8 +1,9 @@
1
- import { loadTrezorConnect } from '../../lib.js';
2
1
  import AccountManager from '../AccountManager.js';
2
+ import { loadTrezorConnect } from '../../lib.js';
3
3
  const TREZOR_CONNECT_MANIFEST = {
4
4
  email: 'contact@injectivelabs.org',
5
5
  appUrl: 'https://injectivelabs.org',
6
+ appName: 'Injective Labs',
6
7
  };
7
8
  export default class BaseTrezorTransport {
8
9
  accountManager = null;
@@ -10,9 +11,12 @@ export default class BaseTrezorTransport {
10
11
  const TrezorConnect = await loadTrezorConnect();
11
12
  const settings = await TrezorConnect.getSettings();
12
13
  if (!settings.success) {
13
- TrezorConnect.init({
14
+ await TrezorConnect.init({
14
15
  lazyLoad: true,
15
16
  manifest: TREZOR_CONNECT_MANIFEST,
17
+ debug: true,
18
+ // 'auto', 'popup', 'iframe'
19
+ coreMode: 'popup',
16
20
  });
17
21
  }
18
22
  return Promise.resolve();
@@ -1,3 +1,41 @@
1
- type TrezorConnectType = typeof import('@bangjelkoski/trezor-connect-web').TrezorConnect;
2
- export declare function loadTrezorConnect(): Promise<TrezorConnectType>;
3
- export {};
1
+ type Manifest = {
2
+ appName: string;
3
+ appIcon?: string;
4
+ appUrl: string;
5
+ email: string;
6
+ };
7
+ type ConnectSettingsWeb = {
8
+ hostLabel?: string;
9
+ coreMode?: 'auto' | 'popup' | 'iframe';
10
+ };
11
+ type ConnectSettingsPublic = {
12
+ manifest?: Manifest;
13
+ connectSrc?: string;
14
+ debug?: boolean;
15
+ popup?: boolean;
16
+ transportReconnect?: boolean;
17
+ transports?: Array<'BridgeTransport' | 'WebUsbTransport' | 'NodeUsbTransport'>;
18
+ pendingTransportEvent?: boolean;
19
+ lazyLoad?: boolean;
20
+ interactionTimeout?: number;
21
+ trustedHost: boolean;
22
+ binFilesBaseUrl?: string;
23
+ enableFirmwareHashCheck?: boolean;
24
+ firmwareHashCheckTimeouts?: Record<string, number>;
25
+ thp?: {
26
+ hostName?: string;
27
+ appName?: string;
28
+ staticKey?: string;
29
+ knownCredentials?: unknown[];
30
+ pairingMethods: unknown[];
31
+ };
32
+ };
33
+ type InitSettingsWithWeb = {
34
+ manifest: Manifest;
35
+ } & Partial<Omit<ConnectSettingsPublic, 'manifest'> & ConnectSettingsWeb>;
36
+ export type { Manifest };
37
+ export type TrezorConnectWithWebSettings = {
38
+ init: (settings: InitSettingsWithWeb) => Promise<void>;
39
+ [key: string]: any;
40
+ };
41
+ export declare function loadTrezorConnect(): Promise<TrezorConnectWithWebSettings>;
@@ -1,9 +1,8 @@
1
- let TrezorConnect;
1
+ // We avoid importing types from @trezor/connect because it triggers a syntax error
2
+ // in the underlying @trezor/connect type definitions (there's a typo: comma instead of space).
3
+ // Instead, we define the minimal types we need inline.
2
4
  export async function loadTrezorConnect() {
3
- if (!TrezorConnect) {
4
- const module = await import('@bangjelkoski/trezor-connect-web');
5
- TrezorConnect = (module.TrezorConnect ||
6
- module.default.TrezorConnect);
7
- }
8
- return TrezorConnect;
5
+ const module = await import('@trezor/connect-web');
6
+ return (module?.default
7
+ ?.default || module.default);
9
8
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@injectivelabs/wallet-trezor",
3
3
  "description": "Trezor wallet strategy for use with @injectivelabs/wallet-core.",
4
- "version": "1.16.34",
4
+ "version": "1.16.35-beta.0",
5
5
  "sideEffects": false,
6
6
  "type": "module",
7
7
  "author": {
@@ -56,16 +56,17 @@
56
56
  "start": "node dist/index.js"
57
57
  },
58
58
  "dependencies": {
59
- "@bangjelkoski/trezor-connect-web": "^9.4.7-beta.1",
60
- "@injectivelabs/exceptions": "1.16.34",
61
- "@injectivelabs/sdk-ts": "1.16.34",
62
- "@injectivelabs/ts-types": "1.16.34",
63
- "@injectivelabs/wallet-base": "1.16.34",
59
+ "@injectivelabs/exceptions": "1.16.35-beta.0",
60
+ "@injectivelabs/sdk-ts": "1.16.35-beta.0",
61
+ "@injectivelabs/ts-types": "1.16.35-beta.0",
62
+ "@injectivelabs/wallet-base": "1.16.35-beta.0",
63
+ "@trezor/connect": "^9.6.4",
64
+ "@trezor/connect-web": "^9.6.4",
64
65
  "alchemy-sdk": "^3.4.7",
65
66
  "viem": "^2.40.3"
66
67
  },
67
68
  "devDependencies": {
68
69
  "shx": "^0.3.3"
69
70
  },
70
- "gitHead": "a77a9cea69fd19e201c3c5ebf14860c7b54cc76e"
71
+ "gitHead": "bcefe1a37f70ba7f0fc7a187b338970390008049"
71
72
  }