Skip to content

Algod API

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

API endpoint for algod operations.

Base URLs:

Email: algorand Web: algorand

Authentication

  • API Key (api_key)
    • Parameter Name: X-Algo-API-Token, in: header. Generated header parameter. This token can be generated using the Goal command line tool. Example value =‘b7e384d0317b8050ce45900a94a1931e28540e1f69b2d242b424659c341b4697’

private

AbortCatchup

Code samples

Terminal window
curl -X DELETE http://localhost/v2/catchup/{catchpoint} \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
DELETE http://localhost/v2/catchup/{catchpoint} HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/catchup/{catchpoint}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.delete 'http://localhost/v2/catchup/{catchpoint}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.delete('http://localhost/v2/catchup/{catchpoint}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','http://localhost/v2/catchup/{catchpoint}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/catchup/{catchpoint}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "http://localhost/v2/catchup/{catchpoint}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

DELETE /v2/catchup/{catchpoint}

Aborts a catchpoint catchup.

Given a catchpoint, it aborts catching up to this catchpoint

Parameters

NameInTypeRequiredDescription
catchpointpathstring(catchpoint)trueA catch point

Example responses

200 Response

{
"catchup-message": "string"
}

Responses

StatusMeaningDescriptionSchema
200OKnoneInline
400Bad RequestBad RequestErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

An catchpoint abort response.

NameTypeRequiredRestrictionsDescription
» catchup-messagestringtruenoneCatchup abort response string

AddParticipationKey

Code samples

