estimateAddDelegate method

Future<BigInt> estimateAddDelegate(
  1. String identityDid,
  2. String delegateType,
  3. String delegateDid, [
  4. int validity = 86400,
])

Implementation

Future<BigInt> estimateAddDelegate(
    String identityDid, String delegateType, String delegateDid,
    [int validity = 86400]) {
  var addDelegateFunction = _erc1056contract.function('addDelegate');
  Transaction tx = Transaction.callContract(
      contract: _erc1056contract,
      function: addDelegateFunction,
      parameters: [
        _didToAddress(identityDid),
        _to32ByteUtf8(delegateType),
        _didToAddress(delegateDid),
        BigInt.from(validity)
      ]);

  return web3Client.estimateGas(
      sender: _didToAddress(identityDid), data: tx.data, to: contractAddress);
}