[][src]Crate near_sdk

Modules

collections

Collections that offer an alternative to standard containers from std::collections::* by utilizing the underlying blockchain trie storage more efficiently.

env

Blockchain-specific methods available to the smart contract. This is a wrapper around a low-level BlockchainInterface. Unless you know what you are doing prefer using env::* whenever possible. In case of cross-contract calls prefer using even higher-level API available through callback_args, callback_args_vec, ext_contract, Promise, and PromiseOrValue.

json_types

Helper types for JSON serialization.

Macros

metadata

metadata generates the metadata method and should be placed at the very end of the lib.rs file. TODO: Once Rust allows inner attributes and custom procedural macros for modules we should switch this to be #![metadata] attribute at the top of the contract file instead. https://github.com/rust-lang/rust/issues/54727

testing_env

Structs

Metadata

Metadata of the contract.

MethodMetadata

Metadata of a single method.

MockedBlockchain

Mocked blockchain that can be used in the tests for the smart contracts. It implements BlockchainInterface by redirecting calls to VMLogic. It unwraps errors of VMLogic to cause panic during the unit test similarly to how errors of VMLogic would cause the termination of guest program execution. Unit tests can even assert the expected error message.

Promise

A structure representing a result of the scheduled execution on another contract.

RuntimeFeesConfig
VMConfig
VMContext

Context for the contract execution.

Enums

PromiseOrValue
PromiseResult

When there is a callback attached to one or more contract calls the execution results of these calls are available to the contract invoked through the callback.

ReturnData

Traits

BlockchainInterface

A low-level interface of either real or mocked blockchain that contract interacts with.

Type Definitions

AccountId
Balance
BlockHeight
EpochHeight
Gas
IteratorIndex
ProfileData

Profile of gas consumption.

PromiseIndex
ProtocolVersion
PublicKey
ReceiptIndex
StorageUsage

Attribute Macros

callback

callback is a marker attribute it does not generate code by itself.

callback_vec

callback_args_vec is a marker attribute it does not generate code by itself.

ext_contract
init

init is a marker attribute it does not generate code by itself.

near_bindgen
result_serializer

result_serializer is a marker attribute it does not generate code by itself.

serializer

serializer is a marker attribute it does not generate code by itself.