This method returns a SolanaInstruction. Add it to a transaction and use the Transaction Service to execute it on-chain. See Instructions & Transactions.
Create
Creates a new Solana account funded with lamports and assigned to an owner program.Request
The account paying for creation. Must be a signer.
The new account’s public key. Must be a signer.
Program that will own the new account. Defaults to the System Program.
Lamports to deposit into the new account. Must cover rent exemption. Use GetMinimumBalanceForRentExemption to calculate.
Bytes to allocate for the account’s data. Use 0 for wallet accounts with no data.
Response
The System Program create_account instruction. Add to a transaction via CompileTransaction.
Code Examples
CreateWithSeed
Creates an account at an address derived from a base public key and seed string. Useful when the account address must be deterministic.Request
The account paying for creation. Must be a signer.
The derived account address. Must match
PublicKey.createWithSeed(base, seed, owner).Base public key used to derive
new_account.Seed string (max 32 bytes) used to derive
new_account.Lamports to deposit into the new account. Must cover rent exemption. Use GetMinimumBalanceForRentExemption to calculate.
Bytes to allocate for the account’s data.
Response
The System Program create_account_with_seed instruction. Add to a transaction via CompileTransaction.