Example #1
0
 /// <summary>
 /// Returns binary 20-byte array representing of the address.
 /// </summary>
 /// <returns>20-byte array containing the address.</returns>
 public byte[] ToByteArray()
 {
     return(CryptoUtils.HexStringToBytes(LocalAddress.Substring(2)));
 }
Example #2
0
        /// <summary>
        /// Decodes event data into event DTO.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns>Decoded event DTO.</returns>
        /// <see href="https://nethereum.readthedocs.io/en/latest/contracts/calling-transactions-events/"/>
        public T DecodeEventDto <T>() where T : new()
        {
            EventTopicDecoder eventTopicDecoder = new EventTopicDecoder();

            return(eventTopicDecoder.DecodeTopics <T>(this.Topics, CryptoUtils.BytesToHexString(this.Data)));
        }
Example #3
0
 private async Task <byte[]> StaticCallAsyncByteArray(string callInput)
 {
     return(await this.client.QueryAsync <byte[]>(this.Address, CryptoUtils.HexStringToBytes(callInput), this.Caller, Protobuf::VMType.Evm));
 }
Example #4
0
 internal Transaction CreateContractMethodCallTx(string hexData, VMType vmType)
 {
     return(CreateContractMethodCallTx(ByteString.CopyFrom(CryptoUtils.HexStringToBytes(hexData)), vmType));
 }