@fueltender/docking-port
v0.1.0
Published
Docking port: sponsor a Robinhood Chain call from a Fueltender gas tank in one line (EIP-7702 + ERC-4337 v0.8, viem).
Maintainers
Readme
fueltender
The Docking port: sponsor a Robinhood Chain call from a Fueltender gas tank in one line. Your user holds 0 ETH; the tank pays the gas.
Under the hood: EIP-7702 (the user's EOA delegates to Simple7702Account) + ERC-4337 v0.8 (one UserOp through the Fueltender bundler, paid by TankPaymaster). Built on viem, no other runtime dependencies.
Quickstart
npm i @fueltender/docking-port viemimport { sponsor, AIRLOCK } from '@fueltender/docking-port'
const { txHash, gasPaidEth } = await sponsor({ account, tankId: 1, to: AIRLOCK, abi, functionName: 'sign', args: ['hello'] })account is any viem local account (privateKeyToAccount, mnemonicToAccount, ...). Tank #1 is the public dock tank: it only opens Airlock.sign(string) and gives each wallet one refuel per UTC day. Point tankId at your own tank for your own contracts.
Full example (local account)
import { parseAbi } from 'viem'
import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'
import { sponsor, willItRefuel, getTank, AIRLOCK, FueltenderError } from '@fueltender/docking-port'
const account = privateKeyToAccount(generatePrivateKey()) // a brand new wallet with 0 ETH
const abi = parseAbi(['function sign(string note)'])
console.log((await getTank(1)).balance, 'ETH in tank #1')
const dry = await willItRefuel({ tankId: 1, sender: account.address, to: AIRLOCK, abi, functionName: 'sign', args: ['gm'] })
if (!dry.willRefuel) throw new Error(`valve ${dry.closedValve} is closed: ${dry.reason}`)
try {
const r = await sponsor({ account, tankId: 1, to: AIRLOCK, abi, functionName: 'sign', args: ['gm'] })
console.log(r.txHash, r.explorer, `tank paid ${r.gasPaidEth} ETH`)
} catch (e) {
if (e instanceof FueltenderError && e.valve) console.error(`closed valve: ${e.valve}`, e.message)
else throw e
}MetaMask / Rabby (viem walletClient)
import { createWalletClient, custom } from 'viem'
import { sponsor, robinhoodChain } from '@fueltender/docking-port'
const [address] = await window.ethereum.request({ method: 'eth_requestAccounts' })
const walletClient = createWalletClient({ account: address, chain: robinhoodChain, transport: custom(window.ethereum) })
const r = await sponsor({ walletClient, tankId: 7, to: '0xYourContract', abi, functionName: 'mint', args: [] })The wallet signs the UserOp as EIP-712 typed data (one signature prompt). It is asked to switch to Robinhood Chain (4663) if it is elsewhere.
Important: browser wallets (MetaMask, Rabby) do not sign EIP-7702 authorizations to other contracts today. A browser-wallet address works only once it is already delegated to Simple7702Account (0xe6Cae83BdE06E4c305530e199D7217f42808555B). Otherwise sponsor throws a FueltenderError with valve: 'account' before asking for any signature. A local account (or a walletClient built on one) signs the authorization itself on its first call, and you can also pass a pre-signed authorization.
API
sponsor(params) → Promise<SponsorResult>
| param | |
|---|---|
| account or walletClient | the signer (see above) |
| tankId | tank that pays (default 1, the dock tank) |
| to | contract to call |
| data or abi + functionName + args | the call |
| value | wei sent with the call, from the user's own balance (default 0n; the tank pays gas only) |
| rpc | chain RPC for reads (default https://robinhood-rpc.publicnode.com) |
| bundler | bundler JSON-RPC (default https://fueltender.agency/rpc) |
| publicClient, authorization, preflight, timeoutMs | optional |
Returns { userOpHash, txHash, receipt, gasPaid, gasPaidEth, sender, explorer }. receipt is the EntryPoint UserOperation receipt; gasPaid is what the tank paid, in wei.
What it does: fueltender_getPaymasterData (tank check, fees, delegation state) → if needed, sign an EIP-7702 authorization to Simple7702Account → send one ERC-4337 v0.8 UserOp with the TankPaymaster fields → wait for the receipt.
willItRefuel({ tankId, sender, to, data | abi+functionName+args }) → Promise<WillItRefuelResult>
Read-only dry-run of every valve (seal, expiry, allowlist, max cost, gas caps, per-wallet and tank day limits, balance) through the public MCP tool will_it_refuel. Returns { willRefuel, closedValve, reason, checks, ... }. Nothing is signed or sent.
getTank(tankId) → Promise<Tank>
GET https://fueltender.agency/api/tank/{id}: balance, valves, open targets, latest refuels.
Errors
Everything throws FueltenderError. When a tank valve closed, err.valve names it, for example allowlist, refuelsPerWalletDaily, perWalletDaily, dailyCap, maxCostPerRefuel, tankBalance, sealed, account. err.checks carries the full valve list when the bundler sent it. If the call reverts on chain, err.txHash is set (the tank still paid for that gas).
Also exported: buildCall, getPaymasterData, resolveOwner, robinhoodChain, and the contract addresses (TANK_PAYMASTER, ENTRY_POINT_V08, SIMPLE_7702_ACCOUNT, AIRLOCK).
Honest limits
- Only sponsors calls a tank's valves allow. Each tank opens a list of (contract, function) pairs with cost and day limits. Anything else is refused before it is signed.
- The tank pays, not Fueltender. Gas comes out of the tank owner's ETH. When a tank is empty, sealed or at its daily cap, calls stop.
- Robinhood Chain mainnet (4663) only, through the public bundler at fueltender.agency. Day limits reset at 00:00 UTC.
- Browser wallets need an address that is already delegated to Simple7702Account (see above).
- Not audited. TankPaymaster, Airlock and this package are not audited. Unofficial, not affiliated with Robinhood.
Proof
scripts/live.ts runs one real sponsored Airlock.sign from a fresh 0-ETH wallet through dock tank #1, using the built package. First run, 2026-11-25 15:43:33 UTC, block 123154192, the tank paid 0.00000438132039 ETH:
0xd3263a7a383c338650c967a399161099f88d064e870ba39c2282a684e7ad0dc2
npm run build && npm run live # costs ~0.000005 ETH from the public dock tank
npm test # unit tests, no networkLicense
MIT
