toJsonAsync method

Future<String> toJsonAsync([
  1. SerializeTransactionOptions? options
])

Resolves intents and serializes the transaction to a JSON string. Use this instead of the synchronous toJson when the transaction contains intents (e.g. coinWithBalance).

Implementation

Future<String> toJsonAsync([SerializeTransactionOptions? options]) async {
  await prepareForSerialization(options);
  return jsonEncode(
    _blockData.snapshot().toJson(),
    toEncodable: (v) => v is BigInt ? v.toString() : v,
  );
}