From 45adc27df53fdee97e86c88e9d6ecc73f67e875d Mon Sep 17 00:00:00 2001 From: AricRedemption Date: Fri, 26 Apr 2024 19:19:59 +0800 Subject: [PATCH] fix: btc sign message again --- src/lib/actions/btc/sign-message.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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)) }