Plasma-Ion developers
This website documents the public API for PlasmaPay DApp
Plasma-Ion
#To quickly test one of these apis run
curl --request POST \
--url https://localhost:8080/v1/chain/get_info \
--header 'accept: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://localhost:8080/v1/chain/get_info");
xhr.setRequestHeader("accept", "application/json");
xhr.send(data);
For the sake of simplicity we'll be connecting to an API endpoint of one of the 21 block producers. If you want a local node, install it according to the instructions. Node Setup Guide: find the producer’s public url Friedman Testnet
RPC API
Requests to Chain API use the same ionode RPC API paths and parameters
Get account
get_account
curl --request POST </span>
--url https://localhost:8080/v1/chain/get_account </span>
--header 'accept: application/json' </span>
--header 'content-type: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://localhost:8080/v1/chain/get_account");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
Response schema
Parameter | Meaning |
---|---|
String representation of Plasma-Ion name type | |
Date/time string in the format YYYY-MM-DDTHH:MM:SS.sss | |
A string representation of an Plasma-Ion symbol, composed of a float with a precision of 18, example 1.000000000000000000 ABC. | |
Plasma-Ion permissions to request from the user. | |
Name of this permission | |
Permissions authorization |
Get info
get_info
curl --request POST </span>
--url https://localhost:8080/v1/chain/get_info </span>
--header 'accept: application/json'
curl --request POST </span>
--url https://localhost:8080/v1/chain/get_info </span>
--header 'accept: application/json'
});
xhr.open("POST", "https://localhost:8080/v1/chain/get_account");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
Response schema
Parameter | Meaning |
---|---|
Hash representing the ID of the chain | |
Highest block number on the chain | |
Highest block ID on the chain | |
Producer that signed the highest block | |
Highest block number on the chain that has | |
Highest block ID on the chain that has been |
Get transaction
get_transaction
curl --request POST </span>
--url http://host/:port/v1/history/get_transaction </span>
--header 'content-type: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "http://host/:port/v1/history/get_transaction");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
This method provides a transaction history
Push transaction
push_transaction
curl --request POST </span>
--url https://localhost:8080/v1/chain/push_transaction </span>
--header 'accept: application/json' </span>
--header 'content-type: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://localhost:8080/v1/chain/push_transaction");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
This method expects a transaction in JSON format and will attempt to apply it to the blockchain.
Push transactions
Push transactions
curl --request POST </span>
--url https://localhost:8080/v1/chain/push_transactions </span>
--header 'accept: application/json' </span>
--header 'content-type: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://localhost:8080/v1/chain/push_transactions");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
This method expects a transaction in JSON format and will attempt to apply it to the blockchain.
Get actions
get_actions
curl --request POST </span>
--url https://localhost:8080/v1/chain/get_account </span>
--header 'accept: application/json' </span>
--header 'content-type: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://localhost:8080/v1/chain/get_account");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
Response schema
Parameter | Meaning |
---|---|
String representation of Plasma-Ion name type | |
Date/time string in the format YYYY-MM-DDTHH:MM:SS.sss | |
A string representation of an Plasma-Ion symbol, composed of a float with a precision of 18, example 1.000000000000000000 ABC. | |
Plasma-Ion permissions to request from the user. | |
Name of this permission | |
Permissions authorization |
Get abi
get_abi
curl --request POST </span>
--url https://localhost:8080/v1/chain/get_abi </span>
--header 'accept: application/json' </span>
--header 'content-type: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://localhost:8080/v1/chain/get_abi");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
});
xhr.open("POST", "https://localhost:8080/v1/chain/get_account");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
Response schema
Parameter | Meaning |
---|---|
String representation of Plasma-Ion name type | |
String representation of ION name type | |
Native and ION types | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type |
Get currency balance
get_currency_balance
curl --request POST </span>
--url https://localhost:8080/v1/chain/get_currency_balance </span>
--header 'accept: application/json' </span>
--header 'content-type: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://localhost:8080/v1/chain/get_currency_balance");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
Response schema
Parameter | Meaning |
---|---|
String representation of Plasma-Ion name type | |
A string representation of an Plasma-Ion symbol, composed of a float with a precision of 18, example 1.000000000000000000 ABC. |
Get currency stats
get_currency_stats
curl --request POST </span>
--url https://localhost:8080/v1/chain/get_currency_stats </span>
--header 'accept: application/json' </span>
--header 'content-type: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://localhost:8080/v1/chain/get_currency_stats");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
Response schema
Parameter | Meaning |
---|---|
String representation of Plasma-Ion name type | |
A string representation of an Plasma-Ion symbol, composed of a float with a precision of 18, example 1.000000000000000000 ABC. |
Get required keys
get_required_keys
curl --request POST </span>
--url https://localhost:8080/v1/chain/get_required_keys </span>
--header 'accept: application/json' </span>
--header 'content-type: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://localhost:8080/v1/chain/get_required_keys");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
Returns the required keys needed to sign a transaction.
Get producers
get_producers
curl --request POST </span>
--url https://localhost:8080/v1/chain/get_producers </span>
--header 'accept: application/json' </span>
--header 'content-type: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://localhost:8080/v1/chain/get_producers");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
Response schema
Parameter | Meaning |
---|---|
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type |
Get raw code and abi
get_raw_code_and_abi
curl --request POST </span>
--url https://localhost:8080/v1/chain/get_raw_code_and_abi </span>
--header 'accept: application/json' </span>
--header 'content-type: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://localhost:8080/v1/chain/get_raw_code_and_abi");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
Response schema
Parameter | Meaning |
---|---|
String representation of Plasma-Ion name type | |
base64 encoded wasm | |
base64 encoded ABI |
Get table by scope
get_table_by_scope
curl --request POST </span>
--url https://localhost:8080/v1/chain/get_table_by_scope </span>
--header 'accept: application/json' </span>
--header 'content-type: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://localhost:8080/v1/chain/get_table_by_scope");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
Response schema
Parameter | Meaning |
---|---|
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
Number of matching items. |
Get table rows
get_table_rows
curl --request POST </span>
--url https://localhost:8080/v1/chain/get_table_rows </span>
--header 'accept: application/json' </span>
--header 'content-type: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://localhost:8080/v1/chain/get_table_rows");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data)
Returns an object containing rows from the specified table. Response schema
Parameter | Meaning |
---|---|
The name of the smart contract that controls the provided table | |
The name of the table to query | |
The account to which this data belongs | |
Position of the index used, accepted parameters primary, secondary, tertiary, fourth, fifth, sixth, seventh, eighth, ninth , tenth | |
Type of key specified by index_position (for example - uint64_t or name) | |
Abi json to bin
abi_json_to_bin
curl --request POST </span>
--url https://localhost:8080/v1/chain/abi_json_to_bin </span>
--header 'accept: application/json' </span>
--header 'content-type: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://localhost:8080/v1/chain/abi_json_to_bin");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
Returns an object containing rows from the specified table. Response schema
Parameter | Meaning |
---|---|
Request | |
String representation of Plasma-Ion name type |
Abi bin to json
abi_bin_to_json
curl --request POST </span>
--url https://localhost:8080/v1/chain/abi_bin_to_json </span>
--header 'accept: application/json' </span>
--header 'content-type: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://localhost:8080/v1/chain/abi_bin_to_json");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
Response schema
Parameter | Meaning |
---|---|
String representation of Plasma-Ion name type | |
Get code
get_code
curl --request POST </span>
--url https://localhost:8080/v1/chain/get_code </span>
--header 'accept: application/json' </span>
--header 'content-type: application/json' </span>
--data '{"code_as_wasm":1}'
var data = "{\"code_as_wasm\":1}";
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://localhost:8080/v1/chain/get_code");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
Response schema
Parameter | Meaning |
---|---|
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type | |
String representation of Plasma-Ion name type |
Push block request
push_block_request
curl --request POST </span>
--url https://localhost:8080/v1/chain/push_block </span>
--header 'accept: application/json' </span>
--header 'content-type: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://localhost:8080/v1/chain/push_block");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
Response schema
Parameter | Meaning |
---|---|
Date/time string in the format YYYY-MM-DDTHH:MM:SS.sss | |
Array containing transactions included in this block |
Get raw abi
get_raw_abi
curl --request POST </span>
--url https://localhost:8080/v1/chain/get_raw_abi </span>
--header 'accept: application/json' </span>
--header 'content-type: application/json'
var data = null;
var xhr = new XMLHttpRequest();
xhr.addEventListener("readystatechange", function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://localhost:8080/v1/chain/get_raw_abi");
xhr.setRequestHeader("accept", "application/json");
xhr.setRequestHeader("content-type", "application/json");
xhr.send(data);
Response schema
Parameter | Meaning |
---|---|
String representation of Plasma-Ion name type | |