Solana dApp integration
EXZIX Wallet exposes Solana through Wallet Standard and a namespaced compatibility object. It never replaces window.ethereum or window.solana. Use the Wallet Standard path for a multi-wallet application, or window.exzixSolana for a small EXZIX-only integration.
What is supported
Connection, disconnect, Wallet Standard account events, message signing, transaction signing and sign-and-send are supported. EXZIX parses every requested transaction and opens the user-selected approval surface: Popup or Side Panel. The website never receives a private key.
- Wallet Standard: standard:connect, standard:disconnect and standard:events
- Solana features: solana:signMessage, solana:signTransaction and solana:signAndSendTransaction
- Legacy compatibility: window.exzixSolana only; window.solana is intentionally untouched
- Transaction versions: legacy and version 0 are supported by the current extension
Connect EXZIX Wallet
The namespaced compatibility surface is the shortest EXZIX-only integration. It returns the connected public address after the user approves the request.
// EXZIX keeps Solana separate from window.ethereum and window.solana.
const wallet = window.exzixSolana;
if (!wallet) throw new Error('EXZIX Wallet is not installed or enabled');
const connected = await wallet.connect();
const address = connected.publicKey.toString();
console.log({ address });Use Wallet Standard in a multi-wallet app
Use the Wallet Standard app registry to discover wallets by metadata and select the wallet the user chose. Do not identify a wallet using isPhantom, isMetaMask or a mutable global name. The EXZIX wallet name is EXZIX Wallet and its icon is provided by the wallet metadata.
import { getWallets } from '@wallet-standard/app';
const wallets = getWallets();
const exzix = wallets.get().find((item) => item.name === 'EXZIX Wallet');
if (!exzix) throw new Error('EXZIX Wallet is not detected');
const result = await exzix.features['standard:connect'].connect();
const account = result.accounts[0];
console.log(account.address);Listen for account changes
Clear application session state and reload balances whenever the selected account changes. A disconnected or changed account must not continue an authorization created for the previous account.
const wallet = window.exzixSolana;
const standardEvents = wallet?.__EXZIX_SOLANA_WALLET__;
// With Wallet Standard, subscribe through the wallet feature returned by
// your selected wallet. For the EXZIX compatibility object, reconnect when
// the page receives a new user action after the account has changed.Sign in with a Solana wallet
Wallet connection is not an EXZIX account login. Use a server-issued, one-time nonce and an exact message containing your domain, address, nonce and expiry. Verify the Ed25519 signature server-side, bind the session to the address and consume the nonce. Never accept a nonce generated in browser JavaScript.
const message = new TextEncoder().encode('Sign in to Example App\nNonce: ' + nonce);
const signature = await window.exzixSolana.signMessage(message);
// Send address, exact message, nonce and signature to your server.
// Verify the signature and consume the nonce on the server.Sign and send a transaction
Build the transaction in the dApp, use an explicit cluster RPC, set the fee payer to the connected address and simulate it before requesting a signature. Show the cluster, program IDs, accounts and amounts to the user. After signing, broadcast through your RPC and confirm the returned signature; a wallet approval does not prove network confirmation.
// Build and serialize the transaction with @solana/kit or your Solana SDK.
// The bytes must contain the exact recent blockhash and fee payer.
const signed = await window.exzixSolana.signTransaction(serializedTransactionBytes);
// Broadcast the signed bytes through your selected Solana RPC, then confirm
// the returned signature. Never treat a signature request as confirmation.Cluster and transaction rules
Solana does not use EVM-style hexadecimal chain IDs. Keep the cluster explicit in your application: mainnet-beta, devnet or testnet. The transaction bytes, recent blockhash and fee payer must belong to the same cluster. For new integrations prefer @solana/kit and transaction version 1 when the connected wallet advertises support; the current EXZIX extension compatibility surface supports legacy and version 0, so detect supported versions and use a compatible fallback.
- Always set maxSupportedTransactionVersion when reading versioned transactions or blocks.
- Treat account data, program logs, token metadata and RPC responses as untrusted input.
- Do not place a private key, seed phrase or decrypted vault data in the page or server request.
Errors and approval surfaces
4001 means the user rejected the request. 4100 means the site is not connected or the permission is no longer valid. -32602 indicates invalid transaction or method parameters. A locked wallet, missing local key or wrong cluster must be shown as a recoverable state, not retried in a loop. EXZIX chooses Popup or Side Panel from the user setting; a dApp should only wait for the provider promise.
Solana checklist
Install the Solana SDK and RPC client; select the wallet through Wallet Standard; request connect only from a user action; display the cluster and fee payer; simulate; request a signature; broadcast and confirm; handle rejection, stale blockhash, wrong cluster, unsupported transaction version and pending confirmation.
رفتن به محتوا
