Solana Wallets
Kevo provisions embedded Solana wallets for users and signs messages or transaction payloads through the authenticated server-backed signing flow.
How Solana wallets work
Solana wallets are created on demand with /v1/wallets/me/solana/ensure or automatically through the SDK when a flow requires them. The resulting wallet is project-scoped and can be used across devices after a normal login.
Getting Solana wallets
React hook
typescript
import { useWallets } from '@kevo-ws/sdk/react'
function SolanaWalletInfo() {
const { solanaWallet, isLoading } = useWallets()
if (isLoading) return <Spinner />
if (!solanaWallet) return <p>No Solana wallet yet</p>
return <p>Address: {solanaWallet.address}</p>
}KevoSolanaWallet type
typescript
interface KevoSolanaWallet {
id: string
address: string
createdAt: string
}Signing Solana messages
typescript
import { useSignSolanaMessage } from '@kevo-ws/sdk/react'
function SolSignDemo() {
const { signSolanaMessage, isLoading } = useSignSolanaMessage()
const handle = async () => {
const sigHex = await signSolanaMessage('Hello Solana!')
console.log(sigHex)
}
return <button onClick={handle} disabled={isLoading}>Sign Message</button>
}Signing and sending transactions
sendSolanaTransaction handles sign plus broadcast and returns the base58 transaction signature. Use signSolanaTransaction when you only need the Ed25519 signature.
Send a SOL transfer
typescript
import { useSignSolanaTransaction, useWallets } from '@kevo-ws/sdk/react'
import { solTransfer, getRecentBlockhash } from '@kevo-ws/sdk/helpers'
function SendSolDemo() {
const { sendSolanaTransaction, isLoading } = useSignSolanaTransaction()
const { solanaWallet } = useWallets()
const send = async () => {
const bh = await getRecentBlockhash('https://api.devnet.solana.com')
const msgBytes = solTransfer({
from: solanaWallet!.address,
to: 'RecipientBase58Address',
lamports: 1_000_000,
recentBlockhash: bh,
})
const txSig = await sendSolanaTransaction(msgBytes)
console.log('TX signature:', txSig)
}
return <button onClick={send} disabled={isLoading}>Send 0.001 SOL</button>
}Solana helpers
typescript
import {
solTransfer,
getRecentBlockhash,
splTokenTransfer,
getAssociatedTokenAddress,
base58Encode,
base58Decode,
} from '@kevo-ws/sdk/helpers'HTTP API
GET /v1/wallets/me/solanaGet the current user's Solana wallet.POST /v1/wallets/me/solana/ensureCreate the current user's Solana wallet if needed.POST /v1/wallets/me/solana/signSign a Solana message or transaction payload.POST /v1/wallets/me/export/solana/confirmOTP-gated export confirmation for the Solana private key.✦
Solana transaction signatures are base58-encoded 64-byte Ed25519 signatures, the same identifier explorers show as the transaction ID.