AnchorInstruction.withDiscriminator constructor

AnchorInstruction.withDiscriminator({
  1. required Ed25519HDPublicKey programId,
  2. required ByteArray discriminator,
  3. required List<AccountMeta> accounts,
  4. ByteArray arguments = const ByteArray.empty(),
})

Implementation

factory AnchorInstruction.withDiscriminator({
  required Ed25519HDPublicKey programId,
  required ByteArray discriminator,
  required List<AccountMeta> accounts,
  ByteArray arguments = const ByteArray.empty(),
}) =>
    AnchorInstruction._(
      programId: programId,
      accounts: accounts,
      data: ByteArray(discriminator.followedBy(arguments)),
    );