This Changelog only applies to notable changes of helios.js
on the main branch.
- Better error message when catching
RuntimeError
insideevalParam
- HashedDatum and InlineDatum no longer exported
- TxId and DatumHash exported,
Hash
no longer exported - changeParam handles Hash type literals
- ScriptPurpose type, with members Minting, Spending, Rewarding and Certifying
ScriptContext.get_script_purpose()
Tx.redeemers
Int::parse
- unused struct/enum fields, and unused enum variants, are now allowed
Option.unwrap()
- added
Value::from_map
- removed
tx.now()
(in favor oftx.time_range.start
andtx.time_range.end
) - changed
time_range.get_start()
totime_range.start
(is a getter!) - added
time_range.end
(is a getter!) - added
map.map_keys()
andmap.map_values()
- support for operator overloading (internally), with
Time - Duration -> Time
andDuration/Duration -> Int
as new overloads +
and*
operators are now commutative in case left and right types differ
- toSchemaJSON renamed to toSchemaJson
- tx.outputs_sent_to_datum, tx.value_sent_to_datum, tx.outputs_locked_by_datum, tx.value_locked_by_datum: now take 'isInline' as a third boolean argument
- PlutusCore renamed to UPLC everywhere
- helios.d.ts file generated
- program.changeParam accepts both jsons strings and PlutusCoreValue is value
[]a.new
method usesfunc(Int) -> a
as second arg (first arg is length), List.new_const introduced that usesa
as second arg (first arg is length).
- TxOutput can have inline datum
- TxOutput.datum returns OutputDatum enum (replaces the .datum_hash field)
- OutputDatum enum has members None, Hash and Inline
- generic Data type introduced (used by inline datum)
- All types have builtin associated ::from_data() method that converts
Data
into that type - Map.get_safe() method that returns Option
- staking script purpose
- StakingPurpose enum, with members Rewarding and Certifying, returned by ScriptContext.get_staking_purpose() (only available in staking/testing script)
- DCert enum with members Register, Deregister, Delegate, RegisterPool, RetirePool (DCertGenesis and DCertMir ignored)
- New fields for Tx: Tx.ref_inputs, Tx.dcerts and Tx.withdrawals (constructor for Tx also changed accordingly)
- ScriptContext constructors have been renamed: new_spending, new_minting, new_rewarding and new_certifying
- Library interface changed to something more object-like
- Script purpose keywords changed to 'testing', 'spending' and 'minting'
- Macro-like builtins whichs are only allowed after 'main': ValidatorHash::CURRENT, MintingPolicyHash::CURRENT, ScriptContext::new, Tx::new, TxID::CURRENT, TxInput::new, TxOutput::new
- Generally usable constructors: TxId::new, Address::new, Credential::new_pubkey, Credential::new_validator, StakingCredential::new_hash, StakingCredential::new_ptr
- First argument of AssetClass::new must be MintingPolicyHash (was ByteArray previously)
- Cost calculation of a plutus-core program run
- 'simplify' boolean flag in config object that is passed to compile()
- Map key can't be bool type (makes it easier to use bool as primitive in plutus-core, instead of as data type)
Value*Int
(not commutative) andValue/Int
operators- tx methods: 'outputs_sent_to_datum', 'outputs_locked_by_datum' and 'value_sent_to_datum' (not yet property tested)
- ByteArray.slice (negative indices relative to end)
- ByteArray starts_with and ends_with
- String starts_with and ends_with
- Map + Map operator (note: map merge doesn't assert uniqueness of keys and simply acts as a concatenation of two lists)
- Map methods: all, all_keys, all_values, any, any_key, any_value, filter, filter_by_key, filter_by_value, fold, fold_keys, fold_values
- all methods named 'get...' or 'find...' throw errors if not found
- TokenName in AssetClass is now ByteArray in order to align with Plutus-Ledger-API (used to be String)
- Rust-like syntax, structs and enums can have methods
- No commas in struct/enum-member definitions
- No semicolon after const statement
- C#-like switch syntax
- TimeRange constructors: ALWAYS, NEVER, from, to
- TimeRange comparison: is_before(Time) and is_after(Time)
- Map literal construction, Map.length, Map.is_empty() and Map.get()
- Value.get_policy()
- renamed to helios
- all named variables in the Plutus-Light are prefixed with u_ when generating the untyped IR