Skip to content

v0.39.0

Compare
Choose a tag to compare
@digorithm digorithm released this 03 Apr 16:45
· 353 commits to master since this release
5c162dd

What's Changed

Full Changelog: v0.38.1...v0.39.0

New features

Bytes types

The Sway Bytes type is now supported in the SDK.

Pay for fees using predicate

We've recently introduced the Account trait, which encapsulates all the behavior you commonly see in a wallet. Predicates also implement the Account trait now. This means you can use a Predicate the same way you'd use a wallet, when paying for transaction fees. For instance:

// Instead of passing the wallet used to sign the contract's transaction, we can now pass a predicate
let contract_methods = MyContract::new(contract_id, predicate).methods();
let tx_params = TxParameters::new(1000000, 10000, 0);

assert_eq!(predicate.get_asset_balance(&BASE_ASSET_ID).await?, 192);

let response = contract_methods
    .initialize_counter(42) // Build the ABI call
    .tx_params(tx_params)
    .call()
    .await?;

Note that this new feature introduces many breaking changes. Read more here: #815.