September 8, 2021

Solana, part3. 😌

This post is going to be short. So, we have accounts. Accounts are kind-a files. The questions I had:

  • if you can send tokens to accounts
  • if you are inside of a program, can you query account's funds.

Answers are: yes, you can send tokens to accounts, if they are not executable, this is pretty important. And yes.

So, I've transferred some funds straight from my wallet to the account I created by createAccountrequest , it worked. It is really straighforward, so I am not attaching the code.

Now inside of the contract: msg!("lamports={}", account.lamports.borrow()); does the thing.