diff --git a/src/lib/actions/btc/sign-message.ts b/src/lib/actions/btc/sign-message.ts index e2ad58e6..c2766b99 100644 --- a/src/lib/actions/btc/sign-message.ts +++ b/src/lib/actions/btc/sign-message.ts @@ -1,7 +1,10 @@ import { getCurrentWallet } from '@/lib/wallet' +import { Message, PrivateKey } from 'bitcore-lib' import { Chain } from '@metalet/utxo-wallet-service' export async function process(message: string, encoding?: BufferEncoding): Promise { const wallet = await getCurrentWallet(Chain.BTC) - return wallet.signMessage(message, encoding ?? 'base64') + const privateKey = wallet.getPrivateKey() + const signMessage = new Message(message) + return signMessage.sign(new PrivateKey(privateKey)) }