Thorest v1.1.0
Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.
RESTful API to access VeChain Thor Network
Base URLs:
License: LGPL 3.0
Accounts
Access to account objects
Retrieve account detail
Code samples
# You can also use wget
curl -X GET http"//localhost:8669/accounts/{address} \
-H 'Accept: application/json'
GET http"//localhost:8669/accounts/{address} HTTP/1.1
Host: null
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'http"//localhost:8669/accounts/{address}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('http"//localhost:8669/accounts/{address}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'http"//localhost:8669/accounts/{address}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('http"//localhost:8669/accounts/{address}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http"//localhost:8669/accounts/{address}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http"//localhost:8669/accounts/{address}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /accounts/{address}
includes balance, energy and hasCode, by account address. An account with hasCode be true is a contract.
Historical account detail can be queried by specifying revision query string.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| address | path | string(bytes20) | true | address of account |
| revision | query | string | false | can be block number or ID. best block is assumed if omitted. |
Example responses
200 Response
{
"balance": "0x47ff1f90327aa0f8e",
"energy": "0xcf624158d591398",
"hasCode": false
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Account |
Execute account code
Code samples
# You can also use wget
curl -X POST http"//localhost:8669/accounts/{address} \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST http"//localhost:8669/accounts/{address} HTTP/1.1
Host: null
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'http"//localhost:8669/accounts/{address}',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"value": "0xde0b6b3a7640000",
"data": "0x5665436861696e2054686f72"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('http"//localhost:8669/accounts/{address}',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'http"//localhost:8669/accounts/{address}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('http"//localhost:8669/accounts/{address}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http"//localhost:8669/accounts/{address}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http"//localhost:8669/accounts/{address}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /accounts/{address}
to simulate contract method call, without sending transaction to block chain.
It's useful to estimate gas usage and execution result of a clause.
Body parameter
{
"value": "0xde0b6b3a7640000",
"data": "0x5665436861696e2054686f72"
}
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | CallData | true | arguments and environment |
| address | path | string(bytes20) | true | address of account |
| revision | query | string | false | can be block number or ID. best block is assumed if omitted. |
Example responses
200 Response
{
"data": "0x103556a73c10e38ffe2fc4aa50fc9d46ad0148f07e26417e117bd1ece9d948b5",
"events": [
{
"address": "0x7567d83b7b8d80addcb281a71d54fc7b3364ffed",
"topics": [
"0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
],
"data": "0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
}
],
"transfers": [
{
"sender": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d",
"recipient": "0x5034aa590125b64023a0262112b98d72e3c8e40e",
"amount": "0x47fdb3c3f456c0000"
}
],
"gasUsed": 21000,
"reverted": false,
"vmError": ""
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | CallResult |
Execute a batch of codes
Code samples
# You can also use wget
curl -X POST http"//localhost:8669/accounts/* \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST http"//localhost:8669/accounts/* HTTP/1.1
Host: null
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'http"//localhost:8669/accounts/*',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"clauses": [
{
"to": "0x5034aa590125b64023a0262112b98d72e3c8e40e",
"value": "0xde0b6b3a7640000",
"data": "0x5665436861696e2054686f72"
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('http"//localhost:8669/accounts/*',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'http"//localhost:8669/accounts/*',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('http"//localhost:8669/accounts/*', params={
}, headers = headers)
print r.json()
URL obj = new URL("http"//localhost:8669/accounts/*");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http"//localhost:8669/accounts/*", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /accounts/*
to simulate execution of a transaction.
Body parameter
{
"clauses": [
{
"to": "0x5034aa590125b64023a0262112b98d72e3c8e40e",
"value": "0xde0b6b3a7640000",
"data": "0x5665436861696e2054686f72"
}
]
}
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| revision | query | string | false | can be block number or ID. best block is assumed if omitted. |
| body | body | BatchCallData | true | arguments and environment |
Example responses
200 Response
[
{
"data": "0x103556a73c10e38ffe2fc4aa50fc9d46ad0148f07e26417e117bd1ece9d948b5",
"events": [
{
"address": "0x7567d83b7b8d80addcb281a71d54fc7b3364ffed",
"topics": [
"0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
],
"data": "0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
}
],
"transfers": [
{
"sender": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d",
"recipient": "0x5034aa590125b64023a0262112b98d72e3c8e40e",
"amount": "0x47fdb3c3f456c0000"
}
],
"gasUsed": 21000,
"reverted": false,
"vmError": ""
}
]
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | BatchCallResult |
Execute bytecodes
Code samples
# You can also use wget
curl -X POST http"//localhost:8669/accounts \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST http"//localhost:8669/accounts HTTP/1.1
Host: null
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'http"//localhost:8669/accounts',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"value": "0xde0b6b3a7640000",
"data": "0x5665436861696e2054686f72"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('http"//localhost:8669/accounts',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'http"//localhost:8669/accounts',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('http"//localhost:8669/accounts', params={
}, headers = headers)
print r.json()
URL obj = new URL("http"//localhost:8669/accounts");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http"//localhost:8669/accounts", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /accounts
to simulate contract deployment without sending transaction to block chain.
It's useful to estimate gas usage and contract deployment result of a clause.
TIPS:
datain request body is the bytecodes of a contractdatain response body is the runtime bytecodes assigned to account which the contract to be deployed
Body parameter
{
"value": "0xde0b6b3a7640000",
"data": "0x5665436861696e2054686f72"
}
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| revision | query | string | false | can be block number or ID. best block is assumed if omitted. |
| body | body | CallData | true | arguments and environment |
Example responses
200 Response
{
"data": "0x103556a73c10e38ffe2fc4aa50fc9d46ad0148f07e26417e117bd1ece9d948b5",
"events": [
{
"address": "0x7567d83b7b8d80addcb281a71d54fc7b3364ffed",
"topics": [
"0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
],
"data": "0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
}
],
"transfers": [
{
"sender": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d",
"recipient": "0x5034aa590125b64023a0262112b98d72e3c8e40e",
"amount": "0x47fdb3c3f456c0000"
}
],
"gasUsed": 21000,
"reverted": false,
"vmError": ""
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | CallResult |
Retrieve account code
Code samples
# You can also use wget
curl -X GET http"//localhost:8669/accounts/{address}/code \
-H 'Accept: application/json'
GET http"//localhost:8669/accounts/{address}/code HTTP/1.1
Host: null
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'http"//localhost:8669/accounts/{address}/code',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('http"//localhost:8669/accounts/{address}/code',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'http"//localhost:8669/accounts/{address}/code',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('http"//localhost:8669/accounts/{address}/code', params={
}, headers = headers)
print r.json()
URL obj = new URL("http"//localhost:8669/accounts/{address}/code");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http"//localhost:8669/accounts/{address}/code", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /accounts/{address}/code
if any. Here the code is runtime bytecodes.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| address | path | string(bytes20) | true | address of account |
| revision | query | string | false | can be block number or ID. best block is assumed if omitted. |
Example responses
200 Response
{
"code": "0x6060604052600080fd00a165627a7a72305820c23d3ae2dc86ad130561a2829d87c7cb8435365492bd1548eb7e7fc0f3632be90029"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Code |
Retrieve account storage value
Code samples
# You can also use wget
curl -X GET http"//localhost:8669/accounts/{address}/storage/{key} \
-H 'Accept: application/json'
GET http"//localhost:8669/accounts/{address}/storage/{key} HTTP/1.1
Host: null
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'http"//localhost:8669/accounts/{address}/storage/{key}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('http"//localhost:8669/accounts/{address}/storage/{key}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'http"//localhost:8669/accounts/{address}/storage/{key}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('http"//localhost:8669/accounts/{address}/storage/{key}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http"//localhost:8669/accounts/{address}/storage/{key}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http"//localhost:8669/accounts/{address}/storage/{key}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /accounts/{address}/storage/{key}
for given key.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| address | path | string(bytes20) | true | address of account |
| key | path | string | true | the key(position) to access account storage |
| revision | query | string | false | can be block number or ID. best block is assumed if omitted. |
Example responses
200 Response
{
"value": "0x0000000000000000000000000000000000000000000000000000000000000001"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Storage |
Transactions
Access to transactions
Retrieve transaction
Code samples
# You can also use wget
curl -X GET http"//localhost:8669/transactions/{id} \
-H 'Accept: application/json'
GET http"//localhost:8669/transactions/{id} HTTP/1.1
Host: null
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'http"//localhost:8669/transactions/{id}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('http"//localhost:8669/transactions/{id}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'http"//localhost:8669/transactions/{id}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('http"//localhost:8669/transactions/{id}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http"//localhost:8669/transactions/{id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http"//localhost:8669/transactions/{id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /transactions/{id}
by ID.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | string | true | ID of transaction |
| raw | query | boolean | false | whether retrieve a raw transaction. |
| head | query | string | false | ID of head block. best block is assumed if omitted |
Example responses
200 Response
{
"id": "0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8",
"chainTag": 1,
"blockRef": "0x00000001511fc0be",
"expiration": 30,
"clauses": [],
"gasPriceCoef": 128,
"gas": 21000,
"origin": "0x7567d83b7b8d80addcb281a71d54fc7b3364ffed",
"nonce": "0xd92966da424d9939",
"dependsOn": null,
"size": 180,
"meta": {
"blockID": "0x00000001c458949985a6d86b7139690b8811dd3b4647c02d4f41cdefb7d32327",
"blockNumber": 1,
"blockTimestamp": 1523156271
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | TxOrRawTxWithMeta |
Retrieve transaction receipt
Code samples
# You can also use wget
curl -X GET http"//localhost:8669/transactions/{id}/receipt \
-H 'Accept: application/json'
GET http"//localhost:8669/transactions/{id}/receipt HTTP/1.1
Host: null
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'http"//localhost:8669/transactions/{id}/receipt',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('http"//localhost:8669/transactions/{id}/receipt',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'http"//localhost:8669/transactions/{id}/receipt',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('http"//localhost:8669/transactions/{id}/receipt', params={
}, headers = headers)
print r.json()
URL obj = new URL("http"//localhost:8669/transactions/{id}/receipt");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http"//localhost:8669/transactions/{id}/receipt", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /transactions/{id}/receipt
by ID.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| id | path | string | true | ID of transaction |
| head | query | string | false | ID of head block. best block is assumed if omitted |
Example responses
200 Response
{
"gasUsed": 21000,
"gasPayer": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d",
"paid": "0x1236efcbcbb340000",
"reward": "0x576e189f04f60000",
"reverted": false,
"outputs": [
{
"contractAddress": null,
"events": [
{
"address": "0x7567d83b7b8d80addcb281a71d54fc7b3364ffed",
"topics": [
"0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
],
"data": "0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
}
],
"transfers": [
{
"sender": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d",
"recipient": "0x5034aa590125b64023a0262112b98d72e3c8e40e",
"amount": "0x47fdb3c3f456c0000"
}
]
}
],
"meta": {
"blockID": "0x0004f6cc88bb4626a92907718e82f255b8fa511453a78e8797eb8cea3393b215",
"blockNumber": 325324,
"blockTimestamp": 1533267900,
"txID": "0x284bba50ef777889ff1a367ed0b38d5e5626714477c40de38d71cedd6f9fa477",
"txOrigin": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d"
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Receipt |
Commit transaction
Code samples
# You can also use wget
curl -X POST http"//localhost:8669/transactions \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST http"//localhost:8669/transactions HTTP/1.1
Host: null
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'http"//localhost:8669/transactions',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"raw": "0xf86981ba800adad994000000000000000000000000000000000000746f82271080018252088001c0b8414792c9439594098323900e6470742cd877ec9f9906bca05510e421f3b013ed221324e77ca10d3466b32b1800c72e12719b213f1d4c370305399dd27af962626400"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('http"//localhost:8669/transactions',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'http"//localhost:8669/transactions',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('http"//localhost:8669/transactions', params={
}, headers = headers)
print r.json()
URL obj = new URL("http"//localhost:8669/transactions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http"//localhost:8669/transactions", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /transactions
in raw or structured format. If no signature in structured format,
signingHash is returned in response body.
Body parameter
{
"raw": "0xf86981ba800adad994000000000000000000000000000000000000746f82271080018252088001c0b8414792c9439594098323900e6470742cd877ec9f9906bca05510e421f3b013ed221324e77ca10d3466b32b1800c72e12719b213f1d4c370305399dd27af962626400"
}
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | RawOrSignedOrUnsignedTx | true | none |
Example responses
200 Response
{
"id": "0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | IDOrSigningHash |
Blocks
Access to blocks
Retrieve block
Code samples
# You can also use wget
curl -X GET http"//localhost:8669/blocks/{revision} \
-H 'Accept: application/json'
GET http"//localhost:8669/blocks/{revision} HTTP/1.1
Host: null
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'http"//localhost:8669/blocks/{revision}',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('http"//localhost:8669/blocks/{revision}',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'http"//localhost:8669/blocks/{revision}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('http"//localhost:8669/blocks/{revision}', params={
}, headers = headers)
print r.json()
URL obj = new URL("http"//localhost:8669/blocks/{revision}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http"//localhost:8669/blocks/{revision}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /blocks/{revision}
by ID or number, or 'best' for latest block.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| revision | path | string | true | block ID or number, or 'best' stands for latest block |
Detailed descriptions
revision: block ID or number, or 'best' stands for latest block
Example responses
200 Response
{
"number": 325324,
"id": "0x0004f6cc88bb4626a92907718e82f255b8fa511453a78e8797eb8cea3393b215",
"size": 373,
"parentID": "0x0004f6cb730dbd90fed09d165bfdf33cc0eed47ec068938f6ee7b7c12a4ea98d",
"timestamp": 1533267900,
"gasLimit": 11253579,
"beneficiary": "0xb4094c25f86d628fdd571afc4077f0d0196afb48",
"gasUsed": 21000,
"totalScore": 1029988,
"txsRoot": "0x89dfd9fcd10c9e53d68592cf8b540b280b72d381b868523223992f3e09a806bb",
"stateRoot": "0x86bcc6d214bc9d8d0dedba1012a63c8317d19ce97f60c8a2ef5c59bbd40d4261",
"receiptsRoot": "0x15787e2533c470e8a688e6cd17a1ee12d8457778d5f82d2c109e2d6226d8e54e",
"signer": "0xab7b27fc9e7d29f9f2e5bd361747a5515d0cc2d1",
"transactions": [
"0x284bba50ef777889ff1a367ed0b38d5e5626714477c40de38d71cedd6f9fa477"
],
"isTrunk": true
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
Response Schema
Logs
Access to event & transfer logs
Filter event logs
Code samples
# You can also use wget
curl -X POST http"//localhost:8669/events \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST http"//localhost:8669/events HTTP/1.1
Host: null
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'http"//localhost:8669/events',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"range": {
"unit": "block",
"from": 0,
"to": 100000
},
"options": {
"offset": 0,
"limit": 10
},
"topicSets": [
{
"topic0": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('http"//localhost:8669/events',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'http"//localhost:8669/events',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('http"//localhost:8669/events', params={
}, headers = headers)
print r.json()
URL obj = new URL("http"//localhost:8669/events");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http"//localhost:8669/events", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /events
Body parameter
{
"range": {
"unit": "block",
"from": 0,
"to": 100000
},
"options": {
"offset": 0,
"limit": 10
},
"topicSets": [
{
"topic0": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
}
]
}
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| order | query | string | false | order of filters, defaults to asc |
| address | query | string | false | address of account which is the events emitter |
| body | body | EventFilterLegacy | true | event filter criteria |
Detailed descriptions
order: order of filters, defaults to asc
Enumerated Values
| Parameter | Value |
|---|---|
| order | asc |
| order | desc |
Example responses
200 Response
[
{
"address": "0x7567d83b7b8d80addcb281a71d54fc7b3364ffed",
"topics": [
"0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
],
"data": "0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8",
"meta": {
"blockID": "0x0004f6cc88bb4626a92907718e82f255b8fa511453a78e8797eb8cea3393b215",
"blockNumber": 325324,
"blockTimestamp": 1533267900,
"txID": "0x284bba50ef777889ff1a367ed0b38d5e5626714477c40de38d71cedd6f9fa477",
"txOrigin": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d"
}
}
]
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
Response Schema
Filter transfer logs
Code samples
# You can also use wget
curl -X POST http"//localhost:8669/transfers \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST http"//localhost:8669/transfers HTTP/1.1
Host: null
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'http"//localhost:8669/transfers',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"range": {
"unit": "block",
"from": 0,
"to": 100000
},
"options": {
"offset": 0,
"limit": 10
},
"addressSets": [
{
"txOrigin": "0xe59d475abe695c7f67a8a2321f33a856b0b4c71d",
"sender": "0xe59d475abe695c7f67a8a2321f33a856b0b4c71d",
"recipient": "0x7567d83b7b8d80addcb281a71d54fc7b3364ffed"
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('http"//localhost:8669/transfers',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'http"//localhost:8669/transfers',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('http"//localhost:8669/transfers', params={
}, headers = headers)
print r.json()
URL obj = new URL("http"//localhost:8669/transfers");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http"//localhost:8669/transfers", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /transfers
Body parameter
{
"range": {
"unit": "block",
"from": 0,
"to": 100000
},
"options": {
"offset": 0,
"limit": 10
},
"addressSets": [
{
"txOrigin": "0xe59d475abe695c7f67a8a2321f33a856b0b4c71d",
"sender": "0xe59d475abe695c7f67a8a2321f33a856b0b4c71d",
"recipient": "0x7567d83b7b8d80addcb281a71d54fc7b3364ffed"
}
]
}
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| order | query | string | false | order of filters, defaults to asc |
| body | body | TransferFilterLegacy | true | transfer log filter criteria |
Detailed descriptions
order: order of filters, defaults to asc
Enumerated Values
| Parameter | Value |
|---|---|
| order | asc |
| order | desc |
Example responses
200 Response
[
{
"sender": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d",
"recipient": "0x5034aa590125b64023a0262112b98d72e3c8e40e",
"amount": "0x47fdb3c3f456c0000",
"meta": {
"blockID": "0x0004f6cc88bb4626a92907718e82f255b8fa511453a78e8797eb8cea3393b215",
"blockNumber": 325324,
"blockTimestamp": 1533267900,
"txID": "0x284bba50ef777889ff1a367ed0b38d5e5626714477c40de38d71cedd6f9fa477",
"txOrigin": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d"
}
}
]
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
Response Schema
Node
Access to node status info
Retrieve connected peers
Code samples
# You can also use wget
curl -X GET http"//localhost:8669/node/network/peers \
-H 'Accept: application/json'
GET http"//localhost:8669/node/network/peers HTTP/1.1
Host: null
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'http"//localhost:8669/node/network/peers',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('http"//localhost:8669/node/network/peers',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'http"//localhost:8669/node/network/peers',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('http"//localhost:8669/node/network/peers', params={
}, headers = headers)
print r.json()
URL obj = new URL("http"//localhost:8669/node/network/peers");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http"//localhost:8669/node/network/peers", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /node/network/peers
Example responses
200 Response
[
{
"name": "thor/v1.0.0-6680b98-dev/linux/go1.10.3",
"bestBlockID": "0x000087b3a4d4cdf1cc52d56b9704f4c18f020e1b48dbbf4a23d1ee4f1fa5ff94",
"totalScore": 68497,
"peerID": "50e122a505ee55b84331068acfd857e37ad58f463a0fab9aaff2c1e4b2e2d22ae71dc14fdaf6eead74bd3f60594644aa35c588f9ca6be3341e2ce18ddc413321",
"netAddr": "128.1.39.120:11235",
"inbound": false,
"duration": 28
}
]
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
Response Schema
Status Code 200
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| » name | string | false | none | none |
| » bestBlockID | string | false | none | none |
| » totalScore | integer | false | none | none |
| » peerID | string | false | none | none |
| » netAddr | string | false | none | none |
| » inbound | boolean | false | none | none |
| » duration | integer | false | none | none |
Subscriptions
Subscribe interested subjects
(Websocket) Subscribe new blocks
Code samples
# You can also use wget
curl -X GET http"//localhost:8669/subscriptions/block \
-H 'Accept: application/json'
GET http"//localhost:8669/subscriptions/block HTTP/1.1
Host: null
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'http"//localhost:8669/subscriptions/block',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('http"//localhost:8669/subscriptions/block',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'http"//localhost:8669/subscriptions/block',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('http"//localhost:8669/subscriptions/block', params={
}, headers = headers)
print r.json()
URL obj = new URL("http"//localhost:8669/subscriptions/block");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http"//localhost:8669/subscriptions/block", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /subscriptions/block
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| pos | query | string | false | a saved block ID for resuming the subscription. best block ID is assumed if omitted. |
Detailed descriptions
pos: a saved block ID for resuming the subscription. best block ID is assumed if omitted.
Example responses
200 Response
{
"number": 325324,
"id": "0x0004f6cc88bb4626a92907718e82f255b8fa511453a78e8797eb8cea3393b215",
"size": 373,
"parentID": "0x0004f6cb730dbd90fed09d165bfdf33cc0eed47ec068938f6ee7b7c12a4ea98d",
"timestamp": 1533267900,
"gasLimit": 11253579,
"beneficiary": "0xb4094c25f86d628fdd571afc4077f0d0196afb48",
"gasUsed": 21000,
"totalScore": 1029988,
"txsRoot": "0x89dfd9fcd10c9e53d68592cf8b540b280b72d381b868523223992f3e09a806bb",
"stateRoot": "0x86bcc6d214bc9d8d0dedba1012a63c8317d19ce97f60c8a2ef5c59bbd40d4261",
"receiptsRoot": "0x15787e2533c470e8a688e6cd17a1ee12d8457778d5f82d2c109e2d6226d8e54e",
"signer": "0xab7b27fc9e7d29f9f2e5bd361747a5515d0cc2d1",
"transactions": [
"0x284bba50ef777889ff1a367ed0b38d5e5626714477c40de38d71cedd6f9fa477"
],
"obsolete": true
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
Response Schema
(Websocket) Subscribe new events
Code samples
# You can also use wget
curl -X GET http"//localhost:8669/subscriptions/event \
-H 'Accept: application/json'
GET http"//localhost:8669/subscriptions/event HTTP/1.1
Host: null
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'http"//localhost:8669/subscriptions/event',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('http"//localhost:8669/subscriptions/event',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'http"//localhost:8669/subscriptions/event',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('http"//localhost:8669/subscriptions/event', params={
}, headers = headers)
print r.json()
URL obj = new URL("http"//localhost:8669/subscriptions/event");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http"//localhost:8669/subscriptions/event", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /subscriptions/event
which satisfy criteria in query.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| pos | query | string | false | a saved block ID for resuming the subscription. best block ID is assumed if omitted. |
| addr | query | string | false | address of event emitter |
| t0 | query | string | false | topic0 of event |
| t1 | query | string | false | topic1 of event |
| t2 | query | string | false | topic2 of event |
| t3 | query | string | false | topic3 of event |
| t4 | query | string | false | topic4 of event |
Detailed descriptions
pos: a saved block ID for resuming the subscription. best block ID is assumed if omitted.
Example responses
200 Response
{
"address": "0x7567d83b7b8d80addcb281a71d54fc7b3364ffed",
"topics": [
"0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
],
"data": "0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8",
"obsolete": true,
"meta": {
"blockID": "0x0004f6cc88bb4626a92907718e82f255b8fa511453a78e8797eb8cea3393b215",
"blockNumber": 325324,
"blockTimestamp": 1533267900,
"txID": "0x284bba50ef777889ff1a367ed0b38d5e5626714477c40de38d71cedd6f9fa477",
"txOrigin": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d"
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
Response Schema
(Websocket) Subscribe new transfers
Code samples
# You can also use wget
curl -X GET http"//localhost:8669/subscriptions/transfer \
-H 'Accept: application/json'
GET http"//localhost:8669/subscriptions/transfer HTTP/1.1
Host: null
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'http"//localhost:8669/subscriptions/transfer',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('http"//localhost:8669/subscriptions/transfer',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'http"//localhost:8669/subscriptions/transfer',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('http"//localhost:8669/subscriptions/transfer', params={
}, headers = headers)
print r.json()
URL obj = new URL("http"//localhost:8669/subscriptions/transfer");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http"//localhost:8669/subscriptions/transfer", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /subscriptions/transfer
which satisfy criteria in query.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| pos | query | string | false | a saved block ID for resuming the subscription. best block ID is assumed if omitted. |
| txOrigin | query | string | false | signer address of tx which contains the transfer |
| sender | query | string | false | address of token sender |
| recipient | query | string | false | address of token recipient |
Detailed descriptions
pos: a saved block ID for resuming the subscription. best block ID is assumed if omitted.
Example responses
200 Response
{
"sender": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d",
"recipient": "0x5034aa590125b64023a0262112b98d72e3c8e40e",
"amount": "0x47fdb3c3f456c0000",
"obsolete": true,
"meta": {
"blockID": "0x0004f6cc88bb4626a92907718e82f255b8fa511453a78e8797eb8cea3393b215",
"blockNumber": 325324,
"blockTimestamp": 1533267900,
"txID": "0x284bba50ef777889ff1a367ed0b38d5e5626714477c40de38d71cedd6f9fa477",
"txOrigin": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d"
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
Response Schema
(Websocket) Subscribe block chain's beats
Code samples
# You can also use wget
curl -X GET http"//localhost:8669/subscriptions/beat \
-H 'Accept: application/json'
GET http"//localhost:8669/subscriptions/beat HTTP/1.1
Host: null
Accept: application/json
var headers = {
'Accept':'application/json'
};
$.ajax({
url: 'http"//localhost:8669/subscriptions/beat',
method: 'get',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const headers = {
'Accept':'application/json'
};
fetch('http"//localhost:8669/subscriptions/beat',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json'
}
result = RestClient.get 'http"//localhost:8669/subscriptions/beat',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json'
}
r = requests.get('http"//localhost:8669/subscriptions/beat', params={
}, headers = headers)
print r.json()
URL obj = new URL("http"//localhost:8669/subscriptions/beat");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http"//localhost:8669/subscriptions/beat", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
GET /subscriptions/beat
which contain summary of new blocks, and bloom filters that composited with affected addresses.
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| pos | query | string | false | a saved block ID for resuming the subscription. best block ID is assumed if omitted. |
Detailed descriptions
pos: a saved block ID for resuming the subscription. best block ID is assumed if omitted.
Example responses
200 Response
{
"number": 325324,
"id": "0x0004f6cc88bb4626a92907718e82f255b8fa511453a78e8797eb8cea3393b215",
"parentID": "0x0004f6cb730dbd90fed09d165bfdf33cc0eed47ec068938f6ee7b7c12a4ea98d",
"timestamp": 1533267900,
"bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"k": 3,
"obsolete": true
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
Response Schema
Debug
Debug utilities
Create a tracer
Code samples
# You can also use wget
curl -X POST http"//localhost:8669/debug/tracers \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST http"//localhost:8669/debug/tracers HTTP/1.1
Host: null
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'http"//localhost:8669/debug/tracers',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"name": "",
"target": "0x000dabb4d6f0a80ad7ad7cd0e07a1f20b546db0730d869d5ccb0dd2a16e7595b/0/0"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('http"//localhost:8669/debug/tracers',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'http"//localhost:8669/debug/tracers',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('http"//localhost:8669/debug/tracers', params={
}, headers = headers)
print r.json()
URL obj = new URL("http"//localhost:8669/debug/tracers");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http"//localhost:8669/debug/tracers", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /debug/tracers
for a clause
Body parameter
{
"name": "",
"target": "0x000dabb4d6f0a80ad7ad7cd0e07a1f20b546db0730d869d5ccb0dd2a16e7595b/0/0"
}
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | TracerOption | true | none |
Example responses
200 Response
{}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | Inline |
Response Schema
Retrieve storage range
Code samples
# You can also use wget
curl -X POST http"//localhost:8669/debug/storage-range \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'
POST http"//localhost:8669/debug/storage-range HTTP/1.1
Host: null
Content-Type: application/json
Accept: application/json
var headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
$.ajax({
url: 'http"//localhost:8669/debug/storage-range',
method: 'post',
headers: headers,
success: function(data) {
console.log(JSON.stringify(data));
}
})
const request = require('node-fetch');
const inputBody = '{
"address": "0xa4627036e2095eb71c2341054daa63577c062498",
"keyStart": "0x0000000000000000000000000000000000000000000000000000000000000000",
"maxResult": 10,
"target": "0x000edefb448685f9c72fc2b946980ef51d8d208bbaa4d3fdcf0c57d4847aca2e/0/0"
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json'
};
fetch('http"//localhost:8669/debug/storage-range',
{
method: 'POST',
body: inputBody,
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Content-Type' => 'application/json',
'Accept' => 'application/json'
}
result = RestClient.post 'http"//localhost:8669/debug/storage-range',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json'
}
r = requests.post('http"//localhost:8669/debug/storage-range', params={
}, headers = headers)
print r.json()
URL obj = new URL("http"//localhost:8669/debug/storage-range");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Content-Type": []string{"application/json"},
"Accept": []string{"application/json"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http"//localhost:8669/debug/storage-range", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
POST /debug/storage-range
of the account with given address
Body parameter
{
"address": "0xa4627036e2095eb71c2341054daa63577c062498",
"keyStart": "0x0000000000000000000000000000000000000000000000000000000000000000",
"maxResult": 10,
"target": "0x000edefb448685f9c72fc2b946980ef51d8d208bbaa4d3fdcf0c57d4847aca2e/0/0"
}
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
| body | body | StorageRangeOption | true | none |
Example responses
200 Response
{
"nextKey": null,
"storage": {
"0x33e423980c9b37d048bd5fadbd4a2aeb95146922045405accc2f468d0ef96988": {
"key": "0x0000000000000000000000000000000000000000000000000000000000000001",
"value": "0x00000000000000000000000000000000000000000000000000000000000000c8"
}
}
}
Responses
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | OK | StorageRange |
Schemas
Account
{
"balance": "0x47ff1f90327aa0f8e",
"energy": "0xcf624158d591398",
"hasCode": false
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| balance | string | false | none | balance in unit WEI, presented with hex string |
| energy | string | false | none | energy in uint WEI, presented with hex string |
| hasCode | boolean | false | none | whether the account has code |
Code
{
"code": "0x6060604052600080fd00a165627a7a72305820c23d3ae2dc86ad130561a2829d87c7cb8435365492bd1548eb7e7fc0f3632be90029"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| code | string | false | none | none |
Storage
{
"value": "0x0000000000000000000000000000000000000000000000000000000000000001"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| value | string | false | none | none |
TxMeta
{
"blockID": "0x0004f6cc88bb4626a92907718e82f255b8fa511453a78e8797eb8cea3393b215",
"blockNumber": 325324,
"blockTimestamp": 1533267900
}
transaction meta info
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| blockID | string | false | none | block identifier (bytes32) |
| blockNumber | integer(uint32) | false | none | block number (height) |
| blockTimestamp | integer(uint64) | false | none | block unix timestamp |
LogMeta
{
"blockID": "0x0004f6cc88bb4626a92907718e82f255b8fa511453a78e8797eb8cea3393b215",
"blockNumber": 325324,
"blockTimestamp": 1533267900,
"txID": "0x284bba50ef777889ff1a367ed0b38d5e5626714477c40de38d71cedd6f9fa477",
"txOrigin": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d"
}
event or transfer log meta info
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| blockID | string | false | none | block identifier (bytes32) |
| blockNumber | integer(uint32) | false | none | block number (height) |
| blockTimestamp | integer(uint64) | false | none | block unix timestamp |
| txID | string | false | none | transaction identifier |
| txOrigin | string | false | none | transaction origin (signer) |
Block
{
"number": 325324,
"id": "0x0004f6cc88bb4626a92907718e82f255b8fa511453a78e8797eb8cea3393b215",
"size": 373,
"parentID": "0x0004f6cb730dbd90fed09d165bfdf33cc0eed47ec068938f6ee7b7c12a4ea98d",
"timestamp": 1533267900,
"gasLimit": 11253579,
"beneficiary": "0xb4094c25f86d628fdd571afc4077f0d0196afb48",
"gasUsed": 21000,
"totalScore": 1029988,
"txsRoot": "0x89dfd9fcd10c9e53d68592cf8b540b280b72d381b868523223992f3e09a806bb",
"stateRoot": "0x86bcc6d214bc9d8d0dedba1012a63c8317d19ce97f60c8a2ef5c59bbd40d4261",
"receiptsRoot": "0x15787e2533c470e8a688e6cd17a1ee12d8457778d5f82d2c109e2d6226d8e54e",
"signer": "0xab7b27fc9e7d29f9f2e5bd361747a5515d0cc2d1",
"transactions": [
"0x284bba50ef777889ff1a367ed0b38d5e5626714477c40de38d71cedd6f9fa477"
]
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| number | integer(uint32) | false | none | block number (height) |
| id | string(bytes32) | false | none | block identifier |
| size | integer(uint32) | false | none | RLP encoded block size in bytes |
| parentID | string(bytes32) | false | none | parent block ID |
| timestamp | integer(uint64) | false | none | block unix timestamp |
| gasLimit | integer(uint64) | false | none | block gas limit (max allowed accumulative gas usage of transactions) |
| beneficiary | string(bytes32) | false | none | address of account to receive block reward |
| gasUsed | integer(uint64) | false | none | accumulative gas usage of transactions |
| totalScore | integer(uint64) | false | none | sum of all ancestral blocks' score |
| txsRoot | string(bytes32) | false | none | root hash of transactions in the block |
| stateRoot | string(bytes32) | false | none | root hash of accounts state |
| receiptsRoot | string(bytes32) | false | none | root hash of transaction receipts |
| signer | string(bytes20) | false | none | the one who signed this block |
| transactions | [string] | false | none | transactions IDs |
Clause
{
"to": "0x5034aa590125b64023a0262112b98d72e3c8e40e",
"value": "0x47fdb3c3f456c0000",
"data": "0x"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| to | string | false | none | recipient of clause, null for contract deployment (bytes32) |
| value | string | false | none | hex form of token to be transferred |
| data | string | false | none | input data (bytes) |
TxBody
{
"chainTag": 39,
"blockRef": "0x0004f6cb730dbd90",
"expiration": 720,
"clauses": [
{
"to": "0x5034aa590125b64023a0262112b98d72e3c8e40e",
"value": "0x47fdb3c3f456c0000",
"data": "0x"
}
],
"gasPriceCoef": 0,
"gas": 21000,
"dependsOn": null,
"nonce": "0x29c257e36ea6e72a"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| chainTag | integer(uint8) | false | none | last byte of genesis block ID |
| blockRef | string | false | none | 8 bytes prefix of some block ID |
| expiration | integer(uint32) | false | none | expiration relative to blockRef, in unit block |
| clauses | [Clause] | false | none | none |
| gasPriceCoef | integer(uint8) | false | none | coefficient used to calculate the final gas price |
| gas | integer(uint64) | false | none | max amount of gas can be consumed to execute this transaction |
| dependsOn | string(bytes32) | false | none | ID of the transaction on which the current transaction depends on. can be null. |
| nonce | string | false | none | none |
SignedTx
{
"chainTag": 39,
"blockRef": "0x0004f6cb730dbd90",
"expiration": 720,
"clauses": [
{
"to": "0x5034aa590125b64023a0262112b98d72e3c8e40e",
"value": "0x47fdb3c3f456c0000",
"data": "0x"
}
],
"gasPriceCoef": 0,
"gas": 21000,
"dependsOn": null,
"nonce": "0x29c257e36ea6e72a",
"signature": "0x67cd851b90fb016457bb30ccbdaa3405f3db667daeb95258e1859c545be30c10f1780476f7c6ba24c75d26c8f1a9df59fe89b105c6f86733c1d5c1c74f14cd9201"
}
Properties
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | TxBody | false | none | none |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » signature | string | false | none | signature hex string |
TxWithMeta
{
"chainTag": 39,
"blockRef": "0x0004f6cb730dbd90",
"expiration": 720,
"clauses": [
{
"to": "0x5034aa590125b64023a0262112b98d72e3c8e40e",
"value": "0x47fdb3c3f456c0000",
"data": "0x"
}
],
"gasPriceCoef": 0,
"gas": 21000,
"dependsOn": null,
"nonce": "0x29c257e36ea6e72a",
"id": "0x284bba50ef777889ff1a367ed0b38d5e5626714477c40de38d71cedd6f9fa477",
"origin": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d",
"size": 130,
"meta": {
"blockID": "0x0004f6cc88bb4626a92907718e82f255b8fa511453a78e8797eb8cea3393b215",
"blockNumber": 325324,
"blockTimestamp": 1533267900
}
}
Properties
allOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | TxBody | false | none | none |
and
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » id | string | false | none | identifier of the transaction |
| » origin | string | false | none | the one who signed the transaction |
| » size | integer(uint32) | false | none | byte size of the transaction that is RLP encoded |
| » meta | TxMeta | false | none | none |
RawTx
{
"raw": "0xf86981ba800adad994000000000000000000000000000000000000746f82271080018252088001c0b8414792c9439594098323900e6470742cd877ec9f9906bca05510e421f3b013ed221324e77ca10d3466b32b1800c72e12719b213f1d4c370305399dd27af962626400"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| raw | string | false | none | hex form of encoded transaction |
RawTxWithMeta
{
"raw": "0xf86981ba800adad994000000000000000000000000000000000000746f82271080018252088001c0b8414792c9439594098323900e6470742cd877ec9f9906bca05510e421f3b013ed221324e77ca10d3466b32b1800c72e12719b213f1d4c370305399dd27af962626400",
"meta": {
"blockID": "0x0004f6cc88bb4626a92907718e82f255b8fa511453a78e8797eb8cea3393b215",
"blockNumber": 325324,
"blockTimestamp": 1533267900
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| raw | string | false | none | hex form of encoded transaction |
| meta | TxMeta | false | none | none |
Event
{
"address": "0x7567d83b7b8d80addcb281a71d54fc7b3364ffed",
"topics": [
"0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
],
"data": "0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| address | string | false | none | the address of contract which produces the event (bytes20) |
| topics | [string] | false | none | none |
| data | string | false | none | none |
Transfer
{
"sender": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d",
"recipient": "0x5034aa590125b64023a0262112b98d72e3c8e40e",
"amount": "0x47fdb3c3f456c0000"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| sender | string | false | none | address that sends tokens |
| recipient | string | false | none | address that receives tokens |
| amount | string | false | none | amount of tokens |
Receipt
{
"gasUsed": 21000,
"gasPayer": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d",
"paid": "0x1236efcbcbb340000",
"reward": "0x576e189f04f60000",
"reverted": false,
"outputs": [
{
"contractAddress": null,
"events": [
{
"address": "0x7567d83b7b8d80addcb281a71d54fc7b3364ffed",
"topics": [
"0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
],
"data": "0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
}
],
"transfers": [
{
"sender": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d",
"recipient": "0x5034aa590125b64023a0262112b98d72e3c8e40e",
"amount": "0x47fdb3c3f456c0000"
}
]
}
],
"meta": {
"blockID": "0x0004f6cc88bb4626a92907718e82f255b8fa511453a78e8797eb8cea3393b215",
"blockNumber": 325324,
"blockTimestamp": 1533267900,
"txID": "0x284bba50ef777889ff1a367ed0b38d5e5626714477c40de38d71cedd6f9fa477",
"txOrigin": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d"
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| gasUsed | integer(uint64) | false | none | none |
| gasPayer | string | false | none | address of account who paid used gas |
| paid | string | false | none | hex form of amount of paid energy |
| reward | string | false | none | hex form of amount of reward |
| reverted | boolean | false | none | true means the transaction was reverted |
| outputs | [any] | false | none | none |
| » contractAddress | string | false | none | deployed contract address, if the corresponding clause is a contract deployment clause |
| » events | [Event] | false | none | none |
| » transfers | [Transfer] | false | none | none |
| meta | LogMeta | false | none | none |
CallData
{
"value": "0xde0b6b3a7640000",
"data": "0x5665436861696e2054686f72"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| value | string | false | none | amount of token to be transferred |
| data | string | false | none | input data for contract call |
| gas | integer(uint64) | false | none | max allowed gas for execution |
| gasPrice | string | false | none | absolute gas price |
| caller | string | false | none | caller address (msg.sender) |
CallResult
{
"data": "0x103556a73c10e38ffe2fc4aa50fc9d46ad0148f07e26417e117bd1ece9d948b5",
"events": [
{
"address": "0x7567d83b7b8d80addcb281a71d54fc7b3364ffed",
"topics": [
"0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
],
"data": "0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
}
],
"transfers": [
{
"sender": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d",
"recipient": "0x5034aa590125b64023a0262112b98d72e3c8e40e",
"amount": "0x47fdb3c3f456c0000"
}
],
"gasUsed": 21000,
"reverted": false,
"vmError": ""
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| data | string | false | none | the output data |
| events | [Event] | false | none | none |
| transfers | [Transfer] | false | none | none |
| gasUsed | integer(uint64) | false | none | gas used during execution |
| reverted | boolean | false | none | none |
| vmError | string | false | none | none |
BatchCallData
{
"clauses": [
{
"to": "0x5034aa590125b64023a0262112b98d72e3c8e40e",
"value": "0xde0b6b3a7640000",
"data": "0x5665436861696e2054686f72"
}
]
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| clauses | [Clause] | false | none | none |
| gas | integer(uint64) | false | none | max allowed gas for execution |
| gasPrice | string | false | none | absolute gas price |
| caller | string | false | none | caller address (msg.sender) |
BatchCallResult
[
{
"data": "0x103556a73c10e38ffe2fc4aa50fc9d46ad0148f07e26417e117bd1ece9d948b5",
"events": [
{
"address": "0x7567d83b7b8d80addcb281a71d54fc7b3364ffed",
"topics": [
"0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
],
"data": "0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
}
],
"transfers": [
{
"sender": "0xdb4027477b2a8fe4c83c6dafe7f86678bb1b8a8d",
"recipient": "0x5034aa590125b64023a0262112b98d72e3c8e40e",
"amount": "0x47fdb3c3f456c0000"
}
],
"gasUsed": 21000,
"reverted": false,
"vmError": ""
}
]
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | [CallResult] | false | none | none |
FilterOptions
{
"offset": 0,
"limit": 10
}
*pass these parameters if you need filtered results paged. e.g.
{
"options": {
"offset": 0,
"limit": 10
}
}
the above refers that page offset is 0, and the page size is 10.
pass options null if you don't need to demand paging.
*
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| offset | integer | false | none | offset in matched record set |
| limit | integer | false | none | limit of records to output |
FilterRange
{
"unit": "block",
"from": 0,
"to": 100000
}
*defines the range to filter in. e.g.
{
"range": {
"unit": "block",
"from": 10,
"to": 1000
}
}
refers to the range from block 10 to block 1000.
null stands for the full range.
*
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| unit | string | false | none | defines the unit of from and to. block means block number, time means block timestamp, default to block. |
| from | integer(uint64) | false | none | none |
| to | integer(uint64) | false | none | none |
Enumerated Values
| Property | Value |
|---|---|
| unit | block |
| unit | time |
TopicSetLegacy
{
"topic0": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
}
*a set of topics joined with and operator. null topics are ignored. e.g.
{
"topic0": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"topic1": null
}
matches events whose topic0 equals 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef.
*
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| topic0 | string | false | none | none |
| topic1 | string | false | none | none |
| topic2 | string | false | none | none |
| topic3 | string | false | none | none |
| topic4 | string | false | none | none |
EventFilterLegacy
{
"range": {
"unit": "block",
"from": 0,
"to": 100000
},
"options": {
"offset": 0,
"limit": 10
},
"topicSets": [
{
"topic0": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
}
]
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| range | FilterRange | false | none | none |
| options | FilterOptions | false | none | none |
| topicSets | [TopicSetLegacy] | false | none | none |
AddressSetLegacy
{
"txOrigin": "0xe59d475abe695c7f67a8a2321f33a856b0b4c71d",
"sender": "0xe59d475abe695c7f67a8a2321f33a856b0b4c71d",
"recipient": "0x7567d83b7b8d80addcb281a71d54fc7b3364ffed"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| txOrigin | string | false | none | none |
| sender | string | false | none | none |
| recipient | string | false | none | none |
TransferFilterLegacy
{
"range": {
"unit": "block",
"from": 0,
"to": 100000
},
"options": {
"offset": 0,
"limit": 10
},
"addressSets": [
{
"txOrigin": "0xe59d475abe695c7f67a8a2321f33a856b0b4c71d",
"sender": "0xe59d475abe695c7f67a8a2321f33a856b0b4c71d",
"recipient": "0x7567d83b7b8d80addcb281a71d54fc7b3364ffed"
}
]
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| range | FilterRange | false | none | none |
| options | FilterOptions | false | none | none |
| addressSets | [AddressSetLegacy] | false | none | none |
EventCriteria
{
"address": "0xe59d475abe695c7f67a8a2321f33a856b0b4c71d",
"topic0": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
}
*criteria to filter out event. All fields are joined with and operator. null field are ignored. e.g.
{
"address": "0xe59d475abe695c7f67a8a2321f33a856b0b4c71d",
"topic0": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
}
matches events emitted by 0xe59d475abe695c7f67a8a2321f33a856b0b4c71d and with topic0 equals 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef.
*
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| address | string | false | none | address of event emitter |
| topic0 | string | false | none | none |
| topic1 | string | false | none | none |
| topic2 | string | false | none | none |
| topic3 | string | false | none | none |
| topic4 | string | false | none | none |
EventFilter
{
"range": {
"unit": "block",
"from": 0,
"to": 100000
},
"options": {
"offset": 0,
"limit": 10
},
"criteriaSet": [
{
"address": "0xe59d475abe695c7f67a8a2321f33a856b0b4c71d",
"topic0": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
}
],
"order": "asc"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| range | FilterRange | false | none | none |
| options | FilterOptions | false | none | none |
| criteriaSet | [EventCriteria] | false | none | none |
| order | string | false | none | order of filters, defaults to asc |
Enumerated Values
| Property | Value |
|---|---|
| order | asc |
| order | desc |
TransferCriteria
{
"txOrigin": "0xe59d475abe695c7f67a8a2321f33a856b0b4c71d",
"sender": "0xe59d475abe695c7f67a8a2321f33a856b0b4c71d",
"recipient": "0x7567d83b7b8d80addcb281a71d54fc7b3364ffed"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| txOrigin | string | false | none | none |
| sender | string | false | none | none |
| recipient | string | false | none | none |
TransferFilter
{
"range": {
"unit": "block",
"from": 0,
"to": 100000
},
"options": {
"offset": 0,
"limit": 10
},
"criteriaSet": [
{
"txOrigin": "0xe59d475abe695c7f67a8a2321f33a856b0b4c71d",
"sender": "0xe59d475abe695c7f67a8a2321f33a856b0b4c71d",
"recipient": "0x7567d83b7b8d80addcb281a71d54fc7b3364ffed"
}
],
"order": "asc"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| range | FilterRange | false | none | none |
| options | FilterOptions | false | none | none |
| criteriaSet | [TransferCriteria] | false | none | none |
| order | string | false | none | order of filters, defaults to asc |
Enumerated Values
| Property | Value |
|---|---|
| order | asc |
| order | desc |
PeerStats
{
"name": "thor/v1.0.0-6680b98-dev/linux/go1.10.3",
"bestBlockID": "0x000087b3a4d4cdf1cc52d56b9704f4c18f020e1b48dbbf4a23d1ee4f1fa5ff94",
"totalScore": 68497,
"peerID": "50e122a505ee55b84331068acfd857e37ad58f463a0fab9aaff2c1e4b2e2d22ae71dc14fdaf6eead74bd3f60594644aa35c588f9ca6be3341e2ce18ddc413321",
"netAddr": "128.1.39.120:11235",
"inbound": false,
"duration": 28
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| name | string | false | none | none |
| bestBlockID | string | false | none | none |
| totalScore | integer | false | none | none |
| peerID | string | false | none | none |
| netAddr | string | false | none | none |
| inbound | boolean | false | none | none |
| duration | integer | false | none | none |
TxOrRawTxWithMeta
{
"id": "0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8",
"chainTag": 1,
"blockRef": "0x00000001511fc0be",
"expiration": 30,
"clauses": [],
"gasPriceCoef": 128,
"gas": 21000,
"origin": "0x7567d83b7b8d80addcb281a71d54fc7b3364ffed",
"nonce": "0xd92966da424d9939",
"dependsOn": null,
"size": 180,
"meta": {
"blockID": "0x00000001c458949985a6d86b7139690b8811dd3b4647c02d4f41cdefb7d32327",
"blockNumber": 1,
"blockTimestamp": 1523156271
}
}
Properties
oneOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | TxWithMeta | false | none | none |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | RawTxWithMeta | false | none | none |
RawOrSignedOrUnsignedTx
{
"raw": "0xf86981ba800adad994000000000000000000000000000000000000746f82271080018252088001c0b8414792c9439594098323900e6470742cd877ec9f9906bca05510e421f3b013ed221324e77ca10d3466b32b1800c72e12719b213f1d4c370305399dd27af962626400"
}
Properties
oneOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | RawTx | false | none | none |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | SignedTx | false | none | none |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | TxBody | false | none | none |
IDOrSigningHash
{
"id": "0x4de71f2d588aa8a1ea00fe8312d92966da424d9939a511fc0be81e65fad52af8"
}
Properties
oneOf
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » id | string | false | none | none |
xor
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| anonymous | object | false | none | none |
| » signingHash | string | false | none | none |
Obsolete
{
"obsolete": true
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| obsolete | boolean | false | none | indicates whether the block containing this data become branch block |
TracerOption
{
"name": "",
"target": "0x000dabb4d6f0a80ad7ad7cd0e07a1f20b546db0730d869d5ccb0dd2a16e7595b/0/0"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| name | string | false | none | name of tracer. Empty name stands for default struct logger tracer. |
| target | string | false | none | the unified path of target to be traced. Currently, only clause is supported. Format: blockID/(txIndex|txId)/clauseIndex |
Enumerated Values
| Property | Value |
|---|---|
| name | 4byte |
| name | bigram |
| name | call |
| name | evmdis |
| name | noop |
| name | opcount |
| name | prestate |
| name | trigram |
| name | unigram |
StorageRangeOption
{
"address": "0xa4627036e2095eb71c2341054daa63577c062498",
"keyStart": "0x0000000000000000000000000000000000000000000000000000000000000000",
"maxResult": 10,
"target": "0x000edefb448685f9c72fc2b946980ef51d8d208bbaa4d3fdcf0c57d4847aca2e/0/0"
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| address | string | false | none | address of account |
| keyStart | string | false | none | none |
| maxResult | number | false | none | none |
| target | string | false | none | none |
StorageRange
{
"nextKey": null,
"storage": {
"0x33e423980c9b37d048bd5fadbd4a2aeb95146922045405accc2f468d0ef96988": {
"key": "0x0000000000000000000000000000000000000000000000000000000000000001",
"value": "0x00000000000000000000000000000000000000000000000000000000000000c8"
}
}
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| nextKey | string | false | none | none |
| storage | object | false | none | none |
Beat
{
"number": 325324,
"id": "0x0004f6cc88bb4626a92907718e82f255b8fa511453a78e8797eb8cea3393b215",
"parentID": "0x0004f6cb730dbd90fed09d165bfdf33cc0eed47ec068938f6ee7b7c12a4ea98d",
"timestamp": 1533267900,
"bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"k": 3
}
Properties
| Name | Type | Required | Restrictions | Description |
|---|---|---|---|---|
| number | integer(uint32) | false | none | block number (height) |
| id | string(bytes32) | false | none | block identifier |
| parentID | string(bytes32) | false | none | parent block ID |
| timestamp | integer(uint64) | false | none | block unix timestamp |
| bloom | string(hex) | false | none | the bloom filter composited with affected addresses |
| k | integer(uint32) | false | none | the number of hash functions for bloom filter |