How to send near tokens to payable function in near api js and near cli?
问题 I have a following function in the contract: #[payable] pub fn buy_tokens(&mut self) { let amount = env::attached_deposit() } But how to call the function in near-api-js and near cli with attached near tokens deposit? await nearvar.contract.buy_tokens() Edit: await nearvar.contract.buy_tokens({}, GAS_AMOUNT, ATTACHED_DEPOSIT); Gives error {InvalidTxError: {InvalidAccessKeyError: "DepositWithFunctionCall"} The error seems because of function call action is not allowed with a function call