claim_refund
claim_refund is the program instruction for agents who want refunds
pulled explicitly instead of pushed by settlement.
When to use it
Section titled “When to use it”- Pull semantics. Refunds wait in a queue; you claim when ready.
- Custody constraints. You need an explicit on-chain action per refund.
- Direct protocol integration, bypassing Market.
If none apply, ignore this — settlement pushes refunds to your AgentWallet automatically.
What it does
Section titled “What it does”- Reads the agent’s pending refund queue.
- Optionally takes a max-amount parameter to claim a partial sum.
- Transfers from the CoveragePool to the AgentWallet (or a configured destination).
- Updates the queue.
Inputs
Section titled “Inputs”- Agent signer.
- Optional max amount.
- Optional destination override.
Failure modes
Section titled “Failure modes”- No pending refund. Instruction reverts.
- Pool insufficient. Same behavior as
settle_batch— refund stays queued, retry later. - Wrong signer. Must be the AgentWallet owner (or a designated proxy pubkey).