Terminal window
curl -X POST http://localhost/v2/participation \
-H 'Content-Type: application/msgpack' \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
POST http://localhost/v2/participation HTTP/1.1
Host: localhost
Content-Type: application/msgpack
Accept: application/json
const inputBody = 'string';
const headers = {
'Content-Type':'application/msgpack',
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/participation',
{
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/msgpack',
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.post 'http://localhost/v2/participation',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/msgpack',
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.post('http://localhost/v2/participation', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/msgpack',
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','http://localhost/v2/participation', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/participation");
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/msgpack"},
"Accept": []string{"application/json"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http://localhost/v2/participation", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

POST /v2/participation

Add a participation key to the node

Body parameter

Parameters

NameInTypeRequiredDescription
bodybodystring(binary)trueThe participation key to add to the node

Example responses

200 Response

{
"partId": "string"
}

Responses

StatusMeaningDescriptionSchema
200OKParticipation ID of the submissionInline
400Bad RequestBad RequestErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundParticipation Key Not FoundErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
503Service UnavailableService Temporarily UnavailableErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» partIdstringtruenoneencoding of the participation ID.

AppendKeys

Code samples

Terminal window
curl -X POST http://localhost/v2/participation/{participation-id} \
-H 'Content-Type: application/msgpack' \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
POST http://localhost/v2/participation/{participation-id} HTTP/1.1
Host: localhost
Content-Type: application/msgpack
Accept: application/json
const inputBody = 'string';
const headers = {
'Content-Type':'application/msgpack',
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/participation/{participation-id}',
{
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/msgpack',
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.post 'http://localhost/v2/participation/{participation-id}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/msgpack',
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.post('http://localhost/v2/participation/{participation-id}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/msgpack',
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','http://localhost/v2/participation/{participation-id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/participation/{participation-id}");
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/msgpack"},
"Accept": []string{"application/json"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http://localhost/v2/participation/{participation-id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

POST /v2/participation/{participation-id}

Append state proof keys to a participation key

Given a participation ID, append state proof keys to a particular set of participation keys

Body parameter

Parameters

NameInTypeRequiredDescription
participation-idpathstringtruenone
bodybodystring(binary)trueThe state proof keys to add to an existing participation ID

Example responses

200 Response

{
"address": "string",
"effective-first-valid": 0,
"effective-last-valid": 0,
"id": "string",
"key": {
"selection-participation-key": "string",
"state-proof-key": "string",
"vote-first-valid": 0,
"vote-key-dilution": 0,
"vote-last-valid": 0,
"vote-participation-key": "string"
},
"last-block-proposal": 0,
"last-state-proof": 0,
"last-vote": 0
}

Responses

StatusMeaningDescriptionSchema
200OKA detailed description of a participation IDParticipationKey
400Bad RequestBad RequestErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundParticipation Key Not FoundErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

DeleteParticipationKeyByID

Code samples

Terminal window
curl -X DELETE http://localhost/v2/participation/{participation-id} \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
DELETE http://localhost/v2/participation/{participation-id} HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/participation/{participation-id}',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.delete 'http://localhost/v2/participation/{participation-id}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.delete('http://localhost/v2/participation/{participation-id}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','http://localhost/v2/participation/{participation-id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/participation/{participation-id}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "http://localhost/v2/participation/{participation-id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

DELETE /v2/participation/{participation-id}

Delete a given participation key by ID

Delete a given participation key by ID

Parameters

NameInTypeRequiredDescription
participation-idpathstringtruenone

Example responses

400 Response

{
"data": {},
"message": "string"
}

Responses

StatusMeaningDescriptionSchema
200OKParticipation key got deleted by IDNone
400Bad RequestBad RequestErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundParticipation Key Not FoundErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

GenerateParticipationKeys

Code samples

Terminal window
curl -X POST http://localhost/v2/participation/generate/{address}?first=0&last=0 \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
POST http://localhost/v2/participation/generate/{address}?first=0&last=0 HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/participation/generate/{address}?first=0&last=0',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.post 'http://localhost/v2/participation/generate/{address}',
params: {
'first' => 'integer',
'last' => 'integer'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.post('http://localhost/v2/participation/generate/{address}', params={
'first': '0', 'last': '0'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','http://localhost/v2/participation/generate/{address}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/participation/generate/{address}?first=0&last=0");
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{
"Accept": []string{"application/json"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http://localhost/v2/participation/generate/{address}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

POST /v2/participation/generate/{address}

Generate and install participation keys to the node.

Parameters

NameInTypeRequiredDescription
addresspathstringtrueAn account public key
dilutionqueryintegerfalseKey dilution for two-level participation keys (defaults to sqrt of validity window).
firstqueryintegertrueFirst round for participation key.
lastqueryintegertrueLast round for participation key.

Example responses

200 Response

"string"

Responses

StatusMeaningDescriptionSchema
200OKAn empty JSON object is returned if the generation process was started. Currently no status is available.string
400Bad RequestBad RequestErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
503Service UnavailableService Temporarily UnavailableErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

GetConfig

Code samples

Terminal window
curl -X GET http://localhost/debug/settings/config \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/debug/settings/config HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/debug/settings/config',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/debug/settings/config',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/debug/settings/config', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/debug/settings/config', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/debug/settings/config");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/debug/settings/config", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /debug/settings/config

Gets the merged config file.

Returns the merged (defaults + overrides) config file in json.

Example responses

200 Response

"string"

Responses

StatusMeaningDescriptionSchema
200OKThe merged config file in json.string
defaultDefaultUnknown ErrorNone

Response Schema

GetDebugSettingsProf

Code samples

Terminal window
curl -X GET http://localhost/debug/settings/pprof \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/debug/settings/pprof HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/debug/settings/pprof',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/debug/settings/pprof',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/debug/settings/pprof', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/debug/settings/pprof', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/debug/settings/pprof");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/debug/settings/pprof", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /debug/settings/pprof

Retrieves the current settings for blocking and mutex profiles

Example responses

200 Response

{
"block-rate": 1000,
"mutex-rate": 1000
}

Responses

StatusMeaningDescriptionSchema
200OKDebugPprof is the response to the /debug/extra/pprof endpointDebugSettingsProf

GetParticipationKeyByID

Code samples

Terminal window
curl -X GET http://localhost/v2/participation/{participation-id} \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/participation/{participation-id} HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/participation/{participation-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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/participation/{participation-id}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/participation/{participation-id}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/participation/{participation-id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/participation/{participation-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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/participation/{participation-id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/participation/{participation-id}

Get participation key info given a participation ID

Given a participation ID, return information about that participation key

Parameters

NameInTypeRequiredDescription
participation-idpathstringtruenone

Example responses

200 Response

{
"address": "string",
"effective-first-valid": 0,
"effective-last-valid": 0,
"id": "string",
"key": {
"selection-participation-key": "string",
"state-proof-key": "string",
"vote-first-valid": 0,
"vote-key-dilution": 0,
"vote-last-valid": 0,
"vote-participation-key": "string"
},
"last-block-proposal": 0,
"last-state-proof": 0,
"last-vote": 0
}

Responses

StatusMeaningDescriptionSchema
200OKA detailed description of a participation IDParticipationKey
400Bad RequestBad RequestErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundParticipation Key Not FoundErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

GetParticipationKeys

Code samples

Terminal window
curl -X GET http://localhost/v2/participation \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/participation HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/participation',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/participation',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/participation', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/participation', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/participation");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/participation", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/participation

Return a list of participation keys

Return a list of participation keys

Example responses

200 Response

[
{
"address": "string",
"effective-first-valid": 0,
"effective-last-valid": 0,
"id": "string",
"key": {
"selection-participation-key": "string",
"state-proof-key": "string",
"vote-first-valid": 0,
"vote-key-dilution": 0,
"vote-last-valid": 0,
"vote-participation-key": "string"
},
"last-block-proposal": 0,
"last-state-proof": 0,
"last-vote": 0
}
]

Responses

StatusMeaningDescriptionSchema
200OKA list of participation keysInline
400Bad RequestBad RequestErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundParticipation Key Not FoundErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
anonymous[ParticipationKey]falsenone[Represents a participation key used by the node.]
» addressstringtruenoneAddress the key was generated for.
» effective-first-validintegerfalsenoneWhen registered, this is the first round it may be used.
» effective-last-validintegerfalsenoneWhen registered, this is the last round it may be used.
» idstringtruenoneThe key’s ParticipationID.
» keyAccountParticipationtruenoneAccountParticipation describes the parameters used by this account in consensus protocol.
»» selection-participation-keystring(byte)truenone[sel] Selection public key (if any) currently registered for this round.
»» state-proof-keystring(byte)falsenone[stprf] Root of the state proof key (if any)
»» vote-first-validintegertruenone[voteFst] First round for which this participation is valid.
»» vote-key-dilutionintegertruenone[voteKD] Number of subkeys in each batch of participation keys.
»» vote-last-validintegertruenone[voteLst] Last round for which this participation is valid.
»» vote-participation-keystring(byte)truenone[vote] root participation public key (if any) currently registered for this round.
» last-block-proposalintegerfalsenoneRound when this key was last used to propose a block.
» last-state-proofintegerfalsenoneRound when this key was last used to generate a state proof.
» last-voteintegerfalsenoneRound when this key was last used to vote.

PutDebugSettingsProf

Code samples

Terminal window
curl -X PUT http://localhost/debug/settings/pprof \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
PUT http://localhost/debug/settings/pprof HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/debug/settings/pprof',
{
method: 'PUT',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.put 'http://localhost/debug/settings/pprof',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.put('http://localhost/debug/settings/pprof', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('PUT','http://localhost/debug/settings/pprof', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/debug/settings/pprof");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("PUT");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("PUT", "http://localhost/debug/settings/pprof", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

PUT /debug/settings/pprof

Enables blocking and mutex profiles, and returns the old settings

Example responses

200 Response

{
"block-rate": 1000,
"mutex-rate": 1000
}

Responses

StatusMeaningDescriptionSchema
200OKDebugPprof is the response to the /debug/extra/pprof endpointDebugSettingsProf

ShutdownNode

Code samples

Terminal window
curl -X POST http://localhost/v2/shutdown \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
POST http://localhost/v2/shutdown HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/shutdown',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.post 'http://localhost/v2/shutdown',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.post('http://localhost/v2/shutdown', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','http://localhost/v2/shutdown', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/shutdown");
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{
"Accept": []string{"application/json"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http://localhost/v2/shutdown", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

POST /v2/shutdown

Special management endpoint to shutdown the node. Optionally provide a timeout parameter to indicate that the node should begin shutting down after a number of seconds.

Parameters

NameInTypeRequiredDescription
timeoutqueryintegerfalsenone

Example responses

200 Response

{}

Responses

StatusMeaningDescriptionSchema
200OKnoneInline

Response Schema

StartCatchup

Code samples

Terminal window
curl -X POST http://localhost/v2/catchup/{catchpoint} \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
POST http://localhost/v2/catchup/{catchpoint} HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/catchup/{catchpoint}',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.post 'http://localhost/v2/catchup/{catchpoint}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.post('http://localhost/v2/catchup/{catchpoint}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','http://localhost/v2/catchup/{catchpoint}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/catchup/{catchpoint}");
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{
"Accept": []string{"application/json"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http://localhost/v2/catchup/{catchpoint}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

POST /v2/catchup/{catchpoint}

Starts a catchpoint catchup.

Given a catchpoint, it starts catching up to this catchpoint

Parameters

NameInTypeRequiredDescription
catchpointpathstring(catchpoint)trueA catch point
minqueryintegerfalseSpecify the minimum number of blocks which the ledger must be advanced by in order to start the catchup. This is useful for simplifying tools which support fast catchup, they can run the catchup unconditionally and the node will skip the catchup if it is not needed.

Example responses

200 Response

{
"catchup-message": "string"
}

Responses

StatusMeaningDescriptionSchema
200OKnoneInline
201CreatednoneInline
400Bad RequestBad RequestErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
408Request TimeoutRequest TimeoutErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

An catchpoint start response.

NameTypeRequiredRestrictionsDescription
» catchup-messagestringtruenoneCatchup start response string

Status Code 201

An catchpoint start response.

NameTypeRequiredRestrictionsDescription
» catchup-messagestringtruenoneCatchup start response string

public

AccountApplicationInformation

Code samples

Terminal window
curl -X GET http://localhost/v2/accounts/{address}/applications/{application-id} \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/accounts/{address}/applications/{application-id} HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/accounts/{address}/applications/{application-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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/accounts/{address}/applications/{application-id}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/accounts/{address}/applications/{application-id}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/accounts/{address}/applications/{application-id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/accounts/{address}/applications/{application-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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/accounts/{address}/applications/{application-id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/accounts/{address}/applications/{application-id}

Get account information about a given app.

Given a specific account public key and application ID, this call returns the account’s application local state and global state (AppLocalState and AppParams, if either exists). Global state will only be returned if the provided address is the application’s creator.

Parameters

NameInTypeRequiredDescription
formatquerystringfalseConfigures whether the response object is JSON or MessagePack encoded. If not provided, defaults to JSON.
addresspathstringtrueAn account public key
application-idpathintegertrueAn application identifier

Enumerated Values

ParameterValue
formatjson
formatmsgpack

Example responses

200 Response

{
"app-local-state": {
"id": 0,
"key-value": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
],
"schema": {
"num-byte-slice": 0,
"num-uint": 0
}
},
"created-app": {
"approval-program": "string",
"clear-state-program": "string",
"creator": "string",
"extra-program-pages": 0,
"global-state": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
],
"global-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
},
"local-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
}
},
"round": 0
}

Responses

StatusMeaningDescriptionSchema
200OKAccountApplicationResponse describes the account’s application local state and global state (AppLocalState and AppParams, if either exists) for a specific application ID. Global state will only be returned if the provided address is the application’s creator.Inline
400Bad RequestMalformed address or application IDErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» app-local-stateApplicationLocalStatefalsenoneStores local state associated with an application.
»» idintegertruenoneThe application which this local state is for.
»» key-value[TealKeyValue]falsenoneRepresents a key-value store for use in an application.
»»» keystringtruenonenone
»»» valueTealValuetruenoneRepresents a TEAL value.
»»»» bytesstringtruenone[tb] bytes value.
»»»» typeintegertruenone[tt] value type. Value 1 refers to bytes, value 2 refers to uint
»»»» uintintegertruenone[ui] uint value.
»» schemaApplicationStateSchematruenoneSpecifies maximums on the number of each type that may be stored.
»»» num-byte-sliceintegertruenone[nbs] num of byte slices.
»»» num-uintintegertruenone[nui] num of uints.
» created-appApplicationParamsfalsenoneStores the global information associated with an application.
»» approval-programstring(byte)truenone[approv] approval program.
»» clear-state-programstring(byte)truenone[clearp] approval program.
»» creatorstringtruenoneThe address that created this application. This is the address where the parameters and global state for this application can be found.
»» extra-program-pagesintegerfalsenone[epp] the amount of extra program pages available to this app.
»» global-state[TealKeyValue]falsenoneRepresents a key-value store for use in an application.
»» global-state-schemaApplicationStateSchemafalsenoneSpecifies maximums on the number of each type that may be stored.
»» local-state-schemaApplicationStateSchemafalsenoneSpecifies maximums on the number of each type that may be stored.
» roundintegertruenoneThe round for which this information is relevant.

AccountAssetInformation

Code samples

Terminal window
curl -X GET http://localhost/v2/accounts/{address}/assets/{asset-id} \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/accounts/{address}/assets/{asset-id} HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/accounts/{address}/assets/{asset-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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/accounts/{address}/assets/{asset-id}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/accounts/{address}/assets/{asset-id}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/accounts/{address}/assets/{asset-id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/accounts/{address}/assets/{asset-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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/accounts/{address}/assets/{asset-id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/accounts/{address}/assets/{asset-id}

Get account information about a given asset.

Given a specific account public key and asset ID, this call returns the account’s asset holding and asset parameters (if either exist). Asset parameters will only be returned if the provided address is the asset’s creator.

Parameters

NameInTypeRequiredDescription
formatquerystringfalseConfigures whether the response object is JSON or MessagePack encoded. If not provided, defaults to JSON.
addresspathstringtrueAn account public key
asset-idpathintegertrueAn asset identifier

Enumerated Values

ParameterValue
formatjson
formatmsgpack

Example responses

200 Response

{
"asset-holding": {
"amount": 0,
"asset-id": 0,
"is-frozen": true
},
"created-asset": {
"clawback": "string",
"creator": "string",
"decimals": 19,
"default-frozen": true,
"freeze": "string",
"manager": "string",
"metadata-hash": "string",
"name": "string",
"name-b64": "string",
"reserve": "string",
"total": 0,
"unit-name": "string",
"unit-name-b64": "string",
"url": "string",
"url-b64": "string"
},
"round": 0
}

Responses

StatusMeaningDescriptionSchema
200OKAccountAssetResponse describes the account’s asset holding and asset parameters (if either exist) for a specific asset ID. Asset parameters will only be returned if the provided address is the asset’s creator.Inline
400Bad RequestMalformed address or asset IDErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» asset-holdingAssetHoldingfalsenoneDescribes an asset held by an account.

Definition:
data/basics/userBalance.go : AssetHolding
»» amountintegertruenone[a] number of units held.
»» asset-idintegertruenoneAsset ID of the holding.
»» is-frozenbooleantruenone[f] whether or not the holding is frozen.
» created-assetAssetParamsfalsenoneAssetParams specifies the parameters for an asset.

[apar] when part of an AssetConfig transaction.

Definition:
data/transactions/asset.go : AssetParams
»» clawbackstringfalsenone[c] Address of account used to clawback holdings of this asset. If empty, clawback is not permitted.
»» creatorstringtruenoneThe address that created this asset. This is the address where the parameters for this asset can be found, and also the address where unwanted asset units can be sent in the worst case.
»» decimalsintegertruenone[dc] The number of digits to use after the decimal point when displaying this asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in tenths. If 2, the base unit of the asset is in hundredths, and so on. This value must be between 0 and 19 (inclusive).
»» default-frozenbooleanfalsenone[df] Whether holdings of this asset are frozen by default.
»» freezestringfalsenone[f] Address of account used to freeze holdings of this asset. If empty, freezing is not permitted.
»» managerstringfalsenone[m] Address of account used to manage the keys of this asset and to destroy it.
»» metadata-hashstring(byte)falsenone[am] A commitment to some unspecified asset metadata. The format of this metadata is up to the application.
»» namestringfalsenone[an] Name of this asset, as supplied by the creator. Included only when the asset name is composed of printable utf-8 characters.
»» name-b64string(byte)falsenoneBase64 encoded name of this asset, as supplied by the creator.
»» reservestringfalsenone[r] Address of account holding reserve (non-minted) units of this asset.
»» totalintegertruenone[t] The total number of units of this asset.
»» unit-namestringfalsenone[un] Name of a unit of this asset, as supplied by the creator. Included only when the name of a unit of this asset is composed of printable utf-8 characters.
»» unit-name-b64string(byte)falsenoneBase64 encoded name of a unit of this asset, as supplied by the creator.
»» urlstringfalsenone[au] URL where more information about the asset can be retrieved. Included only when the URL is composed of printable utf-8 characters.
»» url-b64string(byte)falsenoneBase64 encoded URL where more information about the asset can be retrieved.
» roundintegertruenoneThe round for which this information is relevant.

AccountAssetsInformation

Code samples

Terminal window
curl -X GET http://localhost/v2/accounts/{address}/assets \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/accounts/{address}/assets HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/accounts/{address}/assets',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/accounts/{address}/assets',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/accounts/{address}/assets', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/accounts/{address}/assets', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/accounts/{address}/assets");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/accounts/{address}/assets", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/accounts/{address}/assets

Get a list of assets held by an account, inclusive of asset params.

Lookup an account’s asset holdings.

Parameters

NameInTypeRequiredDescription
addresspathstringtrueAn account public key
limitqueryintegerfalseMaximum number of results to return.
nextquerystringfalseThe next page of results. Use the next token provided by the previous results.

Example responses

200 Response

{
"asset-holdings": [
{
"asset-holding": {
"amount": 0,
"asset-id": 0,
"is-frozen": true
},
"asset-params": {
"clawback": "string",
"creator": "string",
"decimals": 19,
"default-frozen": true,
"freeze": "string",
"manager": "string",
"metadata-hash": "string",
"name": "string",
"name-b64": "string",
"reserve": "string",
"total": 0,
"unit-name": "string",
"unit-name-b64": "string",
"url": "string",
"url-b64": "string"
}
}
],
"next-token": "string",
"round": 0
}

Responses

StatusMeaningDescriptionSchema
200OKAccountAssetsInformationResponse contains a list of assets held by an account.Inline
400Bad RequestMalformed addressErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» asset-holdings[AccountAssetHolding]falsenone[AccountAssetHolding describes the account’s asset holding and asset parameters (if either exist) for a specific asset ID.]
»» asset-holdingAssetHoldingtruenoneDescribes an asset held by an account.

Definition:
data/basics/userBalance.go : AssetHolding
»»» amountintegertruenone[a] number of units held.
»»» asset-idintegertruenoneAsset ID of the holding.
»»» is-frozenbooleantruenone[f] whether or not the holding is frozen.
»» asset-paramsAssetParamsfalsenoneAssetParams specifies the parameters for an asset.

[apar] when part of an AssetConfig transaction.

Definition:
data/transactions/asset.go : AssetParams
»»» clawbackstringfalsenone[c] Address of account used to clawback holdings of this asset. If empty, clawback is not permitted.
»»» creatorstringtruenoneThe address that created this asset. This is the address where the parameters for this asset can be found, and also the address where unwanted asset units can be sent in the worst case.
»»» decimalsintegertruenone[dc] The number of digits to use after the decimal point when displaying this asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in tenths. If 2, the base unit of the asset is in hundredths, and so on. This value must be between 0 and 19 (inclusive).
»»» default-frozenbooleanfalsenone[df] Whether holdings of this asset are frozen by default.
»»» freezestringfalsenone[f] Address of account used to freeze holdings of this asset. If empty, freezing is not permitted.
»»» managerstringfalsenone[m] Address of account used to manage the keys of this asset and to destroy it.
»»» metadata-hashstring(byte)falsenone[am] A commitment to some unspecified asset metadata. The format of this metadata is up to the application.
»»» namestringfalsenone[an] Name of this asset, as supplied by the creator. Included only when the asset name is composed of printable utf-8 characters.
»»» name-b64string(byte)falsenoneBase64 encoded name of this asset, as supplied by the creator.
»»» reservestringfalsenone[r] Address of account holding reserve (non-minted) units of this asset.
»»» totalintegertruenone[t] The total number of units of this asset.
»»» unit-namestringfalsenone[un] Name of a unit of this asset, as supplied by the creator. Included only when the name of a unit of this asset is composed of printable utf-8 characters.
»»» unit-name-b64string(byte)falsenoneBase64 encoded name of a unit of this asset, as supplied by the creator.
»»» urlstringfalsenone[au] URL where more information about the asset can be retrieved. Included only when the URL is composed of printable utf-8 characters.
»»» url-b64string(byte)falsenoneBase64 encoded URL where more information about the asset can be retrieved.
» next-tokenstringfalsenoneUsed for pagination, when making another request provide this token with the next parameter.
» roundintegertruenoneThe round for which this information is relevant.

AccountInformation

Code samples

Terminal window
curl -X GET http://localhost/v2/accounts/{address} \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/accounts/{address} HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/accounts/{address}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/accounts/{address}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/accounts/{address}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/accounts/{address}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/accounts/{address}

Get account information.

Given a specific account public key, this call returns the account’s status, balance and spendable amounts

Parameters

NameInTypeRequiredDescription
formatquerystringfalseConfigures whether the response object is JSON or MessagePack encoded. If not provided, defaults to JSON.
addresspathstringtrueAn account public key
excludequerystringfalseWhen set to all will exclude asset holdings, application local state, created asset parameters, any created application parameters. Defaults to none.

Enumerated Values

ParameterValue
formatjson
formatmsgpack
excludeall
excludenone

Example responses

200 Response

{
"address": "string",
"amount": 0,
"amount-without-pending-rewards": 0,
"apps-local-state": [
{
"id": 0,
"key-value": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
],
"schema": {
"num-byte-slice": 0,
"num-uint": 0
}
}
],
"apps-total-extra-pages": 0,
"apps-total-schema": {
"num-byte-slice": 0,
"num-uint": 0
},
"assets": [
{
"amount": 0,
"asset-id": 0,
"is-frozen": true
}
],
"auth-addr": "string",
"created-apps": [
{
"id": 0,
"params": {
"approval-program": "string",
"clear-state-program": "string",
"creator": "string",
"extra-program-pages": 0,
"global-state": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
],
"global-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
},
"local-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
}
}
}
],
"created-assets": [
{
"index": 0,
"params": {
"clawback": "string",
"creator": "string",
"decimals": 19,
"default-frozen": true,
"freeze": "string",
"manager": "string",
"metadata-hash": "string",
"name": "string",
"name-b64": "string",
"reserve": "string",
"total": 0,
"unit-name": "string",
"unit-name-b64": "string",
"url": "string",
"url-b64": "string"
}
}
],
"incentive-eligible": true,
"last-heartbeat": 0,
"last-proposed": 0,
"min-balance": 0,
"participation": {
"selection-participation-key": "string",
"state-proof-key": "string",
"vote-first-valid": 0,
"vote-key-dilution": 0,
"vote-last-valid": 0,
"vote-participation-key": "string"
},
"pending-rewards": 0,
"reward-base": 0,
"rewards": 0,
"round": 0,
"sig-type": "sig",
"status": "string",
"total-apps-opted-in": 0,
"total-assets-opted-in": 0,
"total-box-bytes": 0,
"total-boxes": 0,
"total-created-apps": 0,
"total-created-assets": 0
}

Responses

StatusMeaningDescriptionSchema
200OKAccountResponse wraps the Account type in a response.Account
400Bad RequestBad requestErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

ExperimentalCheck

Code samples

Terminal window
curl -X GET http://localhost/v2/experimental \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/experimental HTTP/1.1
Host: localhost
const headers = {
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/experimental',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/experimental',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/experimental', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/experimental', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/experimental");
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{
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/experimental", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/experimental

Returns OK if experimental API is enabled.

Example responses

Responses

StatusMeaningDescriptionSchema
200OKExperimental API enabledNone
404Not FoundExperimental API not enabledNone
defaultDefaultUnknown ErrorNone

Response Schema

GetApplicationBoxByName

Code samples

Terminal window
curl -X GET http://localhost/v2/applications/{application-id}/box?name=string \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/applications/{application-id}/box?name=string HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/applications/{application-id}/box?name=string',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/applications/{application-id}/box',
params: {
'name' => 'string'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/applications/{application-id}/box', params={
'name': 'string'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/applications/{application-id}/box', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/applications/{application-id}/box?name=string");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/applications/{application-id}/box", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/applications/{application-id}/box

Get box information for a given application.

Given an application ID and box name, it returns the round, box name, and value (each base64 encoded). Box names must be in the goal app call arg encoding form ‘encoding:value’. For ints, use the form ‘int:1234’. For raw bytes, use the form ‘b64:A==’. For printable strings, use the form ‘str:hello’. For addresses, use the form ‘addr:XYZ…’.

Parameters

NameInTypeRequiredDescription
application-idpathintegertrueAn application identifier
namequerystringtrueA box name, in the goal app call arg form ‘encoding:value’. For ints, use the form ‘int:1234’. For raw bytes, use the form ‘b64:A==’. For printable strings, use the form ‘str:hello’. For addresses, use the form ‘addr:XYZ…’.

Example responses

200 Response

{
"name": "string",
"round": 0,
"value": "string"
}

Responses

StatusMeaningDescriptionSchema
200OKBox informationBox
400Bad RequestBad RequestErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundBox Not FoundErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

GetApplicationBoxes

Code samples

Terminal window
curl -X GET http://localhost/v2/applications/{application-id}/boxes \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/applications/{application-id}/boxes HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/applications/{application-id}/boxes',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/applications/{application-id}/boxes',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/applications/{application-id}/boxes', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/applications/{application-id}/boxes', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/applications/{application-id}/boxes");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/applications/{application-id}/boxes", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/applications/{application-id}/boxes

Get boxes for a given application.

Given an application ID, return boxes in lexographical order by name. If the results must be truncated, a next-token is supplied to continue the request.

Parameters

NameInTypeRequiredDescription
application-idpathintegertrueAn application identifier
maxqueryintegerfalseMaximum number of boxes to return. Server may impose a lower limit.
prefixquerystringfalseA box name prefix, in the goal app call arg form ‘encoding:value’. For ints, use the form ‘int:1234’. For raw bytes, use the form ‘b64:A==’. For printable strings, use the form ‘str:hello’. For addresses, use the form ‘addr:XYZ…‘.
nextquerystringfalseA box name, in the goal app call arg form ‘encoding:value’. When provided, the returned boxes begin (lexographically) with the supplied name. Callers may implement pagination by reinvoking the endpoint with the token from a previous call’s next-token.
valuesquerybooleanfalseIf true, box values will be returned.

Example responses

200 Response

{
"boxes": [
{
"name": "string",
"round": 0,
"value": "string"
}
],
"next-token": "string",
"round": 0
}

Responses

StatusMeaningDescriptionSchema
200OKBoxes of an applicationInline
400Bad RequestBad RequestErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» boxes[Box]truenone[Box name and its content.]
»» namestring(byte)truenoneThe box name, base64 encoded
»» roundintegerfalsenoneThe round for which this information is relevant
»» valuestring(byte)truenoneThe box value, base64 encoded.
» next-tokenstringfalsenoneUsed for pagination, when making another request provide this token with the next parameter.
» roundintegertruenoneThe round for which this information is relevant.

GetApplicationByID

Code samples

Terminal window
curl -X GET http://localhost/v2/applications/{application-id} \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/applications/{application-id} HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/applications/{application-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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/applications/{application-id}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/applications/{application-id}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/applications/{application-id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/applications/{application-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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/applications/{application-id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/applications/{application-id}

Get application information.

Given a application ID, it returns application information including creator, approval and clear programs, global and local schemas, and global state.

Parameters

NameInTypeRequiredDescription
application-idpathintegertrueAn application identifier

Example responses

200 Response

{
"id": 0,
"params": {
"approval-program": "string",
"clear-state-program": "string",
"creator": "string",
"extra-program-pages": 0,
"global-state": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
],
"global-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
},
"local-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
}
}
}

Responses

StatusMeaningDescriptionSchema
200OKApplication informationApplication
400Bad RequestBad RequestErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundApplication Not FoundErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

GetAssetByID

Code samples

Terminal window
curl -X GET http://localhost/v2/assets/{asset-id} \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/assets/{asset-id} HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/assets/{asset-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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/assets/{asset-id}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/assets/{asset-id}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/assets/{asset-id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/assets/{asset-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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/assets/{asset-id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/assets/{asset-id}

Get asset information.

Given a asset ID, it returns asset information including creator, name, total supply and special addresses.

Parameters

NameInTypeRequiredDescription
asset-idpathintegertrueAn asset identifier

Example responses

200 Response

{
"index": 0,
"params": {
"clawback": "string",
"creator": "string",
"decimals": 19,
"default-frozen": true,
"freeze": "string",
"manager": "string",
"metadata-hash": "string",
"name": "string",
"name-b64": "string",
"reserve": "string",
"total": 0,
"unit-name": "string",
"unit-name-b64": "string",
"url": "string",
"url-b64": "string"
}
}

Responses

StatusMeaningDescriptionSchema
200OKAsset informationAsset
400Bad RequestBad RequestErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundApplication Not FoundErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

GetBlock

Code samples

Terminal window
curl -X GET http://localhost/v2/blocks/{round} \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/blocks/{round} HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/blocks/{round}',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/blocks/{round}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/blocks/{round}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/blocks/{round}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/blocks/{round}");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/blocks/{round}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/blocks/{round}

Get the block for the given round.

Parameters

NameInTypeRequiredDescription
formatquerystringfalseConfigures whether the response object is JSON or MessagePack encoded. If not provided, defaults to JSON.
roundpathintegertrueThe round from which to fetch block information.
header-onlyquerybooleanfalseIf true, only the block header (exclusive of payset or certificate) may be included in response.

Enumerated Values

ParameterValue
formatjson
formatmsgpack

Example responses

200 Response

{
"block": {},
"cert": {}
}

Responses

StatusMeaningDescriptionSchema
200OKEncoded block object.Inline
400Bad RequestBad Request - Non integer numberErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundNone existing blockErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» blockobjecttruenoneBlock header data.
» certobjectfalsenoneOptional certificate object. This is only included when the format is set to message pack.

GetBlockHash

Code samples

Terminal window
curl -X GET http://localhost/v2/blocks/{round}/hash \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/blocks/{round}/hash HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/blocks/{round}/hash',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/blocks/{round}/hash',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/blocks/{round}/hash', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/blocks/{round}/hash', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/blocks/{round}/hash");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/blocks/{round}/hash", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/blocks/{round}/hash

Get the block hash for the block on the given round.

Parameters

NameInTypeRequiredDescription
roundpathintegertrueThe round from which to fetch block hash information.

Example responses

200 Response

{
"blockHash": "string"
}

Responses

StatusMeaningDescriptionSchema
200OKHash of a block header.Inline
400Bad RequestBad Request - Non integer numberErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundNone existing blockErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» blockHashstringtruenoneBlock header hash.

GetBlockLogs

Code samples

Terminal window
curl -X GET http://localhost/v2/blocks/{round}/logs \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/blocks/{round}/logs HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/blocks/{round}/logs',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/blocks/{round}/logs',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/blocks/{round}/logs', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/blocks/{round}/logs', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/blocks/{round}/logs");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/blocks/{round}/logs", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/blocks/{round}/logs

Get all of the logs from outer and inner app calls in the given round

Get all of the logs from outer and inner app calls in the given round

Parameters

NameInTypeRequiredDescription
roundpathintegertrueThe round from which to fetch block log information.

Example responses

200 Response

{
"logs": [
{
"application-index": 0,
"logs": [
"string"
],
"txId": "string"
}
]
}

Responses

StatusMeaningDescriptionSchema
200OKAll logs emitted in the given round. Each app call, whether top-level or inner, that contains logs results in a separate AppCallLogs object. Therefore there may be multiple AppCallLogs with the same application ID and outer transaction ID in the event of multiple inner app calls to the same app. App calls with no logs are not included in the response. AppCallLogs are returned in the same order that their corresponding app call appeared in the block (pre-order traversal of inner app calls)Inline
400Bad RequestBad Request - Non integer numberErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundNonexistent blockErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» logs[AppCallLogs]truenone[The logged messages from an app call along with the app ID and outer transaction ID. Logs appear in the same order that they were emitted.]
»» application-indexintegertruenoneThe application from which the logs were generated
»» logs[string]truenoneAn array of logs
»» txIdstringtruenoneThe transaction ID of the outer app call that lead to these logs

GetBlockTimeStampOffset

Code samples

Terminal window
curl -X GET http://localhost/v2/devmode/blocks/offset \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/devmode/blocks/offset HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/devmode/blocks/offset',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/devmode/blocks/offset',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/devmode/blocks/offset', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/devmode/blocks/offset', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/devmode/blocks/offset");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/devmode/blocks/offset", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/devmode/blocks/offset

Returns the timestamp offset. Timestamp offsets can only be set in dev mode.

Gets the current timestamp offset.

Example responses

200 Response

{
"offset": 0
}

Responses

StatusMeaningDescriptionSchema
200OKResponse containing the timestamp offset in secondsInline
400Bad RequestTimeStamp offset not set.ErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» offsetintegertruenoneTimestamp offset in seconds.

GetBlockTxids

Code samples

Terminal window
curl -X GET http://localhost/v2/blocks/{round}/txids \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/blocks/{round}/txids HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/blocks/{round}/txids',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/blocks/{round}/txids',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/blocks/{round}/txids', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/blocks/{round}/txids', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/blocks/{round}/txids");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/blocks/{round}/txids", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/blocks/{round}/txids

Get the top level transaction IDs for the block on the given round.

Parameters

NameInTypeRequiredDescription
roundpathintegertrueThe round from which to fetch block transaction IDs.

Example responses

200 Response

{
"blockTxids": [
"string"
]
}

Responses

StatusMeaningDescriptionSchema
200OKTop level transaction IDs in a block.Inline
400Bad RequestBad Request - Non integer numberErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundNon existing blockErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» blockTxids[string]truenoneBlock transaction IDs.

GetGenesis

Code samples

Terminal window
curl -X GET http://localhost/genesis \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/genesis HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/genesis',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/genesis',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/genesis', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/genesis', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/genesis");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/genesis", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /genesis

Gets the genesis information.

Returns the entire genesis file in json.

Example responses

200 Response

"string"

Responses

StatusMeaningDescriptionSchema
200OKThe genesis file in json.string
defaultDefaultUnknown ErrorNone

Response Schema

GetLedgerStateDelta

Code samples

Terminal window
curl -X GET http://localhost/v2/deltas/{round} \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/deltas/{round} HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/deltas/{round}',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/deltas/{round}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/deltas/{round}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/deltas/{round}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/deltas/{round}");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/deltas/{round}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/deltas/{round}

Get a LedgerStateDelta object for a given round

Get ledger deltas for a round.

Parameters

NameInTypeRequiredDescription
roundpathintegertrueThe round for which the deltas are desired.
formatquerystringfalseConfigures whether the response object is JSON or MessagePack encoded. If not provided, defaults to JSON.

Enumerated Values

ParameterValue
formatjson
formatmsgpack

Example responses

200 Response

{}

Responses

StatusMeaningDescriptionSchema
200OKContains ledger deltasLedgerStateDelta
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundCould not find a delta for roundErrorResponse
408Request Timeouttimed out on requestErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
503Service UnavailableService Temporarily UnavailableErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

GetLedgerStateDeltaForTransactionGroup

Code samples

Terminal window
curl -X GET http://localhost/v2/deltas/txn/group/{id} \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/deltas/txn/group/{id} HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/deltas/txn/group/{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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/deltas/txn/group/{id}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/deltas/txn/group/{id}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/deltas/txn/group/{id}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/deltas/txn/group/{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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/deltas/txn/group/{id}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/deltas/txn/group/{id}

Get a LedgerStateDelta object for a given transaction group

Get a ledger delta for a given transaction group.

Parameters

NameInTypeRequiredDescription
idpathstringtrueA transaction ID, or transaction group ID
formatquerystringfalseConfigures whether the response object is JSON or MessagePack encoded. If not provided, defaults to JSON.

Enumerated Values

ParameterValue
formatjson
formatmsgpack

Example responses

200 Response

{}

Responses

StatusMeaningDescriptionSchema
200OKResponse containing a ledger state delta for a single transaction group.LedgerStateDelta
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundCould not find a delta for transaction ID or group IDErrorResponse
408Request Timeouttimed out on requestErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
501Not ImplementedNot ImplementedErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

GetLightBlockHeaderProof

Code samples

Terminal window
curl -X GET http://localhost/v2/blocks/{round}/lightheader/proof \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/blocks/{round}/lightheader/proof HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/blocks/{round}/lightheader/proof',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/blocks/{round}/lightheader/proof',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/blocks/{round}/lightheader/proof', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/blocks/{round}/lightheader/proof', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/blocks/{round}/lightheader/proof");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/blocks/{round}/lightheader/proof", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/blocks/{round}/lightheader/proof

Gets a proof for a given light block header inside a state proof commitment

Parameters

NameInTypeRequiredDescription
roundpathintegertrueThe round to which the light block header belongs.

Example responses

200 Response

{
"index": 0,
"proof": "string",
"treedepth": 0
}

Responses

StatusMeaningDescriptionSchema
200OKProof of a light block header.LightBlockHeaderProof
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundCould not create proof since some data is missingErrorResponse
408Request Timeouttimed out on requestErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
503Service UnavailableService Temporarily UnavailableErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

GetPendingTransactions

Code samples

Terminal window
curl -X GET http://localhost/v2/transactions/pending \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/transactions/pending HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/transactions/pending',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/transactions/pending',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/transactions/pending', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/transactions/pending', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/transactions/pending");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/transactions/pending", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/transactions/pending

Get a list of unconfirmed transactions currently in the transaction pool.

Get the list of pending transactions, sorted by priority, in decreasing order, truncated at the end at MAX. If MAX = 0, returns all pending transactions.

Parameters

NameInTypeRequiredDescription
maxqueryintegerfalseTruncated number of transactions to display. If max=0, returns all pending txns.
formatquerystringfalseConfigures whether the response object is JSON or MessagePack encoded. If not provided, defaults to JSON.

Enumerated Values

ParameterValue
formatjson
formatmsgpack

Example responses

200 Response

{
"top-transactions": [
{}
],
"total-transactions": 0
}

Responses

StatusMeaningDescriptionSchema
200OKA potentially truncated list of transactions currently in the node’s transaction pool. You can compute whether or not the list is truncated if the number of elements in the top-transactions array is fewer than total-transactions.Inline
401UnauthorizedInvalid API TokenErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
503Service UnavailableService Temporarily UnavailableErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

PendingTransactions is an array of signed transactions exactly as they were submitted.

NameTypeRequiredRestrictionsDescription
» top-transactions[object]truenoneAn array of signed transaction objects.
» total-transactionsintegertruenoneTotal number of transactions in the pool.

GetPendingTransactionsByAddress

Code samples

Terminal window
curl -X GET http://localhost/v2/accounts/{address}/transactions/pending \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/accounts/{address}/transactions/pending HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/accounts/{address}/transactions/pending',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/accounts/{address}/transactions/pending',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/accounts/{address}/transactions/pending', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/accounts/{address}/transactions/pending', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/accounts/{address}/transactions/pending");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/accounts/{address}/transactions/pending", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/accounts/{address}/transactions/pending

Get a list of unconfirmed transactions currently in the transaction pool by address.

Get the list of pending transactions by address, sorted by priority, in decreasing order, truncated at the end at MAX. If MAX = 0, returns all pending transactions.

Parameters

NameInTypeRequiredDescription
addresspathstringtrueAn account public key
maxqueryintegerfalseTruncated number of transactions to display. If max=0, returns all pending txns.
formatquerystringfalseConfigures whether the response object is JSON or MessagePack encoded. If not provided, defaults to JSON.

Enumerated Values

ParameterValue
formatjson
formatmsgpack

Example responses

200 Response

{
"top-transactions": [
{}
],
"total-transactions": 0
}

Responses

StatusMeaningDescriptionSchema
200OKA potentially truncated list of transactions currently in the node’s transaction pool. You can compute whether or not the list is truncated if the number of elements in the top-transactions array is fewer than total-transactions.Inline
400Bad RequestMax must be a non-negative integerErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
503Service UnavailableService Temporarily UnavailableErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

PendingTransactions is an array of signed transactions exactly as they were submitted.

NameTypeRequiredRestrictionsDescription
» top-transactions[object]truenoneAn array of signed transaction objects.
» total-transactionsintegertruenoneTotal number of transactions in the pool.

GetReady

Code samples

Terminal window
curl -X GET http://localhost/ready \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/ready HTTP/1.1
Host: localhost
const headers = {
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/ready',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/ready',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/ready', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/ready', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/ready");
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{
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/ready", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /ready

Returns OK if healthy and fully caught up.

Example responses

Responses

StatusMeaningDescriptionSchema
200OKOK.None
500Internal Server ErrorInternal ErrorNone
503Service UnavailableNode not ready yetNone
defaultDefaultUnknown ErrorNone

Response Schema

GetStateProof

Code samples

Terminal window
curl -X GET http://localhost/v2/stateproofs/{round} \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/stateproofs/{round} HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/stateproofs/{round}',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/stateproofs/{round}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/stateproofs/{round}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/stateproofs/{round}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/stateproofs/{round}");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/stateproofs/{round}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/stateproofs/{round}

Get a state proof that covers a given round

Parameters

NameInTypeRequiredDescription
roundpathintegertrueThe round for which a state proof is desired.

Example responses

200 Response

{
"Message": {
"BlockHeadersCommitment": "string",
"FirstAttestedRound": 0,
"LastAttestedRound": 0,
"LnProvenWeight": 0,
"VotersCommitment": "string"
},
"StateProof": "string"
}

Responses

StatusMeaningDescriptionSchema
200OKStateProofResponse wraps the StateProof type in a response.StateProof
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundCould not find a state proof that covers a given roundErrorResponse
408Request Timeouttimed out on requestErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
503Service UnavailableService Temporarily UnavailableErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

GetStatus

Code samples

Terminal window
curl -X GET http://localhost/v2/status \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/status HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/status',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/status',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/status', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/status', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/status");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/status", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/status

Gets the current node status.

Example responses

200 Response

{
"catchpoint": "string",
"catchpoint-acquired-blocks": 0,
"catchpoint-processed-accounts": 0,
"catchpoint-processed-kvs": 0,
"catchpoint-total-accounts": 0,
"catchpoint-total-blocks": 0,
"catchpoint-total-kvs": 0,
"catchpoint-verified-accounts": 0,
"catchpoint-verified-kvs": 0,
"catchup-time": 0,
"last-catchpoint": "string",
"last-round": 0,
"last-version": "string",
"next-version": "string",
"next-version-round": 0,
"next-version-supported": true,
"stopped-at-unsupported-round": true,
"time-since-last-round": 0,
"upgrade-delay": 0,
"upgrade-next-protocol-vote-before": 0,
"upgrade-no-votes": 0,
"upgrade-node-vote": true,
"upgrade-vote-rounds": 0,
"upgrade-votes": 0,
"upgrade-votes-required": 0,
"upgrade-yes-votes": 0
}

Responses

StatusMeaningDescriptionSchema
200OKnoneInline
401UnauthorizedInvalid API TokenErrorResponse
500Internal Server ErrorInternal Errorstring
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

NodeStatus contains the information about a node status

NameTypeRequiredRestrictionsDescription
» catchpointstringfalsenoneThe current catchpoint that is being caught up to
» catchpoint-acquired-blocksintegerfalsenoneThe number of blocks that have already been obtained by the node as part of the catchup
» catchpoint-processed-accountsintegerfalsenoneThe number of accounts from the current catchpoint that have been processed so far as part of the catchup
» catchpoint-processed-kvsintegerfalsenoneThe number of key-values (KVs) from the current catchpoint that have been processed so far as part of the catchup
» catchpoint-total-accountsintegerfalsenoneThe total number of accounts included in the current catchpoint
» catchpoint-total-blocksintegerfalsenoneThe total number of blocks that are required to complete the current catchpoint catchup
» catchpoint-total-kvsintegerfalsenoneThe total number of key-values (KVs) included in the current catchpoint
» catchpoint-verified-accountsintegerfalsenoneThe number of accounts from the current catchpoint that have been verified so far as part of the catchup
» catchpoint-verified-kvsintegerfalsenoneThe number of key-values (KVs) from the current catchpoint that have been verified so far as part of the catchup
» catchup-timeintegertruenoneCatchupTime in nanoseconds
» last-catchpointstringfalsenoneThe last catchpoint seen by the node
» last-roundintegertruenoneLastRound indicates the last round seen
» last-versionstringtruenoneLastVersion indicates the last consensus version supported
» next-versionstringtruenoneNextVersion of consensus protocol to use
» next-version-roundintegertruenoneNextVersionRound is the round at which the next consensus version will apply
» next-version-supportedbooleantruenoneNextVersionSupported indicates whether the next consensus version is supported by this node
» stopped-at-unsupported-roundbooleantruenoneStoppedAtUnsupportedRound indicates that the node does not support the new rounds and has stopped making progress
» time-since-last-roundintegertruenoneTimeSinceLastRound in nanoseconds
» upgrade-delayintegerfalsenoneUpgrade delay
» upgrade-next-protocol-vote-beforeintegerfalsenoneNext protocol round
» upgrade-no-votesintegerfalsenoneNo votes cast for consensus upgrade
» upgrade-node-votebooleanfalsenoneThis node’s upgrade vote
» upgrade-vote-roundsintegerfalsenoneTotal voting rounds for current upgrade
» upgrade-votesintegerfalsenoneTotal votes cast for consensus upgrade
» upgrade-votes-requiredintegerfalsenoneYes votes required for consensus upgrade
» upgrade-yes-votesintegerfalsenoneYes votes cast for consensus upgrade

GetSupply

Code samples

Terminal window
curl -X GET http://localhost/v2/ledger/supply \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/ledger/supply HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/ledger/supply',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/ledger/supply',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/ledger/supply', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/ledger/supply', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/ledger/supply");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/ledger/supply", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/ledger/supply

Get the current supply reported by the ledger.

Example responses

200 Response

{
"current_round": 0,
"online-money": 0,
"total-money": 0
}

Responses

StatusMeaningDescriptionSchema
200OKSupply represents the current supply of MicroAlgos in the system.Inline
401UnauthorizedInvalid API TokenErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

Supply represents the current supply of MicroAlgos in the system

NameTypeRequiredRestrictionsDescription
» current_roundintegertruenoneRound
» online-moneyintegertruenoneOnlineMoney
» total-moneyintegertruenoneTotalMoney

GetSyncRound

Code samples

Terminal window
curl -X GET http://localhost/v2/ledger/sync \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/ledger/sync HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/ledger/sync',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/ledger/sync',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/ledger/sync', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/ledger/sync', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/ledger/sync");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/ledger/sync", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/ledger/sync

Returns the minimum sync round the ledger is keeping in cache.

Gets the minimum sync round for the ledger.

Example responses

200 Response

{
"round": 0
}

Responses

StatusMeaningDescriptionSchema
200OKResponse containing the ledger’s minimum sync roundInline
400Bad RequestSync round not set.ErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
503Service UnavailableService Temporarily UnavailableErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» roundintegertruenoneThe minimum sync round for the ledger.

GetTransactionGroupLedgerStateDeltasForRound

Code samples

Terminal window
curl -X GET http://localhost/v2/deltas/{round}/txn/group \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/deltas/{round}/txn/group HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/deltas/{round}/txn/group',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/deltas/{round}/txn/group',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/deltas/{round}/txn/group', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/deltas/{round}/txn/group', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/deltas/{round}/txn/group");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/deltas/{round}/txn/group", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/deltas/{round}/txn/group

Get LedgerStateDelta objects for all transaction groups in a given round

Get ledger deltas for transaction groups in a given round.

Parameters

NameInTypeRequiredDescription
roundpathintegertrueThe round for which the deltas are desired.
formatquerystringfalseConfigures whether the response object is JSON or MessagePack encoded. If not provided, defaults to JSON.

Enumerated Values

ParameterValue
formatjson
formatmsgpack

Example responses

200 Response

{
"Deltas": [
{
"Delta": {},
"Ids": [
"string"
]
}
]
}

Responses

StatusMeaningDescriptionSchema
200OKResponse containing all ledger state deltas for transaction groups, with their associated Ids, in a single round.Inline
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundCould not find deltas for roundErrorResponse
408Request Timeouttimed out on requestErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
501Not ImplementedNot ImplementedErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» Deltas[LedgerStateDeltaForTransactionGroup]truenone[Contains a ledger delta for a single transaction group]
»» DeltaLedgerStateDeltatruenoneLedger StateDelta object
»» Ids[string]truenonenone

GetTransactionProof

Code samples

Terminal window
curl -X GET http://localhost/v2/blocks/{round}/transactions/{txid}/proof \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/blocks/{round}/transactions/{txid}/proof HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/blocks/{round}/transactions/{txid}/proof',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/blocks/{round}/transactions/{txid}/proof',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/blocks/{round}/transactions/{txid}/proof', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/blocks/{round}/transactions/{txid}/proof', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/blocks/{round}/transactions/{txid}/proof");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/blocks/{round}/transactions/{txid}/proof", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/blocks/{round}/transactions/{txid}/proof

Get a proof for a transaction in a block.

Parameters

NameInTypeRequiredDescription
roundpathintegertrueThe round in which the transaction appears.
txidpathstringtrueThe transaction ID for which to generate a proof.
hashtypequerystringfalseThe type of hash function used to create the proof, must be one of:
formatquerystringfalseConfigures whether the response object is JSON or MessagePack encoded. If not provided, defaults to JSON.

Detailed descriptions

hashtype: The type of hash function used to create the proof, must be one of:

  • sha512_256
  • sha256

Enumerated Values

ParameterValue
hashtypesha512_256
hashtypesha256
formatjson
formatmsgpack

Example responses

200 Response

{
"hashtype": "sha512_256",
"idx": 0,
"proof": "string",
"stibhash": "string",
"treedepth": 0
}

Responses

StatusMeaningDescriptionSchema
200OKProof of transaction in a block.Inline
400Bad RequestMalformed round number or transaction IDErrorResponse
401UnauthorizedInvalid API tokenErrorResponse
404Not FoundNon-existent block or transactionErrorResponse
500Internal Server ErrorInternal error, including protocol not supporting proofs.ErrorResponse
defaultDefaultUnknown errorNone

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» hashtypestringtruenoneThe type of hash function used to create the proof, must be one of:
* sha512_256
* sha256
» idxintegertruenoneIndex of the transaction in the block’s payset.
» proofstring(byte)truenoneProof of transaction membership.
» stibhashstring(byte)truenoneHash of SignedTxnInBlock for verifying proof.
» treedepthintegertruenoneRepresents the depth of the tree that is being proven, i.e. the number of edges from a leaf to the root.

Enumerated Values

PropertyValue
hashtypesha512_256
hashtypesha256

GetVersion

Code samples

Terminal window
curl -X GET http://localhost/versions \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/versions HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/versions',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/versions',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/versions', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/versions', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/versions");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/versions", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /versions

Retrieves the supported API versions, binary build versions, and genesis information.

Example responses

200 Response

{
"build": {
"branch": "string",
"build_number": 0,
"channel": "string",
"commit_hash": "string",
"major": 0,
"minor": 0
},
"genesis_hash_b64": "string",
"genesis_id": "string",
"versions": [
"string"
]
}

Responses

StatusMeaningDescriptionSchema
200OKVersionsResponse is the response to ‘GET /versions’Version

HealthCheck

Code samples

Terminal window
curl -X GET http://localhost/health \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/health HTTP/1.1
Host: localhost
const headers = {
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/health',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/health',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/health', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/health', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/health");
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{
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/health", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /health

Returns OK if healthy.

Example responses

Responses

StatusMeaningDescriptionSchema
200OKOK.None
defaultDefaultUnknown ErrorNone

Response Schema

Metrics

Code samples

Terminal window
curl -X GET http://localhost/metrics \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/metrics HTTP/1.1
Host: localhost
const headers = {
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/metrics',
{
method: 'GET',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/metrics',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/metrics', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/metrics', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/metrics");
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{
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/metrics", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /metrics

Return metrics about algod functioning.

Example responses

Responses

StatusMeaningDescriptionSchema
200OKtext with #-comments and key:value linesNone
404Not Foundmetrics were compiled outNone

Response Schema

PendingTransactionInformation

Code samples

Terminal window
curl -X GET http://localhost/v2/transactions/pending/{txid} \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/transactions/pending/{txid} HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/transactions/pending/{txid}',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/transactions/pending/{txid}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/transactions/pending/{txid}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/transactions/pending/{txid}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/transactions/pending/{txid}");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/transactions/pending/{txid}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/transactions/pending/{txid}

Get a specific pending transaction.

Given a transaction ID of a recently submitted transaction, it returns information about it. There are several cases when this might succeed:

  • transaction committed (committed round > 0)
  • transaction still in the pool (committed round = 0, pool error = "")
  • transaction removed from pool due to error (committed round = 0, pool error != "") Or the transaction may have happened sufficiently long ago that the node no longer remembers it, and this will return an error.

Parameters

NameInTypeRequiredDescription
txidpathstringtrueA transaction ID
formatquerystringfalseConfigures whether the response object is JSON or MessagePack encoded. If not provided, defaults to JSON.

Enumerated Values

ParameterValue
formatjson
formatmsgpack

Example responses

200 Response

{
"application-index": 0,
"asset-closing-amount": 0,
"asset-index": 0,
"close-rewards": 0,
"closing-amount": 0,
"confirmed-round": 0,
"global-state-delta": [
{
"key": "string",
"value": {
"action": 0,
"bytes": "string",
"uint": 0
}
}
],
"inner-txns": [
{
"application-index": 0,
"asset-closing-amount": 0,
"asset-index": 0,
"close-rewards": 0,
"closing-amount": 0,
"confirmed-round": 0,
"global-state-delta": [
{
"key": "string",
"value": {
"action": 0,
"bytes": "string",
"uint": 0
}
}
],
"inner-txns": [],
"local-state-delta": [
{
"address": "string",
"delta": [
{
"key": "string",
"value": {
"action": 0,
"bytes": "string",
"uint": 0
}
}
]
}
],
"logs": [
"string"
],
"pool-error": "string",
"receiver-rewards": 0,
"sender-rewards": 0,
"txn": {}
}
],
"local-state-delta": [
{
"address": "string",
"delta": [
{
"key": "string",
"value": {
"action": 0,
"bytes": "string",
"uint": 0
}
}
]
}
],
"logs": [
"string"
],
"pool-error": "string",
"receiver-rewards": 0,
"sender-rewards": 0,
"txn": {}
}

Responses

StatusMeaningDescriptionSchema
200OKGiven a transaction ID of a recently submitted transaction, it returns information about it. There are several cases when this might succeed:
  • transaction committed (committed round > 0)
  • transaction still in the pool (committed round = 0, pool error = "")
  • transaction removed from pool due to error (committed round = 0, pool error != "")

Or the transaction may have happened sufficiently long ago that the node no longer remembers it, and this will return an error.|PendingTransactionResponse| |400|Bad Request|Bad Request|ErrorResponse| |401|Unauthorized|Invalid API Token|ErrorResponse| |404|Not Found|Transaction Not Found|ErrorResponse| |default|Default|Unknown Error|None|

Response Schema

RawTransaction

Code samples

Terminal window
curl -X POST http://localhost/v2/transactions \
-H 'Content-Type: application/x-binary' \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
POST http://localhost/v2/transactions HTTP/1.1
Host: localhost
Content-Type: application/x-binary
Accept: application/json
const inputBody = 'string';
const headers = {
'Content-Type':'application/x-binary',
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/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/x-binary',
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.post 'http://localhost/v2/transactions',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/x-binary',
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.post('http://localhost/v2/transactions', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/x-binary',
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','http://localhost/v2/transactions', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/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/x-binary"},
"Accept": []string{"application/json"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http://localhost/v2/transactions", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

POST /v2/transactions

Broadcasts a raw transaction or transaction group to the network.

Body parameter

Parameters

NameInTypeRequiredDescription
bodybodystring(binary)trueThe byte encoded signed transaction to broadcast to network

Example responses

200 Response

{
"txId": "string"
}

Responses

StatusMeaningDescriptionSchema
200OKTransaction ID of the submission.Inline
400Bad RequestBad Request - Malformed Algorand transactionErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
503Service UnavailableService Temporarily UnavailableErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» txIdstringtruenoneencoding of the transaction hash.

RawTransactionAsync

Code samples

Terminal window
curl -X POST http://localhost/v2/transactions/async \
-H 'Content-Type: application/x-binary' \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
POST http://localhost/v2/transactions/async HTTP/1.1
Host: localhost
Content-Type: application/x-binary
Accept: application/json
const inputBody = 'string';
const headers = {
'Content-Type':'application/x-binary',
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/transactions/async',
{
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/x-binary',
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.post 'http://localhost/v2/transactions/async',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/x-binary',
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.post('http://localhost/v2/transactions/async', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/x-binary',
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','http://localhost/v2/transactions/async', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/transactions/async");
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/x-binary"},
"Accept": []string{"application/json"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http://localhost/v2/transactions/async", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

POST /v2/transactions/async

Fast track for broadcasting a raw transaction or transaction group to the network through the tx handler without performing most of the checks and reporting detailed errors. Should be only used for development and performance testing.

Body parameter

Parameters

NameInTypeRequiredDescription
bodybodystring(binary)trueThe byte encoded signed transaction to broadcast to network

Example responses

400 Response

{
"data": {},
"message": "string"
}

Responses

StatusMeaningDescriptionSchema
200OKnoneNone
400Bad RequestBad Request - Malformed Algorand transactionErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundDeveloper or Experimental API not enabledNone
500Internal Server ErrorInternal ErrorErrorResponse
503Service UnavailableService Temporarily UnavailableErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

SetBlockTimeStampOffset

Code samples

Terminal window
curl -X POST http://localhost/v2/devmode/blocks/offset/{offset} \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
POST http://localhost/v2/devmode/blocks/offset/{offset} HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/devmode/blocks/offset/{offset}',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.post 'http://localhost/v2/devmode/blocks/offset/{offset}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.post('http://localhost/v2/devmode/blocks/offset/{offset}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','http://localhost/v2/devmode/blocks/offset/{offset}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/devmode/blocks/offset/{offset}");
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{
"Accept": []string{"application/json"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http://localhost/v2/devmode/blocks/offset/{offset}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

POST /v2/devmode/blocks/offset/{offset}

Given a timestamp offset in seconds, adds the offset to every subsequent block header’s timestamp.

Sets the timestamp offset (seconds) for blocks in dev mode. Providing an offset of 0 will unset this value and try to use the real clock for the timestamp.

Parameters

NameInTypeRequiredDescription
offsetpathintegertrueThe timestamp offset for blocks in dev mode.

Example responses

400 Response

{
"data": {},
"message": "string"
}

Responses

StatusMeaningDescriptionSchema
200OKOKNone
400Bad RequestCannot set timestamp offset to a negative integer.ErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

SetSyncRound

Code samples

Terminal window
curl -X POST http://localhost/v2/ledger/sync/{round} \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
POST http://localhost/v2/ledger/sync/{round} HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/ledger/sync/{round}',
{
method: 'POST',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.post 'http://localhost/v2/ledger/sync/{round}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.post('http://localhost/v2/ledger/sync/{round}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','http://localhost/v2/ledger/sync/{round}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/ledger/sync/{round}");
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{
"Accept": []string{"application/json"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http://localhost/v2/ledger/sync/{round}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

POST /v2/ledger/sync/{round}

Given a round, tells the ledger to keep that round in its cache.

Sets the minimum sync round on the ledger.

Parameters

NameInTypeRequiredDescription
roundpathintegertrueThe round for which the deltas are desired.

Example responses

400 Response

{
"data": {},
"message": "string"
}

Responses

StatusMeaningDescriptionSchema
200OKnoneNone
400Bad RequestCan not set sync round to an earlier round than the current round.ErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
503Service UnavailableService Temporarily UnavailableErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

SimulateTransaction

Code samples

Terminal window
curl -X POST http://localhost/v2/transactions/simulate \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
POST http://localhost/v2/transactions/simulate HTTP/1.1
Host: localhost
Content-Type: application/json
Accept: application/json
const inputBody = '{
"allow-empty-signatures": true,
"allow-more-logging": true,
"allow-unnamed-resources": true,
"exec-trace-config": {
"enable": true,
"scratch-change": true,
"stack-change": true,
"state-change": true
},
"extra-opcode-budget": 0,
"fix-signers": true,
"round": 0,
"txn-groups": [
{
"txns": [
"string"
]
}
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/transactions/simulate',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.post 'http://localhost/v2/transactions/simulate',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.post('http://localhost/v2/transactions/simulate', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','http://localhost/v2/transactions/simulate', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/transactions/simulate");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http://localhost/v2/transactions/simulate", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

POST /v2/transactions/simulate

Simulates a raw transaction or transaction group as it would be evaluated on the network. The simulation will use blockchain state from the latest committed round.

Body parameter

{
"allow-empty-signatures": true,
"allow-more-logging": true,
"allow-unnamed-resources": true,
"exec-trace-config": {
"enable": true,
"scratch-change": true,
"stack-change": true,
"state-change": true
},
"extra-opcode-budget": 0,
"fix-signers": true,
"round": 0,
"txn-groups": [
{
"txns": [
"string"
]
}
]
}

Parameters

NameInTypeRequiredDescription
formatquerystringfalseConfigures whether the response object is JSON or MessagePack encoded. If not provided, defaults to JSON.
bodybodySimulateRequesttrueThe transactions to simulate, along with any other inputs.

Enumerated Values

ParameterValue
formatjson
formatmsgpack

Example responses

200 Response

{
"eval-overrides": {
"allow-empty-signatures": true,
"allow-unnamed-resources": true,
"extra-opcode-budget": 0,
"fix-signers": true,
"max-log-calls": 0,
"max-log-size": 0
},
"exec-trace-config": {
"enable": true,
"scratch-change": true,
"stack-change": true,
"state-change": true
},
"initial-states": {
"app-initial-states": [
{
"app-boxes": {
"account": "string",
"kvs": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
]
},
"app-globals": {
"account": "string",
"kvs": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
]
},
"app-locals": [
{
"account": "string",
"kvs": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
]
}
],
"id": 0
}
]
},
"last-round": 0,
"txn-groups": [
{
"app-budget-added": 0,
"app-budget-consumed": 0,
"failed-at": [
0
],
"failure-message": "string",
"txn-results": [
{
"app-budget-consumed": 0,
"exec-trace": {
"approval-program-hash": "string",
"approval-program-trace": [
{
"pc": 0,
"scratch-changes": [
{
"new-value": {},
"slot": 0
}
],
"spawned-inners": [
0
],
"stack-additions": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack-pop-count": 0,
"state-changes": [
{
"account": "string",
"app-state-type": "string",
"key": "string",
"new-value": {},
"operation": "string"
}
]
}
],
"clear-state-program-hash": "string",
"clear-state-program-trace": [
{
"pc": 0,
"scratch-changes": [
{
"new-value": {},
"slot": 0
}
],
"spawned-inners": [
0
],
"stack-additions": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack-pop-count": 0,
"state-changes": [
{
"account": "string",
"app-state-type": "string",
"key": "string",
"new-value": {},
"operation": "string"
}
]
}
],
"clear-state-rollback": true,
"clear-state-rollback-error": "string",
"inner-trace": [
{}
],
"logic-sig-hash": "string",
"logic-sig-trace": [
{
"pc": 0,
"scratch-changes": [
{
"new-value": {},
"slot": 0
}
],
"spawned-inners": [
0
],
"stack-additions": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack-pop-count": 0,
"state-changes": [
{
"account": "string",
"app-state-type": "string",
"key": "string",
"new-value": {},
"operation": "string"
}
]
}
]
},
"fixed-signer": "string",
"logic-sig-budget-consumed": 0,
"txn-result": {
"application-index": 0,
"asset-closing-amount": 0,
"asset-index": 0,
"close-rewards": 0,
"closing-amount": 0,
"confirmed-round": 0,
"global-state-delta": [
{
"key": "string",
"value": {
"action": 0,
"bytes": "string",
"uint": 0
}
}
],
"inner-txns": [
{}
],
"local-state-delta": [
{
"address": "string",
"delta": [
{
"key": "string",
"value": {}
}
]
}
],
"logs": [
"string"
],
"pool-error": "string",
"receiver-rewards": 0,
"sender-rewards": 0,
"txn": {}
},
"unnamed-resources-accessed": {
"accounts": [
"string"
],
"app-locals": [
{
"account": "string",
"app": 0
}
],
"apps": [
0
],
"asset-holdings": [
{
"account": "string",
"asset": 0
}
],
"assets": [
0
],
"boxes": [
{
"app": 0,
"name": "string"
}
],
"extra-box-refs": 0
}
}
],
"unnamed-resources-accessed": {
"accounts": [
"string"
],
"app-locals": [
{
"account": "string",
"app": 0
}
],
"apps": [
0
],
"asset-holdings": [
{
"account": "string",
"asset": 0
}
],
"assets": [
0
],
"boxes": [
{
"app": 0,
"name": "string"
}
],
"extra-box-refs": 0
}
}
],
"version": 0
}

Responses

StatusMeaningDescriptionSchema
200OKResult of a transaction group simulation.Inline
400Bad RequestBad RequestErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
503Service UnavailableService Temporarily UnavailableErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» eval-overridesSimulationEvalOverridesfalsenoneThe set of parameters and limits override during simulation. If this set of parameters is present, then evaluation parameters may differ from standard evaluation in certain ways.
»» allow-empty-signaturesbooleanfalsenoneIf true, transactions without signatures are allowed and simulated as if they were properly signed.
»» allow-unnamed-resourcesbooleanfalsenoneIf true, allows access to unnamed resources during simulation.
»» extra-opcode-budgetintegerfalsenoneThe extra opcode budget added to each transaction group during simulation
»» fix-signersbooleanfalsenoneIf true, signers for transactions that are missing signatures will be fixed during evaluation.
»» max-log-callsintegerfalsenoneThe maximum log calls one can make during simulation
»» max-log-sizeintegerfalsenoneThe maximum byte number to log during simulation
» exec-trace-configSimulateTraceConfigfalsenoneAn object that configures simulation execution trace.
»» enablebooleanfalsenoneA boolean option for opting in execution trace features simulation endpoint.
»» scratch-changebooleanfalsenoneA boolean option enabling returning scratch slot changes together with execution trace during simulation.
»» stack-changebooleanfalsenoneA boolean option enabling returning stack changes together with execution trace during simulation.
»» state-changebooleanfalsenoneA boolean option enabling returning application state changes (global, local, and box changes) with the execution trace during simulation.
» initial-statesSimulateInitialStatesfalsenoneInitial states of resources that were accessed during simulation.
»» app-initial-states[ApplicationInitialStates]falsenoneThe initial states of accessed application before simulation. The order of this array is arbitrary.
»»» app-boxesApplicationKVStoragefalsenoneAn application’s global/local/box state.
»»»» accountstringfalsenoneThe address of the account associated with the local state.
»»»» kvs[AvmKeyValue]truenoneKey-Value pairs representing application states.
»»»»» keystring(byte)truenonenone
»»»»» valueAvmValuetruenoneRepresents an AVM value.
»»»»»» bytesstring(byte)falsenonebytes value.
»»»»»» typeintegertruenonevalue type. Value 1 refers to bytes, value 2 refers to uint64
»»»»»» uintintegerfalsenoneuint value.
»»» app-globalsApplicationKVStoragefalsenoneAn application’s global/local/box state.
»»» app-locals[ApplicationKVStorage]falsenoneAn application’s initial local states tied to different accounts.
»»» idintegertruenoneApplication index.
» last-roundintegertruenoneThe round immediately preceding this simulation. State changes through this round were used to run this simulation.
» txn-groups[SimulateTransactionGroupResult]truenoneA result object for each transaction group that was simulated.
»» app-budget-addedintegerfalsenoneTotal budget added during execution of app calls in the transaction group.
»» app-budget-consumedintegerfalsenoneTotal budget consumed during execution of app calls in the transaction group.
»» failed-at[integer]falsenoneIf present, indicates which transaction in this group caused the failure. This array represents the path to the failing transaction. Indexes are zero based, the first element indicates the top-level transaction, and successive elements indicate deeper inner transactions.
»» failure-messagestringfalsenoneIf present, indicates that the transaction group failed and specifies why that happened
»» txn-results[SimulateTransactionResult]truenoneSimulation result for individual transactions
»»» app-budget-consumedintegerfalsenoneBudget used during execution of an app call transaction. This value includes budged used by inner app calls spawned by this transaction.
»»» exec-traceSimulationTransactionExecTracefalsenoneThe execution trace of calling an app or a logic sig, containing the inner app call trace in a recursive way.
»»»» approval-program-hashstring(byte)falsenoneSHA512_256 hash digest of the approval program executed in transaction.
»»»» approval-program-trace[SimulationOpcodeTraceUnit]falsenoneProgram trace that contains a trace of opcode effects in an approval program.
»»»»» pcintegertruenoneThe program counter of the current opcode being evaluated.
»»»»» scratch-changes[ScratchChange]falsenoneThe writes into scratch slots.
»»»»»» new-valueAvmValuetruenoneRepresents an AVM value.
»»»»»» slotintegertruenoneThe scratch slot written.
»»»»» spawned-inners[integer]falsenoneThe indexes of the traces for inner transactions spawned by this opcode, if any.
»»»»» stack-additions[AvmValue]falsenoneThe values added by this opcode to the stack.
»»»»» stack-pop-countintegerfalsenoneThe number of deleted stack values by this opcode.
»»»»» state-changes[ApplicationStateOperation]falsenoneThe operations against the current application’s states.
»»»»»» accountstringfalsenoneFor local state changes, the address of the account associated with the local state.
»»»»»» app-state-typestringtruenoneType of application state. Value g is global state, l is local state, b is boxes.
»»»»»» keystring(byte)truenoneThe key (name) of the global/local/box state.
»»»»»» new-valueAvmValuefalsenoneRepresents an AVM value.
»»»»»» operationstringtruenoneOperation type. Value w is write, d is delete.
»»»» clear-state-program-hashstring(byte)falsenoneSHA512_256 hash digest of the clear state program executed in transaction.
»»»» clear-state-program-trace[SimulationOpcodeTraceUnit]falsenoneProgram trace that contains a trace of opcode effects in a clear state program.
»»»» clear-state-rollbackbooleanfalsenoneIf true, indicates that the clear state program failed and any persistent state changes it produced should be reverted once the program exits.
»»»» clear-state-rollback-errorstringfalsenoneThe error message explaining why the clear state program failed. This field will only be populated if clear-state-rollback is true and the failure was due to an execution error.
»»»» inner-trace[SimulationTransactionExecTrace]falsenoneAn array of SimulationTransactionExecTrace representing the execution trace of any inner transactions executed.
»»»» logic-sig-hashstring(byte)falsenoneSHA512_256 hash digest of the logic sig executed in transaction.
»»»» logic-sig-trace[SimulationOpcodeTraceUnit]falsenoneProgram trace that contains a trace of opcode effects in a logic sig.
»»» fixed-signerstringfalsenoneThe account that needed to sign this transaction when no signature was provided and the provided signer was incorrect.
»»» logic-sig-budget-consumedintegerfalsenoneBudget used during execution of a logic sig transaction.
»»» txn-resultPendingTransactionResponsetruenoneDetails about a pending transaction. If the transaction was recently confirmed, includes confirmation details like the round and reward details.
»»»» application-indexintegerfalsenoneThe application index if the transaction was found and it created an application.
»»»» asset-closing-amountintegerfalsenoneThe number of the asset’s unit that were transferred to the close-to address.
»»»» asset-indexintegerfalsenoneThe asset index if the transaction was found and it created an asset.
»»»» close-rewardsintegerfalsenoneRewards in microalgos applied to the close remainder to account.
»»»» closing-amountintegerfalsenoneClosing amount for the transaction.
»»»» confirmed-roundintegerfalsenoneThe round where this transaction was confirmed, if present.
»»»» global-state-delta[EvalDeltaKeyValue]falsenoneApplication state delta.
»»»»» keystringtruenonenone
»»»»» valueEvalDeltatruenoneRepresents a TEAL value delta.
»»»»»» actionintegertruenone[at] delta action.
»»»»»» bytesstringfalsenone[bs] bytes value.
»»»»»» uintintegerfalsenone[ui] uint value.
»»»» inner-txns[PendingTransactionResponse]falsenoneInner transactions produced by application execution.
»»»» local-state-delta[AccountStateDelta]falsenoneLocal state key/value changes for the application being executed by this transaction.
»»»»» addressstringtruenonenone
»»»»» delta[EvalDeltaKeyValue]truenoneApplication state delta.
»»»» logs[string]falsenoneLogs for the application being executed by this transaction.
»»»» pool-errorstringtruenoneIndicates that the transaction was kicked out of this node’s transaction pool (and specifies why that happened). An empty string indicates the transaction wasn’t kicked out of this node’s txpool due to an error.
»»»» receiver-rewardsintegerfalsenoneRewards in microalgos applied to the receiver account.
»»»» sender-rewardsintegerfalsenoneRewards in microalgos applied to the sender account.
»»»» txnobjecttruenoneThe raw signed transaction.
»»» unnamed-resources-accessedSimulateUnnamedResourcesAccessedfalsenoneThese are resources that were accessed by this group that would normally have caused failure, but were allowed in simulation. Depending on where this object is in the response, the unnamed resources it contains may or may not qualify for group resource sharing. If this is a field in SimulateTransactionGroupResult, the resources do qualify, but if this is a field in SimulateTransactionResult, they do not qualify. In order to make this group valid for actual submission, resources that qualify for group sharing can be made available by any transaction of the group; otherwise, resources must be placed in the same transaction which accessed them.
»»»» accounts[string]falsenoneThe unnamed accounts that were referenced. The order of this array is arbitrary.
»»»» app-locals[ApplicationLocalReference]falsenoneThe unnamed application local states that were referenced. The order of this array is arbitrary.
»»»»» accountstringtruenoneAddress of the account with the local state.
»»»»» appintegertruenoneApplication ID of the local state application.
»»»» apps[integer]falsenoneThe unnamed applications that were referenced. The order of this array is arbitrary.
»»»» asset-holdings[AssetHoldingReference]falsenoneThe unnamed asset holdings that were referenced. The order of this array is arbitrary.
»»»»» accountstringtruenoneAddress of the account holding the asset.
»»»»» assetintegertruenoneAsset ID of the holding.
»»»» assets[integer]falsenoneThe unnamed assets that were referenced. The order of this array is arbitrary.
»»»» boxes[BoxReference]falsenoneThe unnamed boxes that were referenced. The order of this array is arbitrary.
»»»»» appintegertruenoneApplication ID which this box belongs to
»»»»» namestring(byte)truenoneBase64 encoded box name
»»»» extra-box-refsintegerfalsenoneThe number of extra box references used to increase the IO budget. This is in addition to the references defined in the input transaction group and any referenced to unnamed boxes.
»» unnamed-resources-accessedSimulateUnnamedResourcesAccessedfalsenoneThese are resources that were accessed by this group that would normally have caused failure, but were allowed in simulation. Depending on where this object is in the response, the unnamed resources it contains may or may not qualify for group resource sharing. If this is a field in SimulateTransactionGroupResult, the resources do qualify, but if this is a field in SimulateTransactionResult, they do not qualify. In order to make this group valid for actual submission, resources that qualify for group sharing can be made available by any transaction of the group; otherwise, resources must be placed in the same transaction which accessed them.
» versionintegertruenoneThe version of this response object.

SwaggerJSON

Code samples

Terminal window
curl -X GET http://localhost/swagger.json \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/swagger.json HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/swagger.json',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/swagger.json',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/swagger.json', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/swagger.json', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/swagger.json");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/swagger.json", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /swagger.json

Gets the current swagger spec.

Returns the entire swagger spec in json.

Example responses

200 Response

"string"

Responses

StatusMeaningDescriptionSchema
200OKThe current swagger specstring
defaultDefaultUnknown ErrorNone

Response Schema

TealCompile

Code samples

Terminal window
curl -X POST http://localhost/v2/teal/compile \
-H 'Content-Type: text/plain' \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
POST http://localhost/v2/teal/compile HTTP/1.1
Host: localhost
Content-Type: text/plain
Accept: application/json
const inputBody = 'string';
const headers = {
'Content-Type':'text/plain',
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/teal/compile',
{
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' => 'text/plain',
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.post 'http://localhost/v2/teal/compile',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'text/plain',
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.post('http://localhost/v2/teal/compile', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'text/plain',
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','http://localhost/v2/teal/compile', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/teal/compile");
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{"text/plain"},
"Accept": []string{"application/json"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http://localhost/v2/teal/compile", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

POST /v2/teal/compile

Compile TEAL source code to binary, produce its hash

Given TEAL source code in plain text, return base64 encoded program bytes and base32 SHA512_256 hash of program bytes (Address style). This endpoint is only enabled when a node’s configuration file sets EnableDeveloperAPI to true.

Body parameter

string

Parameters

NameInTypeRequiredDescription
sourcemapquerybooleanfalseWhen set to true, returns the source map of the program as a JSON. Defaults to false.
bodybodystring(binary)trueTEAL source code to be compiled

Example responses

200 Response

{
"hash": "string",
"result": "string",
"sourcemap": {}
}

Responses

StatusMeaningDescriptionSchema
200OKTeal compile ResultInline
400Bad RequestBad Request - Teal Compile ErrorErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundDeveloper API not enabledNone
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» hashstringtruenonebase32 SHA512_256 of program bytes (Address style)
» resultstringtruenonebase64 encoded program bytes
» sourcemapobjectfalsenoneJSON of the source map

TealDisassemble

Code samples

Terminal window
curl -X POST http://localhost/v2/teal/disassemble \
-H 'Content-Type: application/x-binary' \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
POST http://localhost/v2/teal/disassemble HTTP/1.1
Host: localhost
Content-Type: application/x-binary
Accept: application/json
const inputBody = 'string';
const headers = {
'Content-Type':'application/x-binary',
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/teal/disassemble',
{
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/x-binary',
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.post 'http://localhost/v2/teal/disassemble',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/x-binary',
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.post('http://localhost/v2/teal/disassemble', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/x-binary',
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','http://localhost/v2/teal/disassemble', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/teal/disassemble");
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/x-binary"},
"Accept": []string{"application/json"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http://localhost/v2/teal/disassemble", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

POST /v2/teal/disassemble

Disassemble program bytes into the TEAL source code.

Given the program bytes, return the TEAL source code in plain text. This endpoint is only enabled when a node’s configuration file sets EnableDeveloperAPI to true.

Body parameter

Parameters

NameInTypeRequiredDescription
bodybodystring(byte)trueTEAL program binary to be disassembled

Example responses

200 Response

{
"result": "string"
}

Responses

StatusMeaningDescriptionSchema
200OKTeal disassembly ResultInline
400Bad RequestBad Request - Teal Compile ErrorErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundDeveloper API not enabledNone
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» resultstringtruenonedisassembled Teal code

TealDryrun

Code samples

Terminal window
curl -X POST http://localhost/v2/teal/dryrun \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
POST http://localhost/v2/teal/dryrun HTTP/1.1
Host: localhost
Content-Type: application/json
Accept: application/json
const inputBody = '{
"accounts": [
{
"address": "string",
"amount": 0,
"amount-without-pending-rewards": 0,
"apps-local-state": [
{
"id": 0,
"key-value": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
],
"schema": {
"num-byte-slice": 0,
"num-uint": 0
}
}
],
"apps-total-extra-pages": 0,
"apps-total-schema": {
"num-byte-slice": 0,
"num-uint": 0
},
"assets": [
{
"amount": 0,
"asset-id": 0,
"is-frozen": true
}
],
"auth-addr": "string",
"created-apps": [
{
"id": 0,
"params": {
"approval-program": "string",
"clear-state-program": "string",
"creator": "string",
"extra-program-pages": 0,
"global-state": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
],
"global-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
},
"local-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
}
}
}
],
"created-assets": [
{
"index": 0,
"params": {
"clawback": "string",
"creator": "string",
"decimals": 19,
"default-frozen": true,
"freeze": "string",
"manager": "string",
"metadata-hash": "string",
"name": "string",
"name-b64": "string",
"reserve": "string",
"total": 0,
"unit-name": "string",
"unit-name-b64": "string",
"url": "string",
"url-b64": "string"
}
}
],
"incentive-eligible": true,
"last-heartbeat": 0,
"last-proposed": 0,
"min-balance": 0,
"participation": {
"selection-participation-key": "string",
"state-proof-key": "string",
"vote-first-valid": 0,
"vote-key-dilution": 0,
"vote-last-valid": 0,
"vote-participation-key": "string"
},
"pending-rewards": 0,
"reward-base": 0,
"rewards": 0,
"round": 0,
"sig-type": "sig",
"status": "string",
"total-apps-opted-in": 0,
"total-assets-opted-in": 0,
"total-box-bytes": 0,
"total-boxes": 0,
"total-created-apps": 0,
"total-created-assets": 0
}
],
"apps": [
{
"id": 0,
"params": {
"approval-program": "string",
"clear-state-program": "string",
"creator": "string",
"extra-program-pages": 0,
"global-state": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
],
"global-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
},
"local-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
}
}
}
],
"latest-timestamp": 0,
"protocol-version": "string",
"round": 0,
"sources": [
{
"app-index": 0,
"field-name": "string",
"source": "string",
"txn-index": 0
}
],
"txns": [
"string"
]
}';
const headers = {
'Content-Type':'application/json',
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/teal/dryrun',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.post 'http://localhost/v2/teal/dryrun',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.post('http://localhost/v2/teal/dryrun', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('POST','http://localhost/v2/teal/dryrun', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/teal/dryrun");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("POST", "http://localhost/v2/teal/dryrun", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

POST /v2/teal/dryrun

Provide debugging information for a transaction (or group).

Executes TEAL program(s) in context and returns debugging information about the execution. This endpoint is only enabled when a node’s configuration file sets EnableDeveloperAPI to true.

Body parameter

{
"accounts": [
{
"address": "string",
"amount": 0,
"amount-without-pending-rewards": 0,
"apps-local-state": [
{
"id": 0,
"key-value": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
],
"schema": {
"num-byte-slice": 0,
"num-uint": 0
}
}
],
"apps-total-extra-pages": 0,
"apps-total-schema": {
"num-byte-slice": 0,
"num-uint": 0
},
"assets": [
{
"amount": 0,
"asset-id": 0,
"is-frozen": true
}
],
"auth-addr": "string",
"created-apps": [
{
"id": 0,
"params": {
"approval-program": "string",
"clear-state-program": "string",
"creator": "string",
"extra-program-pages": 0,
"global-state": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
],
"global-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
},
"local-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
}
}
}
],
"created-assets": [
{
"index": 0,
"params": {
"clawback": "string",
"creator": "string",
"decimals": 19,
"default-frozen": true,
"freeze": "string",
"manager": "string",
"metadata-hash": "string",
"name": "string",
"name-b64": "string",
"reserve": "string",
"total": 0,
"unit-name": "string",
"unit-name-b64": "string",
"url": "string",
"url-b64": "string"
}
}
],
"incentive-eligible": true,
"last-heartbeat": 0,
"last-proposed": 0,
"min-balance": 0,
"participation": {
"selection-participation-key": "string",
"state-proof-key": "string",
"vote-first-valid": 0,
"vote-key-dilution": 0,
"vote-last-valid": 0,
"vote-participation-key": "string"
},
"pending-rewards": 0,
"reward-base": 0,
"rewards": 0,
"round": 0,
"sig-type": "sig",
"status": "string",
"total-apps-opted-in": 0,
"total-assets-opted-in": 0,
"total-box-bytes": 0,
"total-boxes": 0,
"total-created-apps": 0,
"total-created-assets": 0
}
],
"apps": [
{
"id": 0,
"params": {
"approval-program": "string",
"clear-state-program": "string",
"creator": "string",
"extra-program-pages": 0,
"global-state": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
],
"global-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
},
"local-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
}
}
}
],
"latest-timestamp": 0,
"protocol-version": "string",
"round": 0,
"sources": [
{
"app-index": 0,
"field-name": "string",
"source": "string",
"txn-index": 0
}
],
"txns": [
"string"
]
}

Parameters

NameInTypeRequiredDescription
bodybodyDryrunRequestfalseTransaction (or group) and any accompanying state-simulation data.

Example responses

200 Response

{
"error": "string",
"protocol-version": "string",
"txns": [
{
"app-call-messages": [
"string"
],
"app-call-trace": [
{
"error": "string",
"line": 0,
"pc": 0,
"scratch": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
]
}
],
"budget-added": 0,
"budget-consumed": 0,
"disassembly": [
"string"
],
"global-delta": [
{
"key": "string",
"value": {
"action": 0,
"bytes": "string",
"uint": 0
}
}
],
"local-deltas": [
{
"address": "string",
"delta": [
{
"key": "string",
"value": {
"action": 0,
"bytes": "string",
"uint": 0
}
}
]
}
],
"logic-sig-disassembly": [
"string"
],
"logic-sig-messages": [
"string"
],
"logic-sig-trace": [
{
"error": "string",
"line": 0,
"pc": 0,
"scratch": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
]
}
],
"logs": [
"string"
]
}
]
}

Responses

StatusMeaningDescriptionSchema
200OKDryrunResponse contains per-txn debug information from a dryrun.Inline
400Bad RequestBad RequestErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
404Not FoundDeveloper API not enabledNone
500Internal Server ErrorInternal ErrorErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

NameTypeRequiredRestrictionsDescription
» errorstringtruenonenone
» protocol-versionstringtruenoneProtocol version is the protocol version Dryrun was operated under.
» txns[DryrunTxnResult]truenone[DryrunTxnResult contains any LogicSig or ApplicationCall program debug information and state updates from a dryrun.]
»» app-call-messages[string]falsenonenone
»» app-call-trace[DryrunState]falsenone[Stores the TEAL eval step data]
»»» errorstringfalsenoneEvaluation error if any
»»» lineintegertruenoneLine number
»»» pcintegertruenoneProgram counter
»»» scratch[TealValue]falsenone[Represents a TEAL value.]
»»»» bytesstringtruenone[tb] bytes value.
»»»» typeintegertruenone[tt] value type. Value 1 refers to bytes, value 2 refers to uint
»»»» uintintegertruenone[ui] uint value.
»»» stack[TealValue]truenone[Represents a TEAL value.]
»» budget-addedintegerfalsenoneBudget added during execution of app call transaction.
»» budget-consumedintegerfalsenoneBudget consumed during execution of app call transaction.
»» disassembly[string]truenoneDisassembled program line by line.
»» global-delta[EvalDeltaKeyValue]falsenoneApplication state delta.
»»» keystringtruenonenone
»»» valueEvalDeltatruenoneRepresents a TEAL value delta.
»»»» actionintegertruenone[at] delta action.
»»»» bytesstringfalsenone[bs] bytes value.
»»»» uintintegerfalsenone[ui] uint value.
»» local-deltas[AccountStateDelta]falsenone[Application state delta.]
»»» addressstringtruenonenone
»»» delta[EvalDeltaKeyValue]truenoneApplication state delta.
»» logic-sig-disassembly[string]falsenoneDisassembled lsig program line by line.
»» logic-sig-messages[string]falsenonenone
»» logic-sig-trace[DryrunState]falsenone[Stores the TEAL eval step data]
»» logs[string]falsenonenone

TransactionParams

Code samples

Terminal window
curl -X GET http://localhost/v2/transactions/params \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/transactions/params HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/transactions/params',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/transactions/params',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/transactions/params', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/transactions/params', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/transactions/params");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/transactions/params", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/transactions/params

Get parameters for constructing a new transaction

Example responses

200 Response

{
"consensus-version": "string",
"fee": 0,
"genesis-hash": "string",
"genesis-id": "string",
"last-round": 0,
"min-fee": 0
}

Responses

StatusMeaningDescriptionSchema
200OKTransactionParams contains the parameters that help a client construct a new transaction.Inline
401UnauthorizedInvalid API TokenErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
503Service UnavailableService Temporarily UnavailableErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

TransactionParams contains the parameters that help a client construct a new transaction.

NameTypeRequiredRestrictionsDescription
» consensus-versionstringtruenoneConsensusVersion indicates the consensus protocol version
as of LastRound.
» feeintegertruenoneFee is the suggested transaction fee
Fee is in units of micro-Algos per byte.
Fee may fall to zero but transactions must still have a fee of
at least MinTxnFee for the current network protocol.
» genesis-hashstring(byte)truenoneGenesisHash is the hash of the genesis block.
» genesis-idstringtruenoneGenesisID is an ID listed in the genesis block.
» last-roundintegertruenoneLastRound indicates the last round seen
» min-feeintegertruenoneThe minimum transaction fee (not per byte) required for the
txn to validate for the current network protocol.

UnsetSyncRound

Code samples

Terminal window
curl -X DELETE http://localhost/v2/ledger/sync \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
DELETE http://localhost/v2/ledger/sync HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/ledger/sync',
{
method: 'DELETE',
headers: headers
})
.then(function(res) {
return res.json();
}).then(function(body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.delete 'http://localhost/v2/ledger/sync',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.delete('http://localhost/v2/ledger/sync', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('DELETE','http://localhost/v2/ledger/sync', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/ledger/sync");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("DELETE", "http://localhost/v2/ledger/sync", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

DELETE /v2/ledger/sync

Removes minimum sync round restriction from the ledger.

Unset the ledger sync round.

Example responses

400 Response

{
"data": {},
"message": "string"
}

Responses

StatusMeaningDescriptionSchema
200OKnoneNone
400Bad RequestSync round not set.ErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
503Service UnavailableService Temporarily UnavailableErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

WaitForBlock

Code samples

Terminal window
curl -X GET http://localhost/v2/status/wait-for-block-after/{round} \
-H 'Accept: application/json' \
-H 'X-Algo-API-Token: API_KEY'
GET http://localhost/v2/status/wait-for-block-after/{round} HTTP/1.1
Host: localhost
Accept: application/json
const headers = {
'Accept':'application/json',
'X-Algo-API-Token':'API_KEY'
};
fetch('http://localhost/v2/status/wait-for-block-after/{round}',
{
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',
'X-Algo-API-Token' => 'API_KEY'
}
result = RestClient.get 'http://localhost/v2/status/wait-for-block-after/{round}',
params: {
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'X-Algo-API-Token': 'API_KEY'
}
r = requests.get('http://localhost/v2/status/wait-for-block-after/{round}', headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'X-Algo-API-Token' => 'API_KEY',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','http://localhost/v2/status/wait-for-block-after/{round}', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("http://localhost/v2/status/wait-for-block-after/{round}");
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"},
"X-Algo-API-Token": []string{"API_KEY"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "http://localhost/v2/status/wait-for-block-after/{round}", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}

GET /v2/status/wait-for-block-after/{round}

Gets the node status after waiting for a round after the given round.

Waits for a block to appear after round {round} and returns the node’s status at the time. There is a 1 minute timeout, when reached the current status is returned regardless of whether or not it is the round after the given round.

Parameters

NameInTypeRequiredDescription
roundpathintegertrueThe round to wait until returning status

Example responses

200 Response

{
"catchpoint": "string",
"catchpoint-acquired-blocks": 0,
"catchpoint-processed-accounts": 0,
"catchpoint-processed-kvs": 0,
"catchpoint-total-accounts": 0,
"catchpoint-total-blocks": 0,
"catchpoint-total-kvs": 0,
"catchpoint-verified-accounts": 0,
"catchpoint-verified-kvs": 0,
"catchup-time": 0,
"last-catchpoint": "string",
"last-round": 0,
"last-version": "string",
"next-version": "string",
"next-version-round": 0,
"next-version-supported": true,
"stopped-at-unsupported-round": true,
"time-since-last-round": 0,
"upgrade-delay": 0,
"upgrade-next-protocol-vote-before": 0,
"upgrade-no-votes": 0,
"upgrade-node-vote": true,
"upgrade-vote-rounds": 0,
"upgrade-votes": 0,
"upgrade-votes-required": 0,
"upgrade-yes-votes": 0
}

Responses

StatusMeaningDescriptionSchema
200OKnoneInline
400Bad RequestBad Request — number must be non-negative integerErrorResponse
401UnauthorizedInvalid API TokenErrorResponse
500Internal Server ErrorInternal ErrorErrorResponse
503Service UnavailableService Temporarily UnavailableErrorResponse
defaultDefaultUnknown ErrorNone

Response Schema

Status Code 200

NodeStatus contains the information about a node status

NameTypeRequiredRestrictionsDescription
» catchpointstringfalsenoneThe current catchpoint that is being caught up to
» catchpoint-acquired-blocksintegerfalsenoneThe number of blocks that have already been obtained by the node as part of the catchup
» catchpoint-processed-accountsintegerfalsenoneThe number of accounts from the current catchpoint that have been processed so far as part of the catchup
» catchpoint-processed-kvsintegerfalsenoneThe number of key-values (KVs) from the current catchpoint that have been processed so far as part of the catchup
» catchpoint-total-accountsintegerfalsenoneThe total number of accounts included in the current catchpoint
» catchpoint-total-blocksintegerfalsenoneThe total number of blocks that are required to complete the current catchpoint catchup
» catchpoint-total-kvsintegerfalsenoneThe total number of key-values (KVs) included in the current catchpoint
» catchpoint-verified-accountsintegerfalsenoneThe number of accounts from the current catchpoint that have been verified so far as part of the catchup
» catchpoint-verified-kvsintegerfalsenoneThe number of key-values (KVs) from the current catchpoint that have been verified so far as part of the catchup
» catchup-timeintegertruenoneCatchupTime in nanoseconds
» last-catchpointstringfalsenoneThe last catchpoint seen by the node
» last-roundintegertruenoneLastRound indicates the last round seen
» last-versionstringtruenoneLastVersion indicates the last consensus version supported
» next-versionstringtruenoneNextVersion of consensus protocol to use
» next-version-roundintegertruenoneNextVersionRound is the round at which the next consensus version will apply
» next-version-supportedbooleantruenoneNextVersionSupported indicates whether the next consensus version is supported by this node
» stopped-at-unsupported-roundbooleantruenoneStoppedAtUnsupportedRound indicates that the node does not support the new rounds and has stopped making progress
» time-since-last-roundintegertruenoneTimeSinceLastRound in nanoseconds
» upgrade-delayintegerfalsenoneUpgrade delay
» upgrade-next-protocol-vote-beforeintegerfalsenoneNext protocol round
» upgrade-no-votesintegerfalsenoneNo votes cast for consensus upgrade
» upgrade-node-votebooleanfalsenoneThis node’s upgrade vote
» upgrade-vote-roundsintegerfalsenoneTotal voting rounds for current upgrade
» upgrade-votesintegerfalsenoneTotal votes cast for consensus upgrade
» upgrade-votes-requiredintegerfalsenoneYes votes required for consensus upgrade
» upgrade-yes-votesintegerfalsenoneYes votes cast for consensus upgrade

Schemas

Account

{
"address": "string",
"amount": 0,
"amount-without-pending-rewards": 0,
"apps-local-state": [
{
"id": 0,
"key-value": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
],
"schema": {
"num-byte-slice": 0,
"num-uint": 0
}
}
],
"apps-total-extra-pages": 0,
"apps-total-schema": {
"num-byte-slice": 0,
"num-uint": 0
},
"assets": [
{
"amount": 0,
"asset-id": 0,
"is-frozen": true
}
],
"auth-addr": "string",
"created-apps": [
{
"id": 0,
"params": {
"approval-program": "string",
"clear-state-program": "string",
"creator": "string",
"extra-program-pages": 0,
"global-state": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
],
"global-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
},
"local-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
}
}
}
],
"created-assets": [
{
"index": 0,
"params": {
"clawback": "string",
"creator": "string",
"decimals": 19,
"default-frozen": true,
"freeze": "string",
"manager": "string",
"metadata-hash": "string",
"name": "string",
"name-b64": "string",
"reserve": "string",
"total": 0,
"unit-name": "string",
"unit-name-b64": "string",
"url": "string",
"url-b64": "string"
}
}
],
"incentive-eligible": true,
"last-heartbeat": 0,
"last-proposed": 0,
"min-balance": 0,
"participation": {
"selection-participation-key": "string",
"state-proof-key": "string",
"vote-first-valid": 0,
"vote-key-dilution": 0,
"vote-last-valid": 0,
"vote-participation-key": "string"
},
"pending-rewards": 0,
"reward-base": 0,
"rewards": 0,
"round": 0,
"sig-type": "sig",
"status": "string",
"total-apps-opted-in": 0,
"total-assets-opted-in": 0,
"total-box-bytes": 0,
"total-boxes": 0,
"total-created-apps": 0,
"total-created-assets": 0
}

Account information at a given round.

Definition: data/basics/userBalance.go : AccountData

Properties

NameTypeRequiredRestrictionsDescription
addressstringtruenonethe account public key
amountintegertruenone[algo] total number of MicroAlgos in the account
amount-without-pending-rewardsintegertruenonespecifies the amount of MicroAlgos in the account, without the pending rewards.
apps-local-state[ApplicationLocalState]falsenone[appl] applications local data stored in this account.

Note the raw object uses map[int] -> AppLocalState for this type.
apps-total-extra-pagesintegerfalsenone[teap] the sum of all extra application program pages for this account.
apps-total-schemaApplicationStateSchemafalsenoneSpecifies maximums on the number of each type that may be stored.
assets[AssetHolding]falsenone[asset] assets held by this account.

Note the raw object uses map[int] -> AssetHolding for this type.
auth-addrstringfalsenone[spend] the address against which signing should be checked. If empty, the address of the current account is used. This field can be updated in any transaction by setting the RekeyTo field.
created-apps[Application]falsenone[appp] parameters of applications created by this account including app global data.

Note: the raw account uses map[int] -> AppParams for this type.
created-assets[Asset]falsenone[apar] parameters of assets created by this account.

Note: the raw account uses map[int] -> Asset for this type.
incentive-eligiblebooleanfalsenoneWhether or not the account can receive block incentives if its balance is in range at proposal time.
last-heartbeatintegerfalsenoneThe round in which this account last went online, or explicitly renewed their online status.
last-proposedintegerfalsenoneThe round in which this account last proposed the block.
min-balanceintegertruenoneMicroAlgo balance required by the account.

The requirement grows based on asset and application usage.
participationAccountParticipationfalsenoneAccountParticipation describes the parameters used by this account in consensus protocol.
pending-rewardsintegertruenoneamount of MicroAlgos of pending rewards in this account.
reward-baseintegerfalsenone[ebase] used as part of the rewards computation. Only applicable to accounts which are participating.
rewardsintegertruenone[ern] total rewards of MicroAlgos the account has received, including pending rewards.
roundintegertruenoneThe round for which this information is relevant.
sig-typestringfalsenoneIndicates what type of signature is used by this account, must be one of:
* sig
* msig
* lsig
statusstringtruenone[onl] delegation status of the account’s MicroAlgos
* Offline - indicates that the associated account is delegated.
* Online - indicates that the associated account used as part of the delegation pool.
* NotParticipating - indicates that the associated account is neither a delegator nor a delegate.
total-apps-opted-inintegertruenoneThe count of all applications that have been opted in, equivalent to the count of application local data (AppLocalState objects) stored in this account.
total-assets-opted-inintegertruenoneThe count of all assets that have been opted in, equivalent to the count of AssetHolding objects held by this account.
total-box-bytesintegerfalsenone[tbxb] The total number of bytes used by this account’s app’s box keys and values.
total-boxesintegerfalsenone[tbx] The number of existing boxes created by this account’s app.
total-created-appsintegertruenoneThe count of all apps (AppParams objects) created by this account.
total-created-assetsintegertruenoneThe count of all assets (AssetParams objects) created by this account.

Enumerated Values

PropertyValue
sig-typesig
sig-typemsig
sig-typelsig

AccountAssetHolding

{
"asset-holding": {
"amount": 0,
"asset-id": 0,
"is-frozen": true
},
"asset-params": {
"clawback": "string",
"creator": "string",
"decimals": 19,
"default-frozen": true,
"freeze": "string",
"manager": "string",
"metadata-hash": "string",
"name": "string",
"name-b64": "string",
"reserve": "string",
"total": 0,
"unit-name": "string",
"unit-name-b64": "string",
"url": "string",
"url-b64": "string"
}
}

AccountAssetHolding describes the account’s asset holding and asset parameters (if either exist) for a specific asset ID.

Properties

NameTypeRequiredRestrictionsDescription
asset-holdingAssetHoldingtruenoneDescribes an asset held by an account.

Definition:
data/basics/userBalance.go : AssetHolding
asset-paramsAssetParamsfalsenoneAssetParams specifies the parameters for an asset.

[apar] when part of an AssetConfig transaction.

Definition:
data/transactions/asset.go : AssetParams

AccountParticipation

{
"selection-participation-key": "string",
"state-proof-key": "string",
"vote-first-valid": 0,
"vote-key-dilution": 0,
"vote-last-valid": 0,
"vote-participation-key": "string"
}

AccountParticipation describes the parameters used by this account in consensus protocol.

Properties

NameTypeRequiredRestrictionsDescription
selection-participation-keystring(byte)truenone[sel] Selection public key (if any) currently registered for this round.
state-proof-keystring(byte)falsenone[stprf] Root of the state proof key (if any)
vote-first-validintegertruenone[voteFst] First round for which this participation is valid.
vote-key-dilutionintegertruenone[voteKD] Number of subkeys in each batch of participation keys.
vote-last-validintegertruenone[voteLst] Last round for which this participation is valid.
vote-participation-keystring(byte)truenone[vote] root participation public key (if any) currently registered for this round.

AccountStateDelta

{
"address": "string",
"delta": [
{
"key": "string",
"value": {
"action": 0,
"bytes": "string",
"uint": 0
}
}
]
}

Application state delta.

Properties

NameTypeRequiredRestrictionsDescription
addressstringtruenonenone
deltaStateDeltatruenoneApplication state delta.

AppCallLogs

{
"application-index": 0,
"logs": [
"string"
],
"txId": "string"
}

The logged messages from an app call along with the app ID and outer transaction ID. Logs appear in the same order that they were emitted.

Properties

NameTypeRequiredRestrictionsDescription
application-indexintegertruenoneThe application from which the logs were generated
logs[string]truenoneAn array of logs
txIdstringtruenoneThe transaction ID of the outer app call that lead to these logs

Application

{
"id": 0,
"params": {
"approval-program": "string",
"clear-state-program": "string",
"creator": "string",
"extra-program-pages": 0,
"global-state": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
],
"global-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
},
"local-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
}
}
}

Application index and its parameters

Properties

NameTypeRequiredRestrictionsDescription
idintegertruenone[appidx] application index.
paramsApplicationParamstruenoneStores the global information associated with an application.

ApplicationInitialStates

{
"app-boxes": {
"account": "string",
"kvs": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
]
},
"app-globals": {
"account": "string",
"kvs": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
]
},
"app-locals": [
{
"account": "string",
"kvs": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
]
}
],
"id": 0
}

An application’s initial global/local/box states that were accessed during simulation.

Properties

NameTypeRequiredRestrictionsDescription
app-boxesApplicationKVStoragefalsenoneAn application’s global/local/box state.
app-globalsApplicationKVStoragefalsenoneAn application’s global/local/box state.
app-locals[ApplicationKVStorage]falsenoneAn application’s initial local states tied to different accounts.
idintegertruenoneApplication index.

ApplicationKVStorage

{
"account": "string",
"kvs": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
]
}

An application’s global/local/box state.

Properties

NameTypeRequiredRestrictionsDescription
accountstringfalsenoneThe address of the account associated with the local state.
kvs[AvmKeyValue]truenoneKey-Value pairs representing application states.

ApplicationLocalReference

{
"account": "string",
"app": 0
}

References an account’s local state for an application.

Properties

NameTypeRequiredRestrictionsDescription
accountstringtruenoneAddress of the account with the local state.
appintegertruenoneApplication ID of the local state application.

ApplicationLocalState

{
"id": 0,
"key-value": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
],
"schema": {
"num-byte-slice": 0,
"num-uint": 0
}
}

Stores local state associated with an application.

Properties

NameTypeRequiredRestrictionsDescription
idintegertruenoneThe application which this local state is for.
key-valueTealKeyValueStorefalsenoneRepresents a key-value store for use in an application.
schemaApplicationStateSchematruenoneSpecifies maximums on the number of each type that may be stored.

ApplicationParams

{
"approval-program": "string",
"clear-state-program": "string",
"creator": "string",
"extra-program-pages": 0,
"global-state": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
],
"global-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
},
"local-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
}
}

Stores the global information associated with an application.

Properties

NameTypeRequiredRestrictionsDescription
approval-programstring(byte)truenone[approv] approval program.
clear-state-programstring(byte)truenone[clearp] approval program.
creatorstringtruenoneThe address that created this application. This is the address where the parameters and global state for this application can be found.
extra-program-pagesintegerfalsenone[epp] the amount of extra program pages available to this app.
global-stateTealKeyValueStorefalsenoneRepresents a key-value store for use in an application.
global-state-schemaApplicationStateSchemafalsenoneSpecifies maximums on the number of each type that may be stored.
local-state-schemaApplicationStateSchemafalsenoneSpecifies maximums on the number of each type that may be stored.

ApplicationStateOperation

{
"account": "string",
"app-state-type": "string",
"key": "string",
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"operation": "string"
}

An operation against an application’s global/local/box state.

Properties

NameTypeRequiredRestrictionsDescription
accountstringfalsenoneFor local state changes, the address of the account associated with the local state.
app-state-typestringtruenoneType of application state. Value g is global state, l is local state, b is boxes.
keystring(byte)truenoneThe key (name) of the global/local/box state.
new-valueAvmValuefalsenoneRepresents an AVM value.
operationstringtruenoneOperation type. Value w is write, d is delete.

ApplicationStateSchema

{
"num-byte-slice": 0,
"num-uint": 0
}

Specifies maximums on the number of each type that may be stored.

Properties

NameTypeRequiredRestrictionsDescription
num-byte-sliceintegertruenone[nbs] num of byte slices.
num-uintintegertruenone[nui] num of uints.

Asset

{
"index": 0,
"params": {
"clawback": "string",
"creator": "string",
"decimals": 19,
"default-frozen": true,
"freeze": "string",
"manager": "string",
"metadata-hash": "string",
"name": "string",
"name-b64": "string",
"reserve": "string",
"total": 0,
"unit-name": "string",
"unit-name-b64": "string",
"url": "string",
"url-b64": "string"
}
}

Specifies both the unique identifier and the parameters for an asset

Properties

NameTypeRequiredRestrictionsDescription
indexintegertruenoneunique asset identifier
paramsAssetParamstruenoneAssetParams specifies the parameters for an asset.

[apar] when part of an AssetConfig transaction.

Definition:
data/transactions/asset.go : AssetParams

AssetHolding

{
"amount": 0,
"asset-id": 0,
"is-frozen": true
}

Describes an asset held by an account.

Definition: data/basics/userBalance.go : AssetHolding

Properties

NameTypeRequiredRestrictionsDescription
amountintegertruenone[a] number of units held.
asset-idintegertruenoneAsset ID of the holding.
is-frozenbooleantruenone[f] whether or not the holding is frozen.

AssetHoldingReference

{
"account": "string",
"asset": 0
}

References an asset held by an account.

Properties

NameTypeRequiredRestrictionsDescription
accountstringtruenoneAddress of the account holding the asset.
assetintegertruenoneAsset ID of the holding.

AssetParams

{
"clawback": "string",
"creator": "string",
"decimals": 19,
"default-frozen": true,
"freeze": "string",
"manager": "string",
"metadata-hash": "string",
"name": "string",
"name-b64": "string",
"reserve": "string",
"total": 0,
"unit-name": "string",
"unit-name-b64": "string",
"url": "string",
"url-b64": "string"
}

AssetParams specifies the parameters for an asset.

[apar] when part of an AssetConfig transaction.

Definition: data/transactions/asset.go : AssetParams

Properties

NameTypeRequiredRestrictionsDescription
clawbackstringfalsenone[c] Address of account used to clawback holdings of this asset. If empty, clawback is not permitted.
creatorstringtruenoneThe address that created this asset. This is the address where the parameters for this asset can be found, and also the address where unwanted asset units can be sent in the worst case.
decimalsintegertruenone[dc] The number of digits to use after the decimal point when displaying this asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in tenths. If 2, the base unit of the asset is in hundredths, and so on. This value must be between 0 and 19 (inclusive).
default-frozenbooleanfalsenone[df] Whether holdings of this asset are frozen by default.
freezestringfalsenone[f] Address of account used to freeze holdings of this asset. If empty, freezing is not permitted.
managerstringfalsenone[m] Address of account used to manage the keys of this asset and to destroy it.
metadata-hashstring(byte)falsenone[am] A commitment to some unspecified asset metadata. The format of this metadata is up to the application.
namestringfalsenone[an] Name of this asset, as supplied by the creator. Included only when the asset name is composed of printable utf-8 characters.
name-b64string(byte)falsenoneBase64 encoded name of this asset, as supplied by the creator.
reservestringfalsenone[r] Address of account holding reserve (non-minted) units of this asset.
totalintegertruenone[t] The total number of units of this asset.
unit-namestringfalsenone[un] Name of a unit of this asset, as supplied by the creator. Included only when the name of a unit of this asset is composed of printable utf-8 characters.
unit-name-b64string(byte)falsenoneBase64 encoded name of a unit of this asset, as supplied by the creator.
urlstringfalsenone[au] URL where more information about the asset can be retrieved. Included only when the URL is composed of printable utf-8 characters.
url-b64string(byte)falsenoneBase64 encoded URL where more information about the asset can be retrieved.

AvmKeyValue

{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}

Represents an AVM key-value pair in an application store.

Properties

NameTypeRequiredRestrictionsDescription
keystring(byte)truenonenone
valueAvmValuetruenoneRepresents an AVM value.

AvmValue

{
"bytes": "string",
"type": 0,
"uint": 0
}

Represents an AVM value.

Properties

NameTypeRequiredRestrictionsDescription
bytesstring(byte)falsenonebytes value.
typeintegertruenonevalue type. Value 1 refers to bytes, value 2 refers to uint64
uintintegerfalsenoneuint value.

Box

{
"name": "string",
"round": 0,
"value": "string"
}

Box name and its content.

Properties

NameTypeRequiredRestrictionsDescription
namestring(byte)truenoneThe box name, base64 encoded
roundintegerfalsenoneThe round for which this information is relevant
valuestring(byte)truenoneThe box value, base64 encoded.

BoxReference

{
"app": 0,
"name": "string"
}

References a box of an application.

Properties

NameTypeRequiredRestrictionsDescription
appintegertruenoneApplication ID which this box belongs to
namestring(byte)truenoneBase64 encoded box name

BuildVersion

{
"branch": "string",
"build_number": 0,
"channel": "string",
"commit_hash": "string",
"major": 0,
"minor": 0
}

BuildVersion contains the current algod build version information.

Properties

NameTypeRequiredRestrictionsDescription
branchstringtruenonenone
build_numberinteger(int64)truenonenone
channelstringtruenonenone
commit_hashstringtruenonenone
majorinteger(int64)truenonenone
minorinteger(int64)truenonenone

DebugSettingsProf

{
"block-rate": 1000,
"mutex-rate": 1000
}

algod mutex and blocking profiling state.

Properties

NameTypeRequiredRestrictionsDescription
block-rateintegerfalsenoneThe rate of blocking events. The profiler aims to sample an average of one blocking event per rate nanoseconds spent blocked. To turn off profiling entirely, pass rate 0.
mutex-rateintegerfalsenoneThe rate of mutex events. On average 1/rate events are reported. To turn off profiling entirely, pass rate 0

DryrunRequest

{
"accounts": [
{
"address": "string",
"amount": 0,
"amount-without-pending-rewards": 0,
"apps-local-state": [
{
"id": 0,
"key-value": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
],
"schema": {
"num-byte-slice": 0,
"num-uint": 0
}
}
],
"apps-total-extra-pages": 0,
"apps-total-schema": {
"num-byte-slice": 0,
"num-uint": 0
},
"assets": [
{
"amount": 0,
"asset-id": 0,
"is-frozen": true
}
],
"auth-addr": "string",
"created-apps": [
{
"id": 0,
"params": {
"approval-program": "string",
"clear-state-program": "string",
"creator": "string",
"extra-program-pages": 0,
"global-state": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
],
"global-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
},
"local-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
}
}
}
],
"created-assets": [
{
"index": 0,
"params": {
"clawback": "string",
"creator": "string",
"decimals": 19,
"default-frozen": true,
"freeze": "string",
"manager": "string",
"metadata-hash": "string",
"name": "string",
"name-b64": "string",
"reserve": "string",
"total": 0,
"unit-name": "string",
"unit-name-b64": "string",
"url": "string",
"url-b64": "string"
}
}
],
"incentive-eligible": true,
"last-heartbeat": 0,
"last-proposed": 0,
"min-balance": 0,
"participation": {
"selection-participation-key": "string",
"state-proof-key": "string",
"vote-first-valid": 0,
"vote-key-dilution": 0,
"vote-last-valid": 0,
"vote-participation-key": "string"
},
"pending-rewards": 0,
"reward-base": 0,
"rewards": 0,
"round": 0,
"sig-type": "sig",
"status": "string",
"total-apps-opted-in": 0,
"total-assets-opted-in": 0,
"total-box-bytes": 0,
"total-boxes": 0,
"total-created-apps": 0,
"total-created-assets": 0
}
],
"apps": [
{
"id": 0,
"params": {
"approval-program": "string",
"clear-state-program": "string",
"creator": "string",
"extra-program-pages": 0,
"global-state": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
],
"global-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
},
"local-state-schema": {
"num-byte-slice": 0,
"num-uint": 0
}
}
}
],
"latest-timestamp": 0,
"protocol-version": "string",
"round": 0,
"sources": [
{
"app-index": 0,
"field-name": "string",
"source": "string",
"txn-index": 0
}
],
"txns": [
"string"
]
}

Request data type for dryrun endpoint. Given the Transactions and simulated ledger state upload, run TEAL scripts and return debugging information.

Properties

NameTypeRequiredRestrictionsDescription
accounts[Account]truenone[Account information at a given round.

Definition:
data/basics/userBalance.go : AccountData
]
apps[Application]truenone[Application index and its parameters]
latest-timestampinteger(int64)truenoneLatestTimestamp is available to some TEAL scripts. Defaults to the latest confirmed timestamp this algod is attached to.
protocol-versionstringtruenoneProtocolVersion specifies a specific version string to operate under, otherwise whatever the current protocol of the network this algod is running in.
roundintegertruenoneRound is available to some TEAL scripts. Defaults to the current round on the network this algod is attached to.
sources[DryrunSource]truenone[DryrunSource is TEAL source text that gets uploaded, compiled, and inserted into transactions or application state.]
txns[string]truenonenone

DryrunSource

{
"app-index": 0,
"field-name": "string",
"source": "string",
"txn-index": 0
}

DryrunSource is TEAL source text that gets uploaded, compiled, and inserted into transactions or application state.

Properties

NameTypeRequiredRestrictionsDescription
app-indexintegertruenonenone
field-namestringtruenoneFieldName is what kind of sources this is. If lsig then it goes into the transactions[this.TxnIndex].LogicSig. If approv or clearp it goes into the Approval Program or Clear State Program of application[this.AppIndex].
sourcestringtruenonenone
txn-indexintegertruenonenone

DryrunState

{
"error": "string",
"line": 0,
"pc": 0,
"scratch": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
]
}

Stores the TEAL eval step data

Properties

NameTypeRequiredRestrictionsDescription
errorstringfalsenoneEvaluation error if any
lineintegertruenoneLine number
pcintegertruenoneProgram counter
scratch[TealValue]falsenone[Represents a TEAL value.]
stack[TealValue]truenone[Represents a TEAL value.]

DryrunTxnResult

{
"app-call-messages": [
"string"
],
"app-call-trace": [
{
"error": "string",
"line": 0,
"pc": 0,
"scratch": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
]
}
],
"budget-added": 0,
"budget-consumed": 0,
"disassembly": [
"string"
],
"global-delta": [
{
"key": "string",
"value": {
"action": 0,
"bytes": "string",
"uint": 0
}
}
],
"local-deltas": [
{
"address": "string",
"delta": [
{
"key": "string",
"value": {
"action": 0,
"bytes": "string",
"uint": 0
}
}
]
}
],
"logic-sig-disassembly": [
"string"
],
"logic-sig-messages": [
"string"
],
"logic-sig-trace": [
{
"error": "string",
"line": 0,
"pc": 0,
"scratch": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
]
}
],
"logs": [
"string"
]
}

DryrunTxnResult contains any LogicSig or ApplicationCall program debug information and state updates from a dryrun.

Properties

NameTypeRequiredRestrictionsDescription
app-call-messages[string]falsenonenone
app-call-trace[DryrunState]falsenone[Stores the TEAL eval step data]
budget-addedintegerfalsenoneBudget added during execution of app call transaction.
budget-consumedintegerfalsenoneBudget consumed during execution of app call transaction.
disassembly[string]truenoneDisassembled program line by line.
global-deltaStateDeltafalsenoneApplication state delta.
local-deltas[AccountStateDelta]falsenone[Application state delta.]
logic-sig-disassembly[string]falsenoneDisassembled lsig program line by line.
logic-sig-messages[string]falsenonenone
logic-sig-trace[DryrunState]falsenone[Stores the TEAL eval step data]
logs[string]falsenonenone

ErrorResponse

{
"data": {},
"message": "string"
}

An error response with optional data field.

Properties

NameTypeRequiredRestrictionsDescription
dataobjectfalsenonenone
messagestringtruenonenone

EvalDelta

{
"action": 0,
"bytes": "string",
"uint": 0
}

Represents a TEAL value delta.

Properties

NameTypeRequiredRestrictionsDescription
actionintegertruenone[at] delta action.
bytesstringfalsenone[bs] bytes value.
uintintegerfalsenone[ui] uint value.

EvalDeltaKeyValue

{
"key": "string",
"value": {
"action": 0,
"bytes": "string",
"uint": 0
}
}

Key-value pairs for StateDelta.

Properties

NameTypeRequiredRestrictionsDescription
keystringtruenonenone
valueEvalDeltatruenoneRepresents a TEAL value delta.

LedgerStateDelta

{}

Ledger StateDelta object

Properties

None

LedgerStateDeltaForTransactionGroup

{
"Delta": {},
"Ids": [
"string"
]
}

Contains a ledger delta for a single transaction group

Properties

NameTypeRequiredRestrictionsDescription
DeltaLedgerStateDeltatruenoneLedger StateDelta object
Ids[string]truenonenone

LightBlockHeaderProof

{
"index": 0,
"proof": "string",
"treedepth": 0
}

Proof of membership and position of a light block header.

Properties

NameTypeRequiredRestrictionsDescription
indexintegertruenoneThe index of the light block header in the vector commitment tree
proofstring(byte)truenoneThe encoded proof.
treedepthintegertruenoneRepresents the depth of the tree that is being proven, i.e. the number of edges from a leaf to the root.

ParticipationKey

{
"address": "string",
"effective-first-valid": 0,
"effective-last-valid": 0,
"id": "string",
"key": {
"selection-participation-key": "string",
"state-proof-key": "string",
"vote-first-valid": 0,
"vote-key-dilution": 0,
"vote-last-valid": 0,
"vote-participation-key": "string"
},
"last-block-proposal": 0,
"last-state-proof": 0,
"last-vote": 0
}

Represents a participation key used by the node.

Properties

NameTypeRequiredRestrictionsDescription
addressstringtruenoneAddress the key was generated for.
effective-first-validintegerfalsenoneWhen registered, this is the first round it may be used.
effective-last-validintegerfalsenoneWhen registered, this is the last round it may be used.
idstringtruenoneThe key’s ParticipationID.
keyAccountParticipationtruenoneAccountParticipation describes the parameters used by this account in consensus protocol.
last-block-proposalintegerfalsenoneRound when this key was last used to propose a block.
last-state-proofintegerfalsenoneRound when this key was last used to generate a state proof.
last-voteintegerfalsenoneRound when this key was last used to vote.

PendingTransactionResponse

{
"application-index": 0,
"asset-closing-amount": 0,
"asset-index": 0,
"close-rewards": 0,
"closing-amount": 0,
"confirmed-round": 0,
"global-state-delta": [
{
"key": "string",
"value": {
"action": 0,
"bytes": "string",
"uint": 0
}
}
],
"inner-txns": [
{
"application-index": 0,
"asset-closing-amount": 0,
"asset-index": 0,
"close-rewards": 0,
"closing-amount": 0,
"confirmed-round": 0,
"global-state-delta": [
{
"key": "string",
"value": {
"action": 0,
"bytes": "string",
"uint": 0
}
}
],
"inner-txns": [],
"local-state-delta": [
{
"address": "string",
"delta": [
{
"key": "string",
"value": {
"action": 0,
"bytes": "string",
"uint": 0
}
}
]
}
],
"logs": [
"string"
],
"pool-error": "string",
"receiver-rewards": 0,
"sender-rewards": 0,
"txn": {}
}
],
"local-state-delta": [
{
"address": "string",
"delta": [
{
"key": "string",
"value": {
"action": 0,
"bytes": "string",
"uint": 0
}
}
]
}
],
"logs": [
"string"
],
"pool-error": "string",
"receiver-rewards": 0,
"sender-rewards": 0,
"txn": {}
}

Details about a pending transaction. If the transaction was recently confirmed, includes confirmation details like the round and reward details.

Properties

NameTypeRequiredRestrictionsDescription
application-indexintegerfalsenoneThe application index if the transaction was found and it created an application.
asset-closing-amountintegerfalsenoneThe number of the asset’s unit that were transferred to the close-to address.
asset-indexintegerfalsenoneThe asset index if the transaction was found and it created an asset.
close-rewardsintegerfalsenoneRewards in microalgos applied to the close remainder to account.
closing-amountintegerfalsenoneClosing amount for the transaction.
confirmed-roundintegerfalsenoneThe round where this transaction was confirmed, if present.
global-state-deltaStateDeltafalsenoneApplication state delta.
inner-txns[PendingTransactionResponse]falsenoneInner transactions produced by application execution.
local-state-delta[AccountStateDelta]falsenoneLocal state key/value changes for the application being executed by this transaction.
logs[string]falsenoneLogs for the application being executed by this transaction.
pool-errorstringtruenoneIndicates that the transaction was kicked out of this node’s transaction pool (and specifies why that happened). An empty string indicates the transaction wasn’t kicked out of this node’s txpool due to an error.
receiver-rewardsintegerfalsenoneRewards in microalgos applied to the receiver account.
sender-rewardsintegerfalsenoneRewards in microalgos applied to the sender account.
txnobjecttruenoneThe raw signed transaction.

ScratchChange

{
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"slot": 0
}

A write operation into a scratch slot.

Properties

NameTypeRequiredRestrictionsDescription
new-valueAvmValuetruenoneRepresents an AVM value.
slotintegertruenoneThe scratch slot written.

SimulateInitialStates

{
"app-initial-states": [
{
"app-boxes": {
"account": "string",
"kvs": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
]
},
"app-globals": {
"account": "string",
"kvs": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
]
},
"app-locals": [
{
"account": "string",
"kvs": [
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
]
}
],
"id": 0
}
]
}

