prepare_sol_transaction, sol_send_transaction, and get_send_transaction_status (plus Gas Station usage / limits for sponsorship budgets).
You can sign and broadcast Solana transactions in two primary ways:
-
Using the React handler (
handleSendTransaction) from@0xkey-io/react-wallet-kitThis gives you:- modals
- spinner + chain logo
- success screen
- explorer link
- built-in polling
-
Using low-level functions in
@0xkey-io/core/@0xkey-io/sdk-serverYou manually call:prepareSolTransaction→ build unsigned message (setsponsor: truefor fee sponsorship)solSendTransaction→ submitpollTransactionStatus/getSendTransactionStatus→ wait for confirmation
Fee sponsorship (
sponsor: true) uses a platform Solana fee-payer as
account_keys[0]. Review
Solana transaction construction for sponsored flows
before submitting third-party or router-built payloads.How Solana fee sponsorship works
Solana sponsorship is not EIP-7702. 0xkey inserts a platform fee-payer asaccount_keys[0] and requires the user wallet as the second required signer on the same transaction (custodial dual-sign). Your users do not need SOL for fees; 0xkey pays them and records usage against your Gas Station limits (lamports).
Enable Gas Station in the 0xkey dashboard and configure Solana spend limits before using
sponsor: true. Self-paid sends (sponsor: false) do not require Gas Station.Prepare then send (recommended)
- Call
prepareSolTransactionwithsponsor: trueso the unsigned message places the platform fee-payer at index0and the user at index1. - Submit
solSendTransactionwith the samesponsor: true,signWithset to the user address, and the unsigned transaction hex from prepare (or an equivalent message you built with the same account ordering).
POST /api/v1/sol_send_transaction) with WebAuthn / stamp auth.
Using handleSendTransaction (React)
When your React kit build exposes Solana send with sponsorship:
unsignedTransaction with prepareSolTransaction({ sponsor: true }) so fee-payer ordering matches what the coordinator validates.
Checking usage and limits
Gas Station tracks Solana sponsorship in lamports (separate from EVM wei limits). Query usage via Gas Station / gas-usage APIs and configure window limits in the dashboard.Policy notes
Sponsored and self-paid Solana sends both flow through the enclave parser and policy engine (solana.tx.*). With sponsor: true, policy binding allows signWith to be a non-fee-payer required signer (account_keys[1..)), and may require feePayer to match account_keys[0].
See Solana policy examples and Solana overview.
Next steps
- Solana (SVM) support
- Solana transaction construction for sponsored flows
- Sending sponsored EVM transactions (EIP-7702 Gas Station — different mechanism)