Sending Transactions

To send a transaction with Hyphen Android SDK

Sending Transactions

How to send a transaction with the Hyphen Flutter SDK

Creating, Signing, and Sending Transactions

To create, sign, and send transactions with the Hyphen Flutter SDK, follow these steps:

try {
  // Define Cadence script
  final String cadenceScript = "...";

  // Define arguments
  final List<Map<String, dynamic>> arguments = [...];

  // Sign and send transaction
  final String txId = await HyphenFlow.signAndSendTransaction(
    cadenceScript,
    arguments,
    true,
  );

  // Handle transaction result
  print("Transaction result: $txId");
} catch (e) {
  print("Error: $e");
}
  • cadenceScript: The Cadence script to be executed in the transaction.

  • arguments: List of arguments for the transaction.

  • withAuthorizer: A boolean indicating whether the transaction requires an authorizer.

  • txId: The transaction ID returned by the signAndSendTransaction method.

Last updated

Was this helpful?