Initial states of resources that were accessed during simulation.

Properties

NameTypeRequiredRestrictionsDescription
app-initial-states[ApplicationInitialStates]falsenoneThe initial states of accessed application before simulation. The order of this array is arbitrary.

SimulateRequest

{
"allow-empty-signatures": true,
"allow-more-logging": true,
"allow-unnamed-resources": true,
"exec-trace-config": {
"enable": true,
"scratch-change": true,
"stack-change": true,
"state-change": true
},
"extra-opcode-budget": 0,
"fix-signers": true,
"round": 0,
"txn-groups": [
{
"txns": [
"string"
]
}
]
}

Request type for simulation endpoint.

Properties

NameTypeRequiredRestrictionsDescription
allow-empty-signaturesbooleanfalsenoneAllows transactions without signatures to be simulated as if they had correct signatures.
allow-more-loggingbooleanfalsenoneLifts limits on log opcode usage during simulation.
allow-unnamed-resourcesbooleanfalsenoneAllows access to unnamed resources during simulation.
exec-trace-configSimulateTraceConfigfalsenoneAn object that configures simulation execution trace.
extra-opcode-budgetintegerfalsenoneApplies extra opcode budget during simulation for each transaction group.
fix-signersbooleanfalsenoneIf true, signers for transactions that are missing signatures will be fixed during evaluation.
roundintegerfalsenoneIf provided, specifies the round preceding the simulation. State changes through this round will be used to run this simulation. Usually only the 4 most recent rounds will be available (controlled by the node config value MaxAcctLookback). If not specified, defaults to the latest available round.
txn-groups[SimulateRequestTransactionGroup]truenoneThe transaction groups to simulate.

