SystemProgram.allocateWithcSeed constructor

SystemProgram.allocateWithcSeed({
  1. required SolAddress accountPubkey,
  2. required SystemAllocateWithSeedLayout layout,
})

Allocate account with seed system transaction

Implementation

factory SystemProgram.allocateWithcSeed({
  /// Account to allocate
  required SolAddress accountPubkey,
  required SystemAllocateWithSeedLayout layout,
}) {
  return SystemProgram(
    layout: layout,
    keys: [
      AccountMeta(
        publicKey: accountPubkey,
        isSigner: false,
        isWritable: true,
      ),
      layout.base.toSigner(),
    ],
    programId: SystemProgramConst.programId,
  );
}