Пример #1
0
 /// <summary
 /// To json
 /// </summary>
 public JObject ToJson()
 {
     return(new JObject
     {
         ["groups"] = Groups.Select(u => u.ToJson()).ToArray(),
         ["supportedstandards"] = SupportedStandards.Select(u => new JString(u)).ToArray(),
         ["abi"] = Abi.ToJson(),
         ["permissions"] = Permissions.Select(p => p.ToJson()).ToArray(),
         ["trusts"] = Trusts.ToJson(),
         ["safemethods"] = SafeMethods.ToJson(),
         ["extra"] = Extra
     });
 }
Пример #2
0
        /// <summary
        /// To json
        /// </summary>
        public JObject ToJson()
        {
            var feature = new JObject();

            feature["storage"] = Features.HasFlag(ContractFeatures.HasStorage);
            feature["payable"] = Features.HasFlag(ContractFeatures.Payable);

            var json = new JObject();

            json["groups"]      = new JArray(Groups.Select(u => u.ToJson()).ToArray());
            json["features"]    = feature;
            json["abi"]         = Abi.ToJson();
            json["permissions"] = Permissions.Select(p => p.ToJson()).ToArray();
            json["trusts"]      = Trusts.ToJson();
            json["safeMethods"] = SafeMethods.ToJson();

            return(json);
        }
Пример #3
0
 /// <summary
 /// To json
 /// </summary>
 public JObject ToJson()
 {
     return(new JObject
     {
         ["groups"] = Groups.Select(u => u.ToJson()).ToArray(),
         ["features"] = new JObject
         {
             ["storage"] = Features.HasFlag(ContractFeatures.HasStorage),
             ["payable"] = Features.HasFlag(ContractFeatures.Payable)
         },
         ["supportedstandards"] = SupportedStandards.Select(u => new JString(u)).ToArray(),
         ["abi"] = Abi.ToJson(),
         ["permissions"] = Permissions.Select(p => p.ToJson()).ToArray(),
         ["trusts"] = Trusts.ToJson(),
         ["safemethods"] = SafeMethods.ToJson(),
         ["extra"] = Extra
     });
 }