From 3176f69fc533b78279bff0621879f9050bb44c89 Mon Sep 17 00:00:00 2001 From: fboucquez Date: Fri, 15 Nov 2024 11:46:22 -0300 Subject: [PATCH] feedback fix --- features/keychain/api/index.d.ts | 4 +++- features/keychain/module/crypto/secp256k1.js | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/features/keychain/api/index.d.ts b/features/keychain/api/index.d.ts index ede00d3..44cb031 100644 --- a/features/keychain/api/index.d.ts +++ b/features/keychain/api/index.d.ts @@ -34,7 +34,9 @@ export interface KeychainApi { secp256k1: { signBuffer(params: { data: Buffer } & KeySource): Promise signBuffer(params: { data: Buffer; enc: 'der' } & KeySource): Promise - signSchnorr(params: { data: Buffer; extraEntropy?: Buffer } & KeySource): Promise + signSchnorr( + params: { data: Buffer; extraEntropy?: Buffer; tweak?: Buffer } & KeySource + ): Promise } } diff --git a/features/keychain/module/crypto/secp256k1.js b/features/keychain/module/crypto/secp256k1.js index 36c53ad..060108f 100644 --- a/features/keychain/module/crypto/secp256k1.js +++ b/features/keychain/module/crypto/secp256k1.js @@ -49,7 +49,7 @@ export const create = ({ getPrivateHDKey }) => { ) const hdkey = getPrivateHDKey({ seedId, keyId }) const privateKey = tweak ? tweakPrivateKey({ hdkey, tweak }) : hdkey.privateKey - return Buffer.from(await secp256k1.schnorrSign({ data, privateKey, extraEntropy })) + return secp256k1.schnorrSign({ data, privateKey, extraEntropy, format: 'buffer' }) }, })