validateEncoding method

  1. @override
EncodingValidation validateEncoding({
  1. int? type,
  2. String? senderPublicKey,
  3. String? receiverPublicKey,
})
override

Implementation

@override
EncodingValidation validateEncoding({
  int? type,
  String? senderPublicKey,
  String? receiverPublicKey,
}) {
  final int t = type ?? EncodeOptions.TYPE_0;
  if (t == EncodeOptions.TYPE_1) {
    if (senderPublicKey == null) {
      throw const ReownCoreError(
          code: -1, message: 'Missing sender public key');
    }
    if (receiverPublicKey == null) {
      throw const ReownCoreError(
          code: -1, message: 'Missing receiver public key');
    }
  }
  return EncodingValidation(
    t,
    senderPublicKey: senderPublicKey,
    receiverPublicKey: receiverPublicKey,
  );
}