public QBitNinja.Client.Models.GetBlockResponse Result()
        {
            //UnityEngine.Debug.Log(UnityEngine.JsonUtility.ToJson(this,true));

            var result = new QBitNinja.Client.Models.GetBlockResponse();

            result.AdditionalInformation = BlockInformation.Create(additionalInformation);
            result.ExtendedInformation   = extendedInformation.Length == 0?null:ExtendedBlockInformation.Create(UnityEngine.JsonUtility.FromJson <ExtendedBlockInformation>(extendedInformation));
            result.Block = block.Length == 0?null:new NBitcoin.Block(NBitcoin.DataEncoders.Encoders.Hex.DecodeData(block));

            return(result);
        }
Example #2
0
        public QBitNinja.Client.Models.GetTransactionResponse Result()
        {
            //UnityEngine.Debug.Log(UnityEngine.JsonUtility.ToJson(this,true));

            var result = new QBitNinja.Client.Models.GetTransactionResponse();

            result.Transaction   = new Transaction(NBitcoin.DataEncoders.Encoders.Hex.DecodeData(transaction));
            result.TransactionId = uint256.Parse(transactionId);
            result.IsCoinbase    = isCoinbase;
            result.Block         = BlockInformation.Create(block);
            result.SpentCoins.AddRange(CoinJson.Create(spentCoins));
            result.ReceivedCoins.AddRange(CoinJson.Create(receivedCoins));
            result.FirstSeen = DateTimeOffset.Parse(firstSeen);
            result.Fees      = fees;

            return(result);
        }