Skip to content

Account.sweep

POST /{namespace}/accounts/{from}/sweep

Sweep moves cash between two cash Accounts of the same owner, once or on a standing rule, within the Treasurer’s Limit.

Mode
do
Event
Account.swept

Inputs

InputTypeRequiredDescription
fromAccountrequiredThe cash Account the money leaves.
toAccountrequiredThe cash Account it lands in.
amountmoneyHow much to move. Leave it out and set keep to move everything above a floor.
keepmoneyLeave this much in from and move the rest.
repeatstringTurns the move into a standing rule that sweeps on this schedule.

Outputs

OutputTypeRequiredDescription
accountAccountrequiredThe to Account, with the money landed.
transactionTransactionrequiredThe move, reconciled on both Accounts.

Effects

  • Emits Account.swept.
  • Performed by the Treasurer.
  • Two-way: it runs at once, in the try, send and do modes.
  • From the payments balance to the card balance, the money lands at once; from a bank it takes up to five business days.
  • A standing rule skips a day when the move would leave from below keep.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.Account.sweep

When it waits

GateDefault
Decision classLow: two-way, nothing at stake
Delay windowNone: it runs once review passes.
LimitThe call Limit of the Permission it runs under.
Over the LimitIt waits pending for an Approval from the Founder. Approved, it runs; refused, it ends refused with limit-exceeded; unanswered by its deadline, it ends canceled.