Crate near_workspaces
source ·Expand description
§NEAR Workspaces
A library for automating workflows and writing tests for NEAR smart contracts. This software is not final, and will likely change.
Re-exports§
pub use network::pick_unused_port;pub use result::Result;pub use types::AccessKey;pub use types::BlockHeight;pub use types::CryptoHash;pub use types::InMemorySigner;pub use near_abi_client;
Modules§
- All errors that can occur within workspaces, including but not limited to the following: IO, RPC, Execution, Sandbox, DataConversion errors.
- All builtin network types and traits.
- All operation types that are generated/used when making transactions or view calls.
- All traits that are essential to the ease of use of workspaces.
- Result and execution types from results of RPC calls to the network.
- Types used in the workspaces crate. A lot of these are types are copied over from near_primitives since those APIs are not yet stable. Once they are, we can directly reference them here, so no changes on the library consumer side is needed. Just keep using these types defined here as-is.
Structs§
Accountis directly associated to an account in the network provided by theWorkerthat creates it. This type offers methods to interact with any network, such as creating transactions and calling into contract functions.- Details of an Account or Contract. This is an non-exhaustive list of items that the account stores in the blockchain state.
- NEAR Account Identifier.
- Struct containing information on block coming from the network
Contractis directly associated to a contract in the network provided by theWorkerthat creates it. This type offers methods to interact with any network, such as creating transactions and calling into contract functions.- The
Workertype allows us to interact with any NEAR related networks, such as mainnet and testnet. This controls where the environment the worker is running on top of it. Refer to this for all network related actions such as deploying a contract, or interacting with transactions.
Traits§
- DevNetwork is a Network that can call into
dev_createanddev_deployto create developer accounts. - Network trait specifies the functionality of a network type such as mainnet, testnet or any other networks that are not specified in this library.
Functions§
- Connect to the betanet network, and grab a
Workerthat can interact with it. - Builds the cargo project located at
project_pathand returns the generated wasm file contents. - Connect to a custom network, and grab a
Workerthat can interact with it. - Connect to the mainnet archival network, and grab a
Workerthat can interact with it. - Spin up a new sandbox instance, and grab a
Workerthat interacts with it. - Spin up a new sandbox instance, and grab a
Workerthat interacts with it. - Connect to the testnet archival network, and grab a
Workerthat can interact with it. - Run a locally scoped task where a
mainnet_archivalinstancedWorkeris supplied. - Run a locally scoped task where a
testnet_archivalinstancedWorkeris supplied.