SimulateRequestTransactionGroup

{
"txns": [
"string"
]
}

A transaction group to simulate.

Properties

NameTypeRequiredRestrictionsDescription
txns[string]truenoneAn atomic transaction group.

SimulateTraceConfig

{
"enable": true,
"scratch-change": true,
"stack-change": true,
"state-change": true
}

An object that configures simulation execution trace.

Properties

NameTypeRequiredRestrictionsDescription
enablebooleanfalsenoneA boolean option for opting in execution trace features simulation endpoint.
scratch-changebooleanfalsenoneA boolean option enabling returning scratch slot changes together with execution trace during simulation.
stack-changebooleanfalsenoneA boolean option enabling returning stack changes together with execution trace during simulation.
state-changebooleanfalsenoneA boolean option enabling returning application state changes (global, local, and box changes) with the execution trace during simulation.

SimulateTransactionGroupResult

{
"app-budget-added": 0,
"app-budget-consumed": 0,
"failed-at": [
0
],
"failure-message": "string",
"txn-results": [
{
"app-budget-consumed": 0,
"exec-trace": {
"approval-program-hash": "string",
"approval-program-trace": [
{
"pc": 0,
"scratch-changes": [
{
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"slot": 0
}
],
"spawned-inners": [
0
],
"stack-additions": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack-pop-count": 0,
"state-changes": [
{
"account": "string",
"app-state-type": "string",
"key": "string",
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"operation": "string"
}
]
}
],
"clear-state-program-hash": "string",
"clear-state-program-trace": [
{
"pc": 0,
"scratch-changes": [
{
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"slot": 0
}
],
"spawned-inners": [
0
],
"stack-additions": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack-pop-count": 0,
"state-changes": [
{
"account": "string",
"app-state-type": "string",
"key": "string",
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"operation": "string"
}
]
}
],
"clear-state-rollback": true,
"clear-state-rollback-error": "string",
"inner-trace": [
{}
],
"logic-sig-hash": "string",
"logic-sig-trace": [
{
"pc": 0,
"scratch-changes": [
{
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"slot": 0
}
],
"spawned-inners": [
0
],
"stack-additions": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack-pop-count": 0,
"state-changes": [
{
"account": "string",
"app-state-type": "string",
"key": "string",
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"operation": "string"
}
]
}
]
},
"fixed-signer": "string",
"logic-sig-budget-consumed": 0,
"txn-result": {
"application-index": 0,
"asset-closing-amount": 0,
"asset-index": 0,
"close-rewards": 0,
"closing-amount": 0,
"confirmed-round": 0,
"global-state-delta": [
{
"key": "string",
"value": {
"action": 0,
"bytes": "string",
"uint": 0
}
}
],
"inner-txns": [
{}
],
"local-state-delta": [
{
"address": "string",
"delta": [
{
"key": "string",
"value": {
"action": 0,
"bytes": "string",
"uint": 0
}
}
]
}
],
"logs": [
"string"
],
"pool-error": "string",
"receiver-rewards": 0,
"sender-rewards": 0,
"txn": {}
},
"unnamed-resources-accessed": {
"accounts": [
"string"
],
"app-locals": [
{
"account": "string",
"app": 0
}
],
"apps": [
0
],
"asset-holdings": [
{
"account": "string",
"asset": 0
}
],
"assets": [
0
],
"boxes": [
{
"app": 0,
"name": "string"
}
],
"extra-box-refs": 0
}
}
],
"unnamed-resources-accessed": {
"accounts": [
"string"
],
"app-locals": [
{
"account": "string",
"app": 0
}
],
"apps": [
0
],
"asset-holdings": [
{
"account": "string",
"asset": 0
}
],
"assets": [
0
],
"boxes": [
{
"app": 0,
"name": "string"
}
],
"extra-box-refs": 0
}
}

