DecaneDocs
Gas & RPCGas sponsorship
Gas & RPC

Gas sponsorship

!

Early access. In decane-connect-kit 2.32.0 and decane-connect-kit-expo 0.7.0 and later. Turn it on yourself on your project’s Gas sponsorship page in the dashboard: set a payout wallet, switch it on, and top up the gas tank.

A new user has a wallet but no ETH to move anything with. A sponsored send lets them send anyway: your project pays the gas from its gas balance, or the user pays the fee in a token such as USDC. It works on the user’s existing Decane wallet, and the address never changes. EVM only; Base first.

Send with sponsorship

The methods are on the client: decane below is the object createDecaneConnect() returns (or the Expo client). The React hooks do not expose them yet.

tscheckout.ts
// The project pays the gas (the default).
const { transactionHash } = await decane.sendSponsoredTransaction({
  chain: "evm:8453",
  to: shop,
  data: checkoutCall,
});

// Several calls, executed atomically in one operation.
await decane.sendSponsoredTransaction({
  chain: "evm:8453",
  calls: [
    { to: USDC, data: approveCall },
    { to: shop, data: checkoutCall },
  ],
});

// The user pays the fee in a token instead of ETH.
await decane.sendSponsoredTransaction({
  chain: "evm:8453",
  to: shop,
  data: checkoutCall,
  payGasWith: { token: USDC },
});

It resolves once the operation is on chain, with { userOpHash, transactionHash, success }, and throws with the sponsor’s reason when the project’s policy refuses the send. Paying in a token approves at most twice the worst-case fee, never an unlimited amount.

Configure the default

tsxapp.tsx
<DecaneKit config={{
  social: {
    apiKey: "dck_live_…",
    gasSponsorship: {
      payGasWith: { token: USDC }, // default: "sponsor", the project pays
      routeSendTransaction: false, // true: sendTransaction is sponsored too
    },
  },
}}>

With routeSendTransaction: true, an ordinary sendTransaction also goes through sponsorship and then resolves on inclusion (up to 120 seconds), not on broadcast. Left false, sponsorship is only ever used when you call sendSponsoredTransaction.

Methods

MemberTypeDescription
The client (createDecaneConnect, and the Expo client)
sendSponsoredTransaction(req)Promise<SponsoredSendResult>Send one call (to, value, data) or several (calls) with the gas paid by the project, or by the user in payGasWith.token.
getSponsorshipStatus(chain)Promise<SponsorChainConfig>Whether sponsorship is available on the chain for this project, and the reason when it is not (for example PROJECT_SUSPENDED).
quoteGasInToken({ chain, token, gas? })Promise<{ token, maxAmount }>The most a send would cost in the token, to show before the user picks pay in USDC.

How it works

  • The wallet is an EOA. Its first sponsored send delegates it to Simple7702Account (EIP-7702) in the same operation, so the address and balances stay the same. A wallet already delegated to another contract is refused.
  • The operation is an ERC-4337 UserOperation, signed by the enclave as EIP-712 typed data, and sent through Decane’s /sponsor proxy, which speaks to the sponsor platform for your project. No key or credential for it reaches a browser or a phone.
  • The SDK uses only the EntryPoint, paymaster and 7702 delegate pinned in the package. A config naming any other contract is refused before anything is signed, so a breached server cannot point a wallet at its own contract.

Limits and safety

  • Off for every project until its owner switches it on, which needs a payout wallet first.
  • Paid from a prepaid gas tank, topped up in a stablecoin from the dashboard; an empty tank stops sponsoring, and nothing is billed afterwards.
  • Only the signed-in user’s own wallet can have operations sponsored.
  • Each session is held to 120 proxy calls a minute.
  • Caps per transaction, per user per day and per project per day are set on the Gas sponsorship page.
  • When a user pays the gas in a token, the payment goes to your payout wallet, and your markup on it (up to 50%, set per token) is yours.
  • A frozen wallet sponsors nothing; a suspended project stops sponsoring at once.

Pricing: the gas your users’ sends use, plus a small platform fee, published on the pricing page before sponsorship goes live. The React Native SDK has the same methods.