FuelLabs / fuels-rs

Fuel Network Rust SDK
https://fuellabs.github.io/fuels-rs
Apache License 2.0
44.04k stars 1.34k forks source link

chore!: move methods from `Account` to `ViewOnlyAccount` #1540

Closed hal3e closed 1 week ago

hal3e commented 1 week ago

Thanks @AurelienFT for his contribution.

Release notes

In this release, we:

Summary

This PR moves get_asset_outputs_for_amount, get_asset_inputs_for_amount and adjust_for_fee from Account to ViewOnlyAccount trait. It seem that these two methods doesn't require a full Account and so it give more flexibility in order to implement them in other structures such as Wallet.

Now Wallet also implement these two methods. Before you were forced to build a WalletUnlocked even if you don't use the secret_key.

Breaking changes

This contains an API breaking change as some public trait as been edited:

Breaking Changes

// before
use fuels::acounts::Account;

wallet.get_asset_outputs_for_amount(...);
// after
use fuels::acounts::ViewOnlyAccount;

wallet.get_asset_outputs_for_amount(...);

Checklist


Release notes

In this release, we:

Summary

Breaking Changes

Checklist

hal3e commented 1 week ago

close and wait for window for breaking changes