createAndInitializeAccountWithSeed static method

List<Instruction> createAndInitializeAccountWithSeed({
  1. required Ed25519HDPublicKey fundingAccount,
  2. required Ed25519HDPublicKey newAccount,
  3. required Authorized authorized,
  4. required Ed25519HDPublicKey base,
  5. required String seed,
  6. required int lamports,
  7. Lockup lockup = const Lockup.none(),
})

Implementation

static List<Instruction> createAndInitializeAccountWithSeed({
  required Ed25519HDPublicKey fundingAccount,
  required Ed25519HDPublicKey newAccount,
  required Authorized authorized,
  required Ed25519HDPublicKey base,
  required String seed,
  required int lamports,
  Lockup lockup = const Lockup.none(),
}) =>
    [
      SystemInstruction.createAccountWithSeed(
        fundingAccount: fundingAccount,
        newAccount: newAccount,
        lamports: lamports,
        space: StakeProgram.neededAccountSpace,
        owner: Ed25519HDPublicKey.fromBase58(StakeProgram.programId),
        seed: seed,
        base: base,
      ),
      StakeInstruction.initialize(
        stake: newAccount,
        authorized: authorized,
        lockup: lockup,
      ),
    ];