signTransaction method

Future<List<Uint8List>> signTransaction(
  1. Uint8List transaction, {
  2. Map<String, dynamic> params = const {},
})

Signs an unsigned transaction by sending a request to the wallet. Returns the signed transaction bytes. Throws WalletConnectException if unable to sign the transaction.

Implementation

Future<List<Uint8List>> signTransaction(
  Uint8List transaction, {
  Map<String, dynamic> params = const {},
}) async {
  final txToSign = {
    'txn': base64Encode(transaction),
    ...params,
  };

  return _signTransactions(requestParams: [txToSign]);
}