Skip to content

Commit

Permalink
feat: rage quit
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre committed Dec 23, 2024
1 parent a3f0af4 commit 5f7eb93
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/hdwallet-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"dependencies": {
"@bitcoinerlab/secp256k1": "^1.1.1",
"@noble/curves": "^1.7.3",
"@noble/curves": "^1.4.0",
"@shapeshiftoss/bitcoinjs-lib": "7.0.0-shapeshift.0",
"@shapeshiftoss/fiosdk": "1.2.1-shapeshift.6",
"@shapeshiftoss/hdwallet-core": "1.57.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type Ed25519Key = {
};

export class Ed25519Node extends Revocable(class {}) {
readonly #privateKey: ByteArray; // Changed to privateKey
readonly #privateKey: ByteArray;
readonly #chainCode: ByteArray;
readonly explicitPath?: string;

Expand All @@ -29,7 +29,7 @@ export class Ed25519Node extends Revocable(class {}) {
}

async getPublicKey(): Promise<ByteArray> {
// Generate public key using noble-curves ed25519
// Generate public key from private key
return Buffer.from(ed25519.getPublicKey(this.#privateKey));
}

Expand All @@ -38,7 +38,6 @@ export class Ed25519Node extends Revocable(class {}) {
}

async sign(message: Uint8Array): Promise<ByteArray> {
// Sign using noble-curves ed25519
return Buffer.from(ed25519.sign(message, this.#privateKey));
}

Expand All @@ -51,7 +50,7 @@ export class Ed25519Node extends Revocable(class {}) {
const indexBuffer = Buffer.alloc(4);
indexBuffer.writeUInt32BE(index, 0);

// SLIP-0010 Ed25519 derivation
// SLIP-0010 for Ed25519
const data = Buffer.concat([Buffer.from([0x00]), Buffer.from(this.#privateKey), indexBuffer]);

const I = bip32crypto.hmacSHA512(Buffer.from(this.#chainCode), data);
Expand Down
2 changes: 0 additions & 2 deletions packages/hdwallet-native/src/native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,6 @@ export class NativeHDWallet
this.#ed25519MasterKey = Promise.resolve(
await (async (mnemonic, masterKey) => {
if (masterKey !== undefined) {
// If a master key is provided, we'll need a way to derive the Ed25519 key from it
// This might require additional logic depending on your key derivation method
throw new Error("TODO?");
} else if (mnemonic !== undefined) {
const isolatedMnemonic = await (async () => {
Expand Down

0 comments on commit 5f7eb93

Please sign in to comment.