Skip to content

Connection buttons and wallet login

Use the official EXZIX Wallet button helper when you want a consistent branded connection control for EVM, Solana and TRON. It is a small browser helper, not a custody SDK: keys remain in the wallet and every approval is user initiated.

Official connection button

Load the official helper and mount a button into an element owned by your application. The helper keeps the EXZIX icon and starts the correct provider flow for the selected chain.

html
<link rel="stylesheet" href="https://exzix.com/assets/exzix-wallet-buttons.css">
<script src="https://exzix.com/assets/exzix-wallet-buttons.js" defer></script>
<div id="exzix-connect"></div>
<script>
window.addEventListener('DOMContentLoaded', () => {
  ExzixWallet.createButton({
    target: '#exzix-connect',
    chain: 'evm', // evm, solana or tron
    onConnect: ({ account, chainId }) => console.log(account, chainId),
    onError: (error) => console.error(error),
  });
});
</script>

Supported chains

Pass evm, solana or tron as the chain value. The helper uses EIP-6963 for EVM, window.exzixSolana for Solana and window.tronLink for TRON. It never overwrites window.ethereum, window.solana or another wallet provider.

Popup and Side Panel behavior

The website must not attempt to open a Chrome extension Popup or Side Panel directly. Call the provider from the click handler and wait for the promise. EXZIX opens the approval request in the surface selected by the user; this works for Popup, Side Panel and supported fallback tabs. If the wallet is locked or the extension is unavailable, show the error and offer a normal retry button.

Wallet login is not EXZIX account login

There are two separate concepts: an EXZIX website account uses the normal EXZIX authentication flow; a dApp wallet login proves control of a blockchain address. For dApp login, your server must issue a one-time nonce, bind it to the domain/address, verify the exact signed message and expire it. Never call a wallet signature “payment confirmation” and never accept a private key or seed phrase.

javascript
// The server creates this nonce and returns it once. It must include expiry
// and the exact origin/domain that will verify the signature.
const challenge = await fetch('/auth/wallet/nonce', { credentials: 'include' }).then((r) => r.json());
const { account, provider } = await ExzixWallet.connect('evm');
const message = `${challenge.domain} wants you to sign in.\nAddress: ${account}\nNonce: ${challenge.nonce}\nIssued At: ${challenge.issuedAt}\nExpiration Time: ${challenge.expiresAt}`;
const signature = await provider.request({ method: 'personal_sign', params: [message, account] });
await fetch('/auth/wallet/verify', { method: 'POST', headers: { 'Content-Type': 'application/json' }, credentials: 'include', body: JSON.stringify({ chain: 'evm', address: account, message, signature }) });

// Solana: send the exact UTF-8 message and the returned Ed25519 bytes.
const solana = await ExzixWallet.connect('solana');
const solanaSignature = await solana.provider.signMessage(new TextEncoder().encode(message));
const solanaSignatureBase64 = btoa(String.fromCharCode(...solanaSignature));
await fetch('/auth/wallet/verify', { method: 'POST', headers: { 'Content-Type': 'application/json' }, credentials: 'include', body: JSON.stringify({ chain: 'solana', address: solana.account, message, signature: solanaSignatureBase64 }) });

// TRON: EXZIX returns a 0x-prefixed r || s || recovery signature.
const tron = await ExzixWallet.connect('tron');
const tronSignature = await tron.provider.signMessage(message);
await fetch('/auth/wallet/verify', { method: 'POST', headers: { 'Content-Type': 'application/json' }, credentials: 'include', body: JSON.stringify({ chain: 'tron', address: tron.account, message, signature: tronSignature }) });

Server-side verification

For EVM verify EIP-191 personal_sign or EIP-712 according to the exact method requested. For Solana verify the Ed25519 signature against the connected public key. For TRON verify the TRON message signature against the normalized base58 address. Use HTTPS, short expiries, replay protection and a server session bound to the verified address.

Transaction UX rules

Before a signing request, show network, account, recipient/contract, function, token, amount, fee limit or gas limit and whether the transaction is a deployment. Simulate where the chain supports it, do not retry after rejection, and wait for a server or chain confirmation after broadcast.

Production checklist

Serve the dApp over HTTPS; use a visible button; request connection only after a click; discover providers by standard metadata; preserve account/network change listeners; use server nonces for login; validate all contract addresses and calldata; support locked-wallet and wrong-network states; never store secrets; and test Popup, Side Panel, rejection, pending, timeout and extension-not-installed flows.