@@ -31,7 +31,7 @@ export class Bip32PrivateKeyError extends Data.TaggedError("Bip32PrivateKeyError
3131 * @category schemas
3232 */
3333export class Bip32PrivateKey extends Schema . TaggedClass < Bip32PrivateKey > ( ) ( "Bip32PrivateKey" , {
34- bytes : Bytes96 . BytesSchema
34+ bytes : Bytes96 . BytesFromHex
3535} ) {
3636 toJSON ( ) {
3737 return { _tag : "Bip32PrivateKey" as const , bytes : Bytes . toHex ( this . bytes ) }
@@ -46,7 +46,7 @@ export class Bip32PrivateKey extends Schema.TaggedClass<Bip32PrivateKey>()("Bip3
4646 }
4747
4848 [ Equal . symbol ] ( that : unknown ) : boolean {
49- return that instanceof Bip32PrivateKey && Bytes . bytesEquals ( this . bytes , that . bytes )
49+ return that instanceof Bip32PrivateKey && Bytes . equals ( this . bytes , that . bytes )
5050 }
5151
5252 [ Hash . symbol ] ( ) : number {
@@ -60,7 +60,7 @@ export class Bip32PrivateKey extends Schema.TaggedClass<Bip32PrivateKey>()("Bip3
6060 * @since 2.0.0
6161 * @category schemas
6262 */
63- export const FromBytes = Schema . transform ( Bytes96 . BytesSchema , Bip32PrivateKey , {
63+ export const FromBytes = Schema . transform ( Schema . typeSchema ( Bytes96 . BytesFromHex ) , Schema . typeSchema ( Bip32PrivateKey ) , {
6464 strict : true ,
6565 decode : ( bytes ) => new Bip32PrivateKey ( { bytes } , { disableValidation : true } ) ,
6666 encode : ( bip32PrivateKey ) => bip32PrivateKey . bytes
@@ -75,7 +75,7 @@ export const FromBytes = Schema.transform(Bytes96.BytesSchema, Bip32PrivateKey,
7575 * @category schemas
7676 */
7777export const FromHex = Schema . compose (
78- Bytes96 . FromHex , // string -> Bytes96
78+ Bytes96 . BytesFromHex , // string -> Bytes96
7979 FromBytes // Bytes96 -> Bip32PrivateKey
8080) . annotations ( {
8181 identifier : "Bip32PrivateKey.FromHex"
@@ -443,7 +443,9 @@ export namespace Either {
443443 export const from_128_xprv = ( bytes : Uint8Array ) =>
444444 Effect . gen ( function * ( ) {
445445 if ( bytes . length !== 128 ) {
446- return yield * Effect . fail ( new Bip32PrivateKeyError ( { message : `Expected exactly 128 bytes, got ${ bytes . length } ` } ) )
446+ return yield * Effect . fail (
447+ new Bip32PrivateKeyError ( { message : `Expected exactly 128 bytes, got ${ bytes . length } ` } )
448+ )
447449 }
448450 const scalar = bytes . slice ( 0 , 32 )
449451 const iv = bytes . slice ( 32 , 64 )
0 commit comments