Recently I copy pasted a bunch of method signatures and attempted to create a view method for a NEAR smart contract:
pub fn get_credits(&mut self, account_id: AccountId) -> u128 {
self.credits.get(&account_id).unwrap_or(0)
}
When calling this contract using near-api-js
it will throw an error saying that the method is not allowed env::attached_deposit()
.
Do you see the problem?