Hardcoded values are great for quick prototyping and iteration, but chances are that you will at some point need to inject some variables into your Numscript files. Here is an example using definitions of all the supported variable types:Documentation Index
Fetch the complete documentation index at: https://docs.formance.com/llms.txt
Use this file to discover all available pages before exploring further.
POST /{ledger}/transactions endpoint.
The script.vars field in the request body is used to inject variable values:
_.
They can contain letters, digits, and _.
Account type
This type represents account names. They must start with at least one letter or_.
They can contain letters, digits, _, and :.
Asset type
This type represents asset names. They can contain uppercase letters, digits and/.
Monetary type
This type represents a positive integer amount associated with an asset.balance(_account_, _asset_) statement.
The balance pulled needs to be non-negative, or the script will fail to execute. Here is an example:
Portion type
This type represents portions of monetary values. They can be expressed in 2 different ways:- As a percentage:
15% - As a fraction:
15/100
Variables can also be pulled from account metadata, as per described in the metadata section.