validDelegate method

Future<bool>? validDelegate(
  1. String identityDid,
  2. String delegateType,
  3. String delegateDid
)

Implementation

Future<bool>? validDelegate(
    String identityDid, String delegateType, String delegateDid) async {
  if (!_matchesExpectedDid(identityDid)) {
    throw Exception(
        'Information about $identityDid do not belong to this network');
  }
  if (!_matchesExpectedDid(delegateDid)) {
    throw Exception(
        'Information about $delegateDid do not belong to this network');
  }
  var validDelegateFunction = _erc1056contract.function('validDelegate');
  var valid = await web3Client.call(
      contract: _erc1056contract,
      function: validDelegateFunction,
      params: [
        _didToAddress(identityDid),
        _to32ByteUtf8(delegateType),
        _didToAddress(delegateDid)
      ]);

  return valid.first as bool;
}