Ika Accountsdocs

Reference

#createIkaAccounts

ts
createIkaAccounts(options: CreateIkaAccountsOptions): IkaAccounts
OptionType
apiKeystringYour platform key, from the dashboard.
apiUrlstringhttps://ika-accounts.mpckit.xyz
keysOriginstringhttps://ika-accounts.mpckit.xyz. Required in browsers.
network'mainnet' | 'testnet'Default 'mainnet'.
sessionSessionConfigOptional. See sessions.
suiUrlstringOptional Sui gRPC endpoint for reads.
keyHostKeyHostNode and tests: createLocalKeyHost(...) instead of the iframe.

#Methods

Sign-in

openConnect(options?)Sign-in modal. Resolves addresses or null.
reconnect()Restores the last wallet silently, or resolves null.
signInWallets()Installed wallets: { id, name, icon, chain }[].
connectWallet(id)Signs in with one of them.
connect(provider)Signs in with an EIP-1193 provider or a Solana wallet.
disconnect()Signs out and ends the session on-chain.
forgetDevice()Also erases this browser's cached key.
preload()Fetches Ika parameters early.
whenReady()Resolves when the account's keys are ready.
subscribe(listener)Called on sign-in and sign-out. Returns an unsubscribe function.

State: isConnected, address, addresses, owner, wallet, fundingWallets.

Transactions

execute(input)Gasless Sui transaction. { digest }
perform(options)Fund if needed, then execute. { digest, deposits }
swap({ from, to, amountIn | amountOut })Swap on Sui through Aftermath.
balance(coinType?)Balance on Sui, default USDC. bigint
signMessage(bytes)Raw Ed25519 signature.
near.signIntents(intents), near.publish(signed)NEAR Intents.
solana.signTransaction(message)Solana.

Funds

openFunds({ tab, receive })Deposit and withdraw panel.
estimateDeposit(params), estimateWithdraw(params)Quote without an order.
deposit(params)Creates an order: { order, send(), wait() }.
withdraw(params)Sends from Sui: { order, digest, wait() }.
waitForOrder(id)Follows an order to SUCCESS, or throws.
tokens(), chains()Everything that can be bridged, with logos.
fundingOptions()The user's bridgeable balances, largest first.
availableWallets(), addFundingWallet(id)Extra wallets to deposit from.

#React

tsx
import { IkaAccountsProvider, useIkaAccount, useBalance, usePerform } from '@ika-accounts/react';

<IkaAccountsProvider options={{ apiKey, apiUrl, keysOrigin, network: 'mainnet' }}>
  <App />
</IkaAccountsProvider>

const { connect, addresses, isReady } = useIkaAccount();
const { balance } = useBalance(USDC);
const { perform, status, error } = usePerform();

useIkaAccounts() returns the client, and useFundingOptions() the user's balances on other chains.

#Errors

The SDK throws IkaAccountsError with a stable code. API errors surface with the API's code.

CodeMeaning
not_connectedCall a sign-in method first.
transaction_failedThe transaction executed and failed on-chain.
insufficient_fundsNo balance on any connected chain covers the amount.
bridge_refunded, bridge_failedThe bridge order was refunded or failed.
bridge_timeout, balance_timeoutFunds didn't arrive in time.
approval_required, invalid_approval, approval_expiredThe wallet approval is missing, wrong or too old.
wallet_key_mismatchThe wallet produced a different key than the account's (not deterministic).
rate_limitedA limit was hit. See limits.
insufficient_platform_balanceYour platform balance is too low. Top up.
presign_pool_empty, service_underfunded, service_pausedTemporary. Retry shortly.

#Deployments

Sui mainnet:

Accounts package0xc60bb39a956847eeb02651435809241e8a6aa83780e157f5523ddbdfa533cae0
Registry0xb83e52ab869e84bc435f8042403b6de28b3796b6e640feac6867759d20e53b76
Upgrade timelock (7 days)0xac3bdc737adf7b9e829759237f1bf9993b935012afbd4e0cd656693f1796cda2

#Endpoints

APIhttps://ika-accounts.mpckit.xyz/v1
Key originhttps://ika-accounts.mpckit.xyz
Dashboardhttps://dashboard-ika-accounts.mpckit.xyz
Healthhttps://ika-accounts.mpckit.xyz/health