sendSolanaPay method

Future<TransactionId> sendSolanaPay({
  1. required Ed25519HDKeyPair payer,
  2. required Ed25519HDPublicKey recipient,
  3. required Decimal amount,
  4. Ed25519HDPublicKey? splToken,
  5. Iterable<Ed25519HDPublicKey>? reference,
  6. String? memo,
  7. SignatureCallback? onSigned,
  8. Commitment commitment = Commitment.finalized,
})

Creates, signs and sends Solana Pay transaction from payer to recipient.

If splToken is null, the transaction will be in SOL.

Recipient is recipient in the Solana Pay spec.

Amount is amount in the Solana Pay spec.

Implementation

Future<TransactionId> sendSolanaPay({
  required Ed25519HDKeyPair payer,
  required Ed25519HDPublicKey recipient,
  required Decimal amount,
  Ed25519HDPublicKey? splToken,
  Iterable<Ed25519HDPublicKey>? reference,
  String? memo,
  SignatureCallback? onSigned,
  Commitment commitment = Commitment.finalized,
}) async =>
    sendAndConfirmTransaction(
      message: await createSolanaPayMessage(
        payer: payer,
        recipient: recipient,
        amount: amount,
        splToken: splToken,
        reference: reference,
        memo: memo,
        commitment: commitment,
      ),
      signers: [payer],
      onSigned: onSigned ?? ignoreOnSigned,
      commitment: commitment,
    );