/// <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 }); }
/// <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); }
/// <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 }); }