Skip to main content
An action is the only thing in GOL that moves value. Your agent signs it, the API relays it, and the contract checks it against the owner’s signed policy before the transfer happens. Integrate hosted gas is the end-to-end walkthrough; this page is the SDK detail for the action itself.

Prepare, sign, submit

The API compiles the exact EIP-712 GasActionAuthorization payload, including maxChargeWei, the most network gas the action may be charged. signPreparedGasExecution recomputes the transfer from the prepared fields, refuses a charge above the ceiling you pass, has your agent sign, and returns the submission body. Your agent never needs ETH.
The action ID is your idempotency key. It is also sent as the Idempotency-Key header, and the SDK validates that it is a 32-byte hex value before making the request, throwing GolTransportError otherwise.

Retries never move value twice

Store actionId and the agent signature before you submit, and reuse exactly those values on a retry. This is the rule that makes a timeout safe.
Never mint a new actionId to work around a timeout. That is how a retry becomes a duplicate payment.

States

Treat any state you do not recognize as non-terminal. waitForGasExecution stops at a terminal state by default.
GasExecutionResponse is exported from the browser-safe root entry point, so a server module can import it as a type without touching anything credentialed.

What the result contains

getGasExecution returns separate views rather than one blended number, which is the point: network cost, what the owner owes, what the owner actually paid, and GOL’s own cost never collapse into a single figure.
receipt, settlement, and claimReceipt are null until the corresponding transaction is observed, so read them with optional chaining rather than assuming presence. finalizedBlockNumber shows how far the background observation has progressed; the hosted Base Sepolia setup settles at the lower safe head and continues observing through finalized, so a populated receipt is not by itself a finality claim. A refusal or a revert is a contract outcome, not an API error: the request succeeded and the contract declined the action because it fell outside the owner’s rules, usually a cap. No USDC moved. With refusal consent the owner still pays that transaction’s gas inline. An API-level refusal with capability_unavailable is different: the action was never sent, for example because the policy is paused, revoked, expired, or disputed.

List actions

listGasExecutions pages through a project’s history and accepts a state filter. Each summary carries the three cost figures already reduced, so a table needs one call.

Open a dispute

If a charge looks wrong, open a dispute. New submissions under that execution’s gas policy pause until GOL resolves it, and a confirmed overcharge is refunded from GOL’s funds.

Poll or subscribe

Polling is authoritative. Webhooks tell you when to look, not what is true. Treat a webhook as a hint to fetch, deduplicate by event ID because delivery is at least once and may be out of order, and reconcile against getGasExecution.

Relay it yourself

For a policy the owner approved with a developer-operated relayer, submission returns the execution in external_pending with transaction. developerRelayerTransaction checks that the calldata is the agent’s signed action under this execution’s mandate, action, and gas policy, and returns the EIP-1559 envelope. Your relayer chooses its nonce and a priority fee no higher than maxFeePerGas, signs from the approved submitter, and submits the raw bytes.
GOL broadcasts the bytes and observes the receipt like its own, and you may broadcast them too. The owner reimburses your recipient inline in the action transaction; GOL records no cost for it.

Reconcile from your own records

The figures are separately observable, so your application can check its own accounting without trusting a summary. The receipt’s network cost and the inline charge are different fields, which is exactly the pair to compare.
Because the caps, the agent’s maximum charge, and the outcomes the owner pays for are in the quote the action was accepted under, you can also check that a charge stayed inside what the owner and the agent agreed to, rather than only inside the network’s own total.