/cargo-near

Cargo extension for building Rust smart contracts on NEAR

Primary LanguageRustApache License 2.0Apache-2.0

cargo-near

Cargo extension for building near-sdk-rs smart contracts and ABI schemas on NEAR

Github CI Build Crates.io version Download

Release notes

Release notes and unreleased changes can be found in the CHANGELOG

Installation

From crates.io:

$ cargo install cargo-near

To install from source:

$ git clone https://github.com/near/cargo-near
$ cargo install --path cargo-near

Usage

See cargo near --help for a complete list of available commands. Help is also available for each individual command with a --help flag, e.g. cargo near build --help.

cargo near build

Builds a NEAR smart contract along with its ABI (while in the directory containing contract's Cargo.toml).

You can also make this command embed ABI into your WASM artifact by adding --embed-abi parameter. Once deployed, this will allow you to call a view function __contract_abi to retrieve a ZST-compressed ABI.

cargo near abi

Generates NEAR smart contract's ABI (while in the directory containing contract's Cargo.toml).

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as below, without any additional terms or conditions.

License

Licensed under either of

at your option.