Simulation result for an atomic transaction group

Properties

NameTypeRequiredRestrictionsDescription
app-budget-addedintegerfalsenoneTotal budget added during execution of app calls in the transaction group.
app-budget-consumedintegerfalsenoneTotal budget consumed during execution of app calls in the transaction group.
failed-at[integer]falsenoneIf present, indicates which transaction in this group caused the failure. This array represents the path to the failing transaction. Indexes are zero based, the first element indicates the top-level transaction, and successive elements indicate deeper inner transactions.
failure-messagestringfalsenoneIf present, indicates that the transaction group failed and specifies why that happened
txn-results[SimulateTransactionResult]truenoneSimulation result for individual transactions
unnamed-resources-accessedSimulateUnnamedResourcesAccessedfalsenoneThese are resources that were accessed by this group that would normally have caused failure, but were allowed in simulation. Depending on where this object is in the response, the unnamed resources it contains may or may not qualify for group resource sharing. If this is a field in SimulateTransactionGroupResult, the resources do qualify, but if this is a field in SimulateTransactionResult, they do not qualify. In order to make this group valid for actual submission, resources that qualify for group sharing can be made available by any transaction of the group; otherwise, resources must be placed in the same transaction which accessed them.

SimulateTransactionResult

{
"app-budget-consumed": 0,
"exec-trace": {
"approval-program-hash": "string",
"approval-program-trace": [
{
"pc": 0,
"scratch-changes": [
{
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"slot": 0
}
],
"spawned-inners": [
0
],
"stack-additions": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack-pop-count": 0,
"state-changes": [
{
"account": "string",
"app-state-type": "string",
"key": "string",
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"operation": "string"
}
]
}
],
"clear-state-program-hash": "string",
"clear-state-program-trace": [
{
"pc": 0,
"scratch-changes": [
{
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"slot": 0
}
],
"spawned-inners": [
0
],
"stack-additions": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack-pop-count": 0,
"state-changes": [
{
"account": "string",
"app-state-type": "string",
"key": "string",
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"operation": "string"
}
]
}
],
"clear-state-rollback": true,
"clear-state-rollback-error": "string",
"inner-trace": [
{}
],
"logic-sig-hash": "string",
"logic-sig-trace": [
{
"pc": 0,
"scratch-changes": [
{
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"slot": 0
}
],
"spawned-inners": [
0
],
"stack-additions": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack-pop-count": 0,
"state-changes": [
{
"account": "string",
"app-state-type": "string",
"key": "string",
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"operation": "string"
}
]
}
]
},
"fixed-signer": "string",
"logic-sig-budget-consumed": 0,
"txn-result": {
"application-index": 0,
"asset-closing-amount": 0,
"asset-index": 0,
"close-rewards": 0,
"closing-amount": 0,
"confirmed-round": 0,
"global-state-delta": [
{
"key": "string",
"value": {
"action": 0,
"bytes": "string",
"uint": 0
}
}
],
"inner-txns": [
{}
],
"local-state-delta": [
{
"address": "string",
"delta": [
{
"key": "string",
"value": {
"action": 0,
"bytes": "string",
"uint": 0
}
}
]
}
],
"logs": [
"string"
],
"pool-error": "string",
"receiver-rewards": 0,
"sender-rewards": 0,
"txn": {}
},
"unnamed-resources-accessed": {
"accounts": [
"string"
],
"app-locals": [
{
"account": "string",
"app": 0
}
],
"apps": [
0
],
"asset-holdings": [
{
"account": "string",
"asset": 0
}
],
"assets": [
0
],
"boxes": [
{
"app": 0,
"name": "string"
}
],
"extra-box-refs": 0
}
}

