encodeStoreAck static method

Uint8List encodeStoreAck(
  1. StoreAck ack
)

Encode store acknowledgment

Implementation

static Uint8List encodeStoreAck(StoreAck ack) {
  final data = <String, dynamic>{
    'messageId': ack.messageId,
    'success': ack.success,
    'errorMessage': ack.errorMessage,
    'estimatedDeliveryTime': ack.estimatedDeliveryTime,
  };

  final json = jsonEncode(data);
  return Uint8List.fromList(utf8.encode(json));
}