Skip to content

Commit 163d187

Browse files
committed
fix: build
1 parent f713453 commit 163d187

6 files changed

Lines changed: 29 additions & 9 deletions

File tree

packages/keyring-eth-onekey/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eth-onekey-bridge-keyring",
3-
"version": "0.3.3",
3+
"version": "0.3.4",
44
"description": "A MetaMask compatible keyring, for onekey hardware wallets",
55
"keywords": [
66
"ethereum",
@@ -41,6 +41,7 @@
4141
"changelog:update": "../../scripts/update-changelog.sh @metamask/eth-trezor-keyring",
4242
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/eth-trezor-keyring",
4343
"publish:preview": "yarn npm publish --tag preview",
44+
"publish": "yarn npm publish",
4445
"test": "jest && jest-it-up",
4546
"test:clean": "jest --clearCache",
4647
"test:watch": "jest --watch"
@@ -67,6 +68,7 @@
6768
"@metamask/auto-changelog": "^3.4.4",
6869
"@metamask/keyring-utils": "workspace:^",
6970
"@ts-bridge/cli": "^0.6.3",
71+
"@types/bytebuffer": "^5.0.49",
7072
"@types/ethereumjs-tx": "^1.0.1",
7173
"@types/hdkey": "^2.0.1",
7274
"@types/jest": "^29.5.12",
@@ -103,6 +105,7 @@
103105
"hdkey>secp256k1": false,
104106
"ethereumjs-tx>ethereumjs-util>ethereum-cryptography>keccak": false,
105107
"ethereumjs-tx>ethereumjs-util>ethereum-cryptography>secp256k1": false,
108+
"@onekeyfe/hd-transport>protobufjs": false,
106109
"@onekeyfe/hd-core>@onekeyfe/hd-transport>protobufjs": false,
107110
"@onekeyfe/hd-web-sdk>@onekeyfe/hd-core>@onekeyfe/hd-transport>protobufjs": false
108111
}

