Sign-in and accounts
A user signs in with a wallet they already have. That wallet becomes the owner of a Sui account: it approves every transaction, and it is the only way to recover the account.
#The sign-in modal
const addresses = await accounts.openConnect();The modal finds every installed wallet: EVM wallets through EIP-6963 (MetaMask, Rabby, Coinbase Wallet, Phantom's EVM side…) and Solana wallets through Wallet Standard (Phantom, Backpack, Solflare…). Wallets that support both appear in both groups. The last one used is marked, and if no wallet is installed the modal offers install links.
It resolves with the account's addresses, or null if the user closed it.
#Bring your own wallet UI
If you already have a wallet picker, list the wallets yourself and connect one by id:
const wallets = await accounts.signInWallets(); // [{ id, name, icon, chain: 'evm' | 'solana' }]
await accounts.connectWallet(wallets[0].id);Or pass a provider you already hold, such as an EIP-1193 provider from wagmi or a Solana wallet with signMessage:
await accounts.connect(await connector.getProvider());#What the user signs
| When | Prompts |
|---|---|
| First visit on a device | Approve your site once, then sign one message in the wallet. It derives the account key; it is not a transaction and costs nothing. |
| First account for an EVM wallet | One extra signature of the same message, to confirm the wallet signs deterministically. |
| Returning on the same device | Nothing. The key stays sealed in the browser, and reconnect() restores the session silently. |
| Every transaction | One approval in the wallet, unless it falls inside an active session. |
The key message and the site approval happen in a small window on the Ika Accounts origin, so your page never sees the signature the key is derived from.
Wallets must sign deterministically: the same message must always give the same signature. Regular EOA wallets do. Smart-contract and passkey wallets don't, and are refused before an account is created.
#One key, three addresses
accounts.addresses; // { sui, solana, nearIntents, publicKey }The account is an Ed25519 key, so it is also a valid Solana address and a NEAR Intents implicit account. See NEAR and Solana.
The Sui address exists as soon as the user signs in. The dWallet behind it is created on Ika with the user's first transaction, in the same request, so nothing is spent on users who never transact.
#State
accounts.isConnected; // boolean
accounts.address; // Sui address (throws before sign-in)
accounts.owner; // { chain: 'evm' | 'solana', address } of the owner wallet
accounts.wallet; // { id, name, icon, chain, address } when signed in through the modal
accounts.subscribe(() => render()); // called on sign-in and sign-out
await accounts.whenReady(); // resolves when the account's keys are ready (execute() waits anyway)#Signing out
await accounts.disconnect(); // signs out and ends any active session on-chain
await accounts.forgetDevice(); // also erases this browser's cached key and site approvalAfter forgetDevice(), the next sign-in on that browser asks the wallet again, as on a new device. The account itself is unchanged: the same wallet always derives the same key.