Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: build
  • Loading branch information
ByteZhang1024 committed Aug 15, 2025
commit f8dc1e0f8c1f405b5b026db110f90164a8e5bb69
5 changes: 4 additions & 1 deletion packages/keyring-eth-onekey/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eth-onekey-bridge-keyring",
"version": "0.3.3",
"version": "0.3.4",
"description": "A MetaMask compatible keyring, for onekey hardware wallets",
"keywords": [
"ethereum",
Expand Down Expand Up @@ -41,6 +41,7 @@
"changelog:update": "../../scripts/update-changelog.sh @metamask/eth-trezor-keyring",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/eth-trezor-keyring",
"publish:preview": "yarn npm publish --tag preview",
"publish": "yarn npm publish",
"test": "jest && jest-it-up",
"test:clean": "jest --clearCache",
"test:watch": "jest --watch"
Expand All @@ -67,6 +68,7 @@
"@metamask/auto-changelog": "^3.4.4",
"@metamask/keyring-utils": "workspace:^",
"@ts-bridge/cli": "^0.6.3",
"@types/bytebuffer": "^5.0.49",
"@types/ethereumjs-tx": "^1.0.1",
"@types/hdkey": "^2.0.1",
"@types/jest": "^29.5.12",
Expand Down Expand Up @@ -103,6 +105,7 @@
"hdkey>secp256k1": false,
"ethereumjs-tx>ethereumjs-util>ethereum-cryptography>keccak": false,
"ethereumjs-tx>ethereumjs-util>ethereum-cryptography>secp256k1": false,
"@onekeyfe/hd-transport>protobufjs": false,
"@onekeyfe/hd-core>@onekeyfe/hd-transport>protobufjs": false,
"@onekeyfe/hd-web-sdk>@onekeyfe/hd-core>@onekeyfe/hd-transport>protobufjs": false
}
Expand Down
12 changes: 6 additions & 6 deletions packages/keyring-eth-onekey/src/onekey-keyring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ enum NetworkApiUrls {
export type AccountDetails = {
index?: number;
hdPath: string;
passphraseState?: string;
passphraseState?: string | undefined;
};

export type AccountPageEntry = {
Expand Down Expand Up @@ -229,7 +229,7 @@ export class OneKeyKeyring extends EventEmitter {
showOnOneKey: false,
chainId: 1,
path: this.#getBasePath(),
passphraseState: this.passphraseState,
passphraseState: this.passphraseState ?? '',
})
.then(async (res) => {
if (res.success) {
Expand Down Expand Up @@ -418,14 +418,14 @@ export class OneKeyKeyring extends EventEmitter {
...tx.toJSON(),
chainId,
to: this.#normalize(Buffer.from(tx.to?.bytes ?? [])),
} as EVMSignTransactionParams['transaction'];
} as unknown as EVMSignTransactionParams['transaction'];
}

try {
const details = this.#accountDetailsFromAddress(address);
const response = await this.bridge.ethereumSignTransaction({
path: details.hdPath,
passphraseState: details.passphraseState,
passphraseState: details.passphraseState ?? '',
useEmptyPassphrase: isEmptyPassphrase(details.passphraseState),
transaction,
});
Expand Down Expand Up @@ -464,7 +464,7 @@ export class OneKeyKeyring extends EventEmitter {
this.bridge
.ethereumSignMessage({
path: details.hdPath,
passphraseState: details.passphraseState,
passphraseState: details.passphraseState ?? '',
useEmptyPassphrase: isEmptyPassphrase(details.passphraseState),
messageHex: ethUtil.stripHexPrefix(message),
})
Expand Down Expand Up @@ -517,7 +517,7 @@ export class OneKeyKeyring extends EventEmitter {
const details = this.#accountDetailsFromAddress(address);
const response = await this.bridge.ethereumSignTypedData({
path: details.hdPath,
passphraseState: details.passphraseState,
passphraseState: details.passphraseState ?? '',
useEmptyPassphrase: isEmptyPassphrase(details.passphraseState),
data: data as EthereumSignTypedDataMessage<EthereumSignTypedDataTypes>,
domainHash,
Expand Down
1 change: 0 additions & 1 deletion packages/keyring-eth-onekey/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"outDir": "dist",
"rootDir": "src",
"exactOptionalPropertyTypes": false,
// circumvent missing types in @trezor/connect-web, please see https://github.com/trezor/trezor-suite/issues/10389
"skipLibCheck": true,
"lib": ["ES2020"],
"target": "es2017"
Expand Down
1 change: 0 additions & 1 deletion packages/keyring-eth-onekey/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"compilerOptions": {
"baseUrl": "./",
"exactOptionalPropertyTypes": false,
// circumvent missing types in @trezor/connect-web, please see https://github.com/trezor/trezor-suite/issues/10389
"skipLibCheck": true,
"lib": ["ES2020"],
"target": "es2017"
Expand Down
1 change: 1 addition & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{ "path": "./packages/keyring-internal-api/tsconfig.build.json" },
{ "path": "./packages/keyring-eth-ledger-bridge/tsconfig.build.json" },
{ "path": "./packages/keyring-eth-qr/tsconfig.build.json" },
{ "path": "./packages/keyring-eth-onekey/tsconfig.build.json" },
{ "path": "./packages/keyring-eth-simple/tsconfig.build.json" },
{ "path": "./packages/keyring-eth-trezor/tsconfig.build.json" },
{ "path": "./packages/keyring-eth-hd/tsconfig.build.json" },
Expand Down
18 changes: 18 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4017,6 +4017,16 @@ __metadata:
languageName: node
linkType: hard

"@types/bytebuffer@npm:^5.0.49":
version: 5.0.49
resolution: "@types/bytebuffer@npm:5.0.49"
dependencies:
"@types/long": "npm:^3.0.0"
"@types/node": "npm:*"
checksum: 10/31eb2521d2710f256c3d17a3e8d87f04394f335b29f7276c31c054ddbf4795146f2663effa3b6e910442da69238e994d2db9f7d5918eead4313e3f9e29165932
languageName: node
linkType: hard

"@types/color-name@npm:^1.1.1":
version: 1.1.1
resolution: "@types/color-name@npm:1.1.1"
Expand Down Expand Up @@ -4138,6 +4148,13 @@ __metadata:
languageName: node
linkType: hard

"@types/long@npm:^3.0.0":
version: 3.0.32
resolution: "@types/long@npm:3.0.32"
checksum: 10/cc5422875a085b49b74ffeb5c60a8681d30f700859a8931012b4a58c5c6005cdacb4d3ce3e5af7a7f579ee20d5c2e442a773a83b3a4f7a2d39795a7a8e9a962d
languageName: node
linkType: hard

"@types/long@npm:^4.0.1":
version: 4.0.2
resolution: "@types/long@npm:4.0.2"
Expand Down Expand Up @@ -6856,6 +6873,7 @@ __metadata:
"@onekeyfe/hd-transport": "npm:1.1.6-patch.1"
"@onekeyfe/hd-web-sdk": "npm:1.1.6-patch.1"
"@ts-bridge/cli": "npm:^0.6.3"
"@types/bytebuffer": "npm:^5.0.49"
"@types/ethereumjs-tx": "npm:^1.0.1"
"@types/hdkey": "npm:^2.0.1"
"@types/jest": "npm:^29.5.12"
Expand Down