Docs Navigationexpand_more

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-relayer

Environments and endpoints

The Public Relayer has two JSON-RPC endpoints. Chain selection happens via relayer_getCapabilities params — not via a path on the URL.

ERC-7710 gas abstraction uses the permissionless Public Relayer JSON-RPC (relayer_* methods). The authenticated Dev Platform REST API is a separate surface with different method names — do not mix them. See Dev Platform: Get Started for REST integration.

  • Productionhttps://relayer.1shotapi.com/relayers — mainnet chains (Ethereum 1, Base 8453, …). Use for production mainnet flows.
  • Developmenthttps://relayer.1shotapi.dev/relayers — testnet chains: Base Sepolia (84532, recommended), Ethereum Sepolia (11155111). Use for development and CI scripts.
  • See Supported Networks for the full chain matrix.

Critical integration rules

  1. targetAddress is the delegation to — fetch from relayer_getCapabilities; the leaf delegation delegate must equal targetAddress. Any mismatch causes silent redemption failure.
  2. permissionContext is relayer JSON, not ABI hex — pass signed delegation objects via toRelayerJson(); do not use encodeDelegations() output. See Permission Context.
  3. Fee execution must be in executions — include an in-band ERC-20 transfer to feeCollector as executions[0], then your work call as executions[1], both in one redemption bundle.
  4. authorizationList — optional top-level param on send; at most one entry; required for first-use EIP-7702 upgrade; omit for browser EIP-7715 wallet flows.
  5. Quote expiry (~45s) — if signing takes too long, re-fetch fee/estimate context, update fee amount if needed, re-sign, and send immediately.
  6. Fee slippage buffer — when using pre-bundle relayer_getFeeData, use feeAmount = max(estimated, minFee) + buffer, or prefer Step 2 Option B estimate immediately before send. Both estimate and relayer_getFeeData return a context value. This serves as a lock for the quoted price, good for about 30 seconds. Return the context value verbatim to relayer_send7710Transaction to assure the fee is locked.
  7. delegationSecret (recommended) — pass the same app-level secret (10–1024 chars) on every send to bind delegations to your integration. Omit on estimate. See Permission Context: delegationSecret.

Complete runnable example

The First JSON-RPC Call page embeds full TypeScript examples that default to the dev relayer and Base Sepolia. Source: /examples/relayer-first-json-rpc-call.ts.

Minimal send shape (fee transfer first, then work)

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "relayer_send7710Transaction",
  "params": {
    "chainId": "8453",
    "context": "<context from relayer_getFeeData or estimate>",
    "destinationUrl": "https://my-app.example.com/relayer-webhook",
    "delegationSecret": "ChooseYourOwnSecretValueAndReuseItButDon'tRevealIt",
    "transactions": [{
      "permissionContext": [{
        "delegate": "<targetAddress>",
        "delegator": "<smart account>",
        "authority": "0x0000000000000000000000000000000000000000000000000000000000000000",
        "caveats": [],
        "salt": "<fresh 32-byte hex>",
        "signature": "<hex>"
      }],
      "executions": [
        { "target": "<erc20>", "value": "0", "data": "<fee transfer to feeCollector>" },
        { "target": "<work contract>", "value": "0", "data": "<work calldata>" }
      ]
    }]
  }
}

Why 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.
  • The correct relayer endpoint for your environment (mainnet → .com, testnet → .dev).
  • 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.

1

Authorize smart-account upgrade if needed

EVM Account
Local
Sign EIP-7702 authorization for a stateless delegator smart account.
2

Sign delegation and fee scope

EVM Account
USDCUSDC
USDTUSDT
USDGUSDG
Local
Sign delegation/caveats for fee payment and the target onchain execution.
3

Submit to the public relayer

EVM Account
1Shot Public Relayer
POST payload: delegation context, encoded transactions, optional: 7702 authorization + destinationUrl.
4

Track lifecycle status