Simulation result for an individual transaction

Properties

NameTypeRequiredRestrictionsDescription
app-budget-consumedintegerfalsenoneBudget used during execution of an app call transaction. This value includes budged used by inner app calls spawned by this transaction.
exec-traceSimulationTransactionExecTracefalsenoneThe execution trace of calling an app or a logic sig, containing the inner app call trace in a recursive way.
fixed-signerstringfalsenoneThe account that needed to sign this transaction when no signature was provided and the provided signer was incorrect.
logic-sig-budget-consumedintegerfalsenoneBudget used during execution of a logic sig transaction.
txn-resultPendingTransactionResponsetruenoneDetails about a pending transaction. If the transaction was recently confirmed, includes confirmation details like the round and reward details.
unnamed-resources-accessedSimulateUnnamedResourcesAccessedfalsenoneThese are resources that were accessed by this group that would normally have caused failure, but were allowed in simulation. Depending on where this object is in the response, the unnamed resources it contains may or may not qualify for group resource sharing. If this is a field in SimulateTransactionGroupResult, the resources do qualify, but if this is a field in SimulateTransactionResult, they do not qualify. In order to make this group valid for actual submission, resources that qualify for group sharing can be made available by any transaction of the group; otherwise, resources must be placed in the same transaction which accessed them.

