From 56a39264ad05bb69cce798c46973d5b86ef36bf4 Mon Sep 17 00:00:00 2001 From: Ilja Date: Tue, 15 Mar 2022 16:00:52 +0200 Subject: [PATCH] Update solana method names, fix signMessage --- wallets/react-wallet-v2/src/data/SolanaData.ts | 4 ++-- wallets/react-wallet-v2/src/lib/SolanaLib.ts | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wallets/react-wallet-v2/src/data/SolanaData.ts b/wallets/react-wallet-v2/src/data/SolanaData.ts index e5b9ca0..6d6d1ee 100644 --- a/wallets/react-wallet-v2/src/data/SolanaData.ts +++ b/wallets/react-wallet-v2/src/data/SolanaData.ts @@ -32,6 +32,6 @@ export const SOLANA_CHAINS = { ...SOLANA_MAINNET_CHAINS, ...SOLANA_TEST_CHAINS } * Methods */ export const SOLANA_SIGNING_METHODS = { - SOLANA_SIGN_TRANSACTION: 'sol_signTransaction', - SOLANA_SIGN_MESSAGE: 'sol_signMessage' + SOLANA_SIGN_TRANSACTION: 'solana_signTransaction', + SOLANA_SIGN_MESSAGE: 'solana_signMessage' } diff --git a/wallets/react-wallet-v2/src/lib/SolanaLib.ts b/wallets/react-wallet-v2/src/lib/SolanaLib.ts index e6c77b2..22273c0 100644 --- a/wallets/react-wallet-v2/src/lib/SolanaLib.ts +++ b/wallets/react-wallet-v2/src/lib/SolanaLib.ts @@ -35,8 +35,9 @@ export default class SolanaLib { public async signMessage(message: string) { const signature = nacl.sign.detached(bs58.decode(message), this.keypair.secretKey) + const bs58Signature = bs58.encode(signature) - return signature + return { signature: bs58Signature } } public async signTransaction(