api decoding example provided

This commit is contained in:
moneroexamples 2017-07-30 06:21:44 +08:00
parent 9db09581b6
commit a850751d48
1 changed files with 8 additions and 1 deletions

View File

@ -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/<block_number|block_hash>