#[near_bindgen]
Expand description
This macro is deprecated. Use #[near] instead. The difference between #[near] and #[near_bindgen] is that with #[near_bindgen] you have to manually add boilerplate code for structs and enums so that they become Json- and Borsh-serializable:
ⓘ
#[near_bindgen]
#[derive(BorshSerialize, BorshDeserialize, NearSchema)]
#[borsh(crate = "near_sdk::borsh")]
struct MyStruct {
pub name: String,
}
Instead of:
ⓘ
#[near]
struct MyStruct {
pub name: String,
}