SimulateUnnamedResourcesAccessed

{
"accounts": [
"string"
],
"app-locals": [
{
"account": "string",
"app": 0
}
],
"apps": [
0
],
"asset-holdings": [
{
"account": "string",
"asset": 0
}
],
"assets": [
0
],
"boxes": [
{
"app": 0,
"name": "string"
}
],
"extra-box-refs": 0
}

These are resources that were accessed by this group that would normally have caused failure, but were allowed in simulation. Depending on where this object is in the response, the unnamed resources it contains may or may not qualify for group resource sharing. If this is a field in SimulateTransactionGroupResult, the resources do qualify, but if this is a field in SimulateTransactionResult, they do not qualify. In order to make this group valid for actual submission, resources that qualify for group sharing can be made available by any transaction of the group; otherwise, resources must be placed in the same transaction which accessed them.

Properties

NameTypeRequiredRestrictionsDescription
accounts[string]falsenoneThe unnamed accounts that were referenced. The order of this array is arbitrary.
app-locals[ApplicationLocalReference]falsenoneThe unnamed application local states that were referenced. The order of this array is arbitrary.
apps[integer]falsenoneThe unnamed applications that were referenced. The order of this array is arbitrary.
asset-holdings[AssetHoldingReference]falsenoneThe unnamed asset holdings that were referenced. The order of this array is arbitrary.
assets[integer]falsenoneThe unnamed assets that were referenced. The order of this array is arbitrary.
boxes[BoxReference]falsenoneThe unnamed boxes that were referenced. The order of this array is arbitrary.
extra-box-refsintegerfalsenoneThe number of extra box references used to increase the IO budget. This is in addition to the references defined in the input transaction group and any referenced to unnamed boxes.

