Combine @abstraxn/server-signer and @abstraxn/relayer so your backend agent can sign meta-transactions with an Abstraxn Server Wallet and submit them gaslessly through the relayer.
How it works
| Step | Who signs / pays |
|---|
| Meta-tx authorization | Abstraxn Server Wallet |
| On-chain execution | Relayer (gas tank) |
Install
1. Authenticate the server wallet
Use the same userIdentity string every time — it must match the value you used when the wallet was first created.
userIdentity is permanent. Changing it creates a new wallet. accessKey must match the key from the first authenticate() for that identity.
2. Create a relayer signer
createRelayerSigner() returns a signer the relayer SDK can use. Signing is handled remotely by Abstraxn — your backend never holds the wallet private key.
3. Build and send a gasless transaction
Pick the build method that matches your contract (see Relayer guide):
| Method | When to use |
|---|
buildRelayerTxEIP712 | Default — most Abstraxn meta-tx contracts |
buildRelayerTx | Contracts that verify EIP-191 signMessage hashes |
Use buildRelayerTx only if your contract does not verify EIP-712 MetaTransaction typed data.
Prerequisites
- Same
userIdentity on every authenticate() call for that wallet
- Contract exposes
getNonce(address) and your target method in the ABI
- Contract is whitelisted on your relayer app
- Relayer gas tank has balance on the target chain
fromAddress / server wallet address owns the on-chain meta-tx nonce
- (Optional) If wallet whitelist is enabled in Dashboard, your server wallet address must be in the list — add it with
setWalletWhitelist() from the backend (details)
Environment variables
| Variable | Description |
|---|
ABSTRAXN_API_KEY | App API key from dashboard |
SERVER_WALLET_ACCESS_KEY | 64-char hex from first authenticate() (omit on first run) |
RPC_URL | Chain JSON-RPC URL |
RELAYER_URL | Relayer URL from dashboard |
Next Steps