Skip to content

v0.101.0

Choose a tag to compare

@github-actions github-actions released this 19 May 20:30
· 39 commits to master since this release
4ceb898

Summary

In this release, we:

  • Added method setData to Predicate class
  • Added support for on-the-fly modifications to TransactionRequest when using InvocationScope
  • Made provider.assembleTx() to consider reserveGas when setting TX gasLimit
  • Enforced Predicate's data property when the Predicate has arguments
  • Close subscription after Preconfirmation when another status is not awaited by the user
  • Removed BaseInvocationScope.getTransactionId()

Breaking


Features

Fixes

  • #3887 - Close subscription after Preconfirmation status 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 the BaseInvocationScope.
// 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)