Skip to main content

Fund operations

deposit

Deposits funds into a specific agent, or splits the amount across all eligible agents.

  • If agentId is omitted: splits the amount equally across all eligible agents for the active chain and asset.
  • If agentId is provided: deposits into the specified agent.

Requires wallet connection: Yes

deposit(
params: DepositOptions
): Promise<OwneyDepositResult | OwneyMultiDepositResult>

Parameters

  • params: DepositOptions - Deposit parameters (See DepositOptions for details):
    • amount: string - Deposit amount in the token's smallest unit (for example "100000000" for 100 USDC with 6 decimals).
    • asset: Asset - The asset to deposit (See Asset for details).
    • agentId?: AgentId - Optional target agent (See AgentId for details).

Returns

  • Promise<OwneyMultiDepositResult> if agentId is omitted. Contains agentResults keyed by agent ID.
  • Promise<OwneyDepositResult> if agentId is provided.

See OwneyDepositResult and OwneyMultiDepositResult for details.


withdraw

Withdraws funds from an agent.

  • If agentId is omitted: withdraws from all eligible agents on the active chain.
  • If agentId is provided: withdraws from the specified agent.
  • If amount is omitted: withdraws the full balance (from one or all agents, depending on agentId).
  • If amount is provided and agentId is omitted: splits the requested amount proportionally across eligible agents based on their per-asset balances.
  • If an agent withdrawal fails during a proportional split, its share is redistributed to the remaining not-yet-attempted agents where possible.

Requires wallet connection: Yes

withdraw(
params: WithdrawOptions
): Promise<OwneyWithdrawResult | AgentWithdrawResult>

Parameters

  • params: WithdrawOptions - Withdraw parameters (See WithdrawOptions for details):
    • asset: Asset - The asset to withdraw (See Asset for details).
    • amount?: string - Optional amount to withdraw in the token's smallest unit. If omitted, withdraws the full balance.
    • agentId?: AgentId - Optional agent ID (See AgentId for details). If omitted, withdraws from all eligible agents for the active chain and asset.

Returns

  • Promise<OwneyWithdrawResult> if agentId is omitted. Contains agentResult keyed by agent ID plus totalWithdrawn.
  • Promise<AgentWithdrawResult> if agentId is provided.

See OwneyWithdrawResult and AgentWithdrawResult for details.