Solana

Solana integration via OneKey provider — detect, connect, send transactions, and sign messages

Use OneKey’s Solana provider in web apps.

Minimal pattern

// Detect
const provider = window?.$onekey?.solana || window?.solana
if (!provider?.isOneKey) throw new Error('OneKey Solana provider not detected')

// Connect
const { publicKey } = await provider.connect()
console.log(publicKey.toString())

Events

  • connect, disconnect, accountChanged

Common errors

  • 4001: user rejected the request

  • Use OneKey deeplinks with a WalletConnect URI for mobile handoff

Last updated

Was this helpful?