@gol/sdk/server. Owner steps run in your application’s browser code with the owner’s own wallet through @gol/sdk. GOL never sees the owner’s key.
Before you start
- A test API key with the full integration scopes (create one).
pnpm add @gol/sdk@next viem- An owner account of a supported type on Base Sepolia, holding the USDC your agent will send and a little ETH for gas reimbursement (a few thousandths of an ETH covers many actions).
- An agent key that your server controls. The agent needs no ETH.
1. Check the owner’s account
family: null means the account is not one of the supported configurations. Stop there.
2. Install the core (owner, once per account)
The owner installs the GOL core through the account’s own owner path. The SDK builds the exact operation; the owner’s wallet signs it.personal_sign, and the account pays the user operation’s gas from its own ETH. Recheck getAccountStatus until coreInstalled is true.
3. Prepare the approval (server)
prepared.review is a plain summary to show the owner: recipients, caps, gas caps, which outcomes they pay gas for, expiry, and the GOL attester and reimbursement recipient. Send prepared to the browser.
4. Owner signs (browser)
signPreparedGasPolicy first recomputes the policy bytes, mandate and gas policy IDs, digest, and wallet payload from the response and compares them with what you asked for, so a wrong response cannot get signed. The owner sees one eth_signTypedData_v4 request in the format their account checks. A Safe with several owners needs its threshold of signatures; pass the assembled signature bytes.
5. Confirm (server)
6. Submit an agent action (server and agent)
actionId before submitting. A retry with the same actionId and signature returns the original execution and never moves value twice. Changed fields under the same ID are refused.
7. Observe the result
settled.receipt gives the transaction and block, the outcome (success, refusal, or revert), and each fee component. settled.claimReceipt gives the reimbursement transaction and the amount collected. settled.ledger lists network cost, owner receivable, owner reimbursement collected, and GOL’s own costs as separate entries. Use webhooks to be notified instead of polling; polling stays authoritative.
An action outside the owner’s rules, such as an amount above the per-action cap, is refused by the contract and moves no USDC.
8. Revoke
revocation.directOwnerCall is the same revocation as a call the account makes itself; wrap it with accountExecuteCall and prepareOwnerOperation to send it through the owner path.
Costs, trust, and disputes
- GOL’s relayer pays each action’s gas. After finality GOL claims
gasUsed * effectiveGasPrice + l1Fee + operatorFeefrom the account, only for outcomes the owner enabled, and never above the accepted per-action maximum or the remaining total cap. Anything above is GOL’s cost, as is the claim transaction’s own gas. - The contract enforces the owner’s recipients, caps, gas caps, revocation, and replay protection. It cannot read a past Base receipt, so the GOL attester signs the receipt facts that the platform verified with two independent providers. That signature is a trust dependency bounded by the owner’s caps.
- If a charge looks wrong, open a dispute with
openGasExecutionDisputeor from the action’s detail panel in the console. New actions under that policy pause until GOL resolves it, and a confirmed overcharge is refunded from GOL’s funds.