@onekeyfe/hwk-keystone-adapter 1.2.8-alpha.109 → 1.2.8-alpha.110
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/index.d.mts +1 -4
- package/dist/index.d.ts +1 -4
- package/dist/index.js +2 -23
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -23
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.d.mts
CHANGED
|
@@ -84,12 +84,9 @@ interface KeystoneBtcSignatureResult {
|
|
|
84
84
|
}
|
|
85
85
|
/** SLIP-10 secp256k1 (EVM/BTC) and ed25519 (SOL); Cardano BIP32-Ed25519 is out of scope. */
|
|
86
86
|
type KeystoneDerivationCurve = 'secp256k1' | 'ed25519';
|
|
87
|
-
/** Chain types firmware before 3.0.4 checks each requested path against. */
|
|
88
|
-
type KeystoneHardwareCallChainType = 'ETH' | 'SOL' | 'TRX' | 'BTC_LEGACY' | 'BTC' | 'BTC_NATIVE_SEGWIT' | 'BTC_TAPROOT';
|
|
89
87
|
interface KeystoneKeySchema {
|
|
90
88
|
path: string;
|
|
91
89
|
curve?: KeystoneDerivationCurve;
|
|
92
|
-
chainType?: KeystoneHardwareCallChainType;
|
|
93
90
|
}
|
|
94
91
|
interface KeystoneKeyDerivationRequestInput {
|
|
95
92
|
schemas: KeystoneKeySchema[];
|
|
@@ -436,4 +433,4 @@ declare function splitAccountPath(path: string): {
|
|
|
436
433
|
/** BIP-44/49/84/86 purpose to script type; undefined for any other purpose. */
|
|
437
434
|
declare function btcScriptTypeFromPath(path: string): BtcScriptType | undefined;
|
|
438
435
|
|
|
439
|
-
export { type BtcScriptType, type ImportFromQrOptions, KEYSTONE_COLD_START_PATH, KEYSTONE_WALLET_CONNECT_ID_PREFIX, type KeystoneAccountEntry, KeystoneAdapter, type KeystoneBtcSignRequestAccount, type KeystoneBtcSignatureResult, type KeystoneDerivationCurve, type KeystoneDeviceRecord, type KeystoneEthSignRequestInput, type KeystoneEthSignatureResult, type
|
|
436
|
+
export { type BtcScriptType, type ImportFromQrOptions, KEYSTONE_COLD_START_PATH, KEYSTONE_WALLET_CONNECT_ID_PREFIX, type KeystoneAccountEntry, KeystoneAdapter, type KeystoneBtcSignRequestAccount, type KeystoneBtcSignatureResult, type KeystoneDerivationCurve, type KeystoneDeviceRecord, type KeystoneEthSignRequestInput, type KeystoneEthSignatureResult, type KeystoneKeyDerivationRequestInput, type KeystoneKeySchema, type KeystoneParsedAccount, type KeystoneParsedMultiAccounts, type KeystoneSolSignRequestInput, type KeystoneSolSignatureResult, type KeystoneTronSignRequestInput, type KeystoneTronSignatureResult, type KeystoneUr, KeystoneUrEngine, accountKey, btcScriptTypeFromPath, createDeviceRecord, normalizePath, placeholderDeviceInfo, splitAccountPath, toDeviceInfo, walletConnectId };
|
package/dist/index.d.ts
CHANGED
|
@@ -84,12 +84,9 @@ interface KeystoneBtcSignatureResult {
|
|
|
84
84
|
}
|
|
85
85
|
/** SLIP-10 secp256k1 (EVM/BTC) and ed25519 (SOL); Cardano BIP32-Ed25519 is out of scope. */
|
|
86
86
|
type KeystoneDerivationCurve = 'secp256k1' | 'ed25519';
|
|
87
|
-
/** Chain types firmware before 3.0.4 checks each requested path against. */
|
|
88
|
-
type KeystoneHardwareCallChainType = 'ETH' | 'SOL' | 'TRX' | 'BTC_LEGACY' | 'BTC' | 'BTC_NATIVE_SEGWIT' | 'BTC_TAPROOT';
|
|
89
87
|
interface KeystoneKeySchema {
|
|
90
88
|
path: string;
|
|
91
89
|
curve?: KeystoneDerivationCurve;
|
|
92
|
-
chainType?: KeystoneHardwareCallChainType;
|
|
93
90
|
}
|
|
94
91
|
interface KeystoneKeyDerivationRequestInput {
|
|
95
92
|
schemas: KeystoneKeySchema[];
|
|
@@ -436,4 +433,4 @@ declare function splitAccountPath(path: string): {
|
|
|
436
433
|
/** BIP-44/49/84/86 purpose to script type; undefined for any other purpose. */
|
|
437
434
|
declare function btcScriptTypeFromPath(path: string): BtcScriptType | undefined;
|
|
438
435
|
|
|
439
|
-
export { type BtcScriptType, type ImportFromQrOptions, KEYSTONE_COLD_START_PATH, KEYSTONE_WALLET_CONNECT_ID_PREFIX, type KeystoneAccountEntry, KeystoneAdapter, type KeystoneBtcSignRequestAccount, type KeystoneBtcSignatureResult, type KeystoneDerivationCurve, type KeystoneDeviceRecord, type KeystoneEthSignRequestInput, type KeystoneEthSignatureResult, type
|
|
436
|
+
export { type BtcScriptType, type ImportFromQrOptions, KEYSTONE_COLD_START_PATH, KEYSTONE_WALLET_CONNECT_ID_PREFIX, type KeystoneAccountEntry, KeystoneAdapter, type KeystoneBtcSignRequestAccount, type KeystoneBtcSignatureResult, type KeystoneDerivationCurve, type KeystoneDeviceRecord, type KeystoneEthSignRequestInput, type KeystoneEthSignatureResult, type KeystoneKeyDerivationRequestInput, type KeystoneKeySchema, type KeystoneParsedAccount, type KeystoneParsedMultiAccounts, type KeystoneSolSignRequestInput, type KeystoneSolSignatureResult, type KeystoneTronSignRequestInput, type KeystoneTronSignatureResult, type KeystoneUr, KeystoneUrEngine, accountKey, btcScriptTypeFromPath, createDeviceRecord, normalizePath, placeholderDeviceInfo, splitAccountPath, toDeviceInfo, walletConnectId };
|
package/dist/index.js
CHANGED
|
@@ -251,8 +251,7 @@ var KeystoneUrEngine = class {
|
|
|
251
251
|
const ur = this.sdk.generateKeyDerivationCall({
|
|
252
252
|
schemas: input.schemas.map((schema) => ({
|
|
253
253
|
path: schema.path,
|
|
254
|
-
curve: DERIVATION_CURVE[schema.curve ?? "secp256k1"]
|
|
255
|
-
chainType: schema.chainType
|
|
254
|
+
curve: DERIVATION_CURVE[schema.curve ?? "secp256k1"]
|
|
256
255
|
})),
|
|
257
256
|
origin: input.origin,
|
|
258
257
|
version: import_keystone_sdk.QRHardwareCallVersion.V1
|
|
@@ -609,28 +608,8 @@ function keystoneBtcParamsFailure(params) {
|
|
|
609
608
|
}
|
|
610
609
|
var KEYSTONE_USB_REATTACH_PROBE_ATTEMPTS = 4;
|
|
611
610
|
var KEYSTONE_USB_REATTACH_PROBE_INTERVAL_MS = 500;
|
|
612
|
-
var CHAIN_TYPE_BY_CHAIN = {
|
|
613
|
-
evm: "ETH",
|
|
614
|
-
sol: "SOL",
|
|
615
|
-
tron: "TRX"
|
|
616
|
-
};
|
|
617
|
-
var BTC_CHAIN_TYPE_BY_PURPOSE = {
|
|
618
|
-
44: "BTC_LEGACY",
|
|
619
|
-
49: "BTC",
|
|
620
|
-
84: "BTC_NATIVE_SEGWIT",
|
|
621
|
-
86: "BTC_TAPROOT"
|
|
622
|
-
};
|
|
623
|
-
function hardwareCallChainType(chain, path) {
|
|
624
|
-
if (chain !== "btc") return CHAIN_TYPE_BY_CHAIN[chain];
|
|
625
|
-
const purpose = normalizePath(path).match(/^m\/(\d+)'/)?.[1];
|
|
626
|
-
return purpose ? BTC_CHAIN_TYPE_BY_PURPOSE[Number(purpose)] : void 0;
|
|
627
|
-
}
|
|
628
611
|
function keySchema(chain, path) {
|
|
629
|
-
return {
|
|
630
|
-
path,
|
|
631
|
-
curve: chain === "sol" ? "ed25519" : "secp256k1",
|
|
632
|
-
chainType: hardwareCallChainType(chain, path)
|
|
633
|
-
};
|
|
612
|
+
return { path, curve: chain === "sol" ? "ed25519" : "secp256k1" };
|
|
634
613
|
}
|
|
635
614
|
function waitForKeystoneUsbReattachProbe() {
|
|
636
615
|
return new Promise((resolve) => {
|