Helios API/ API Reference/ Namespaces/
config
Mutable global config properties.
Index
Variables
- AUTO_SET_VALIDITY_RANGE
- CHECK_CASTS
- DEBUG
- IGNORE_UNEVALUATED_CONSTANTS
- IS_TESTNET
- MAX_ASSETS_PER_CHANGE_OUTPUT
- N_DUMMY_INPUTS
- STRICT_BABBAGE
- VALIDITY_RANGE_END_OFFSET
- VALIDITY_RANGE_START_OFFSET
Functions
Variables
AUTO_SET_VALIDITY_RANGE
• Const
AUTO_SET_VALIDITY_RANGE: boolean
The validity time range can be set automatically if a call to tx.time_range in a Helios script is detected.
If false
the validity range is still set automatically if not set manually but a warning is printed.
Default: false
.
CHECK_CASTS
• Const
CHECK_CASTS: boolean
Check that from_data
casts make sense during runtime, printing a warning if it doesn't. This ony impacts unsimplified UplcPrograms.
Default: false
.
DEBUG
• Const
DEBUG: boolean
Global debug flag. Currently unused.
Default: false
.
IGNORE_UNEVALUATED_CONSTANTS
• Const
IGNORE_UNEVALUATED_CONSTANTS: boolean
Ignore constants that can't be evaluated during compile-time.
Default: false
.
IS_TESTNET
• Const
IS_TESTNET: boolean
If true, Address
instances are assumed to be for a Testnet when constructing from hashes or raw bytes, otherwise for mainnet.
Default: true
.
MAX_ASSETS_PER_CHANGE_OUTPUT
• Const
MAX_ASSETS_PER_CHANGE_OUTPUT: undefined
Maximum number of assets per change output. Used to break up very large asset outputs into multiple outputs.
Default: undefined
(no limit).
N_DUMMY_INPUTS
• Const
N_DUMMY_INPUTS: number
Calculating the execution budget during tx building requires knowing all the inputs beforehand, which is very difficult because balancing is done after the budget is calculated. Instead we use at least 1 dummy input, which should act as a representative balancing input. For increased robustness we use 2 dummy inputs, one with Txid 0 and other with TxId ffff..., because eg. there are cases where the TxId is being printed, and a Txid of ffff... would overestimate the fee for that. This value must be '1' or '2'.
Default: 2.
Deprecated
STRICT_BABBAGE
• Const
STRICT_BABBAGE: boolean
If true, TxOutput
is serialized using strictly the Babagge cddl format (slightly more verbose).
Default: false
.
VALIDITY_RANGE_END_OFFSET
• Const
VALIDITY_RANGE_END_OFFSET: number
Upper offset wrt. the current system time when setting a transaction validity range automatically.
Default: 300 seconds.
VALIDITY_RANGE_START_OFFSET
• Const
VALIDITY_RANGE_START_OFFSET: number
Lower offset wrt. the current system time when setting a transaction validity range automatically.
Defaut: 90 seconds.
Functions
set
▸ set(props
): void
Modify the config properties
Parameters
Name | Type |
---|---|
props | Object |
props.AUTO_SET_VALIDITY_RANGE? | boolean |
props.CHECK_CASTS? | boolean |
props.DEBUG? | boolean |
props.IGNORE_UNEVALUATED_CONSTANTS? | boolean |
props.IS_TESTNET? | boolean |
props.MAX_ASSETS_PER_CHANGE_OUTPUT? | number |
props.N_DUMMY_INPUTS? | number |
props.STRICT_BABBAGE? | boolean |
props.VALIDITY_RANGE_END_OFFSET? | number |
props.VALIDITY_RANGE_START_OFFSET? | number |
Returns
void