Getting Started

Connect to Sui using OneKey's Sui Wallet Standard provider

Learn how to detect, connect, and interact with Sui using OneKey's provider.

OneKey implements the Sui Wallet Standard, ensuring compatibility with all Sui dApps.


Provider Detection

// Detect OneKey Sui provider
const provider = window.$onekey?.sui

if (!provider) {
  throw new Error('OneKey Sui provider not detected')
}

Check Permissions

// Check if already connected
const hasPermission = await provider.hasPermissions()

if (hasPermission) {
  const accounts = await provider.getAccounts()
  console.log('Connected accounts:', accounts)
}

Request Connection


Get Accounts


Get Active Chain


Check Connection Status


Disconnect


Event Listeners

Listen for Account Changes

Listen for Network Changes


Using with Sui Wallet Kit

For React applications, use the official Sui Wallet Kit:

OneKey is automatically detected through the Sui Wallet Standard.

Last updated

Was this helpful?