Skip to content

Commit

Permalink
fix: btc sign message again
Browse files Browse the repository at this point in the history
  • Loading branch information
AricRedemption committed Apr 26, 2024
1 parent 3a378ec commit 45adc27
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/lib/actions/btc/sign-message.ts
Original file line number Diff line number Diff line change
@@ -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<string> {
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))
}

0 comments on commit 45adc27

Please sign in to comment.