Quickstart
Quickstart: Gas Abstraction (EIP-7710)
Run a minimal gas-sponsorship flow through the public relayer.
Recommended first step: load the skill
For best results, install and use the public-relayer skill before implementing this quickstart. It includes proven guidance for capability discovery, fee quote locking, delegation payloads, and status tracking.
Install skill
npx skills add 1Shot-API/skills/public-relayerWhy Use the 1Shot Public Relayer
The 1Shot public relayer provides intent execution infrastructure with gas abstraction in a single permissionless solution with no signup, no business account, and no tier-managed overhead. You can integrate directly over JSON-RPC and ship immediately.
To pay for execution, include a stablecoin transfer in the submitted bundle using one of the relayer's accepted tokens. If the fee token sits on a different network than the work transaction, you can pay gas on one chain and still execute work on the target chain. The 1Shot relayer gives you a stable, highly-available delegate address to grant execution permissions to so your app or agent doesn't have to manage its own delegate key just to handle intents.
The relayer is built for enterprise-scale traffic, so when usage spikes you don't need to upgrade plans or pre-fund infrastructure like a paymaster. 1Shot handles operational capacity so your team can focus on product growth.
What you need before starting
- A target chain supported by the relayer and an accepted ERC-20 payment token for that chain.
- A signer that can produce EIP-7702 authorization and delegation signatures (commonly via
@metamask/smart-accounts-kit). - A transaction intent to execute (token transfer, app action, or contract call) and a rough gas estimate.
- A webhook endpoint (
destinationUrl) if you want near real-time status updates without polling.
Lifecycle
The end-to-end flow from account authorization to confirmed relay status.
Authorize smart-account upgrade if needed
Sign delegation and fee scope
Submit to the public relayer
destinationUrl.Track lifecycle status
destinationUrl.relayer_getStatus until terminal state.Step 1: Discover relayer capabilities
Call relayer_getCapabilities first. Use this response as source-of-truth for chain support, accepted payment tokens, feeCollector, and targetAddress.
- Do not hardcode payment tokens; pick from the returned token list for the selected chain.
- Use the returned
targetAddressas the delegationtoaddress. If this does not match, redemption will fail. - Cache capabilities for the session and refresh periodically.
Query supported networks and tokens
curl -X POST "https://relayer.1shotapi.com/relayers" -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1,"method":"relayer_getCapabilities","params":["1"]}' | jqStep 2 (Option A): Quote fee and lock context
Use relayer_getFeeData when the delegation bundle is **not built yet** — for example, to show a rough fee in browser permission UX before the user signs.
Call relayer_getFeeData with (chainId, paymentToken).
This returns gasPrice, rate, minFee, expiry, and context. Pass the exact context into your send call to lock the quote during its validity window.
- Estimate execution gas and convert native gas cost to payment-token amount using
rate. - Apply the floor:
feeAmount = max(convertedFee, minFee). - Treat quotes past
expiryas stale and fetch a fresh quote before signing/submitting.
Quote network fee (price lock)
curl -X POST "https://relayer.1shotapi.com/relayers" -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1,"method":"relayer_getFeeData","params":{"chainId":"8453","token":"<select-token>"}}' | jqStep 2 (Option B): Estimate fee from a signed bundle
Once the send bundle is assembled (Step 3), call the matching estimate method **immediately before submission**. Use the same params shape as send; omit context. Optional taskId, destinationUrl, and memo are ignored for pricing.
Prefer the estimate context over Step 2 (Option A) relayer_getFeeData when the signed bundle exists. Reserve Step 2 (Option A) for pre-bundle rough quotes only.
- Same chain fee + work execution →
relayer_estimate7710Transaction. - Fee on chain A and work on chain B (or atomic multi-chain batch) →
relayer_estimate7710TransactionMultichain. success— check before send; validation and simulation failures returnerrorin the result body (not always a JSON-RPC error).requiredPaymentAmount— fee in payment-token atoms, floored at chain/tokenminFee.gasUsed— map of chain id → summed gas units (decimal strings).context— signed price-lock quote for single-chain send; pass asparams.contexton send.contextByChainId— per-chain signed quotes for multichain send; setparams[i].context = contextByChainId[params[i].chainId].
- POST estimate with the current bundle (mock fee execution ≥
minFee). - If
success === false, fix the bundle fromerror(missing payment, below minFee, simulation revert, invalid delegation). - If
requiredPaymentAmountdiffers from your mock fee, update the fee execution amount and delegation scope, then re-sign and re-estimate. - Send immediately with the returned
context/contextByChainIdto lock the quote (~45 seconds).
Example: Estimate Gas Abstracted Token Send
Select a chain to load supported tokens.
Relayer endpoint: https://relayer.1shotapi.com/relayers
Estimate transaction fee
Connect, sign a delegation, and run estimate to generate the curl command.Step 3: Build and send the transaction bundle
Use relayer_send7710Transaction for same-chain fee + execution, or relayer_send7710TransactionMultichain when fee payment and execution happen across chains.
- Initialize a
7702StatelessDelegatorsmart account representation for the signer. - Browser EIP-7715 flow: the wallet handles EIP-7702 upgrade and authorization; do not add
authorizationListto the relayer payload. Local/script signers may include oneauthorizationListentry on first use. - Create and sign a delegation scoped to required actions and amounts (fee transfer plus work call).
- Submit
transactionswith permission context and encoded executions; include the signedcontextfrom Step 2 (Option B) estimate when available (result.contextorresult.contextByChainId[chainId]). Fall back to Step 2 (Option A)relayer_getFeeDataonly for pre-bundle rough quotes. - Prefer setting
destinationUrlso relayer status is pushed to you instead of polled.
Example: One-time Gas Abstracted Token Send
Select a chain to load supported tokens.
Relayer endpoint: https://relayer.1shotapi.com/relayers
Gas relay transaction
Curl -X POST ...Step 4: Track execution to terminal state
Submission returns TaskId (or TaskId[] for multichain). Track each task until terminal success/failure.
- Preferred path: receive signed webhook events and verify Ed25519 signatures against relayer JWKS.
- Polling fallback: call
relayer_getStatusevery 2-3 seconds and stop on terminal statuses. - Operational status shape: Pending/Submitted are non-terminal; Confirmed/Rejected/Reverted are terminal.
Relayer endpoint: https://relayer.1shotapi.com/relayers
Query relay status
Enter a TaskId to generate the curl command.Implementation checklist
- Always use fresh delegation salt values to avoid replay collisions.
- Serialize bigint/byte values to JSON-safe hex before sending JSON-RPC payloads.
- Scope permissions narrowly (amount, token, target function) and avoid overbroad allowances.
- Use webhooks in production for scale, and verify each event signature before accepting state transitions.
- Log task IDs and terminal outcomes with enough context for support/debugging.
Use the skill to accelerate implementation
- Install:
npx skills add 1Shot-API/skills/public-relayer - Prompt your coding agent with concrete outcomes: capabilities fetch, fee lock flow, signed send call, and webhook verification.
- For non-custodial client wallets, combine with
webauthn-prf-walletand keep key material isolated in an iframe boundary.