Skip to content

Commit 6a5d4b9

Browse files
committed
chore: bump @scure/bip32 to v2
1 parent f2e209f commit 6a5d4b9

File tree

4 files changed

+30
-23
lines changed

4 files changed

+30
-23
lines changed

.changeset/brave-walls-sneeze.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@fleet-sdk/wallet": patch
3+
---
4+
5+
Bump `@scure/bip32` to `v2`

packages/wallet/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"@fleet-sdk/crypto": "workspace:^",
4545
"@fleet-sdk/serializer": "workspace:^",
4646
"@noble/curves": "^2.0.1",
47-
"@scure/bip32": "^1.7.0",
47+
"@scure/bip32": "^2.0.1",
4848
"@scure/bip39": "^2.0.1"
4949
},
5050
"engines": {

packages/wallet/src/ergoHDKey.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,23 @@ export class ErgoHDKey {
8080
return this.#address;
8181
}
8282

83-
static async fromMnemonic(mnemonic: string, options?: FromMnemonicOptions): Promise<ErgoHDKey> {
83+
static async fromMnemonic(
84+
mnemonic: string,
85+
options?: FromMnemonicOptions,
86+
): Promise<ErgoHDKey> {
8487
return ErgoHDKey.fromMasterSeed(
8588
await mnemonicToSeed(mnemonic, options?.passphrase),
86-
options?.path
89+
options?.path,
8790
);
8891
}
8992

90-
static fromMnemonicSync(mnemonic: string, options?: FromMnemonicOptions): ErgoHDKey {
93+
static fromMnemonicSync(
94+
mnemonic: string,
95+
options?: FromMnemonicOptions,
96+
): ErgoHDKey {
9197
return ErgoHDKey.fromMasterSeed(
9298
mnemonicToSeedSync(mnemonic, options?.passphrase),
93-
options?.path
99+
options?.path,
94100
);
95101
}
96102

@@ -111,12 +117,16 @@ export class ErgoHDKey {
111117
/** @deprecated use the default constructor instead */
112118
static fromExtendedKey(options: PublicKeyOptions): ErgoHDKey;
113119
/** @deprecated use the default constructor instead */
114-
static fromExtendedKey(keyOrOptions: string | PrivateKeyOptions | PublicKeyOptions): ErgoHDKey {
120+
static fromExtendedKey(
121+
keyOrOptions: string | PrivateKeyOptions | PublicKeyOptions,
122+
): ErgoHDKey {
115123
if (typeof keyOrOptions !== "string") {
116124
return new ErgoHDKey(keyOrOptions);
117125
}
118126

119-
const xKey = isHex(keyOrOptions) ? base58check.encode(hex.decode(keyOrOptions)) : keyOrOptions;
127+
const xKey = isHex(keyOrOptions)
128+
? base58check.encode(hex.decode(keyOrOptions))
129+
: keyOrOptions;
120130
return new ErgoHDKey(HDKey.fromExtendedKey(xKey));
121131
}
122132

pnpm-lock.yaml

Lines changed: 8 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)