As with sources, there are several options when it comes to deciding where should funds in a financial transaction come from. The send statement provides the following ways of defining destinations:
Single destination#
Allocation destinations#
Similar to portioned sources, destination can be defined as a sequence of fractions to split the monetary onto multiple accounts.
In any case, the summed total of fractions in a block needs to be equal to 1 and the remaining keyword can be used to reach that total:
Out of convenience, percentage notation is also available:
Kept destinations#
Instead of transferring all funds to new accounts, you can keep part of the amount in the source account with the kept keyword. It stands in for a destination account inside a block, and pairs naturally with remaining to keep whatever is left after the explicit allocations:
Here 50% of the amount goes to users:001 and the remaining 50% stays in world. This is useful when you only want to transfer a portion of the funds.
Ordered destinations with maximum caps#
Ordered destinations route funds to multiple accounts in sequence, sending up to a maximum cap to each one before moving on. Any leftover goes to the final remaining destination:
This sends COIN 20 to users:001, COIN 50 to users:002, and the remaining COIN 30 to users:003.
Nested destinations#
Finally, as with sources, destination blocks can be nested: