Skip to main content
This demo shows how transaction signing works with Action Codes. You’ll build a SOL transfer and sign it with your wallet.
This demo creates a real transaction. If you approve it, SOL will be transferred from your wallet.

How to use this demo

1

Get a code from actioncode.app

Open actioncode.app in your Solana wallet’s browser (Phantom, Solflare, etc.), connect your wallet, and tap “Get Code”
2

Enter transfer details below

Paste your 8-digit code, enter the recipient address, and the amount of SOL to send
3

Approve in actioncode.app

Go back to actioncode.app — you’ll see the transaction request. Review and approve it with your wallet.
4

See the result

Once approved, the transaction signature appears below
Codes expire in ~2 minutes. Get a fresh code right before using this demo.


What’s happening

This demo calls the Action Codes SDK:
// 1. Resolve the code to get the wallet address
const actionCode = await client.resolve(code)

// 2. Build the transaction
const transaction = new Transaction().add(
  SystemProgram.transfer({
    fromPubkey: new PublicKey(actionCode.pubkey),
    toPubkey: new PublicKey(recipient),
    lamports: amount * LAMPORTS_PER_SOL
  })
)

// 3. Attach the transaction
const serialized = transaction.serialize({ requireAllSignatures: false })
await client.attachTransaction(code, serialized.toString('base64'))

// 4. Wait for user approval
for await (const status of client.observeStatus(code)) {
  if (status.finalizedSignature) {
    // User signed the transaction!
  }
}
For the full SDK reference, see SDK Methods.