示例#1
0
        public static string MyPayments(APIKey apiKey, int pageNumber, int rowCount, int nodeId = 0, PaymentStatus paymentStatus = PaymentStatus.NONE, string category = null)
        {
            var retVal = "/api/nodes/my/Payments?key=" + apiKey.APIkey + "&page=" + pageNumber + "&rows=" + rowCount + (nodeId > 0 ? "&nid=" + nodeId : "") + (!string.IsNullOrEmpty(category) ? "&cat=" + category : "");

            switch (paymentStatus)
            {
            case PaymentStatus.EXCLUDE:
                return(retVal + "&status=exclude");

            case PaymentStatus.NONE:
            default:
                return(retVal);
            }
        }
示例#2
0
        public static string MyChallenges(APIKey apiKey, int pageNumber, int rowCount, int nodeId = 0, ChallengeResult challengeResult = ChallengeResult.NONE, string category = null)
        {
            var retVal = "/api/nodes/my/challenges?key=" + apiKey.APIkey + "&page=" + pageNumber + "&rows=" + rowCount + (nodeId > 0 ? "&nid=" + nodeId : "") + (!string.IsNullOrEmpty(category) ? "&cat=" + category : "");

            switch (challengeResult)
            {
            case ChallengeResult.PASS:
                return(retVal + "&result=pass");

            case ChallengeResult.FAIL:
                return(retVal + "&result=fail");

            case ChallengeResult.NONE:
            default:
                return(retVal);
            }
        }
示例#3
0
        public static string MyExceptions(APIKey apiKey, int pageNumber, int rowCount, int nodeId = 0, ExceptionStatus exceptionStatus = ExceptionStatus.NONE, string category = null)
        {
            var retVal = "/api/nodes/my/exceptions?key=" + apiKey.APIkey + "&page=" + pageNumber + "&rows=" + rowCount + (nodeId > 0 ? "&nid=" + nodeId : "") + (!string.IsNullOrEmpty(category) ? "&cat=" + category : "");

            switch (exceptionStatus)
            {
            case ExceptionStatus.OPEN:
                return(retVal + "&status=o");

            case ExceptionStatus.CLOSED:
                return(retVal + "&status=c");

            case ExceptionStatus.EXCLUDE:
                return(retVal + "&status=x");

            case ExceptionStatus.NONE:
            default:
                return(retVal);
            }
        }
示例#4
0
        public static string MyNodes(APIKey apiKey, NodeStatus nodeStatus = NodeStatus.NONE, string category = null)
        {
            var retVal = "/api/nodes/my/list?key=" + apiKey.APIkey;

            switch (nodeStatus)
            {
            case NodeStatus.UP:
                retVal += "&status=up";
                break;

            case NodeStatus.DOWN:
                retVal += "&status=down";
                break;
            }

            if (!string.IsNullOrEmpty(category))
            {
                retVal += "&cat=" + category;
            }
            return(retVal);
        }
示例#5
0
 /* Path: /api/nodes/my/downtimes?key=<apikey>&page=<pageservernumber>&rows=<rowcount>
  * Optional Parameters:  &nid=<nodeid>  return only for specified node. e.g. &nid=435, &status=<status>  where <status> is 'o' for open or 'c' for closed.  e.g. &status=o
  * Return: Downtimes for all nodes associated with the API key.
  * Expected return: {"page":1,"total":79,"rowsperpage":"10","records":781,"rows":[{"id":120679,"fqdn":"zen1.secnodes.com","home":"ts1-testnet.na","curserver":"ts1-testnet.na","start":"2018-06-12T06:06:20.000Z","check":"2018-06-12T06:19:14.000Z","end":"2018-06-12T06:19:29.000Z","duration":789000,"dtype":"sys","nid":9}]}
  */
 public static HorizenNodeAPIDataModels.MyDowntimes GetMyDowntimes(APIKey apikey, int pageservernumber, int rowcount, int?servernumber, int nodeid = 0, string category = null, DowntimeStatus downtimestatus = DowntimeStatus.NONE, ServerRegion serverregion = ServerRegion.NONE)
 {
     return(JsonConvert.DeserializeObject <HorizenNodeAPIDataModels.MyDowntimes>(GetQueryJson(apikey.APINodeType, serverregion, servernumber, APIPagedCallUrlParts.MyDowntimes(apikey, pageservernumber, rowcount, nodeid, downtimestatus, category))));
 }
示例#6
0
 /* Path: /api/nodes/my/earnings?key=<apikey>
  * Optional Parameters:   &nid=<nodeid>  return only for specified node. e.g. &nid=435
  * Return: array of nodes with their associated earnings to date along with a record count and summary data that include the total zen earned to date and the current price of Zen in USD. Data is associated with the node email address linked to the API key.
  * Expected return: {"records":2,"rows":[{"nid":9,"fqdn":"zen1.secnodes.com","zen":"484.41397152","added":"2017-10-16T19:24:11.000Z"},{"nid":12,"fqdn":"zen102.secnodes.com","zen":"5.22053245","added":"2017-10-16T19:25:06.000Z"}],"summary":{"totalzen":489.63450397,"zenusd":17.18517909073966}}
  */
 public static HorizenNodeAPIDataModels.MyEarnings GetMyEarnings(APIKey apikey, int?servernumber, int nodeid = 0, string category = null, ServerRegion serverregion = ServerRegion.NONE)
 {
     return(JsonConvert.DeserializeObject <HorizenNodeAPIDataModels.MyEarnings>(GetQueryJson(apikey.APINodeType, serverregion, servernumber, APINonPagedCallUrlParts.MyEarnings(apikey, nodeid, category))));
 }
示例#7
0
 public static string MyEarnings(APIKey apiKey, int nodeId, string category = null)
 {
     return("/api/nodes/my/earnings?key=" + apiKey + (nodeId > 0 ? "&nid=" + nodeId : "") + (!string.IsNullOrEmpty(category)? "&cat=" + category: ""));
 }
示例#8
0
 public static string NodeDetail(APIKey apiKey, int nodeId)
 {
     return("/api/nodes/" + nodeId + "/detail?key=" + apiKey.APIkey);
 }