TokenInstruction.createNativeMint constructor

TokenInstruction.createNativeMint({
  1. required Ed25519HDPublicKey payer,
})

Creates the native mint.

This instruction only needs to be invoked once after deployment and is permissionless, Wrapped SOL will not be available until this instruction is successfully executed.

Implementation

factory TokenInstruction.createNativeMint({
  required Ed25519HDPublicKey payer,
}) =>
    TokenInstruction._(
      accounts: [
        AccountMeta.writeable(pubKey: payer, isSigner: true),
        AccountMeta.writeable(pubKey: nativeMint2022, isSigner: false),
        AccountMeta.readonly(pubKey: SystemProgram.id, isSigner: false),
      ],
      data: Token2022Program.createNativeMintInstructionIndex,
      tokenProgram: TokenProgramType.token2022Program,
    );