v0.101.0
Summary
In this release, we:
- Added method
setDatatoPredicateclass - Added support for on-the-fly modifications to
TransactionRequestwhen usingInvocationScope - Made
provider.assembleTx()to considerreserveGaswhen setting TXgasLimit - Enforced Predicate's
dataproperty when the Predicate has arguments - Close subscription after
Preconfirmationwhen another status is not awaited by the user - Removed
BaseInvocationScope.getTransactionId()
Breaking
- Fixes
- #3886 - Enforce
predicateDatawhen predicate has arguments, by @Torres-ssf
- #3886 - Enforce
- Chores
- #3864 - Remove
BaseInvocationScope.getTransactionId(), by @Torres-ssf
- #3864 - Remove
Features
- #3885 - Add
PredicatemethodsetData, by @Torres-ssf - #3875 - Support TX customization at BaseInvocationScope, by @Torres-ssf
Fixes
- #3887 - Close subscription after
Preconfirmationstatus when applicable, by @Torres-ssf
Migration Notes
Fixes
#3886 - Enforce predicateData when predicate has arguments
Predicates that define arguments must now be instantiated with the data property. It is no longer allowed to omit data when the predicate expects input arguments.
For example, for the given predicate:
predicate;
fn main(pin: u64) -> bool {
return 999 == pin;
}
The following code would compile, even though the predicate expects arguments:
// before
const predicateNoData = new PredicatePin({ provider }) // ✅ Allowed (incorrectly)
const predicate = new PredicatePin({ provider, data: [100] }) // ✅ Correct
TypeScript now enforces that data must be provided:
// after
const predicateNoData = new PredicatePin({ provider }) // ❌ Error: missing required `data`
const predicate = new PredicatePin({ provider, data: [100] }) // ✅ Correct
Chores
#3864 - Remove BaseInvocationScope.getTransactionId()
getTransactionId()is no longer available on theBaseInvocationScope.
// before
const contract = new CounterContract(contractId, wallet)
const scope = contract.functions.get_counter()
const txId = await scope.getTransactionId()
// after
const contract = new CounterContract(contractId, wallet)
const request = contract.functions.get_counter().fundWithRequiredCoins()
const chainId = await provider.getChainId()
const txId = await scope.getTransactionId(chainId)