Accounts metadata
Reading metadata to initialize a variable
Structured account metadata can be injected in Numscript variables during initialization. In the example below, we inject the monetary value stored under the metadata key"coupon_value" from the coupon account:
type of the object stored under the metadata key.
Its value is read from the value of the key value. Here are all the available types:
- Number
- String
- Asset
- Monetary
- Account
- Portion
Writing account metadata during a transaction
Metadata can be written to an account using theset_account_meta(_account_, "key", _value_) statement.
The statement takes a string-type key and a value which can be of any type, either as a variable or a literal.
Writing metadata to a transaction
Metadata can be written to a transaction using theset_tx_meta("key", _value_) statement.
The statement takes a string-type key and a value which can be of any type, either as a variable or a literal.