Pay gas in any token
Users don't need native ETH at all — they can pay gas in any ERC-20. The user signs an exact fee; the on-chain KryardDelegate transfers that token amount to the relayer as the batch's final step.
How it works
- Kryard quotes a token fee off-chain (
gas × price × rate × margin). - The user signs the batch including the exact
gasToken+gasTokenAmount— so the relayer can never inflate it. KryardDelegate.executeWithGasReimbursementruns the batch, then transfers the token fee to the relayer and emitsGasReimbursed(relayer, gasToken, amount).- Kryard records the token usage; query it via
token_usage.
Usage
Add gasToken, gasTokenAmount, and relayer to sponsorExecute:
ts
await sponsorExecute({
client, signer, chainId, signWith, delegateAddress, calls, nonce,
gasToken: USDC,
gasTokenAmount: 50_000n, // Kryard quotes this off-chain
relayer: RELAYER_ADDRESS, // the address the relayer signs with on this chain
});The user signs the fee
The fee is part of the digest the user signs — it is cryptographically fixed. A relayer cannot charge more than the user agreed to. The user must hold enough of gasToken and have approved the delegate to move it where required.
Verifying settlement
The reimbursement is observable two ways:
- On-chain: the
GasReimbursedevent on the transaction. - Off-chain: the org's
token_usagerollup reflects thegas_token/gas_token_amountrecorded for the activity.