v0.23.0
What's Changed
- fix!: update connect method by @digorithm in #564
- docs: add connect to testnet instructions by @hal3e in #563
- feat: bump forc to 0.24.0 by @hal3e in #565
- Use estimation to cover transaction fees by @MujkicA in #556
- Bump versions to 0.23.0 by @digorithm in #567
Full Changelog: v0.22.0...v0.23.0
Breaking changes
Update to theProvider::connect()
method
Provider::connect()
now takes a string instead of a SocketAddr
. This simplifies the process of connecting to a given node address. All you have to do is change from:
// This is the address of a running node.
let server_address: SocketAddr = "127.0.0.1:4000"
.parse()
.expect("Unable to parse socket address");
// Create the provider using the client.
let provider = Provider::connect(server_address).await.unwrap();
to:
let address = "[<port>:<IP> | <URL>]"; // port:IP like "127.0.0.1:4000" or a URL like "https://my-node-address.com"
let provider = Provider::connect(address).await.unwrap();
New features
Automatic fee estimation for hand-crafted transactions
When hand-crafting transactions with the SDK, you can now use add_fee_coins()
to automatically add the necessary coins to that transaction, based on an automatic estimation:
let wallet_config = add_fee_coins_wallet_config(1);
let wallet = launch_custom_provider_and_get_wallets(wallet_config, None)
.await
.pop()
.unwrap();
let mut tx = Wallet::build_transfer_tx(&[], &[], TxParameters::default());
wallet.add_fee_coins(&mut tx, 0, 0).await?;
Check out the cost estimation section in the SDK book.