Numscript
Requires flag: experimental-account-interpolation
Build account addresses dynamically by inserting variables into the address:
Numscript
vars {
string $user_id
string $type
}
send [USD/2 1000] (
source = @world
destination = @users:$user_id:wallets:$type
)With $user_id = "42" and $type = "main", the destination resolves to @users:42:wallets:main.
Supported variable types#
Account, string, and number variables can be interpolated. Each is coerced to a string and inserted into the address.
Numscript
vars {
number $id
account $org
}
send [USD/2 500] (
source = @world
destination = @orgs:$org:members:$id:balance
)Use cases#
- Route to user-specific accounts without hardcoding addresses
- Build hierarchical account structures from transaction parameters
- Create dynamic chart-of-accounts patterns like
@orders:$order_id:payments:$payment_id