Skip to content

claim_refund

claim_refund is the program instruction for agents who want refunds pulled explicitly instead of pushed by settlement.

  • 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.

  • 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.
  • Agent signer.
  • Optional max amount.
  • Optional destination override.
  • 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).