SimulationEvalOverrides

{
"allow-empty-signatures": true,
"allow-unnamed-resources": true,
"extra-opcode-budget": 0,
"fix-signers": true,
"max-log-calls": 0,
"max-log-size": 0
}

The set of parameters and limits override during simulation. If this set of parameters is present, then evaluation parameters may differ from standard evaluation in certain ways.

Properties

NameTypeRequiredRestrictionsDescription
allow-empty-signaturesbooleanfalsenoneIf true, transactions without signatures are allowed and simulated as if they were properly signed.
allow-unnamed-resourcesbooleanfalsenoneIf true, allows access to unnamed resources during simulation.
extra-opcode-budgetintegerfalsenoneThe extra opcode budget added to each transaction group during simulation
fix-signersbooleanfalsenoneIf true, signers for transactions that are missing signatures will be fixed during evaluation.
max-log-callsintegerfalsenoneThe maximum log calls one can make during simulation
max-log-sizeintegerfalsenoneThe maximum byte number to log during simulation

SimulationOpcodeTraceUnit

{
"pc": 0,
"scratch-changes": [
{
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"slot": 0
}
],
"spawned-inners": [
0
],
"stack-additions": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack-pop-count": 0,
"state-changes": [
{
"account": "string",
"app-state-type": "string",
"key": "string",
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"operation": "string"
}
]
}

The set of trace information and effect from evaluating a single opcode.

Properties

NameTypeRequiredRestrictionsDescription
pcintegertruenoneThe program counter of the current opcode being evaluated.
scratch-changes[ScratchChange]falsenoneThe writes into scratch slots.
spawned-inners[integer]falsenoneThe indexes of the traces for inner transactions spawned by this opcode, if any.
stack-additions[AvmValue]falsenoneThe values added by this opcode to the stack.
stack-pop-countintegerfalsenoneThe number of deleted stack values by this opcode.
state-changes[ApplicationStateOperation]falsenoneThe operations against the current application’s states.

SimulationTransactionExecTrace

{
"approval-program-hash": "string",
"approval-program-trace": [
{
"pc": 0,
"scratch-changes": [
{
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"slot": 0
}
],
"spawned-inners": [
0
],
"stack-additions": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack-pop-count": 0,
"state-changes": [
{
"account": "string",
"app-state-type": "string",
"key": "string",
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"operation": "string"
}
]
}
],
"clear-state-program-hash": "string",
"clear-state-program-trace": [
{
"pc": 0,
"scratch-changes": [
{
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"slot": 0
}
],
"spawned-inners": [
0
],
"stack-additions": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack-pop-count": 0,
"state-changes": [
{
"account": "string",
"app-state-type": "string",
"key": "string",
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"operation": "string"
}
]
}
],
"clear-state-rollback": true,
"clear-state-rollback-error": "string",
"inner-trace": [
{
"approval-program-hash": "string",
"approval-program-trace": [
{
"pc": 0,
"scratch-changes": [
{
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"slot": 0
}
],
"spawned-inners": [
0
],
"stack-additions": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack-pop-count": 0,
"state-changes": [
{
"account": "string",
"app-state-type": "string",
"key": "string",
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"operation": "string"
}
]
}
],
"clear-state-program-hash": "string",
"clear-state-program-trace": [
{
"pc": 0,
"scratch-changes": [
{
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"slot": 0
}
],
"spawned-inners": [
0
],
"stack-additions": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack-pop-count": 0,
"state-changes": [
{
"account": "string",
"app-state-type": "string",
"key": "string",
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"operation": "string"
}
]
}
],
"clear-state-rollback": true,
"clear-state-rollback-error": "string",
"inner-trace": [],
"logic-sig-hash": "string",
"logic-sig-trace": [
{
"pc": 0,
"scratch-changes": [
{
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"slot": 0
}
],
"spawned-inners": [
0
],
"stack-additions": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack-pop-count": 0,
"state-changes": [
{
"account": "string",
"app-state-type": "string",
"key": "string",
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"operation": "string"
}
]
}
]
}
],
"logic-sig-hash": "string",
"logic-sig-trace": [
{
"pc": 0,
"scratch-changes": [
{
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"slot": 0
}
],
"spawned-inners": [
0
],
"stack-additions": [
{
"bytes": "string",
"type": 0,
"uint": 0
}
],
"stack-pop-count": 0,
"state-changes": [
{
"account": "string",
"app-state-type": "string",
"key": "string",
"new-value": {
"bytes": "string",
"type": 0,
"uint": 0
},
"operation": "string"
}
]
}
]
}

The execution trace of calling an app or a logic sig, containing the inner app call trace in a recursive way.

Properties

NameTypeRequiredRestrictionsDescription
approval-program-hashstring(byte)falsenoneSHA512_256 hash digest of the approval program executed in transaction.
approval-program-trace[SimulationOpcodeTraceUnit]falsenoneProgram trace that contains a trace of opcode effects in an approval program.
clear-state-program-hashstring(byte)falsenoneSHA512_256 hash digest of the clear state program executed in transaction.
clear-state-program-trace[SimulationOpcodeTraceUnit]falsenoneProgram trace that contains a trace of opcode effects in a clear state program.
clear-state-rollbackbooleanfalsenoneIf true, indicates that the clear state program failed and any persistent state changes it produced should be reverted once the program exits.
clear-state-rollback-errorstringfalsenoneThe error message explaining why the clear state program failed. This field will only be populated if clear-state-rollback is true and the failure was due to an execution error.
inner-trace[SimulationTransactionExecTrace]falsenoneAn array of SimulationTransactionExecTrace representing the execution trace of any inner transactions executed.
logic-sig-hashstring(byte)falsenoneSHA512_256 hash digest of the logic sig executed in transaction.
logic-sig-trace[SimulationOpcodeTraceUnit]falsenoneProgram trace that contains a trace of opcode effects in a logic sig.

StateDelta

[
{
"key": "string",
"value": {
"action": 0,
"bytes": "string",
"uint": 0
}
}
]

Application state delta.

Properties

NameTypeRequiredRestrictionsDescription
anonymous[EvalDeltaKeyValue]falsenoneApplication state delta.

StateProof

{
"Message": {
"BlockHeadersCommitment": "string",
"FirstAttestedRound": 0,
"LastAttestedRound": 0,
"LnProvenWeight": 0,
"VotersCommitment": "string"
},
"StateProof": "string"
}

Represents a state proof and its corresponding message

Properties

NameTypeRequiredRestrictionsDescription
MessageStateProofMessagetruenoneRepresents the message that the state proofs are attesting to.
StateProofstring(byte)truenoneThe encoded StateProof for the message.

StateProofMessage

{
"BlockHeadersCommitment": "string",
"FirstAttestedRound": 0,
"LastAttestedRound": 0,
"LnProvenWeight": 0,
"VotersCommitment": "string"
}

Represents the message that the state proofs are attesting to.

Properties

NameTypeRequiredRestrictionsDescription
BlockHeadersCommitmentstring(byte)truenoneThe vector commitment root on all light block headers within a state proof interval.
FirstAttestedRoundintegertruenoneThe first round the message attests to.
LastAttestedRoundintegertruenoneThe last round the message attests to.
LnProvenWeightintegertruenoneAn integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof.
VotersCommitmentstring(byte)truenoneThe vector commitment root of the top N accounts to sign the next StateProof.

TealKeyValue

{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}

Represents a key-value pair in an application store.

Properties

NameTypeRequiredRestrictionsDescription
keystringtruenonenone
valueTealValuetruenoneRepresents a TEAL value.

TealKeyValueStore

[
{
"key": "string",
"value": {
"bytes": "string",
"type": 0,
"uint": 0
}
}
]

Represents a key-value store for use in an application.

Properties

NameTypeRequiredRestrictionsDescription
anonymous[TealKeyValue]falsenoneRepresents a key-value store for use in an application.

TealValue

{
"bytes": "string",
"type": 0,
"uint": 0
}

Represents a TEAL value.

Properties

NameTypeRequiredRestrictionsDescription
bytesstringtruenone[tb] bytes value.
typeintegertruenone[tt] value type. Value 1 refers to bytes, value 2 refers to uint
uintintegertruenone[ui] uint value.

Version

{
"build": {
"branch": "string",
"build_number": 0,
"channel": "string",
"commit_hash": "string",
"major": 0,
"minor": 0
},
"genesis_hash_b64": "string",
"genesis_id": "string",
"versions": [
"string"
]
}

Version contains the current algod version.

Properties

NameTypeRequiredRestrictionsDescription
buildBuildVersiontruenonenone
genesis_hash_b64string(byte)truenonenone
genesis_idstringtruenonenone
versions[string]truenonenone