0

I am new to solana and exploring the things. I came across these terms

SystemProgram.createAccount
Token.createInitAccountInstruction
Token.createTransferInstruction

What is the difference between these three?

Ketul s
  • 55
  • 1
  • 8

1 Answers1

0
  • SystemProgram.createAccount: allocates a certain number of bytes, assigns the account to a program, and transfers the given lamports into the account. More information about accounts at https://docs.solana.com/terminology#account

  • Token.createInitAccountInstruction: after an account has been created, then you can use this instruction to initialize data in the account, specifying what mint it belongs to, who owns it, etc

  • Token.createTransferInstruction: after two accounts has been created and initialized, and at least one of them has tokens, you can use this instruction to move tokens from one account to another

Jon C
  • 7,019
  • 10
  • 17