Skip to main content

Solana

Solana Provider is used to connect UKey Wallet Solana accounts in web applications. It allows applications to read public keys, sign messages, sign transactions and submit them to the Solana network.

Mini Demo

// Provider detection
const provider = window?.$ukey?.solana || window?.solana;
if (!provider?.isUKey) throw new Error("UKey Wallet Solana Provider not detected");

// establish connection
const { publicKey } = await provider.connect();
console.log(publicKey.toString());

Events

  • connect: Wallet connection successful.
  • disconnect: User or application disconnected.
  • accountChanged: The user switches accounts in the wallet.

Top Errors

  • 4001: The user refused the connection, signature or transaction request.