@exodus/hardware-wallets 1.7.0 → 2.0.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.
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.0.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hardware-wallets@1.7.0...@exodus/hardware-wallets@2.0.0) (2024-11-18)
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
- fix: use correct parameter name for publicKeyStore (#10460)
|
|
11
|
+
|
|
6
12
|
## [1.7.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/hardware-wallets@1.6.0...@exodus/hardware-wallets@1.7.0) (2024-11-13)
|
|
7
13
|
|
|
8
14
|
### Features
|
package/lib/api/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ declare const hardwareWalletsApiDefinition: {
|
|
|
19
19
|
ensureApplicationIsOpened: ({ assetName }: import("../module/interfaces.js").EnsureApplicationIsOpenedParams) => Promise<void>;
|
|
20
20
|
scan: ({ assetName, accountIndexes, addressLimit, addressOffset, }: import("../module/interfaces.js").ScanParams) => Promise<import("../module/interfaces.js").ScanResult>;
|
|
21
21
|
sync: ({ accountIndex: index, isMultisig }?: import("../module/interfaces.js").SyncParams) => Promise<import("../module/interfaces.js").SyncedKeysId>;
|
|
22
|
-
addPublicKeysToWalletAccount: ({
|
|
22
|
+
addPublicKeysToWalletAccount: ({ walletAccount, syncedKeysId }: import("../module/interfaces.js").StoreSyncedKeysParams) => Promise<void>;
|
|
23
23
|
create: ({ syncedKeysId, isMultisig }: import("../module/interfaces.js").CreateParams) => Promise<import("@exodus/models").WalletAccount>;
|
|
24
24
|
};
|
|
25
25
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ declare const hardwareWallets: () => {
|
|
|
22
22
|
ensureApplicationIsOpened: ({ assetName }: import("./module/interfaces.js").EnsureApplicationIsOpenedParams) => Promise<void>;
|
|
23
23
|
scan: ({ assetName, accountIndexes, addressLimit, addressOffset, }: import("./module/interfaces.js").ScanParams) => Promise<import("./module/interfaces.js").ScanResult>;
|
|
24
24
|
sync: ({ accountIndex: index, isMultisig }?: import("./module/interfaces.js").SyncParams) => Promise<import("./module/interfaces.js").SyncedKeysId>;
|
|
25
|
-
addPublicKeysToWalletAccount: ({
|
|
25
|
+
addPublicKeysToWalletAccount: ({ walletAccount, syncedKeysId }: import("./module/interfaces.js").StoreSyncedKeysParams) => Promise<void>;
|
|
26
26
|
create: ({ syncedKeysId, isMultisig }: import("./module/interfaces.js").CreateParams) => Promise<import("@exodus/models").WalletAccount>;
|
|
27
27
|
};
|
|
28
28
|
};
|
|
@@ -35,7 +35,7 @@ export declare class HardwareWallets implements HardwareSignerProvider {
|
|
|
35
35
|
getAddress: ({ assetName, accountIndex, addressIndex, multisigData, displayOnDevice, }: GetAddressParams) => Promise<string>;
|
|
36
36
|
scan: ({ assetName, accountIndexes, addressLimit, addressOffset, }: ScanParams) => Promise<ScanResult>;
|
|
37
37
|
sync: ({ accountIndex: index, isMultisig }?: SyncParams) => Promise<SyncedKeysId>;
|
|
38
|
-
addPublicKeysToWalletAccount: ({
|
|
38
|
+
addPublicKeysToWalletAccount: ({ walletAccount, syncedKeysId }: StoreSyncedKeysParams) => Promise<void>;
|
|
39
39
|
create: ({ syncedKeysId, isMultisig }: CreateParams) => Promise<WalletAccount>;
|
|
40
40
|
requireDeviceFor: ({ walletAccount }: RequireDeviceForParams) => Promise<{
|
|
41
41
|
signTransaction: ({ baseAssetName, unsignedTx, walletAccount, multisigData, }: SignTransactionParams) => Promise<any>;
|
|
@@ -277,7 +277,10 @@ export class HardwareWallets {
|
|
|
277
277
|
const useableAssetNames = new Set(await device.listUseableAssetNames());
|
|
278
278
|
for (const assetName of useableAssetNames) {
|
|
279
279
|
const asset = this.#assetsModule.getAsset(assetName);
|
|
280
|
-
|
|
280
|
+
if (!asset) {
|
|
281
|
+
this.#logger.warn(`asset with ${assetName} was not found`);
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
281
284
|
const baseAsset = asset.baseAsset;
|
|
282
285
|
const supportedPurposes = baseAsset.api.getSupportedPurposes({
|
|
283
286
|
compatibilityMode: 'ledger',
|
|
@@ -298,12 +301,12 @@ export class HardwareWallets {
|
|
|
298
301
|
});
|
|
299
302
|
return id;
|
|
300
303
|
};
|
|
301
|
-
addPublicKeysToWalletAccount = async ({
|
|
304
|
+
addPublicKeysToWalletAccount = async ({ walletAccount, syncedKeysId }) => {
|
|
302
305
|
assert(this.#syncedKeysMap.has(syncedKeysId), `no synchronized keys found for id ${syncedKeysId}`);
|
|
303
306
|
const { assetNames, keysToSync } = this.#syncedKeysMap.get(syncedKeysId);
|
|
304
307
|
for (const [keyIdentifier, keys] of keysToSync) {
|
|
305
308
|
const { xpub, publicKey } = keys;
|
|
306
|
-
await this.#publicKeyStore.add({
|
|
309
|
+
await this.#publicKeyStore.add({ walletAccount, keyIdentifier, xpub, publicKey });
|
|
307
310
|
}
|
|
308
311
|
this.events.emit('syncAssets', { assetNames });
|
|
309
312
|
};
|
|
@@ -322,7 +325,7 @@ export class HardwareWallets {
|
|
|
322
325
|
const walletAccountName = walletAccount.toString();
|
|
323
326
|
await this.#walletAccounts.create(walletAccount);
|
|
324
327
|
await this.#walletAccounts.setActive(walletAccountName);
|
|
325
|
-
await this.addPublicKeysToWalletAccount({
|
|
328
|
+
await this.addPublicKeysToWalletAccount({ walletAccount, syncedKeysId });
|
|
326
329
|
return walletAccount;
|
|
327
330
|
};
|
|
328
331
|
requireDeviceFor = async ({ walletAccount }) => {
|
|
@@ -9,7 +9,7 @@ export interface HardwareSignerProvider {
|
|
|
9
9
|
ensureApplicationIsOpened: ({ assetName }: EnsureApplicationIsOpenedParams) => Promise<void>;
|
|
10
10
|
scan: ({ assetName, accountIndexes, addressOffset }: ScanParams) => Promise<ScanResult>;
|
|
11
11
|
sync: ({ accountIndex }: SyncParams) => Promise<SyncedKeysId>;
|
|
12
|
-
addPublicKeysToWalletAccount: ({
|
|
12
|
+
addPublicKeysToWalletAccount: ({ walletAccount, syncedKeysId, }: StoreSyncedKeysParams) => Promise<void>;
|
|
13
13
|
create: ({ syncedKeysId, isMultisig }: CreateParams) => Promise<WalletAccount>;
|
|
14
14
|
signTransaction: ({ baseAssetName, unsignedTx, walletAccount, }: SignTransactionParams) => Promise<any>;
|
|
15
15
|
signMessage: ({ assetName, derivationPath, message }: SignMessageParams) => Promise<any>;
|
|
@@ -69,7 +69,7 @@ export type KeyToSyncData = [KeyIdentifier, {
|
|
|
69
69
|
publicKey?: Readonly<Uint8Array>;
|
|
70
70
|
}];
|
|
71
71
|
export interface StoreSyncedKeysParams {
|
|
72
|
-
|
|
72
|
+
walletAccount: WalletAccount;
|
|
73
73
|
syncedKeysId: SyncedKeysId;
|
|
74
74
|
}
|
|
75
75
|
export interface CreateParams {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/hardware-wallets",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "An Exodus SDK feature that provides a high level abstraction for interacting with hardware wallet devices",
|
|
5
5
|
"author": "Exodus Movement, Inc.",
|
|
6
6
|
"repository": {
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"p-defer": "^4.0.1",
|
|
49
49
|
"redux": "^4.2.1"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "889cd0c2573163dccab136ffeb7fed0f2ec34bf8"
|
|
52
52
|
}
|