signTransactions method

  1. @override
Future<List<Map<String, dynamic>>> signTransactions({
  1. required List<Map<String, dynamic>> transactions,
})

Send transaction objects to AlgoSigner for approval. The Network is determined from the 'genesis-id' property. If approved, the response is an array of signed transaction objects, with the binary blob field base64 encoded to prevent transmission issues.

Implementation

@override
Future<List<Map<String, dynamic>>> signTransactions({
  required List<Map<String, dynamic>> transactions,
}) async {
  final txs = transactions.map(mapToJSObj).toList();
  Completer<List<Map<String, dynamic>>> c = Completer();
  promiseToFuture(algosigner.signTransactions(txs))
      .then(
        (value) => c.complete(
          List<Map<String, dynamic>>.from(
            convertList(value),
          ),
        ),
      )
      .onError((error, stackTrace) => c.completeError(_handleError(error)));

  return c.future;
}