EVM Account / App Backend
Webhook
Polling
1Shot Public Relayer
Webhook status updates to your destinationUrl.
Poll 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 targetAddress as the delegation to address and as the leaf delegate in permissionContext. If this does not match, redemption will fail silently.
  • Cache capabilities for the session and refresh periodically.
  • If capabilities return empty {} for a chain (reported on Base mainnet), verify endpoint/chain pairing or fall back to relayer_getFeeData to confirm support.

Relayer endpoint: https://relayer.1shotapi.com/relayers

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"]}' | jq

Step 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). Add a slippage buffer if signing may take more than a few seconds.
  • Treat quotes past expiry as stale and fetch a fresh quote before signing/submitting.
  • The decimals field in token data may arrive as a number or string — normalize defensively before arithmetic.

Relayer endpoint: https://relayer.1shotapi.com/relayers

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>"}}' | jq

Step 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 return error in the result body (not always a JSON-RPC error).
  • requiredPaymentAmount — fee in payment-token atoms, floored at chain/token minFee.
  • gasUsed — map of chain id → summed gas units (decimal strings). Do not call .toString() on the object — iterate keys.
  • context — signed price-lock quote for single-chain send; pass as params.context on send.
  • contextByChainId — per-chain signed quotes for multichain send; set params[i].context = contextByChainId[params[i].chainId].
  1. POST estimate with the current bundle (mock fee execution ≥ minFee).
  2. If success === false, fix the bundle from error (missing payment, below minFee, simulation revert, invalid delegation).
  3. If requiredPaymentAmount differs from your mock fee, update the fee execution amount and delegation scope, then re-sign and re-estimate.
  4. Send immediately with the returned context / contextByChainId to 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.

The send payload nests signed delegations and encoded calls under transactions[{ permissionContext, executions }].

  • Initialize a 7702StatelessDelegator smart account representation for the signer.
  • Browser EIP-7715 flow: the wallet handles EIP-7702 upgrade and authorization; do not add authorizationList to the relayer payload. Local/script signers may include one authorizationList entry on first use.
  • Create and sign a delegation scoped to required actions and amounts (fee transfer plus work call). Set to: targetAddress in createDelegation().
  • Build executions with fee transfer to feeCollector first, then the work call. See Permission Context.
  • Submit transactions with permissionContext (relayer JSON delegations) and encoded executions; include the signed context from Step 2 (Option B) estimate when available (result.context or result.contextByChainId[chainId]). Fall back to Step 2 (Option A) relayer_getFeeData only for pre-bundle rough quotes.
  • Include delegationSecret on send (same value for all submissions from your app; omit on estimate) to prevent third parties from replaying delegations copied from chain data. See Permission Context.
  • Prefer setting destinationUrl so 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.

Treat Confirmed (status 200) via webhook or relayer_getStatus as the public boundary for success/paid wording.

  • Preferred path: receive signed webhook events at destinationUrl and verify Ed25519 signatures against relayer JWKS. See Error Handling: Webhook verification.
  • Polling fallback: call relayer_getStatus with { id, logs } every 2–3 seconds until terminal.
  • Status codes are numeric: 100 Pending (non-terminal), 110 Submitted (non-terminal, may include top-level hash), 200 Confirmed (terminal — use receipt.transactionHash), 400 Rejected (terminal, message), 500 Reverted (terminal, data).
  • On Confirmed, receipt.blockHash and receipt.blockNumber may be unset; receipt.transactionHash is authoritative.

Relayer endpoint: https://relayer.1shotapi.com/relayers

Query relay status

Enter a TaskId to generate the curl command.

Implementation checklist

  • Match relayer endpoint to environment: .com for mainnet, .dev for Sepolia/Base Sepolia.
  • 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.
  • Reuse one delegationSecret per integration on every send; store it server-side, never in client-visible code or on-chain.
  • 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 1shot-wallet and embed the hosted wallet via OWSProxy (Host → Branding → Signing).