- Send native SOL transfers
- Send SPL-token transfers (with automatic ATA creation)
- Submit arbitrary program instructions
- Track transaction status until finality
- Sponsor gas for your users (same model as EVM Paymaster)
Installation
Setup
Relayer URL Format
The Solana relayer URL follows this pattern:Get Your Relayer URL
- Visit https://dashboard.abstraxn.com/ and log in or sign up
- Go to Apps → create or select an app with Solana as a supported chain
- Navigate to Paymaster — if your app has Solana selected, you will see the Solana paymaster link
- Copy the Paymaster URL — this is your relayer URL
Create the Client
Core Flow
Every relayed transaction follows four steps:Native SOL Transfer
Send SOL from one wallet to another, with gas paid by the relayer:SPL Token Transfer
Transfer any SPL token. If the recipient’s Associated Token Account (ATA) does not exist, the SDK automatically creates it with the relayer as rent payer.Token transfer parameters
Custom Program Transaction
For any instruction set that isn’t a simple transfer — swaps, NFT mints, program calls — pass your own instructions:Static instructions
Dynamic instructions with buildInstructions
When your instructions need the relayer’s public key before they can be built (e.g. ATA creation where the relayer pays rent), use the buildInstructions callback:
buildTx Input Variants
buildTx accepts exactly one of three transaction types:
All variants require
connection and sender.
API Reference
new SolanaRelayer(config)
buildTx(params) → { tx, lastValidBlockHeight }
Fetches an available relayer, reserves it, and builds a VersionedTransaction. Returns the transaction and block height for expiry tracking.
signTx(params) → serializedTransaction
sendTx(params) → { txnId }
getTxStatus(params) → { status, signature }
Returns:
How It Works Under the Hood
The SDK communicates withsol-relayer-hub using a JSON-RPC style protocol over a single POST endpoint:
You never call these directly — the SDK handles serialization, reservation tokens, and retries.
Integrating with Wallet Adapters
ThesignTx method accepts any standard Solana wallet adapter. Here’s a React example using @solana/wallet-adapter-react:
Troubleshooting
Q:buildTx fails with “no relayer available”
All relayers are currently reserved. Wait a moment and retry — relayers are released after submission or timeout.
Q: sendTx returns an error
- Ensure you call
sendTxafter a successfulbuildTx(the reservation token is stored internally). - Check that the
lastValidBlockHeighthas not expired — if the block height has passed, rebuild the transaction.
- Verify the
mintaddress is correct on the target network (devnet vs mainnet). - Ensure
splTokenProgramIdmatches the token standard (Token vs Token-2022).
- Check Solana network status for congestion.
- Verify the relayer hub is healthy via its health endpoint.
Security Notes
- Store the relayer URL (which contains your API key) in server-side environment variables.
- Validate all user inputs (addresses, amounts) before building transactions.
- The relayer only pays gas from your sponsored pool — it cannot move user funds. Users must still sign with their own wallet.
- Monitor your gas pool balance in the dashboard to avoid failed sponsorships.
Useful Links
- Dashboard: https://dashboard.abstraxn.com/
- EVM Relayer Docs: Relayer (EVM)
- Support: https://www.abstraxn.com/contact-us/