signV0Transaction function

Future<SignedTx> signV0Transaction(
  1. RecentBlockhash recentBlockhash,
  2. Message message,
  3. List<Ed25519HDKeyPair> signers, {
  4. List<AddressLookupTableAccount> addressLookupTableAccounts = const [],
})

Implementation

Future<SignedTx> signV0Transaction(
  RecentBlockhash recentBlockhash,
  Message message,
  List<Ed25519HDKeyPair> signers, {
  List<AddressLookupTableAccount> addressLookupTableAccounts = const [],
}) {
  if (signers.isEmpty) {
    throw const FormatException('you must specify at least on signer');
  }

  final CompiledMessage compiledMessage = message.compileV0(
    recentBlockhash: recentBlockhash.blockhash,
    feePayer: signers.first.publicKey,
    addressLookupTableAccounts: addressLookupTableAccounts,
  );

  return _signCompiledMessage(
    compiledMessage,
    signers,
  );
}