packages/keyring-eth-onekey/src/onekey-keyring.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ enum NetworkApiUrls {
3535
export type AccountDetails = {
3636
index?: number;
3737
hdPath: string;
38-
passphraseState?: string;
38+
passphraseState?: string | undefined;
3939
};
4040

4141
export type AccountPageEntry = {
@@ -229,7 +229,7 @@ export class OneKeyKeyring extends EventEmitter {
229229
showOnOneKey: false,
230230
chainId: 1,
231231
path: this.#getBasePath(),
232-
passphraseState: this.passphraseState,
232+
passphraseState: this.passphraseState ?? '',
233233
})
234234
.then(async (res) => {
235235
if (res.success) {
@@ -418,14 +418,14 @@ export class OneKeyKeyring extends EventEmitter {
418418
...tx.toJSON(),
419419
chainId,
420420
to: this.#normalize(Buffer.from(tx.to?.bytes ?? [])),
421-
} as EVMSignTransactionParams['transaction'];
421+
} as unknown as EVMSignTransactionParams['transaction'];
422422
}
423423

424424
try {
425425
const details = this.#accountDetailsFromAddress(address);
426426
const response = await this.bridge.ethereumSignTransaction({
427427
path: details.hdPath,
428-
passphraseState: details.passphraseState,
428+
passphraseState: details.passphraseState ?? '',
429429
useEmptyPassphrase: isEmptyPassphrase(details.passphraseState),
430430
transaction,
431431
});
@@ -464,7 +464,7 @@ export class OneKeyKeyring extends EventEmitter {
464464
this.bridge
465465
.ethereumSignMessage({
466466
path: details.hdPath,
467-
passphraseState: details.passphraseState,
467+
passphraseState: details.passphraseState ?? '',
468468
useEmptyPassphrase: isEmptyPassphrase(details.passphraseState),
469469
messageHex: ethUtil.stripHexPrefix(message),
470470
})
@@ -517,7 +517,7 @@ export class OneKeyKeyring extends EventEmitter {
517517
const details = this.#accountDetailsFromAddress(address);
518518
const response = await this.bridge.ethereumSignTypedData({
519519
path: details.hdPath,
520-
passphraseState: details.passphraseState,
520+
passphraseState: details.passphraseState ?? '',
521521
useEmptyPassphrase: isEmptyPassphrase(details.passphraseState),
522522
data: data as EthereumSignTypedDataMessage<EthereumSignTypedDataTypes>,
523523
domainHash,

packages/keyring-eth-onekey/tsconfig.build.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"outDir": "dist",
66
"rootDir": "src",
77
"exactOptionalPropertyTypes": false,
8-
// circumvent missing types in @trezor/connect-web, please see https://github.com/trezor/trezor-suite/issues/10389
98
"skipLibCheck": true,
109
"lib": ["ES2020"],
1110
"target": "es2017"

packages/keyring-eth-onekey/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"compilerOptions": {
44
"baseUrl": "./",
55
"exactOptionalPropertyTypes": false,
6-
// circumvent missing types in @trezor/connect-web, please see https://github.com/trezor/trezor-suite/issues/10389
76
"skipLibCheck": true,
87
"lib": ["ES2020"],
98
"target": "es2017"

tsconfig.build.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{ "path": "./packages/keyring-api/tsconfig.build.json" },
44
{ "path": "./packages/keyring-internal-api/tsconfig.build.json" },
55
{ "path": "./packages/keyring-eth-ledger-bridge/tsconfig.build.json" },
6+
{ "path": "./packages/keyring-eth-onekey/tsconfig.build.json" },
67
{ "path": "./packages/keyring-eth-simple/tsconfig.build.json" },
78
{ "path": "./packages/keyring-eth-trezor/tsconfig.build.json" },
89
{ "path": "./packages/keyring-eth-hd/tsconfig.build.json" },

yarn.lock

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3884,6 +3884,16 @@ __metadata:
38843884
languageName: node
38853885
linkType: hard
38863886

3887+
"@types/bytebuffer@npm:^5.0.49":
3888+
version: 5.0.49
3889+
resolution: "@types/bytebuffer@npm:5.0.49"
3890+
dependencies:
3891+
"@types/long": "npm:^3.0.0"
3892+
"@types/node": "npm:*"
3893+
checksum: 10/31eb2521d2710f256c3d17a3e8d87f04394f335b29f7276c31c054ddbf4795146f2663effa3b6e910442da69238e994d2db9f7d5918eead4313e3f9e29165932
3894+
languageName: node
3895+
linkType: hard
3896+
38873897
"@types/color-name@npm:^1.1.1":
38883898
version: 1.1.1
38893899
resolution: "@types/color-name@npm:1.1.1"
@@ -4005,6 +4015,13 @@ __metadata:
40054015
languageName: node
40064016
linkType: hard
40074017

4018+
"@types/long@npm:^3.0.0":
4019+
version: 3.0.32
4020+
resolution: "@types/long@npm:3.0.32"
4021+
checksum: 10/cc5422875a085b49b74ffeb5c60a8681d30f700859a8931012b4a58c5c6005cdacb4d3ce3e5af7a7f579ee20d5c2e442a773a83b3a4f7a2d39795a7a8e9a962d
4022+
languageName: node
4023+
linkType: hard
4024+
40084025
"@types/long@npm:^4.0.1":
40094026
version: 4.0.2
40104027
resolution: "@types/long@npm:4.0.2"
@@ -6624,6 +6641,7 @@ __metadata:
66246641
"@onekeyfe/hd-transport": "npm:1.1.6-patch.1"
66256642
"@onekeyfe/hd-web-sdk": "npm:1.1.6-patch.1"
66266643
"@ts-bridge/cli": "npm:^0.6.3"
6644+
"@types/bytebuffer": "npm:^5.0.49"
66276645
"@types/ethereumjs-tx": "npm:^1.0.1"
66286646
"@types/hdkey": "npm:^2.0.1"
66296647
"@types/jest": "npm:^29.5.12"

0 commit comments

Comments
 (0)