near-workspaces (Rust) 0.7.0
This release comes with some minor breaking changes, with the main feature here being asynchronous builders for querying data into the chain. Also comes with general fixes for better error reporting that comes from…
- The latest release in the 0.7 line.
- Newest near-workspaces (Rust): near-workspaces (Rust) 0.24.0
This release comes with some minor breaking changes, with the main feature here being asynchronous builders for querying data into the chain. Also comes with general fixes for better error reporting that comes from anyhow errors from running sandbox.
Added
view_*asynchronous builders have been added which provides being able to query from a specific block hash or block height{CallTransaction, Transaction}::transact_asyncfor performing transactions without directly having to wait for it complete it on chainview_chunkadded for querying into chunk related info on the network.- Adds
ChunkandChunkHeadertype to reference specific chunk info.
- Adds
Error::{simple, message, custom}are now public and usable for custom errors
Changed
- Apart of the changes from adding
view_*async builders, we have a couple breaking changes to theview_*functions:{Account, Contract, Worker}::view_statemovedprefixparameter into builder. i.e.worker.view_state("account_id", Some(prefix)).await?; // is now worker.view_state("account_id") .prefix(prefix) .await?; // if prefix was `None`, then simply delete the None argument.viewfunction changed to be a builder, and no longer take inargsas a parameter. It instead has been moved to the builder side.- Changed
Worker::view_latest_blocktoWorker::view_blockas the default behavior is equivalent. operations::Functiontype no longer takes a lifetime parameter.operations::CallTransactiontype takes one less lifetime parameter.
Worker::callsignature changed to be more in line withview_*async builders. It will now return a builder like{Account, Contract}::call- This
callno longer acceptsContractsince that was not as accessible. Instead aInMemorySigneris now required to sign transactions (which can be retrieved from{Account, Contract}::signerorInMemorySigner::{from_secret_key, from_file}). {Account, Contract}::signernow exposed.
- This
Fixed
- Changed the docs to reflect proper size of of rate limits on near.org RPC
- Cached nonces now are per account-id and public-key instead of just public-key
- this didn't matter if only one KeyPair was being used per account, but could be problematic when there were multiple KeyPairs per account utilizing the same nonces.
- Error message context wasn't being exposed properly by sandbox, so this fixed it