From a850751d486b38e0d940180d6bd397d5b2f49715 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Sun, 30 Jul 2017 06:21:44 +0800 Subject: [PATCH] api decoding example provided --- README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 20b5998..2c2a7d6 100644 --- a/README.md +++ b/README.md @@ -736,7 +736,14 @@ curl -w "\n" -X GET "http://139.162.32.245:8081/api/version" } ``` -api number is store as `uint32_t`. +api number is store as `uint32_t`. In this case `65536` represents +major version 1 and minor version 0. +In JavaScript to get these numbers, one can do as follows: + +```javascript +var api_major = response.data.api >> 16; +var api_minor = response.data.api & 0xffff; +``` #### api/rawblock/