Пример #1
0
 public object ToJson()
 {
     return(new
     {
         number = Number?.ToJson(),
         hash = Hash?.ToJson(),
         parentHash = ParentHash?.ToJson(),
         nonce = Nonce?.ToJson(),
         MixHash = MixHash?.ToJson(),
         sha3Uncles = Sha3Uncles?.ToJson(),
         logsBloom = LogsBloom?.ToJson(),
         transactionsRoot = TransactionsRoot?.ToJson(),
         stateRoot = StateRoot?.ToJson(),
         receiptsRoot = ReceiptsRoot?.ToJson(),
         miner = Miner?.ToJson(),
         difficulty = Difficulty?.ToJson(),
         totalDifficulty = TotalDifficulty?.ToJson(),
         extraData = ExtraData?.ToJson(),
         size = Size?.ToJson(),
         gasLimit = GasLimit?.ToJson(),
         gasUsed = GasUsed?.ToJson(),
         timestamp = Timestamp?.ToJson(),
         transactions = Transactions?.Select(x => x.ToJson()).ToArray() ?? TransactionHashes?.Select(x => x.ToJson()).ToArray(),
         uncles = Uncles?.Select(x => x.ToJson()).ToArray()
     });
 }
Пример #2
0
 public object ToJson()
 {
     return(new
     {
         transactionHash = TransactionHash?.ToJson(),
         transactionIndex = TransactionIndex?.ToJson(),
         blockHash = BlockHash?.ToJson(),
         blockNumber = BlockNumber?.ToJson(),
         cumulativeGasUsed = CumulativeGasUsed?.ToJson(),
         gasUsed = GasUsed?.ToJson(),
         contractAddress = ContractAddress?.ToJson(),
         logs = Logs?.Select(x => x.ToJson()).ToArray(),
         logsBloom = LogsBloom?.ToJson(),
         root = Root?.ToJson(),
         status = Status?.ToJson()
     });
 }