i'm quite struggling understanding how we can deposit and withdraw funds from smart contract on NEAR blockchain.
I'm currently using near-sdk-as with AssemblyScript. According to documentation I do have the
ContractPromiseBatch.create(recipient).transfert(amount)
But how can we lock funds into the smart contract and withdraw it from allowed accounts ?
When you call your method with
--amount <some amount here>
you have deposited these amounts to your contract balance. For example:When you want to send an amount from your contract balance to another person's balance you can use the
contractPromiseBatch
API as follows: