testnet
GitHub

agent.drain

drain(agentId, amount) → Receipt

Transfer OKRW from the agent's AA wallet back to the owner's primary wallet. Subject to the agent's spendingLimit.

Parameters

Name Type Required Description
agentId string The UUID of the agent to drain.
amount string Amount of OKRW to withdraw, as a decimal string.

Returns

Type: object

Transaction receipt containing the txHash.

Errors

Code Name Description
POLICY_REJECTED PolicyRejected The drain amount exceeds the agent's spendingLimit.

Examples

Drain 10 OKRW

{
  "agentId": "123e4567-e89b-12d3-a456-426614174000",
  "amount": "10"
}
ESC
Type to search