@injectivelabs/wallet-trezor 1.16.39-alpha.1 → 1.17.2-alpha.1
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/cjs/index.cjs +12 -5
- package/dist/cjs/index.d.cts +3 -1
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.js +12 -5
- package/package.json +5 -5
package/dist/cjs/index.cjs
CHANGED
|
@@ -405,6 +405,9 @@ var TrezorBase = class extends __injectivelabs_wallet_base.BaseConcreteStrategy
|
|
|
405
405
|
this.derivationPathType = args.derivationPathType;
|
|
406
406
|
this.baseDerivationPath = __injectivelabs_wallet_base.DEFAULT_BASE_DERIVATION_PATH;
|
|
407
407
|
}
|
|
408
|
+
setMetadata(metadata) {
|
|
409
|
+
this.metadata = metadata;
|
|
410
|
+
}
|
|
408
411
|
async getWalletDeviceType() {
|
|
409
412
|
return Promise.resolve(__injectivelabs_wallet_base.WalletDeviceType.Hardware);
|
|
410
413
|
}
|
|
@@ -414,6 +417,10 @@ var TrezorBase = class extends __injectivelabs_wallet_base.BaseConcreteStrategy
|
|
|
414
417
|
async disconnect() {
|
|
415
418
|
return Promise.resolve();
|
|
416
419
|
}
|
|
420
|
+
async getDerivationPath(address) {
|
|
421
|
+
var _this$metadata;
|
|
422
|
+
return ((_this$metadata = this.metadata) === null || _this$metadata === void 0 ? void 0 : _this$metadata.derivationPath) ? this.metadata.derivationPath : (await this.getWalletForAddress(address)).derivationPath;
|
|
423
|
+
}
|
|
417
424
|
async getAddresses() {
|
|
418
425
|
const { baseDerivationPath, derivationPathType } = this;
|
|
419
426
|
try {
|
|
@@ -483,7 +490,7 @@ var TrezorBase = class extends __injectivelabs_wallet_base.BaseConcreteStrategy
|
|
|
483
490
|
});
|
|
484
491
|
try {
|
|
485
492
|
await this.trezor.connect();
|
|
486
|
-
const
|
|
493
|
+
const derivationPath = await this.getDerivationPath(address);
|
|
487
494
|
const response = await TrezorConnect.ethereumSignTypedData({
|
|
488
495
|
path: derivationPath,
|
|
489
496
|
data: {
|
|
@@ -528,7 +535,7 @@ var TrezorBase = class extends __injectivelabs_wallet_base.BaseConcreteStrategy
|
|
|
528
535
|
const TrezorConnect = await loadTrezorConnect();
|
|
529
536
|
try {
|
|
530
537
|
await this.trezor.connect();
|
|
531
|
-
const
|
|
538
|
+
const derivationPath = await this.getDerivationPath(signer);
|
|
532
539
|
const response = await TrezorConnect.ethereumSignMessage({
|
|
533
540
|
path: derivationPath,
|
|
534
541
|
message: (0, __injectivelabs_sdk_ts_utils.toUtf8)(data)
|
|
@@ -591,7 +598,7 @@ var TrezorBase = class extends __injectivelabs_wallet_base.BaseConcreteStrategy
|
|
|
591
598
|
};
|
|
592
599
|
try {
|
|
593
600
|
await this.trezor.connect();
|
|
594
|
-
const
|
|
601
|
+
const derivationPath = await this.getDerivationPath(args.address);
|
|
595
602
|
const response = await TrezorConnect.ethereumSignTransaction({
|
|
596
603
|
path: derivationPath,
|
|
597
604
|
transaction: trezorTxData
|
|
@@ -634,10 +641,10 @@ var TrezorBase = class extends __injectivelabs_wallet_base.BaseConcreteStrategy
|
|
|
634
641
|
return await accountManager.getWalletForAddress(address);
|
|
635
642
|
}
|
|
636
643
|
async getEip1193Provider() {
|
|
637
|
-
var _this$
|
|
644
|
+
var _this$metadata2;
|
|
638
645
|
return new TrezorEip1193Provider(this.trezor, {
|
|
639
646
|
chainId: this.evmOptions.evmChainId.toString(),
|
|
640
|
-
derivationPath: (_this$
|
|
647
|
+
derivationPath: (_this$metadata2 = this.metadata) === null || _this$metadata2 === void 0 ? void 0 : _this$metadata2.derivationPath
|
|
641
648
|
});
|
|
642
649
|
}
|
|
643
650
|
async getPublicClient(evmChainId) {
|
package/dist/cjs/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseConcreteStrategy, ConcreteEvmWalletStrategyArgs, ConcreteWalletStrategy, Eip1193Provider, SendTransactionOptions, StdSignDoc, WalletDeviceType } from "@injectivelabs/wallet-base";
|
|
1
|
+
import { BaseConcreteStrategy, ConcreteEvmWalletStrategyArgs, ConcreteWalletStrategy, Eip1193Provider, SendTransactionOptions, StdSignDoc, WalletDeviceType, WalletMetadata } from "@injectivelabs/wallet-base";
|
|
2
2
|
import { AccountAddress, EvmChainId } from "@injectivelabs/ts-types";
|
|
3
3
|
import { TxResponse } from "@injectivelabs/sdk-ts/core/tx";
|
|
4
4
|
import { AminoSignResponse, DirectSignResponse, TxRaw } from "@injectivelabs/sdk-ts/types";
|
|
@@ -30,9 +30,11 @@ declare class TrezorBase extends BaseConcreteStrategy implements ConcreteWalletS
|
|
|
30
30
|
constructor(args: ConcreteEvmWalletStrategyArgs & {
|
|
31
31
|
derivationPathType: TrezorDerivationPathType;
|
|
32
32
|
});
|
|
33
|
+
setMetadata(metadata: WalletMetadata): void;
|
|
33
34
|
getWalletDeviceType(): Promise<WalletDeviceType>;
|
|
34
35
|
enable(): Promise<boolean>;
|
|
35
36
|
disconnect(): Promise<void>;
|
|
37
|
+
protected getDerivationPath(address: string): Promise<string>;
|
|
36
38
|
getAddresses(): Promise<string[]>;
|
|
37
39
|
getAddressesInfo(): Promise<{
|
|
38
40
|
address: string;
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TxResponse } from "@injectivelabs/sdk-ts/core/tx";
|
|
2
|
-
import { BaseConcreteStrategy, ConcreteEvmWalletStrategyArgs, ConcreteWalletStrategy, Eip1193Provider, SendTransactionOptions, StdSignDoc, WalletDeviceType } from "@injectivelabs/wallet-base";
|
|
2
|
+
import { BaseConcreteStrategy, ConcreteEvmWalletStrategyArgs, ConcreteWalletStrategy, Eip1193Provider, SendTransactionOptions, StdSignDoc, WalletDeviceType, WalletMetadata } from "@injectivelabs/wallet-base";
|
|
3
3
|
import { AccountAddress, EvmChainId } from "@injectivelabs/ts-types";
|
|
4
4
|
import { AminoSignResponse, DirectSignResponse, TxRaw } from "@injectivelabs/sdk-ts/types";
|
|
5
5
|
|
|
@@ -30,9 +30,11 @@ declare class TrezorBase extends BaseConcreteStrategy implements ConcreteWalletS
|
|
|
30
30
|
constructor(args: ConcreteEvmWalletStrategyArgs & {
|
|
31
31
|
derivationPathType: TrezorDerivationPathType;
|
|
32
32
|
});
|
|
33
|
+
setMetadata(metadata: WalletMetadata): void;
|
|
33
34
|
getWalletDeviceType(): Promise<WalletDeviceType>;
|
|
34
35
|
enable(): Promise<boolean>;
|
|
35
36
|
disconnect(): Promise<void>;
|
|
37
|
+
protected getDerivationPath(address: string): Promise<string>;
|
|
36
38
|
getAddresses(): Promise<string[]>;
|
|
37
39
|
getAddressesInfo(): Promise<{
|
|
38
40
|
address: string;
|
package/dist/esm/index.js
CHANGED
|
@@ -405,6 +405,9 @@ var TrezorBase = class extends BaseConcreteStrategy {
|
|
|
405
405
|
this.derivationPathType = args.derivationPathType;
|
|
406
406
|
this.baseDerivationPath = DEFAULT_BASE_DERIVATION_PATH;
|
|
407
407
|
}
|
|
408
|
+
setMetadata(metadata) {
|
|
409
|
+
this.metadata = metadata;
|
|
410
|
+
}
|
|
408
411
|
async getWalletDeviceType() {
|
|
409
412
|
return Promise.resolve(WalletDeviceType.Hardware);
|
|
410
413
|
}
|
|
@@ -414,6 +417,10 @@ var TrezorBase = class extends BaseConcreteStrategy {
|
|
|
414
417
|
async disconnect() {
|
|
415
418
|
return Promise.resolve();
|
|
416
419
|
}
|
|
420
|
+
async getDerivationPath(address) {
|
|
421
|
+
var _this$metadata;
|
|
422
|
+
return ((_this$metadata = this.metadata) === null || _this$metadata === void 0 ? void 0 : _this$metadata.derivationPath) ? this.metadata.derivationPath : (await this.getWalletForAddress(address)).derivationPath;
|
|
423
|
+
}
|
|
417
424
|
async getAddresses() {
|
|
418
425
|
const { baseDerivationPath, derivationPathType } = this;
|
|
419
426
|
try {
|
|
@@ -483,7 +490,7 @@ var TrezorBase = class extends BaseConcreteStrategy {
|
|
|
483
490
|
});
|
|
484
491
|
try {
|
|
485
492
|
await this.trezor.connect();
|
|
486
|
-
const
|
|
493
|
+
const derivationPath = await this.getDerivationPath(address);
|
|
487
494
|
const response = await TrezorConnect.ethereumSignTypedData({
|
|
488
495
|
path: derivationPath,
|
|
489
496
|
data: {
|
|
@@ -528,7 +535,7 @@ var TrezorBase = class extends BaseConcreteStrategy {
|
|
|
528
535
|
const TrezorConnect = await loadTrezorConnect();
|
|
529
536
|
try {
|
|
530
537
|
await this.trezor.connect();
|
|
531
|
-
const
|
|
538
|
+
const derivationPath = await this.getDerivationPath(signer);
|
|
532
539
|
const response = await TrezorConnect.ethereumSignMessage({
|
|
533
540
|
path: derivationPath,
|
|
534
541
|
message: toUtf8(data)
|
|
@@ -591,7 +598,7 @@ var TrezorBase = class extends BaseConcreteStrategy {
|
|
|
591
598
|
};
|
|
592
599
|
try {
|
|
593
600
|
await this.trezor.connect();
|
|
594
|
-
const
|
|
601
|
+
const derivationPath = await this.getDerivationPath(args.address);
|
|
595
602
|
const response = await TrezorConnect.ethereumSignTransaction({
|
|
596
603
|
path: derivationPath,
|
|
597
604
|
transaction: trezorTxData
|
|
@@ -634,10 +641,10 @@ var TrezorBase = class extends BaseConcreteStrategy {
|
|
|
634
641
|
return await accountManager.getWalletForAddress(address);
|
|
635
642
|
}
|
|
636
643
|
async getEip1193Provider() {
|
|
637
|
-
var _this$
|
|
644
|
+
var _this$metadata2;
|
|
638
645
|
return new TrezorEip1193Provider(this.trezor, {
|
|
639
646
|
chainId: this.evmOptions.evmChainId.toString(),
|
|
640
|
-
derivationPath: (_this$
|
|
647
|
+
derivationPath: (_this$metadata2 = this.metadata) === null || _this$metadata2 === void 0 ? void 0 : _this$metadata2.derivationPath
|
|
641
648
|
});
|
|
642
649
|
}
|
|
643
650
|
async getPublicClient(evmChainId) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/wallet-trezor",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.2-alpha.1",
|
|
4
4
|
"description": "Trezor wallet strategy for use with @injectivelabs/wallet-core.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"@trezor/connect": "^9.6.4",
|
|
42
42
|
"@trezor/connect-web": "^9.6.4",
|
|
43
43
|
"viem": "^2.41.2",
|
|
44
|
-
"@injectivelabs/
|
|
45
|
-
"@injectivelabs/
|
|
46
|
-
"@injectivelabs/
|
|
47
|
-
"@injectivelabs/
|
|
44
|
+
"@injectivelabs/sdk-ts": "1.17.2-alpha.1",
|
|
45
|
+
"@injectivelabs/wallet-base": "1.17.2-alpha.1",
|
|
46
|
+
"@injectivelabs/ts-types": "1.17.2-alpha.1",
|
|
47
|
+
"@injectivelabs/exceptions": "1.17.2-alpha.1"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public"
|