Home

Awesome

<div align="center"> <h1><code>NEAR ABI</code></h1> <p> <strong>ABI schema format and tooling to define interface to NEAR smart contracts.</strong> </p> </div>

⚠️ Warning: Format and tooling are not final and changes are likely to happen.

What is an ABI?

An ABI (Application Binary Interface) traditionally defines the interface between two binary program modules. In the context of the NEAR ABI, this JSON schema defines the interface to the Wasm binary (smart contract) on the NEAR network, including parameter and result formats used through the NEAR runtime.

Why do we need ABI?

Usage

Rust

Ensure you have cargo-near installed

To generate an ABI for a contract within the directory containing contract's Cargo.toml

$ cargo near abi

Ensure that the project you are generating an ABI for depends on a version of near-sdk of 4.1.0 or later and has the abi feature enabled.

near-sdk = { version = "4.1.0", features = ["abi"] }

TypeScript

Ensure you have a near-sdk-js (version 0.7.0 or later) contract

To generate an ABI for a contract within the directory containing contract's package.json

$ npx near-sdk-js build --generateABI path/to/contract.ts

The ABI will be put in build/contract-abi.json

Supported tools:

ABI generation

ABI clients

Utility Libraries