public ContractABI ExtractContractABI(params Type[] contractMessagesTypes)
        {
            var contractABI = new ContractABI();
            var functions   = new List <FunctionABI>();
            var events      = new List <EventABI>();
            var errors      = new List <ErrorABI>();

            foreach (var contractMessageType in contractMessagesTypes)
            {
                if (FunctionAttribute.IsFunctionType(contractMessageType))
                {
                    functions.Add(ExtractFunctionABI(contractMessageType));
                }

                if (EventAttribute.IsEventType(contractMessageType))
                {
                    events.Add(ExtractEventABI(contractMessageType));
                }

                if (ErrorAttribute.IsErrorType(contractMessageType))
                {
                    errors.Add(ExtractErrorABI(contractMessageType));
                }
            }

            contractABI.Functions = functions.ToArray();
            contractABI.Events    = events.ToArray();
            contractABI.Errors    = errors.ToArray();
            return(contractABI);
        }
 public EventABI ExtractEventABI(Type contractMessageType)
 {
     if (EventAttribute.IsEventType(contractMessageType))
     {
         var eventAttribute = EventAttribute.GetAttribute(contractMessageType);
         var eventABI       = new EventABI(eventAttribute.Name, eventAttribute.IsAnonymous);
         eventABI.InputParameters = ExtractParametersFromAttributes(contractMessageType);
         return(eventABI);
     }
     return(null);
 }