forMethod static method

Future<AnchorInstruction> forMethod({
  1. required Ed25519HDPublicKey programId,
  2. required String method,
  3. required String namespace,
  4. required List<AccountMeta> accounts,
  5. ByteArray arguments = const ByteArray.empty(),
})

Implementation

static Future<AnchorInstruction> forMethod({
  required Ed25519HDPublicKey programId,
  required String method,
  required String namespace,
  required List<AccountMeta> accounts,
  ByteArray arguments = const ByteArray.empty(),
}) async =>
    AnchorInstruction._(
      programId: programId,
      accounts: accounts,
      data: await arguments.addDiscriminator(namespace, method),
    );