signSorted static method

Uint8List signSorted(
  1. Map<String, dynamic> data,
  2. Wallet wallet
)

Takes the given data, converts it to an alphabetically sorted JSON object and signs its content using the given wallet.

Implementation

static Uint8List signSorted(Map<String, dynamic> data, Wallet wallet) {
  final sorted = MapSorter.sort(data);
  final dataToSign = Uint8List.fromList(utf8.encode(json.encode(sorted)));

  return wallet.sign(dataToSign);
}