Ejemplo n.º 1
0
        public JObject ToJson()
        {
            JObject json = new JObject();

            json["txid"]       = Hash.ToString();
            json["size"]       = Size;
            json["version"]    = Version;
            json["script"]     = Script.ToHexString();
            json["sender"]     = Sender.ToAddress();
            json["gas"]        = new BigDecimal(Gas, (byte)NativeContract.GAS.Decimals).ToString();
            json["net_fee"]    = new BigDecimal(NetworkFee, (byte)NativeContract.GAS.Decimals).ToString();
            json["attributes"] = Attributes.Select(p => p.ToJson()).ToArray();
            json["witnesses"]  = Witnesses.Select(p => p.ToJson()).ToArray();
            return(json);
        }
Ejemplo n.º 2
0
        public virtual JObject ToJson()
        {
            JObject json = new JObject();

            json["txid"]       = Hash.ToString();
            json["size"]       = Size;
            json["type"]       = Type;
            json["version"]    = Version;
            json["nonce"]      = Nonce.ToString();
            json["account"]    = Account.ToString();
            json["attributes"] = Attributes.Select(p => p.ToJson()).ToArray();
            json["sys_fee"]    = SystemFee.ToString();
            json["scripts"]    = Witnesses.Select(p => p.ToJson()).ToArray();
            return(json);
        }
Ejemplo n.º 3
0
        public virtual JObject ToJson()
        {
            JObject json = new JObject();

            json["txid"]       = Hash.ToString();
            json["size"]       = Size;
            json["type"]       = Type;
            json["version"]    = Version;
            json["attributes"] = Attributes.Select(p => p.ToJson()).ToArray();
            json["vin"]        = Inputs.Select(p => p.ToJson()).ToArray();
            json["vout"]       = Outputs.Select((p, i) => p.ToJson((ushort)i)).ToArray();
            json["sys_fee"]    = SystemFee.ToString();
            json["net_fee"]    = NetworkFee.ToString();
            json["scripts"]    = Witnesses.Select(p => p.ToJson()).ToArray();
            return(json);
        }
Ejemplo n.º 4
0
        public JObject ToJson()
        {
            JObject json = new JObject();

            json["hash"]              = Hash.ToString();
            json["size"]              = Size;
            json["version"]           = Version;
            json["nonce"]             = Nonce;
            json["sender"]            = Sender.ToAddress();
            json["sys_fee"]           = new BigDecimal(SystemFee, NativeContract.GAS.Decimals).ToString();
            json["net_fee"]           = new BigDecimal(NetworkFee, NativeContract.GAS.Decimals).ToString();
            json["valid_until_block"] = ValidUntilBlock;
            json["attributes"]        = Attributes.Select(p => p.ToJson()).ToArray();
            json["script"]            = Script.ToHexString();
            json["witnesses"]         = Witnesses.Select(p => p.ToJson()).ToArray();
            return(json);
        }
Ejemplo n.º 5
0
        public JObject ToJson()
        {
            JObject json = new JObject();

            json["hash"]              = Hash.ToString();
            json["size"]              = Size;
            json["version"]           = Version;
            json["nonce"]             = Nonce;
            json["sender"]            = Sender.ToAddress();
            json["sys_fee"]           = SystemFee.ToString();
            json["net_fee"]           = NetworkFee.ToString();
            json["valid_until_block"] = ValidUntilBlock;
            json["attributes"]        = Attributes.Select(p => p.ToJson()).ToArray();
            json["cosigners"]         = Cosigners.Select(p => p.ToJson()).ToArray();
            json["script"]            = Convert.ToBase64String(Script);
            json["witnesses"]         = Witnesses.Select(p => p.ToJson()).ToArray();
            return(json);
        }