RPC API of Klayr Service
Introduction to Klayr Service Endpoints
API base URL
The base URL for the Klayr Service WS-RPC endpoints are available to query under the /rpc-v3
namespace.
-
WS-RPC:
wss://service.klayr.xyz/rpc-v3/
Structure of endpoint
Each RPC endpoint in Klayr Service follows a specific structure.
For WS, the RPC endpoint name is passed in the method
property after establishing a WebSocket connection using socket.io.
For more information, see the guide on invoking the endpoints of Klayr Service.
"method": "<requestType>.<moduleName or rootEntity>.<object>.<property>"
The query parameters or payload are passed in the params
object. For example:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.token.account.exists",
"params": {
"tokenID": "0000000000000000"
}
}
Response format
All responses are in the JSON format: application/json
.
Each API request has the following structure:
{
"data": {}, // Contains the requested data
"meta": {}, // Contains additional metadata, e.g. the values of `limit` and `offset`
}
{
"error": true,
"message": "Unknown input parameter(s): <param_name>", // Contains the error message
}
Klayr Blockchain-related endpoints
Blocks
API endpoints about blocks and block assets.
get.blocks
Retrieves blocks from the blockchain based on the properties such as blockID
, height
, address
, etc.
The API supports pagination.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
Block ID of a block in the blockchain. |
none |
01967dba384998026fe028119bd099ecf073c05c045381500a93d1a7c7307e5b |
|
String |
Height of a block in the blockchain.
Query by height e.g. 10 or a range of height.
Can be expressed as an interval i.e. |
none |
10 |
|
String |
Query by timestamp or by the range of timestamps.
Can be expressed as an interval i.e. |
none |
1000000:2000000 |
|
String |
The property can be used to search a block generated by a particular block generator. |
none |
klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99 |
|
Number |
The number of records to be returned for a query. |
10 |
10 |
|
Number |
The number of records a query should skip before selecting records. |
0 |
0 |
|
Enum |
Defines the criteria on which the retrieved data is sorted. Value can be: height:asc, height:desc, timestamp:asc, or timestamp:desc. |
height:desc |
height:desc |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.blocks",
"params": {
"blockID": "01967dba384998026fe028119bd099ecf073c05c045381500a93d1a7c7307e5b"
}
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.blocks",
"params": {
"height": "10"
}
}
Sample responses
{
"data": [
{
"id": "485ddcec34ffe77942eb8e4ffb90c323d9eec290aa80ff6fc9806c5679ce0bc2",
"version": 2,
"timestamp": 1683666343,
"height": 10,
"previousBlockID": "72fb960ff7fa7077f4f89e2d6cad844032222794a507d5dba0737e0ddc40d88d",
"generator": {
"address": "kly5omgus3q5w4jn5xscv5ppmq9kp8k7xu6thy4f7",
"name": "genesis_9",
"publicKey": "e38fc26924497c4ec892e32d47c8d40c99791ae3e71bc2565f9e34a9c81825df"
},
"transactionRoot": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"assetRoot": "86ac617cde82f4ecfc4597829f4df34634b9dead231e4a22c96152025ef41e4c",
"stateRoot": "ab4e6af04f93ea0c5348828eb6af2fe8b0c903fe455956c7a48caec6fab306b1",
"maxHeightPrevoted": 0,
"maxHeightGenerated": 0,
"validatorsHash": "8438b6d8c70e18c79a9215f53b6c4677e2f4bab793479a35c03d8f514f3389b3",
"aggregateCommit": {
"height": 0,
"aggregationBits": "",
"certificateSignature": ""
},
"numberOfTransactions": 0,
"numberOfAssets": 1,
"numberOfEvents": 1,
"totalForged": "0",
"totalBurnt": "0",
"networkFee": "0",
"signature": "69ab16efce598facb355cca7441cdb932345e13b50f1f5256efb7f14f1f52fba0d994bbf607803bb0cbf8d1d58169e3b33e8c46fdb5434994b523df42f0b240d",
"reward": "0",
"isFinal": true
}
],
"meta": {
"count": 1,
"offset": 0,
"total": 1
}
}
get.blocks.assets
Retrieves block assets based on criteria defined by request parameters. The API supports pagination.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
Block ID of a block in the blockchain. |
none |
1967dba384998026fe028119bd099ecf073c05c045381500a93d1a7c7307e5b |
|
String |
Height of a block in the blockchain.
Query by height e.g. 10 or a range of height.
Can be expressed as an interval i.e. |
none |
10 |
|
String |
Query by timestamp or by the range of timestamps.
Can be expressed as an interval i.e. |
none |
1000000:2000000 |
|
String |
Name of a module e.g. token, auth, fee, etc. |
none |
token |
|
Number |
The number of records to be returned for a query. |
10 |
10 |
|
Number |
The number of records a query should skip before selecting records. |
0 |
0 |
|
Enum |
Defines the criteria on which the retrieved data is sorted. Value can be: height:asc, height:desc, timestamp:asc, or timestamp:desc. |
height:desc |
height:desc |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.blocks.assets",
"params": {
"blockID": "485ddcec34ffe77942eb8e4ffb90c323d9eec290aa80ff6fc9806c5679ce0bc2"
}
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.blocks.assets",
"params": {
"height": "10"
}
}
Sample responses
{
"data": [
{
"block": {
"id": "485ddcec34ffe77942eb8e4ffb90c323d9eec290aa80ff6fc9806c5679ce0bc2",
"height": 10,
"timestamp": 1683666343
},
"assets": [
{
"module": "random",
"data": {
"seedReveal": "c6e438bcbfe9e77825cf70e5cafcc2b3"
}
}
]
}
],
"meta": {
"count": 1,
"offset": 0,
"total": 1
}
}
Transactions
API endpoints about transactions.
get.transactions
Retrieves network transactions by the criteria defined in the parameters.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
A unique string value that identifies a transaction. |
none |
dcb3840032b0bcabc1a0ae5e89124004e537927cfa8e9061d5984eaff91b5243 |
|
String |
Combination of a module and its command name e.g. |
none |
token:transfer |
|
String |
Address of transaction’s sender. |
none |
klyguo9kqnea2zsfo3a6qppozsxsg92nuuma3p7ad |
|
String |
Address of transaction’s receiver. |
none |
klynhqvv8ou5jpjcn3ezazkjgbjp2kdhwvoyz6hfj |
|
String |
Address of either the sender or receiver of the transaction.
The property resolves for both |
none |
klynhqvv8ou5jpjcn3ezazkjgbjp2kdhwvoyz6hfj |
|
String |
Block ID of a block in the blockchain. |
none |
1967dba384998026fe028119bd099ecf073c05c045381500a93d1a7c7307e5b |
|
String |
Height of a block in the blockchain.
Query by height e.g. 10 or a range of height.
Can be expressed as an interval i.e. |
none |
10 |
|
String |
Query by timestamp or by the range of timestamps.
Can be expressed as an interval i.e. |
none |
1000000:2000000 |
|
String |
Defines the execution status of a transaction.
Possible values are |
none |
pending |
|
Number |
A number that can only be used once. A transaction can be queried based on a nonce as well. |
none |
1 |
|
Number |
The number of records to be returned for a query. |
10 |
10 |
|
Number |
The number of records a query should skip before selecting records. |
0 |
0 |
|
Enum |
Defines the criteria on which the retrieved data is sorted. Value can be: height:asc, height:desc, timestamp:asc, or timestamp:desc. |
height:desc |
height:desc |
|
Enum |
The |
index:asc |
index:asc |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.transactions",
"params": {
"transactionID": "dcb3840032b0bcabc1a0ae5e89124004e537927cfa8e9061d5984eaff91b5243"
}
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.transactions",
"params": {
"address": "klyguo9kqnea2zsfo3a6qppozsxsg92nuuma3p7ad",
"limit": 25
}
}
Sample responses
{
"data": [
{
"id": "dcb3840032b0bcabc1a0ae5e89124004e537927cfa8e9061d5984eaff91b5243",
"moduleCommand": "token:transfer",
"nonce": "4",
"fee": "5174000",
"minFee": "173000",
"size": 174,
"sender": {
"address": "klyguo9kqnea2zsfo3a6qppozsxsg92nuuma3p7ad",
"publicKey": "3972849f2ab66376a68671c10a00e8b8b67d880434cc65b04c6ed886dfa91c2c",
"name": "genesis_0"
},
"params": {
"tokenID": "0000000000000000",
"amount": "12000000000",
"recipientAddress": "klynhqvv8ou5jpjcn3ezazkjgbjp2kdhwvoyz6hfj",
"data": "welcome"
},
"block": {
"id": "5d81effdba82a15977935609e4626091ee904f289e5d7074d67a5b26750064b9",
"height": 880,
"timestamp": 1684325210,
"isFinal": false
},
"meta": {
"recipient": {
"address": "klynhqvv8ou5jpjcn3ezazkjgbjp2kdhwvoyz6hfj",
"publicKey": "1a186d8a1ab33501d6f04c6e98588c7aa0746800888f975f7481850bb193eab6",
"name": "genesis"
}
},
"executionStatus": "success",
"index": 0
}
],
"meta": {
"count": 1,
"offset": 0,
"total": 1
}
}
post.transactions.dryrun
Sends decoded or encoded transaction(s) to the node for dry-running purposes.
The endpoint can be invoked by sending a payload to it.
|
{
"skipDecode": false,
"skipVerify": false,
"transaction": {
"module": "token",
"command": "transfer",
"fee": "100000000",
"nonce": "0",
"senderPublicKey": "a3f96c50d0446220ef2f98240898515cbba8155730679ca35326d98dcfb680f0",
"signatures": [
"48425002226745847e155cf5480478c2336a43bb178439e9058cc2b50e26335cf7c8360b6c6a49793d7ae8d087bc746cab9618655e6a0adba4694cce2015b50f"
],
"params": {
"recipientAddress": "klyz4upsnrwk75wmfurf6kbxsne2nkjqd3yzwdaup",
"amount": "10000000000",
"tokenID": "0000000000000000",
"data": "Token transfer tx"
}
}
}
OR
{
"skipDecode": false,
"skipVerify": false,
"transaction": "0a040000000212040000000018002080c2d72f2a2044c3cb523c0a069e3f2dcb2d5994b6ba8ff9f73cac9ae746922aac4bc22f95b132310a0800000001000000001080c2d72f1a14632228a3e6a67ac6892de2eb4f60abe2e3bc42a1220a73656e6420746f6b656e3a40964d81e28727e6567b0fcd8a7fcf0a03f401cadbc1c16b9a7f300a52c372022b51a4553865199af34b5f73765f970704fc443d2a6dd510a26748905c306e530b"
}
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "post.transactions.dryrun",
"params": {
"skipDecode": false,
"skipVerify": false,
"transaction": "0a040000000212040000000018002080c2d72f2a2044c3cb523c0a069e3f2dcb2d5994b6ba8ff9f73cac9ae746922aac4bc22f95b132310a0800000001000000001080c2d72f1a14632228a3e6a67ac6892de2eb4f60abe2e3bc42a1220a73656e6420746f6b656e3a40964d81e28727e6567b0fcd8a7fcf0a03f401cadbc1c16b9a7f300a52c372022b51a4553865199af34b5f73765f970704fc443d2a6dd510a26748905c306e530b"
}
}
Sample responses
{
"data": {
"result": 1,
"status": "ok",
"events": [
{
"data": {
"senderAddress": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99",
"tokenID": "0000000000000000",
"amount": "100003490",
"recipientAddress": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99"
},
"index": 0,
"module": "token",
"name": "transferEvent",
"topics": [
"86afcdd640846bf41525481938653ee942be3fac1ecbcff08e98f9aeda3a9583",
"klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99",
"0000000000000000",
"klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99"
],
"height": 10
}
]
},
"meta": {}
}
{
"error": true,
"message": "Unable to reach a network node."
}
post.transactions.estimate-fees
Estimate the fees of a transaction before it is sent to the network node for execution.
The endpoint can be invoked by sending a payload to it.
{
"transaction": {
"module": "token",
"command": "transferCrossChain",
"fee": "100000000",
"nonce": "1",
"senderPublicKey": "3972849f2ab66376a68671c10a00e8b8b67d880434cc65b04c6ed886dfa91c2c",
"signatures": [
"0f0af2be5a18593f76dbd7a5d43e29cb9cce7a056dc28f818cc2d75e671bde9e5cccaf924b2a86415dc49be14c8b6bbf348a8918521b7a028bea1d9637bec905"
],
"params": {
"tokenID": "0000000000000000",
"amount": "100000000000",
"receivingChainID": "00000001",
"recipientAddress": "klyyvvam5rxyvbvofxbdfcupxetzmqxu22phm4yuo",
"data": "",
"messageFee": "10000000",
"messageFeeTokenID": "0000000000000000"
},
"id": "0f77248481c050fcf4f88ef7b967548452869879137364df3b33da09cc419395"
}
}
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "post.transactions.estimate-fees",
"params": {
"transaction": {
"module": "token",
"command": "transferCrossChain",
"fee": "100000000",
"nonce": "1",
"senderPublicKey": "3972849f2ab66376a68671c10a00e8b8b67d880434cc65b04c6ed886dfa91c2c",
"signatures": [
"0f0af2be5a18593f76dbd7a5d43e29cb9cce7a056dc28f818cc2d75e671bde9e5cccaf924b2a86415dc49be14c8b6bbf348a8918521b7a028bea1d9637bec905"
],
"params": {
"tokenID": "0000000000000000",
"amount": "100000000000",
"receivingChainID": "00000001",
"recipientAddress": "klyyvvam5rxyvbvofxbdfcupxetzmqxu22phm4yuo",
"data": "",
"messageFee": "10000000",
"messageFeeTokenID": "0000000000000000"
},
"id": "0f77248481c050fcf4f88ef7b967548452869879137364df3b33da09cc419395"
}
}
}
Sample responses
{
"data": {
"transactionFeeEstimates": {
"minFee": "166000",
"accountInitializationFee": {
"tokenID": "0000000000000000",
"amount": "5000000"
},
"messageFee": {
"tokenID": "0000000000000000",
"amount": "343000"
}
},
"dynamicFeeEstimates": {
"low": "166000",
"medium": "166000",
"high": "166000"
}
},
"meta": {}
}
{
"error": true,
"message": "Unable to reach a network node."
}
post.transactions
Sends encoded transactions to the node for execution.
The endpoint can be invoked by sending a payload to it.
{
"transaction": "0a040000000212040000000018002080c2d72f2a2044c3cb523c0a069e3f2dcb2d5994b6ba8ff9f73cac9ae746922aac4bc22f95b132310a0800000001000000001080c2d72f1a14632228a3e6a67ac6892de2eb4f60abe2e3bc42a1220a73656e6420746f6b656e3a40964d81e28727e6567b0fcd8a7fcf0a03f401cadbc1c16b9a7f300a52c372022b51a4553865199af34b5f73765f970704fc443d2a6dd510a26748905c306e530b"
}
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "post.transactions",
"params": {
"transaction": "0a040000000212040000000018002080c2d72f2a2044c3cb523c0a069e3f2dcb2d5994b6ba8ff9f73cac9ae746922aac4bc22f95b132310a0800000001000000001080c2d72f1a14632228a3e6a67ac6892de2eb4f60abe2e3bc42a1220a73656e6420746f6b656e3a40964d81e28727e6567b0fcd8a7fcf0a03f401cadbc1c16b9a7f300a52c372022b51a4553865199af34b5f73765f970704fc443d2a6dd510a26748905c306e530b"
}
}
Sample responses
{
"message": "Transaction payload was successfully passed to the network node.",
"transactionID": "bfd3521aeddd586f43931b6972b5771e9919e18f2cc91e940a15eacb588ecc6c"
}
{
"error": true,
"message": "Transaction payload was rejected by the network node."
}
{
"error": true,
"message": "Unable to reach a network node."
}
get.transactions.statistics
Retrieves transaction statistics from the network. Requires a time period to be passed as a parameter. The API supports pagination.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
Defines a time interval such as a |
none |
day |
|
Number |
The number of records to be returned for a query. |
10 |
10 |
|
Number |
The number of records a query should skip before selecting records. |
0 |
0 |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.transactions.statistics",
"params": {
"interval": "day",
"limit": 7
}
}
Sample responses
{
"data": {
"distributionByType": {
"pos:changeCommission": 1,
"pos:registerValidator": 2,
"pos:stake": 8,
"token:transfer": 9
},
"distributionByAmount": {
"0000000000000000": {
"0.001_0.01": 9,
"0.1_1": 2,
"10_100": 4,
"100_1000": 3,
"10000_100000": 2
}
},
"timeline": {
"0000000000000000": [
{
"date": "2023-05-17",
"transactionCount": 20,
"volume": 2258455916000,
"timestamp": 1684281600
},
{
"date": "2023-05-16",
"transactionCount": 0,
"volume": 0,
"timestamp": 1684195200
},
{
"date": "2023-05-15",
"transactionCount": 0,
"volume": 0,
"timestamp": 1684108800
},
{
"date": "2023-05-14",
"transactionCount": 0,
"volume": 0,
"timestamp": 1684022400
},
{
"date": "2023-05-13",
"transactionCount": 0,
"volume": 0,
"timestamp": 1683936000
},
{
"date": "2023-05-12",
"transactionCount": 0,
"volume": 0,
"timestamp": 1683849600
},
{
"date": "2023-05-11",
"transactionCount": 0,
"volume": 0,
"timestamp": 1683763200
}
]
}
},
"meta": {
"limit": 7,
"offset": 0,
"total": 365,
"duration": {
"format": "YYYY-MM-DD",
"from": "2023-05-11",
"to": "2023-05-17"
}
}
}
{
"error": true,
"message": "Service is not ready yet."
}
Events
Endpoint related to blockchain events.
get.events
Retrieves blockchain events based on the criteria defined by parameters. The API supports pagination.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
A unique string value that identifies a transaction. |
none |
dcb3840032b0bcabc1a0ae5e89124004e537927cfa8e9061d5984eaff91b5243 |
|
String |
Address of transaction’s sender. |
none |
klyguo9kqnea2zsfo3a6qppozsxsg92nuuma3p7ad |
|
String |
Highlights the entities an event relates to.
A topic aids in searching for a relevant event.
Search can be done by passing an |
none |
klyfqjehvg8b86cobzzy72q36s6nyb5d5mxg6ndu3 |
|
String |
Block ID of a block in the blockchain. |
none |
1967dba384998026fe028119bd099ecf073c05c045381500a93d1a7c7307e5b |
|
String |
Height of a block in the blockchain.
Query by height e.g. 10 or a range of height.
Can be expressed as an interval i.e. |
none |
10 |
|
String |
Query by timestamp or by the range of timestamps.
Can be expressed as an interval i.e. |
none |
1000000:2000000 |
|
Number |
The number of records to be returned for a query. |
10 |
10 |
|
Number |
The number of records a query should skip before selecting records. |
0 |
0 |
|
Enum |
Defines the criteria on which the retrieved data is sorted. Value can be: height:asc, height:desc, timestamp:asc, or timestamp:desc. |
height:desc |
height:desc |
|
Enum |
The |
index:asc |
index:asc |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.events",
"params": {
"blockID": "2cede47ca8ae76a4355ad36d8fc5b8a1e8407198e9e1201bf19d8c658c4dae81"
}
}
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.events",
"params": {
"topic": "klyfqjehvg8b86cobzzy72q36s6nyb5d5mxg6ndu3"
}
}
Sample responses
{
"data": [
{
"id": "d6eb4eac33af3645be1c805e15a58b1cb00f09285d9cf1aa18930ce017f078f5",
"module": "dynamicReward",
"name": "rewardMinted",
"data": {
"amount": "0",
"reduction": 1
},
"topics": [
"03",
"klyfqjehvg8b86cobzzy72q36s6nyb5d5mxg6ndu3"
],
"index": 0,
"block": {
"id": "2cede47ca8ae76a4355ad36d8fc5b8a1e8407198e9e1201bf19d8c658c4dae81",
"height": 7140,
"timestamp": 1684409170
}
}
],
"meta": {
"count": 1,
"offset": 0,
"total": 1
}
}
Generators
Endpoint related to block generators.
get.generators
Retrieves the list of block generators. The API supports pagination.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
Case-insensitive keyword search by either |
none |
klynhqvv8ou5jpjcn3ezazkjgbjp2kdhwvoyz6hfj |
|
Number |
The number of records to be returned for a query. |
10 |
10 |
|
Number |
The number of records a query should skip before selecting records. |
0 |
0 |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.generators",
"params": {
"search": "klybm4p4sava9x75osfcw67jwv387m7zgwvz35mkw"
}
}
Sample responses
Auth
Endpoint related to Auth module.
get.auth
Retrieves user details from the Auth module.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
Address of a blockchain account. This is a required property. |
none |
klynhqvv8ou5jpjcn3ezazkjgbjp2kdhwvoyz6hfj |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.auth",
"params": {
"address": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99"
}
}
Sample responses
{
"data": {
"nonce": "1",
"numberOfSignatures": 1,
"mandatoryKeys": [
"689b9a40aa11cbc8327d5eeebed9a1052940730f9c34cffb33ae591131141349"
],
"optionalKeys": [
"478842a844914f18a1c620a6494bf9931d0a862e96212bf5fc6f3ca18658febe"
]
},
"meta": {
"address": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99",
"publicKey": "b1d6bc6c7edd0673f5fed0681b73de6eb70539c21278b300f07ade277e1962cd",
"name": "genesis_84"
}
}
Validator
Endpoint related to validator module.
get.validator
Retrieves user details from the Validator module.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
Address of a blockchain account. This is a required property. |
none |
klynhqvv8ou5jpjcn3ezazkjgbjp2kdhwvoyz6hfj |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.validator",
"params": {
"address": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99"
}
}
Sample responses
{
"data": {
"generatorKey": "59274923432b74133be4def9c9f8e544bf032184a2153b0ca34b1dd5669f5fdf",
"blsKey": "8aeba1cc038ad2cf1ba6ae1479f293f1e3c074369c3afe623e6921ac4cd6c959647ca85fe197228c38dda1df18812d32",
"proofOfPossession": "abb6c31f5885022765301fbfcc6c34686ef9a9b0eec34cb487433558071ab57fd28852752f81dda00447e69d61f63f48174c10a0a0a2d34d230b9a75d903a0befdef82708e5f869ff75090c1b5ce85565e8a17e5e06c4cae305c5efb1f37d996"
},
"meta": {
"address": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99",
"publicKey": "b1d6bc6c7edd0673f5fed0681b73de6eb70539c21278b300f07ade277e1962cd",
"name": "genesis_84"
}
}
post.validator.validate-bls-key
Sends and validates a BLS key against its corresponding Proof of Possession.
The endpoint can be invoked by sending a payload to it.
{
"blsKey": "b301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81",
"proofOfPossession": "88bb31b27eae23038e14f9d9d1b628a39f5881b5278c3c6f0249f81ba0deb1f68aa5f8847854d6554051aa810fdf1cdb02df4af7a5647b1aa4afb60ec6d446ee17af24a8a50876ffdaf9bf475038ec5f8ebeda1c1c6a3220293e23b13a9a5d26"
}
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "post.validator.validate-bls-key",
"params": {
"blsKey": "b301803f8b5ac4a1133581fc676dfedc60d891dd5fa99028805e5ea5b08d3491af75d0707adab3b70c6a6a580217bf81",
"proofOfPossession": "88bb31b27eae23038e14f9d9d1b628a39f5881b5278c3c6f0249f81ba0deb1f68aa5f8847854d6554051aa810fdf1cdb02df4af7a5647b1aa4afb60ec6d446ee17af24a8a50876ffdaf9bf475038ec5f8ebeda1c1c6a3220293e23b13a9a5d26"
}
}
Token
Endpoints related to the Token module.
get.token.account.exists
Validates if an entry exists in the Token sub-store for the specified address
, name
, or publicKey
.
The request params should have a combination of tokenID
with either address
, name
, or publicKey
.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
A unique string value that identifies a token. This is a required property. |
none |
0000000000000000 |
|
String |
Address of a blockchain account. |
none |
klynhqvv8ou5jpjcn3ezazkjgbjp2kdhwvoyz6hfj |
|
String |
The The public key of a blockchain account. |
none |
b1d6bc6c7edd0673f5fed0681b73de6eb70539c21278b300f07ade277e1962cd |
|
String |
Name of the blockchain account. |
none |
genesis_84 |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.token.account.exists",
"params": {
"tokenID": "0000000000000000",
"address": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99"
}
}
get.token.balances
Retrieves the balances from the Token sub-store for the specified address.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
A unique string value that identifies a token. |
none |
0000000000000000 |
|
String |
Address of a blockchain account. This is a required property. |
none |
klynhqvv8ou5jpjcn3ezazkjgbjp2kdhwvoyz6hfj |
|
Number |
The number of records to be returned for a query. |
10 |
10 |
|
Number |
The number of records a query should skip before selecting records. |
0 |
0 |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.token.balances",
"params": {
"address": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99"
}
}
get.token.constants
Retrieves module constants from the Token module.
No parameters are required.
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.token.constants",
"params": {
}
}
get.token.summary
Retrieves the summary of the Token sub-store state from the Token module.
No parameters are required.
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.token.summary",
"params": {
}
}
Sample responses
{
"data": {
"escrowedAmounts": [
{
"escrowChainID": "00000000",
"tokenID": "0000000000000000",
"amount": "50000000000"
}
],
"supportedTokens": [
{
"isSupportAllTokens": true,
"patternTokenIDs": [
"00000000******"
],
"exactTokenIDs": [
"0000000000000000"
]
}
],
"totalSupply": [
{
"tokenID": "0000000000000000",
"amount": "50000000000"
}
]
},
"meta": {}
}
get.token.available-ids
Retrieves all the available token identifiers.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
Enum |
Defines the criteria on which the retrieved data is sorted. Value can be: tokenID:desc, or tokenID:asc. |
tokenID:asc |
tokenID:asc |
|
Number |
The number of records to be returned for a query. |
10 |
10 |
|
Number |
The number of records a query should skip before selecting records. |
0 |
0 |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.token.available-ids",
"params": {
}
}
get.token.balances.top
Retrieves top token balances for a token ID.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
A unique string value that identifies a token. This is a required field. |
none |
0000000000000000 |
|
Enum |
Defines the criteria on which the retrieved data is sorted. Value can be: balance:desc, or balance:asc. |
balance:desc |
balance:desc |
|
Number |
The number of records to be returned for a query. |
10 |
10 |
|
Number |
The number of records a query should skip before selecting records. |
0 |
0 |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.token.balances.top",
"params": {
"tokenID": "0000000000000000"
}
}
Sample responses
{
"data": {
"0000000000000000": [
{
"address": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99",
"publicKey": "b1d6bc6c7edd0673f5fed0681b73de6eb70539c21278b300f07ade277e1962cd",
"name": "genesis_84",
"balance": "10000000",
"knowledge": {
"owner": "Genesis Account",
"description": "Initial supply",
},
},
],
},
"meta": {
"count": 1,
"offset": 0,
"total": 1
}
}
Dynamic Fees
Endpoint related to dynamic fee estimates.
get.fees
Requests transaction fee estimates per byte.
No parameters are required.
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.fees",
"params": {
}
}
Sample responses
{
"data": {
"feeEstimatePerByte": {
"low": 0,
"medium": 1000,
"high": 2000
},
"feeTokenID": "0000000000000000",
"minFeePerByte": 1000
},
"meta": {
"lastUpdate": 1616008148,
"lastBlockHeight": 25,
"lastBlockID": "01967dba384998026fe028119bd099ecf073c05c045381500a93d1a7c7307e5b"
}
}
{
"error": true,
"message": "Service is not ready yet."
}
Proof of Stake (PoS)
Endpoints related to PoS module.
get.pos.rewards.claimable
Retrieves currently claimable rewards information from the PoS module for the specified address
, publicKey
, or validator name
.
The API supports pagination.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
Address of a blockchain account. |
none |
klynhqvv8ou5jpjcn3ezazkjgbjp2kdhwvoyz6hfj |
|
String |
The public key of a blockchain account. |
none |
b1d6bc6c7edd0673f5fed0681b73de6eb70539c21278b300f07ade277e1962cd |
|
String |
Name of the blockchain account. |
none |
genesis_84 |
|
Number |
The number of records to be returned for a query. |
10 |
10 |
|
Number |
The number of records a query should skip before selecting records. |
0 |
0 |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.pos.rewards.claimable",
"params": {
"address": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99"
}
}
get.pos.rewards.locked
Retrieves currently locked rewards information from the PoS module for the specified address
, publicKey
, or validator name
.
The API supports pagination.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
Address of a blockchain account. |
none |
klynhqvv8ou5jpjcn3ezazkjgbjp2kdhwvoyz6hfj |
|
String |
The public key of a blockchain account. |
none |
b1d6bc6c7edd0673f5fed0681b73de6eb70539c21278b300f07ade277e1962cd |
|
String |
Name of the blockchain account. |
none |
genesis_84 |
|
Number |
The number of records to be returned for a query. |
10 |
10 |
|
Number |
The number of records a query should skip before selecting records. |
0 |
0 |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.pos.rewards.locked",
"params": {
"address": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99"
}
}
get.pos.constants
Retrieves configurable constants information from the PoS module.
No parameters are required.
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.pos.constants",
"params": {
}
}
Sample responses
{
"data": {
"factorSelfStakes": 10,
"maxLengthName": 20,
"maxNumberSentStakes": 10,
"maxNumberPendingUnlocks": 20,
"failSafeMissedBlocks": 50,
"failSafeInactiveWindow": 260000,
"punishmentWindow": 0,
"roundLength": 103,
"minWeightStandby": "100000000000",
"numberActiveValidators": 101,
"numberStandbyValidators": 2,
"posTokenID": "0000000000000000",
"maxBFTWeightCap": 500,
"commissionIncreasePeriod": 0,
"maxCommissionIncreaseRate": 500,
"extraCommandFees": {
"validatorRegistrationFee": "1000000000"
}
},
"meta": {}
}
get.pos.stakers
Retrieves the list of stakers (received stakes) for the specified validator address
, publicKey
, or name
.
The API supports pagination.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
Address of a blockchain account. |
none |
klynhqvv8ou5jpjcn3ezazkjgbjp2kdhwvoyz6hfj |
|
String |
The public key of a blockchain account. |
none |
b1d6bc6c7edd0673f5fed0681b73de6eb70539c21278b300f07ade277e1962cd |
|
String |
Name of the blockchain account. |
none |
genesis_84 |
|
String |
Case-insensitive keyword search by either |
none |
klynhqvv8ou5jpjcn3ezazkjgbjp2kdhwvoyz6hfj |
|
Number |
The number of records to be returned for a query. |
10 |
10 |
|
Number |
The number of records a query should skip before selecting records. |
0 |
0 |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.pos.stakers",
"params": {
"address": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99"
}
}
Sample responses
{
"data": {
"stakers": [
{
"address": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99",
"amount": "10815000000000",
"name": "klayrhq"
}
]
},
"meta": {
"validator": {
"address": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99",
"publicKey": "b1d6bc6c7edd0673f5fed0681b73de6eb70539c21278b300f07ade277e1962cd",
"name": "genesis_84"
},
"count": 100,
"offset": 25,
"total": 43749
}
}
get.pos.stakes
Retrieves the list of stakes sent by the specified user by their address
, publicKey
, or validator name
.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
Address of a blockchain account. |
none |
klynhqvv8ou5jpjcn3ezazkjgbjp2kdhwvoyz6hfj |
|
String |
The public key of a blockchain account. |
none |
b1d6bc6c7edd0673f5fed0681b73de6eb70539c21278b300f07ade277e1962cd |
|
String |
Name of the blockchain account. |
none |
genesis_84 |
|
String |
Case-insensitive keyword search by either |
none |
klynhqvv8ou5jpjcn3ezazkjgbjp2kdhwvoyz6hfj |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.pos.stakes",
"params": {
"address": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99"
}
}
Sample responses
{
"data": {
"stakes": [
{
"address": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99",
"amount": "10815000000000",
"name": "klayrhq"
}
]
},
"meta": {
"staker": {
"address": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99",
"publicKey": "b1d6bc6c7edd0673f5fed0681b73de6eb70539c21278b300f07ade277e1962cd",
"name": "genesis_84"
},
"count": 10
}
}
get.pos.unlocks
Retrieves the list of available unlocks as a result of un-stakes for the specified address
, publicKey
, or validator name
.
The API supports pagination.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
Address of a blockchain account. |
none |
klynhqvv8ou5jpjcn3ezazkjgbjp2kdhwvoyz6hfj |
|
String |
The public key of a blockchain account. |
none |
b1d6bc6c7edd0673f5fed0681b73de6eb70539c21278b300f07ade277e1962cd |
|
String |
Name of the blockchain account. |
none |
genesis_84 |
|
Boolean |
Describes whether the tokens are locked or not.
Possible value can be either |
none |
true |
|
Number |
The number of records to be returned for a query. |
10 |
10 |
|
Number |
The number of records a query should skip before selecting records. |
0 |
0 |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.pos.unlocks",
"params": {
"address": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99"
}
}
Sample responses
{
"data": [
{
"address": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99",
"publicKey": "b1d6bc6c7edd0673f5fed0681b73de6eb70539c21278b300f07ade277e1962cd",
"name": "genesis_84",
"pendingUnlocks": [
{
"validatorAddress": "kly24cd35u4jdq8szo3pnsqe5dsxwrnazyqqqg5eu",
"amount": "1000000000",
"tokenID": "0000000000000000",
"unstakeHeight": "10000",
"expectedUnlockableHeight": "270000",
"isLocked": true
}
]
}
],
"meta": {
"count": 10,
"offset": 0,
"total": 15
}
}
get.pos.validators
Retrieves the list of validators. The API supports pagination.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
Address of a blockchain account. |
none |
klynhqvv8ou5jpjcn3ezazkjgbjp2kdhwvoyz6hfj |
|
String |
The public key of a blockchain account. |
none |
b1d6bc6c7edd0673f5fed0681b73de6eb70539c21278b300f07ade277e1962cd |
|
String |
Name of the blockchain account. |
none |
genesis_84 |
|
String |
Status of a validator.
Possible value can be: |
none |
active |
|
String |
Case-insensitive keyword search by either |
none |
klynhqvv8ou5jpjcn3ezazkjgbjp2kdhwvoyz6hfj |
|
Number |
The number of records to be returned for a query. |
10 |
10 |
|
Number |
The number of records a query should skip before selecting records. |
0 |
0 |
|
Enum |
Defines the criteria on which the retrieved data is sorted. Possible value can be either: commission:asc, commission:desc, validatorWeight:desc, validatorWeight:asc, rank:asc, rank:desc, name:asc, or name:desc |
commission:asc |
commission:asc |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.pos.validators",
"params": {
"address": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99"
}
}
Sample responses
{
"data": [
{
"name": "genesis_84",
"totalStake": "109000000000",
"selfStake": "109000000000",
"validatorWeight": "109000000000",
"address": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99",
"publicKey": "b1d6bc6c7edd0673f5fed0681b73de6eb70539c21278b300f07ade277e1962cd",
"lastGeneratedHeight": 0,
"status": "active",
"isBanned": false,
"reportMisbehaviorHeights": [
123
],
"punishmentPeriods": [
{
"start": 123,
"end": 260123
}
],
"consecutiveMissedBlocks": 0,
"commission": 100000,
"lastCommissionIncreaseHeight": 0,
"sharingCoefficients": [
{
"tokenID": "0000000000000000",
"coefficient": "0"
}
],
"rank": 93,
"generatedBlocks": 1000,
"totalCommission": "100000000000",
"totalSelfStakeRewards": "0",
"earnedRewards": "100000000000"
}
],
"meta": {
"count": 10,
"offset": 10,
"total": 400
}
}
Dynamic Reward
Endpoints related to the Dynamic Reward module.
get.reward.constants
Retrieves configurable constants information from the Dynamic Reward module.
No parameters are required.
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.reward.constants",
"params": {
}
}
get.reward.default
Retrieves expected block reward at a specified height, as per the network configuration.
The actual reward can vary and can be determined from the rewardMinted
block event for the said height.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
Height of a block in the blockchain. |
none |
55000 |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.reward.default",
"params": {
"height": 55000
}
}
get.reward.annual-inflation
Retrieves the annual inflation at a specified height for the Reward token.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
Height of a block in the blockchain. |
none |
500 |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.reward.annual-inflation",
"params": {
"height": 500
}
}
Legacy
Endpoint related to Legacy module.
get.legacy
Retrieves legacy account details for the specified publicKey
.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
The public key of a blockchain account. |
none |
b1d6bc6c7edd0673f5fed0681b73de6eb70539c21278b300f07ade277e1962cd |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.legacy",
"params": {
"publicKey": "b1d6bc6c7edd0673f5fed0681b73de6eb70539c21278b300f07ade277e1962cd"
}
}
Network
Endpoints related to the blockchain network.
get.network.peers
Retrieves network peers with details based on criteria.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
Internet protocol address. |
none |
210.239.23.62 |
|
String |
Network version |
none |
2.0 |
|
String |
State of the node at an instance.
Possible values are: |
any |
any |
|
String |
Height of the latest block in the blockchain. |
none |
500 |
|
Number |
The number of records to be returned for a query. |
10 |
10 |
|
Number |
The number of records a query should skip before selecting records. |
0 |
0 |
|
Enum |
Defines the criteria on which the retrieved data is sorted. Value can be: height:asc, height:desc, timestamp:asc, or timestamp:desc. |
height:desc |
height:desc |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.network.peers",
"params": {
"ip": "210.239.23.62"
}
}
Sample responses
{
"data": [
{
"ip": "127.0.0.1",
"port": 4000,
"networkVersion": "2.0",
"state": "connected",
"height": 8350681,
"networkIdentifier": "258974416d58533227c6a3da1b6333f0541b06c65b41e45cf31926847a3db1ea",
"location": {
"countryCode": "DE",
"countryName": "Germany",
"hostname": "host.210.239.23.62.rev.coltfrance.com",
"ip": "210.239.23.62",
}
}
],
"meta": {
"count": 100,
"offset": 25,
"total": 43749
},
"links": {}
}
get.network.status
Retrieves network details and constants such as network height, fees, reward amount, etc.
No parameters are required.
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.network.status",
"params": {
}
}
Sample responses
{
"data": {
"version": "4.0.0-beta.0",
"networkVersion": "1.0",
"chainID": "00000000",
"lastBlockID": "a8bc21713042dd6bfbd990392b7f5f8b1f56d5d4c9a5b11360883e56bc2e0892",
"height": 12694,
"finalizedHeight": 10502,
"syncing": false,
"unconfirmedTransactions": 0,
"genesis": {
"block": {
"fromFile": "./config/genesis_block.blob"
},
"blockTime": 10,
"bftBatchSize": 103,
"maxTransactionsSize": 15360,
"chainID": "00000000"
},
"genesisHeight": 0,
"registeredModules": [
"auth",
"dynamicReward",
"fee",
"interoperability",
"legacy",
"pos",
"random",
"token",
"validators"
],
"moduleCommands": [
"auth:registerMultisignature",
"interoperability:submitMainchainCrossChainUpdate",
"interoperability:initializeMessageRecovery",
"interoperability:recoverMessage",
"interoperability:registerSidechain",
"interoperability:recoverState",
"interoperability:terminateSidechainForLiveness",
"legacy:reclaimKLY",
"legacy:registerKeys",
"pos:registerValidator",
"pos:reportMisbehavior",
"pos:unlock",
"pos:updateGeneratorKey",
"pos:stake",
"pos:changeCommission",
"pos:claimRewards",
"token:transfer",
"token:transferCrossChain"
],
"network": {
"version": "1.0",
"port": 7667,
"seedPeers": [
{
"ip": "209.38.242.134",
"port": 7667
}
]
}
},
"meta": {
"lastUpdate": 1684488678,
"lastBlockHeight": 12694,
"lastBlockID": "a8bc21713042dd6bfbd990392b7f5f8b1f56d5d4c9a5b11360883e56bc2e0892"
}
}
get.network.statistics
Retrieves network statistics such as the number of peers, node versions, heights, etc.
No parameters are required.
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.network.statistics",
"params": {
}
}
Sample responses
{
"data": {
"basic": {
"totalPeers": 1,
"connectedPeers": 0,
"disconnectedPeers": 1
},
"height": {},
"networkVersion": {},
"totalLocked": [
{
"tokenID": "0000000000000000",
"amount": "20931000000000"
}
],
"totalStaked": {
"tokenID": "0000000000000000",
"amount": "10302000000000"
},
"totalSelfStaked": {
"tokenID": "0000000000000000",
"amount": "10300000000000"
}
},
"meta": {}
}
{
"error": true,
"message": "Service is not ready yet"
}
Schemas
Endpoint related to schemas.
get.schemas
Retrieves all available schemas.
No parameters are required.
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.schemas",
"params": {
}
}
Sample responses
{
"data": {
"block": {
"schema": {
"$id": "/block",
"type": "object",
"properties": {
"header": {
"dataType": "bytes",
"fieldNumber": 1
},
"transactions": {
"type": "array",
"items": {
"dataType": "bytes"
},
"fieldNumber": 2
},
"assets": {
"type": "array",
"items": {
"dataType": "bytes"
},
"fieldNumber": 3
}
},
"required": [
"header",
"transactions",
"assets"
]
}
},
"header": {
"schema": {
"$id": "/block/header/3",
"type": "object",
"properties": {
"version": {
"dataType": "uint32",
"fieldNumber": 1
},
"timestamp": {
"dataType": "uint32",
"fieldNumber": 2
},
"height": {
"dataType": "uint32",
"fieldNumber": 3
},
"previousBlockID": {
"dataType": "bytes",
"fieldNumber": 4
},
"generatorAddress": {
"dataType": "bytes",
"fieldNumber": 5,
"format": "klayr32"
},
"transactionRoot": {
"dataType": "bytes",
"fieldNumber": 6
},
"assetRoot": {
"dataType": "bytes",
"fieldNumber": 7
},
"eventRoot": {
"dataType": "bytes",
"fieldNumber": 8
},
"stateRoot": {
"dataType": "bytes",
"fieldNumber": 9
},
"maxHeightPrevoted": {
"dataType": "uint32",
"fieldNumber": 10
},
"maxHeightGenerated": {
"dataType": "uint32",
"fieldNumber": 11
},
"impliesMaxPrevotes": {
"dataType": "boolean",
"fieldNumber": 12
},
"validatorsHash": {
"dataType": "bytes",
"fieldNumber": 13
},
"aggregateCommit": {
"type": "object",
"fieldNumber": 14,
"required": [
"height",
"aggregationBits",
"certificateSignature"
],
"properties": {
"height": {
"dataType": "uint32",
"fieldNumber": 1
},
"aggregationBits": {
"dataType": "bytes",
"fieldNumber": 2
},
"certificateSignature": {
"dataType": "bytes",
"fieldNumber": 3
}
}
},
"signature": {
"dataType": "bytes",
"fieldNumber": 15
}
},
"required": [
"version",
"timestamp",
"height",
"previousBlockID",
"generatorAddress",
"transactionRoot",
"assetRoot",
"eventRoot",
"stateRoot",
"maxHeightPrevoted",
"maxHeightGenerated",
"impliesMaxPrevotes",
"validatorsHash",
"aggregateCommit",
"signature"
]
}
},
"asset": {
"schema": {
"$id": "/block/asset/3",
"type": "object",
"required": [
"module",
"data"
],
"properties": {
"module": {
"dataType": "string",
"fieldNumber": 1
},
"data": {
"dataType": "bytes",
"fieldNumber": 2
}
}
}
},
"transaction": {
"schema": {
"$id": "/klayr/transaction",
"type": "object",
"required": [
"module",
"command",
"nonce",
"fee",
"senderPublicKey",
"params"
],
"properties": {
"module": {
"dataType": "string",
"fieldNumber": 1,
"minLength": 1,
"maxLength": 32
},
"command": {
"dataType": "string",
"fieldNumber": 2,
"minLength": 1,
"maxLength": 32
},
"nonce": {
"dataType": "uint64",
"fieldNumber": 3
},
"fee": {
"dataType": "uint64",
"fieldNumber": 4
},
"senderPublicKey": {
"dataType": "bytes",
"fieldNumber": 5,
"minLength": 32,
"maxLength": 32
},
"params": {
"dataType": "bytes",
"fieldNumber": 6
},
"signatures": {
"type": "array",
"items": {
"dataType": "bytes"
},
"fieldNumber": 7
}
}
}
},
"event": {
"schema": {
"$id": "/block/event",
"type": "object",
"required": [
"module",
"name",
"data",
"topics",
"height",
"index"
],
"properties": {
"module": {
"dataType": "string",
"minLength": 1,
"maxLength": 32,
"fieldNumber": 1
},
"name": {
"dataType": "string",
"minLength": 1,
"maxLength": 32,
"fieldNumber": 2
},
"data": {
"dataType": "bytes",
"fieldNumber": 3
},
"topics": {
"type": "array",
"fieldNumber": 4,
"items": {
"dataType": "bytes"
}
},
"height": {
"dataType": "uint32",
"fieldNumber": 5
},
"index": {
"dataType": "uint32",
"fieldNumber": 6
}
}
}
},
"standardEvent": {
"schema": {
"$id": "/block/event/standard",
"type": "object",
"required": [
"success"
],
"properties": {
"success": {
"dataType": "boolean",
"fieldNumber": 1
}
}
}
},
"ccm": {
"schema": {
"$id": "/modules/interoperability/ccm",
"type": "object",
"required": [
"module",
"crossChainCommand",
"nonce",
"fee",
"sendingChainID",
"receivingChainID",
"params",
"status"
],
"properties": {
"module": {
"dataType": "string",
"minLength": 1,
"maxLength": 32,
"fieldNumber": 1
},
"crossChainCommand": {
"dataType": "string",
"minLength": 1,
"maxLength": 32,
"fieldNumber": 2
},
"nonce": {
"dataType": "uint64",
"fieldNumber": 3
},
"fee": {
"dataType": "uint64",
"fieldNumber": 4
},
"sendingChainID": {
"dataType": "bytes",
"minLength": 4,
"maxLength": 4,
"fieldNumber": 5
},
"receivingChainID": {
"dataType": "bytes",
"minLength": 4,
"maxLength": 4,
"fieldNumber": 6
},
"params": {
"dataType": "bytes",
"fieldNumber": 7
},
"status": {
"dataType": "uint32",
"fieldNumber": 8
}
}
}
},
"events": [
{
"module": "auth",
"name": "multisignatureRegistration",
"schema": {
"$id": "/auth/events/multisigRegData",
"type": "object",
"required": [
"numberOfSignatures",
"mandatoryKeys",
"optionalKeys"
],
"properties": {
"numberOfSignatures": {
"dataType": "uint32",
"fieldNumber": 1
},
"mandatoryKeys": {
"type": "array",
"items": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32
},
"fieldNumber": 2
},
"optionalKeys": {
"type": "array",
"items": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32
},
"fieldNumber": 3
}
}
}
},
{
"module": "auth",
"name": "invalidSignature",
"schema": {
"$id": "/auth/events/invalidSigData",
"type": "object",
"required": [
"numberOfSignatures",
"mandatoryKeys",
"optionalKeys",
"failingPublicKey",
"failingSignature"
],
"properties": {
"numberOfSignatures": {
"dataType": "uint32",
"fieldNumber": 1
},
"mandatoryKeys": {
"type": "array",
"items": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32
},
"fieldNumber": 2
},
"optionalKeys": {
"type": "array",
"items": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32
},
"fieldNumber": 3
},
"failingPublicKey": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32,
"fieldNumber": 4
},
"failingSignature": {
"dataType": "bytes",
"minLength": 64,
"maxLength": 64,
"fieldNumber": 5
}
}
}
},
{
"module": "dynamicReward",
"name": "rewardMinted",
"schema": {
"$id": "/reward/events/rewardMintedData",
"type": "object",
"required": [
"amount",
"reduction"
],
"properties": {
"amount": {
"dataType": "uint64",
"fieldNumber": 1
},
"reduction": {
"dataType": "uint32",
"fieldNumber": 2
}
}
}
},
{
"module": "fee",
"name": "generatorFeeProcessed",
"schema": {
"$id": "/fee/events/generatorFeeProcessed",
"type": "object",
"required": [
"senderAddress",
"generatorAddress",
"burntAmount",
"generatorAmount"
],
"properties": {
"senderAddress": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 1
},
"generatorAddress": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 2
},
"burntAmount": {
"dataType": "uint64",
"fieldNumber": 3
},
"generatorAmount": {
"dataType": "uint64",
"fieldNumber": 4
}
}
}
},
{
"module": "fee",
"name": "relayerFeeProcessed",
"schema": {
"$id": "/fee/events/relayerFeeProcessed",
"type": "object",
"required": [
"ccmID",
"relayerAddress",
"burntAmount",
"relayerAmount"
],
"properties": {
"ccmID": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32,
"fieldNumber": 1
},
"relayerAddress": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 2
},
"burntAmount": {
"dataType": "uint64",
"fieldNumber": 3
},
"relayerAmount": {
"dataType": "uint64",
"fieldNumber": 4
}
}
}
},
{
"module": "fee",
"name": "insufficientFee",
"schema": {
"$id": "/klayr/empty",
"type": "object",
"properties": {}
}
},
{
"module": "interoperability",
"name": "chainAccountUpdated",
"schema": {
"$id": "/modules/interoperability/chainData",
"type": "object",
"required": [
"name",
"lastCertificate",
"status"
],
"properties": {
"name": {
"dataType": "string",
"fieldNumber": 1
},
"lastCertificate": {
"type": "object",
"fieldNumber": 2,
"required": [
"height",
"timestamp",
"stateRoot",
"validatorsHash"
],
"properties": {
"height": {
"dataType": "uint32",
"fieldNumber": 1
},
"timestamp": {
"dataType": "uint32",
"fieldNumber": 2
},
"stateRoot": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32,
"fieldNumber": 3
},
"validatorsHash": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32,
"fieldNumber": 4
}
}
},
"status": {
"dataType": "uint32",
"fieldNumber": 3
}
}
}
},
{
"module": "interoperability",
"name": "ccmProcessed",
"schema": {
"$id": "/interoperability/events/ccmProcessed",
"type": "object",
"required": [
"ccm",
"result",
"code"
],
"properties": {
"ccm": {
"fieldNumber": 1,
"type": "object",
"required": [
"module",
"crossChainCommand",
"nonce",
"fee",
"sendingChainID",
"receivingChainID",
"params",
"status"
],
"properties": {
"module": {
"dataType": "string",
"minLength": 1,
"maxLength": 32,
"fieldNumber": 1
},
"crossChainCommand": {
"dataType": "string",
"minLength": 1,
"maxLength": 32,
"fieldNumber": 2
},
"nonce": {
"dataType": "uint64",
"fieldNumber": 3
},
"fee": {
"dataType": "uint64",
"fieldNumber": 4
},
"sendingChainID": {
"dataType": "bytes",
"minLength": 4,
"maxLength": 4,
"fieldNumber": 5
},
"receivingChainID": {
"dataType": "bytes",
"minLength": 4,
"maxLength": 4,
"fieldNumber": 6
},
"params": {
"dataType": "bytes",
"fieldNumber": 7
},
"status": {
"dataType": "uint32",
"fieldNumber": 8
}
}
},
"result": {
"dataType": "uint32",
"fieldNumber": 2
},
"code": {
"dataType": "uint32",
"fieldNumber": 3
}
}
}
},
{
"module": "interoperability",
"name": "ccmSendSuccess",
"schema": {
"$id": "/interoperability/events/ccmSendSuccess",
"type": "object",
"required": [
"ccm"
],
"properties": {
"ccm": {
"fieldNumber": 1,
"type": "object",
"required": [
"module",
"crossChainCommand",
"nonce",
"fee",
"sendingChainID",
"receivingChainID",
"params",
"status"
],
"properties": {
"module": {
"dataType": "string",
"minLength": 1,
"maxLength": 32,
"fieldNumber": 1
},
"crossChainCommand": {
"dataType": "string",
"minLength": 1,
"maxLength": 32,
"fieldNumber": 2
},
"nonce": {
"dataType": "uint64",
"fieldNumber": 3
},
"fee": {
"dataType": "uint64",
"fieldNumber": 4
},
"sendingChainID": {
"dataType": "bytes",
"minLength": 4,
"maxLength": 4,
"fieldNumber": 5
},
"receivingChainID": {
"dataType": "bytes",
"minLength": 4,
"maxLength": 4,
"fieldNumber": 6
},
"params": {
"dataType": "bytes",
"fieldNumber": 7
},
"status": {
"dataType": "uint32",
"fieldNumber": 8
}
}
}
}
}
},
{
"module": "interoperability",
"name": "ccmSentFailed",
"schema": {
"$id": "/interoperability/events/ccmSendFail",
"type": "object",
"required": [
"ccm",
"code"
],
"properties": {
"ccm": {
"$id": "/modules/interoperability/ccm",
"type": "object",
"required": [
"module",
"crossChainCommand",
"nonce",
"fee",
"sendingChainID",
"receivingChainID",
"params",
"status"
],
"properties": {
"module": {
"dataType": "string",
"minLength": 1,
"maxLength": 32,
"fieldNumber": 1
},
"crossChainCommand": {
"dataType": "string",
"minLength": 1,
"maxLength": 32,
"fieldNumber": 2
},
"nonce": {
"dataType": "uint64",
"fieldNumber": 3
},
"fee": {
"dataType": "uint64",
"fieldNumber": 4
},
"sendingChainID": {
"dataType": "bytes",
"minLength": 4,
"maxLength": 4,
"fieldNumber": 5
},
"receivingChainID": {
"dataType": "bytes",
"minLength": 4,
"maxLength": 4,
"fieldNumber": 6
},
"params": {
"dataType": "bytes",
"fieldNumber": 7
},
"status": {
"dataType": "uint32",
"fieldNumber": 8
}
},
"fieldNumber": 1
},
"code": {
"dataType": "uint32",
"fieldNumber": 2
}
}
}
},
{
"module": "interoperability",
"name": "invalidRegistrationSignature",
"schema": {
"$id": "/klayr/empty",
"type": "object",
"properties": {}
}
},
{
"module": "interoperability",
"name": "terminatedStateCreated",
"schema": {
"$id": "/modules/interoperability/terminatedState",
"type": "object",
"required": [
"stateRoot",
"mainchainStateRoot",
"initialized"
],
"properties": {
"stateRoot": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32,
"fieldNumber": 1
},
"mainchainStateRoot": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32,
"fieldNumber": 2
},
"initialized": {
"dataType": "boolean",
"fieldNumber": 3
}
}
}
},
{
"module": "interoperability",
"name": "terminatedOutboxCreated",
"schema": {
"$id": "/modules/interoperability/terminatedOutbox",
"type": "object",
"required": [
"outboxRoot",
"outboxSize",
"partnerChainInboxSize"
],
"properties": {
"outboxRoot": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32,
"fieldNumber": 1
},
"outboxSize": {
"dataType": "uint32",
"fieldNumber": 2
},
"partnerChainInboxSize": {
"dataType": "uint32",
"fieldNumber": 3
}
}
}
},
{
"module": "interoperability",
"name": "invalidCertificateSignature",
"schema": {
"$id": "/klayr/empty",
"type": "object",
"properties": {}
}
},
{
"module": "legacy",
"name": "accountReclaimed",
"schema": {
"$id": "klayr/legacy/accountReclaimedEventData",
"type": "object",
"required": [
"legacyAddress",
"address",
"amount"
],
"properties": {
"legacyAddress": {
"dataType": "bytes",
"maxLength": 8,
"fieldNumber": 1
},
"address": {
"dataType": "bytes",
"maxLength": 20,
"fieldNumber": 2
},
"amount": {
"dataType": "uint64",
"fieldNumber": 3
}
}
}
},
{
"module": "legacy",
"name": "keysRegistered",
"schema": {
"$id": "klayr/legacy/keysRegisteredEventData",
"type": "object",
"required": [
"address",
"generatorKey",
"blsKey"
],
"properties": {
"address": {
"dataType": "bytes",
"maxLength": 20,
"fieldNumber": 1
},
"generatorKey": {
"dataType": "bytes",
"maxLength": 32,
"fieldNumber": 2
},
"blsKey": {
"dataType": "bytes",
"maxLength": 48,
"fieldNumber": 3
}
}
}
},
{
"module": "pos",
"name": "validatorBanned",
"schema": {
"$id": "/pos/events/validatorBannedData",
"type": "object",
"required": [
"address",
"height"
],
"properties": {
"address": {
"dataType": "bytes",
"fieldNumber": 1,
"format": "klayr32"
},
"height": {
"dataType": "uint32",
"fieldNumber": 2
}
}
}
},
{
"module": "pos",
"name": "validatorPunished",
"schema": {
"$id": "/pos/events/punishValidatorData",
"type": "object",
"required": [
"address",
"height"
],
"properties": {
"address": {
"dataType": "bytes",
"fieldNumber": 1,
"format": "klayr32"
},
"height": {
"dataType": "uint32",
"fieldNumber": 2
}
}
}
},
{
"module": "pos",
"name": "validatorRegistered",
"schema": {
"$id": "/pos/events/registerValidatorData",
"type": "object",
"required": [
"address",
"name"
],
"properties": {
"address": {
"dataType": "bytes",
"fieldNumber": 1,
"format": "klayr32"
},
"name": {
"dataType": "string",
"fieldNumber": 2
}
}
}
},
{
"module": "pos",
"name": "validatorStaked",
"schema": {
"$id": "/pos/events/validatorStakedData",
"type": "object",
"required": [
"senderAddress",
"validatorAddress",
"amount",
"result"
],
"properties": {
"senderAddress": {
"dataType": "bytes",
"fieldNumber": 1,
"format": "klayr32"
},
"validatorAddress": {
"dataType": "bytes",
"fieldNumber": 2,
"format": "klayr32"
},
"amount": {
"dataType": "sint64",
"fieldNumber": 3
},
"result": {
"dataType": "uint32",
"fieldNumber": 4
}
}
}
},
{
"module": "pos",
"name": "commissionChange",
"schema": {
"$id": "/pos/events/commissionChangeData",
"type": "object",
"required": [
"validatorAddress",
"oldCommission",
"newCommission"
],
"properties": {
"validatorAddress": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 1
},
"oldCommission": {
"dataType": "uint32",
"fieldNumber": 2
},
"newCommission": {
"dataType": "uint32",
"fieldNumber": 3
}
}
}
},
{
"module": "pos",
"name": "rewardsAssigned",
"schema": {
"$id": "/pos/events/rewardsAssignedData",
"type": "object",
"required": [
"stakerAddress",
"validatorAddress",
"tokenID",
"amount"
],
"properties": {
"stakerAddress": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 1
},
"validatorAddress": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 2
},
"tokenID": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8,
"fieldNumber": 3
},
"amount": {
"dataType": "uint64",
"fieldNumber": 4
}
}
}
},
{
"module": "token",
"name": "transfer",
"schema": {
"$id": "/token/events/transfer",
"type": "object",
"required": [
"senderAddress",
"recipientAddress",
"tokenID",
"amount",
"result"
],
"properties": {
"senderAddress": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 1
},
"recipientAddress": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 2
},
"tokenID": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8,
"fieldNumber": 3
},
"amount": {
"dataType": "uint64",
"fieldNumber": 4
},
"result": {
"dataType": "uint32",
"fieldNumber": 5
}
}
}
},
{
"module": "token",
"name": "transferCrossChain",
"schema": {
"$id": "/token/events/transferCrossChain",
"type": "object",
"required": [
"senderAddress",
"recipientAddress",
"tokenID",
"amount",
"receivingChainID",
"result"
],
"properties": {
"senderAddress": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 1
},
"recipientAddress": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 2
},
"tokenID": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8,
"fieldNumber": 3
},
"amount": {
"dataType": "uint64",
"fieldNumber": 4
},
"receivingChainID": {
"dataType": "bytes",
"minLength": 4,
"maxLength": 4,
"fieldNumber": 5
},
"result": {
"dataType": "uint32",
"fieldNumber": 6
}
}
}
},
{
"module": "token",
"name": "ccmTransfer",
"schema": {
"$id": "/token/events/ccmTransfer",
"type": "object",
"required": [
"senderAddress",
"recipientAddress",
"tokenID",
"amount",
"receivingChainID",
"result"
],
"properties": {
"senderAddress": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 1
},
"recipientAddress": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 2
},
"tokenID": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8,
"fieldNumber": 3
},
"amount": {
"dataType": "uint64",
"fieldNumber": 4
},
"receivingChainID": {
"dataType": "bytes",
"minLength": 4,
"maxLength": 4,
"fieldNumber": 5
},
"result": {
"dataType": "uint32",
"fieldNumber": 6
}
}
}
},
{
"module": "token",
"name": "mint",
"schema": {
"$id": "/token/events/mint",
"type": "object",
"required": [
"address",
"tokenID",
"amount",
"result"
],
"properties": {
"address": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 1
},
"tokenID": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8,
"fieldNumber": 2
},
"amount": {
"dataType": "uint64",
"fieldNumber": 3
},
"result": {
"dataType": "uint32",
"fieldNumber": 4
}
}
}
},
{
"module": "token",
"name": "burn",
"schema": {
"$id": "/token/events/burn",
"type": "object",
"required": [
"address",
"tokenID",
"amount",
"result"
],
"properties": {
"address": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 1
},
"tokenID": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8,
"fieldNumber": 2
},
"amount": {
"dataType": "uint64",
"fieldNumber": 3
},
"result": {
"dataType": "uint32",
"fieldNumber": 4
}
}
}
},
{
"module": "token",
"name": "lock",
"schema": {
"$id": "/token/events/lock",
"type": "object",
"required": [
"address",
"module",
"tokenID",
"amount",
"result"
],
"properties": {
"address": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 1
},
"module": {
"dataType": "string",
"minLength": 1,
"maxLength": 32,
"fieldNumber": 2
},
"tokenID": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8,
"fieldNumber": 3
},
"amount": {
"dataType": "uint64",
"fieldNumber": 4
},
"result": {
"dataType": "uint32",
"fieldNumber": 5
}
}
}
},
{
"module": "token",
"name": "unlock",
"schema": {
"$id": "/token/events/unlock",
"type": "object",
"required": [
"address",
"module",
"tokenID",
"amount",
"result"
],
"properties": {
"address": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 1
},
"module": {
"dataType": "string",
"minLength": 1,
"maxLength": 32,
"fieldNumber": 2
},
"tokenID": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8,
"fieldNumber": 3
},
"amount": {
"dataType": "uint64",
"fieldNumber": 4
},
"result": {
"dataType": "uint32",
"fieldNumber": 5
}
}
}
},
{
"module": "token",
"name": "initializeToken",
"schema": {
"$id": "/token/events/initializeTokenEvent",
"type": "object",
"required": [
"tokenID",
"result"
],
"properties": {
"tokenID": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8,
"fieldNumber": 1
},
"result": {
"dataType": "uint32",
"fieldNumber": 2
}
}
}
},
{
"module": "token",
"name": "initializeUserAccount",
"schema": {
"$id": "/token/events/initializeUserAccount",
"type": "object",
"required": [
"address",
"tokenID",
"initializationFee",
"result"
],
"properties": {
"address": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 1
},
"tokenID": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8,
"fieldNumber": 2
},
"initializationFee": {
"dataType": "uint64",
"fieldNumber": 3
},
"result": {
"dataType": "uint32",
"fieldNumber": 4
}
}
}
},
{
"module": "token",
"name": "initializeEscrowAccount",
"schema": {
"$id": "/token/events/initializeEscrowAccount",
"type": "object",
"required": [
"chainID",
"tokenID",
"initializationFee",
"result"
],
"properties": {
"chainID": {
"dataType": "bytes",
"minLength": 4,
"maxLength": 4,
"fieldNumber": 1
},
"tokenID": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8,
"fieldNumber": 2
},
"initializationFee": {
"dataType": "uint64",
"fieldNumber": 3
},
"result": {
"dataType": "uint32",
"fieldNumber": 4
}
}
}
},
{
"module": "token",
"name": "recover",
"schema": {
"$id": "/token/events/recover",
"type": "object",
"required": [
"terminatedChainID",
"tokenID",
"amount",
"result"
],
"properties": {
"terminatedChainID": {
"dataType": "bytes",
"minLength": 4,
"maxLength": 4,
"fieldNumber": 1
},
"tokenID": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8,
"fieldNumber": 2
},
"amount": {
"dataType": "uint64",
"fieldNumber": 3
},
"result": {
"dataType": "uint32",
"fieldNumber": 4
}
}
}
},
{
"module": "token",
"name": "beforeCCCExecution",
"schema": {
"$id": "/token/events/beforeCCCExecution",
"type": "object",
"required": [
"ccmID",
"messageFeeTokenID",
"relayerAddress",
"result"
],
"properties": {
"ccmID": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32,
"fieldNumber": 1
},
"messageFeeTokenID": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8,
"fieldNumber": 2
},
"relayerAddress": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 3
},
"result": {
"dataType": "uint32",
"fieldNumber": 4
}
}
}
},
{
"module": "token",
"name": "beforeCCMForwarding",
"schema": {
"$id": "/token/events/beforeCCMForwarding",
"type": "object",
"required": [
"ccmID",
"messageFeeTokenID",
"result"
],
"properties": {
"ccmID": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32,
"fieldNumber": 1
},
"messageFeeTokenID": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8,
"fieldNumber": 2
},
"result": {
"dataType": "uint32",
"fieldNumber": 3
}
}
}
},
{
"module": "token",
"name": "allTokensSupported",
"schema": {
"$id": "/klayr/empty",
"type": "object",
"properties": {}
}
},
{
"module": "token",
"name": "allTokensSupportRemoved",
"schema": {
"$id": "/klayr/empty",
"type": "object",
"properties": {}
}
},
{
"module": "token",
"name": "allTokensFromChainSupported",
"schema": {
"$id": "/token/events/allTokensFromChainSupported",
"type": "object",
"required": [
"chainID"
],
"properties": {
"chainID": {
"dataType": "bytes",
"minLength": 4,
"maxLength": 4,
"fieldNumber": 1
}
}
}
},
{
"module": "token",
"name": "allTokensFromChainSupportRemoved",
"schema": {
"$id": "/token/events/allTokensFromChainSupportRemoved",
"type": "object",
"required": [
"chainID"
],
"properties": {
"chainID": {
"dataType": "bytes",
"minLength": 4,
"maxLength": 4,
"fieldNumber": 1
}
}
}
},
{
"module": "token",
"name": "tokenIDSupported",
"schema": {
"$id": "/token/events/tokenIDSupported",
"type": "object",
"required": [
"tokenID"
],
"properties": {
"tokenID": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8,
"fieldNumber": 1
}
}
}
},
{
"module": "token",
"name": "tokenIDSupportRemoved",
"schema": {
"$id": "/token/events/tokenIDSupportRemoved",
"type": "object",
"required": [
"tokenID"
],
"properties": {
"tokenID": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8,
"fieldNumber": 1
}
}
}
},
{
"module": "validators",
"name": "generatorKeyRegistration",
"schema": {
"$id": "/validators/event/generatorKeyRegData",
"type": "object",
"required": [
"generatorKey",
"result"
],
"properties": {
"generatorKey": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32,
"fieldNumber": 1
},
"result": {
"dataType": "uint32",
"fieldNumber": 2
}
}
}
},
{
"module": "validators",
"name": "blsKeyRegistration",
"schema": {
"$id": "/validators/event/blsKeyRegData",
"type": "object",
"required": [
"blsKey",
"result"
],
"properties": {
"blsKey": {
"dataType": "bytes",
"minLength": 48,
"maxLength": 48,
"fieldNumber": 1
},
"proofOfPossession": {
"dataType": "bytes",
"minLength": 96,
"maxLength": 96,
"fieldNumber": 2
},
"result": {
"dataType": "uint32",
"fieldNumber": 3
}
}
}
}
],
"assets": [
{
"module": "auth",
"version": "0",
"schema": {
"$id": "/auth/module/genesis",
"type": "object",
"required": [
"authDataSubstore"
],
"properties": {
"authDataSubstore": {
"type": "array",
"fieldNumber": 1,
"items": {
"type": "object",
"required": [
"storeKey",
"storeValue"
],
"properties": {
"storeKey": {
"dataType": "bytes",
"fieldNumber": 1
},
"storeValue": {
"type": "object",
"fieldNumber": 2,
"required": [
"nonce",
"numberOfSignatures",
"mandatoryKeys",
"optionalKeys"
],
"properties": {
"nonce": {
"dataType": "uint64",
"fieldNumber": 1
},
"numberOfSignatures": {
"dataType": "uint32",
"fieldNumber": 2
},
"mandatoryKeys": {
"type": "array",
"fieldNumber": 3,
"items": {
"dataType": "bytes"
}
},
"optionalKeys": {
"type": "array",
"fieldNumber": 4,
"items": {
"dataType": "bytes"
}
}
}
}
}
}
}
}
}
},
{
"module": "interoperability",
"version": "0",
"schema": {
"$id": "/interoperability/module/genesis",
"type": "object",
"required": [
"ownChainName",
"ownChainNonce",
"chainInfos",
"terminatedStateAccounts",
"terminatedOutboxAccounts"
],
"properties": {
"ownChainName": {
"dataType": "string",
"maxLength": 32,
"fieldNumber": 1
},
"ownChainNonce": {
"dataType": "uint64",
"fieldNumber": 2
},
"chainInfos": {
"type": "array",
"fieldNumber": 3,
"items": {
"type": "object",
"required": [
"chainID",
"chainData",
"channelData",
"chainValidators"
],
"properties": {
"chainID": {
"dataType": "bytes",
"minLength": 4,
"maxLength": 4,
"fieldNumber": 1
},
"chainData": {
"$id": "/modules/interoperability/chainData",
"type": "object",
"required": [
"name",
"lastCertificate",
"status"
],
"properties": {
"name": {
"dataType": "string",
"fieldNumber": 1
},
"lastCertificate": {
"type": "object",
"fieldNumber": 2,
"required": [
"height",
"timestamp",
"stateRoot",
"validatorsHash"
],
"properties": {
"height": {
"dataType": "uint32",
"fieldNumber": 1
},
"timestamp": {
"dataType": "uint32",
"fieldNumber": 2
},
"stateRoot": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32,
"fieldNumber": 3
},
"validatorsHash": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32,
"fieldNumber": 4
}
}
},
"status": {
"dataType": "uint32",
"fieldNumber": 3
}
},
"fieldNumber": 2
},
"channelData": {
"$id": "/modules/interoperability/channel",
"type": "object",
"required": [
"inbox",
"outbox",
"partnerChainOutboxRoot",
"messageFeeTokenID",
"minReturnFeePerByte"
],
"properties": {
"inbox": {
"type": "object",
"fieldNumber": 1,
"required": [
"appendPath",
"size",
"root"
],
"properties": {
"appendPath": {
"type": "array",
"items": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32
},
"fieldNumber": 1
},
"size": {
"dataType": "uint32",
"fieldNumber": 2
},
"root": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32,
"fieldNumber": 3
}
}
},
"outbox": {
"type": "object",
"fieldNumber": 2,
"required": [
"appendPath",
"size",
"root"
],
"properties": {
"appendPath": {
"type": "array",
"items": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32
},
"fieldNumber": 1
},
"size": {
"dataType": "uint32",
"fieldNumber": 2
},
"root": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32,
"fieldNumber": 3
}
}
},
"partnerChainOutboxRoot": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32,
"fieldNumber": 3
},
"messageFeeTokenID": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8,
"fieldNumber": 4
},
"minReturnFeePerByte": {
"dataType": "uint64",
"fieldNumber": 5
}
},
"fieldNumber": 3
},
"chainValidators": {
"$id": "/modules/interoperability/chainValidators",
"type": "object",
"required": [
"activeValidators",
"certificateThreshold"
],
"properties": {
"activeValidators": {
"type": "array",
"fieldNumber": 1,
"minItems": 1,
"maxItems": 199,
"items": {
"type": "object",
"required": [
"blsKey",
"bftWeight"
],
"properties": {
"blsKey": {
"dataType": "bytes",
"minLength": 48,
"maxLength": 48,
"fieldNumber": 1
},
"bftWeight": {
"dataType": "uint64",
"fieldNumber": 2
}
}
}
},
"certificateThreshold": {
"dataType": "uint64",
"fieldNumber": 2
}
},
"fieldNumber": 4
}
}
}
},
"terminatedStateAccounts": {
"type": "array",
"fieldNumber": 4,
"items": {
"type": "object",
"required": [
"chainID",
"terminatedStateAccount"
],
"properties": {
"chainID": {
"dataType": "bytes",
"minLength": 4,
"maxLength": 4,
"fieldNumber": 1
},
"terminatedStateAccount": {
"$id": "/modules/interoperability/terminatedState",
"type": "object",
"required": [
"stateRoot",
"mainchainStateRoot",
"initialized"
],
"properties": {
"stateRoot": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32,
"fieldNumber": 1
},
"mainchainStateRoot": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32,
"fieldNumber": 2
},
"initialized": {
"dataType": "boolean",
"fieldNumber": 3
}
},
"fieldNumber": 2
}
}
}
},
"terminatedOutboxAccounts": {
"type": "array",
"fieldNumber": 5,
"items": {
"type": "object",
"required": [
"chainID",
"terminatedOutboxAccount"
],
"properties": {
"chainID": {
"dataType": "bytes",
"minLength": 4,
"maxLength": 4,
"fieldNumber": 1
},
"terminatedOutboxAccount": {
"$id": "/modules/interoperability/terminatedOutbox",
"type": "object",
"required": [
"outboxRoot",
"outboxSize",
"partnerChainInboxSize"
],
"properties": {
"outboxRoot": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32,
"fieldNumber": 1
},
"outboxSize": {
"dataType": "uint32",
"fieldNumber": 2
},
"partnerChainInboxSize": {
"dataType": "uint32",
"fieldNumber": 3
}
},
"fieldNumber": 2
}
}
}
}
}
}
},
{
"module": "legacy",
"version": "0",
"schema": {
"$id": "/legacy/module/genesis",
"type": "object",
"required": [
"accounts"
],
"properties": {
"accounts": {
"type": "array",
"fieldNumber": 1,
"items": {
"type": "object",
"required": [
"address",
"balance"
],
"properties": {
"address": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8,
"fieldNumber": 1
},
"balance": {
"dataType": "uint64",
"fieldNumber": 2
}
}
}
}
}
}
},
{
"module": "pos",
"version": "0",
"schema": {
"$id": "/pos/module/genesis",
"type": "object",
"required": [
"validators",
"stakers",
"genesisData"
],
"properties": {
"validators": {
"type": "array",
"fieldNumber": 1,
"items": {
"type": "object",
"required": [
"address",
"name",
"blsKey",
"proofOfPossession",
"generatorKey",
"lastGeneratedHeight",
"isBanned",
"reportMisbehaviorHeights",
"consecutiveMissedBlocks",
"commission",
"lastCommissionIncreaseHeight",
"sharingCoefficients"
],
"properties": {
"address": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 1
},
"name": {
"dataType": "string",
"fieldNumber": 2,
"minLength": 1,
"maxLength": 20
},
"blsKey": {
"dataType": "bytes",
"fieldNumber": 3,
"minLength": 48,
"maxLength": 48
},
"proofOfPossession": {
"dataType": "bytes",
"fieldNumber": 4,
"minLength": 96,
"maxLength": 96
},
"generatorKey": {
"dataType": "bytes",
"fieldNumber": 5,
"minLength": 32,
"maxLength": 32
},
"lastGeneratedHeight": {
"dataType": "uint32",
"fieldNumber": 6
},
"isBanned": {
"dataType": "boolean",
"fieldNumber": 7
},
"reportMisbehaviorHeights": {
"type": "array",
"fieldNumber": 8,
"items": {
"dataType": "uint32"
}
},
"consecutiveMissedBlocks": {
"dataType": "uint32",
"fieldNumber": 9
},
"commission": {
"dataType": "uint32",
"fieldNumber": 10,
"maximum": 10000
},
"lastCommissionIncreaseHeight": {
"dataType": "uint32",
"fieldNumber": 11
},
"sharingCoefficients": {
"type": "array",
"fieldNumber": 12,
"items": {
"type": "object",
"required": [
"tokenID",
"coefficient"
],
"properties": {
"tokenID": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8,
"fieldNumber": 1
},
"coefficient": {
"dataType": "bytes",
"maxLength": 24,
"fieldNumber": 2
}
}
}
}
}
}
},
"stakers": {
"type": "array",
"fieldNumber": 2,
"items": {
"type": "object",
"required": [
"address",
"stakes",
"pendingUnlocks"
],
"properties": {
"address": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 1
},
"stakes": {
"type": "array",
"fieldNumber": 2,
"items": {
"type": "object",
"required": [
"validatorAddress",
"amount",
"sharingCoefficients"
],
"properties": {
"validatorAddress": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 1
},
"amount": {
"dataType": "uint64",
"fieldNumber": 2
},
"sharingCoefficients": {
"type": "array",
"fieldNumber": 3,
"items": {
"type": "object",
"required": [
"tokenID",
"coefficient"
],
"properties": {
"tokenID": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8,
"fieldNumber": 1
},
"coefficient": {
"dataType": "bytes",
"maxLength": 24,
"fieldNumber": 2
}
}
}
}
}
}
},
"pendingUnlocks": {
"type": "array",
"fieldNumber": 3,
"items": {
"type": "object",
"required": [
"validatorAddress",
"amount",
"unstakeHeight"
],
"properties": {
"validatorAddress": {
"dataType": "bytes",
"fieldNumber": 1,
"format": "klayr32"
},
"amount": {
"dataType": "uint64",
"fieldNumber": 2
},
"unstakeHeight": {
"dataType": "uint32",
"fieldNumber": 3
}
}
}
}
}
}
},
"genesisData": {
"type": "object",
"fieldNumber": 3,
"required": [
"initRounds",
"initValidators"
],
"properties": {
"initRounds": {
"dataType": "uint32",
"fieldNumber": 1
},
"initValidators": {
"type": "array",
"fieldNumber": 2,
"items": {
"dataType": "bytes",
"format": "klayr32"
}
}
}
}
}
}
},
{
"module": "random",
"version": "2",
"schema": {
"$id": "/modules/random/block/header/asset",
"type": "object",
"properties": {
"seedReveal": {
"dataType": "bytes",
"fieldNumber": 1,
"minLength": 16,
"maxLength": 16
}
},
"required": [
"seedReveal"
]
}
},
{
"module": "token",
"version": "0",
"schema": {
"$id": "/token/module/genesis",
"type": "object",
"required": [
"userSubstore",
"supplySubstore",
"escrowSubstore",
"supportedTokensSubstore"
],
"properties": {
"userSubstore": {
"type": "array",
"fieldNumber": 1,
"items": {
"type": "object",
"required": [
"address",
"tokenID",
"availableBalance",
"lockedBalances"
],
"properties": {
"address": {
"dataType": "bytes",
"format": "klayr32",
"fieldNumber": 1
},
"tokenID": {
"dataType": "bytes",
"fieldNumber": 2,
"minLength": 8,
"maxLength": 8
},
"availableBalance": {
"dataType": "uint64",
"fieldNumber": 3
},
"lockedBalances": {
"type": "array",
"fieldNumber": 4,
"items": {
"type": "object",
"required": [
"module",
"amount"
],
"properties": {
"module": {
"dataType": "string",
"minLength": 1,
"maxLength": 32,
"fieldNumber": 1
},
"amount": {
"dataType": "uint64",
"fieldNumber": 2
}
}
}
}
}
}
},
"supplySubstore": {
"type": "array",
"fieldNumber": 2,
"items": {
"type": "object",
"required": [
"tokenID",
"totalSupply"
],
"properties": {
"tokenID": {
"dataType": "bytes",
"fieldNumber": 1,
"minLength": 8,
"maxLength": 8
},
"totalSupply": {
"dataType": "uint64",
"fieldNumber": 2
}
}
}
},
"escrowSubstore": {
"type": "array",
"fieldNumber": 3,
"items": {
"type": "object",
"required": [
"escrowChainID",
"tokenID",
"amount"
],
"properties": {
"escrowChainID": {
"dataType": "bytes",
"minLength": 4,
"maxLength": 4,
"fieldNumber": 1
},
"tokenID": {
"dataType": "bytes",
"fieldNumber": 2,
"minLength": 8,
"maxLength": 8
},
"amount": {
"dataType": "uint64",
"fieldNumber": 3
}
}
}
},
"supportedTokensSubstore": {
"type": "array",
"fieldNumber": 4,
"items": {
"type": "object",
"required": [
"chainID",
"supportedTokenIDs"
],
"properties": {
"chainID": {
"dataType": "bytes",
"minLength": 4,
"maxLength": 4,
"fieldNumber": 1
},
"supportedTokenIDs": {
"type": "array",
"fieldNumber": 2,
"items": {
"dataType": "bytes",
"minLength": 8,
"maxLength": 8
}
}
}
}
}
}
}
}
],
"commands": [
{
"moduleCommand": "auth:registerMultisignature",
"schema": {
"$id": "/auth/command/regMultisig",
"type": "object",
"properties": {
"numberOfSignatures": {
"dataType": "uint32",
"fieldNumber": 1,
"minimum": 1,
"maximum": 64
},
"mandatoryKeys": {
"type": "array",
"items": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32
},
"fieldNumber": 2,
"minItems": 0,
"maxItems": 64
},
"optionalKeys": {
"type": "array",
"items": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32
},
"fieldNumber": 3,
"minItems": 0,
"maxItems": 64
},
"signatures": {
"type": "array",
"items": {
"dataType": "bytes",
"minLength": 64,
"maxLength": 64
},
"fieldNumber": 4
}
},
"required": [
"numberOfSignatures",
"mandatoryKeys",
"optionalKeys",
"signatures"
]
}
},
{
"moduleCommand": "interoperability:submitMainchainCrossChainUpdate",
"schema": {
"$id": "/modules/interoperability/ccu",
"type": "object",
"required": [
"sendingChainID",
"certificate",
"activeValidatorsUpdate",
"certificateThreshold",
"inboxUpdate"
],
"properties": {
"sendingChainID": {
"dataType": "bytes",
"fieldNumber": 1,
"minLength": 4,
"maxLength": 4
},
"certificate": {
"dataType": "bytes",
"fieldNumber": 2
},
"activeValidatorsUpdate": {
"type": "object",
"fieldNumber": 3,
"required": [
"blsKeysUpdate",
"bftWeightsUpdate",
"bftWeightsUpdateBitmap"
],
"properties": {
"blsKeysUpdate": {
"type": "array",
"fieldNumber": 1,
"items": {
"dataType": "bytes",
"minLength": 48,
"maxLength": 48
}
},
"bftWeightsUpdate": {
"type": "array",
"fieldNumber": 2,
"items": {
"dataType": "uint64"
}
},
"bftWeightsUpdateBitmap": {
"dataType": "bytes",
"fieldNumber": 3
}
}
},
"certificateThreshold": {
"dataType": "uint64",
"fieldNumber": 4
},
"inboxUpdate": {
"type": "object",
"fieldNumber": 5,
"required": [
"crossChainMessages",
"messageWitnessHashes",
"outboxRootWitness"
],
"properties": {
"crossChainMessages": {
"type": "array",
"fieldNumber": 1,
"items": {
"dataType": "bytes"
}
},
"messageWitnessHashes": {
"type": "array",
"fieldNumber": 2,
"items": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32
}
},
"outboxRootWitness": {
"type": "object",
"fieldNumber": 3,
"required": [
"bitmap",
"siblingHashes"
],
"properties": {
"bitmap": {
"dataType": "bytes",
"fieldNumber": 1
},
"siblingHashes": {
"type": "array",
"fieldNumber": 2,
"items": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32
}
}
}
}
}
}
}
}
},
{
"moduleCommand": "interoperability:initializeMessageRecovery",
"schema": {
"$id": "/modules/interoperability/mainchain/messageRecoveryInitialization",
"type": "object",
"required": [
"chainID",
"channel",
"bitmap",
"siblingHashes"
],
"properties": {
"chainID": {
"dataType": "bytes",
"fieldNumber": 1,
"minLength": 4,
"maxLength": 4
},
"channel": {
"dataType": "bytes",
"fieldNumber": 2
},
"bitmap": {
"dataType": "bytes",
"fieldNumber": 3
},
"siblingHashes": {
"type": "array",
"items": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32
},
"fieldNumber": 4
}
}
}
},
{
"moduleCommand": "interoperability:recoverMessage",
"schema": {
"$id": "/modules/interoperability/mainchain/messageRecovery",
"type": "object",
"required": [
"chainID",
"crossChainMessages",
"idxs",
"siblingHashes"
],
"properties": {
"chainID": {
"dataType": "bytes",
"minLength": 4,
"maxLength": 4,
"fieldNumber": 1
},
"crossChainMessages": {
"type": "array",
"items": {
"dataType": "bytes"
},
"fieldNumber": 2
},
"idxs": {
"type": "array",
"items": {
"dataType": "uint32"
},
"fieldNumber": 3
},
"siblingHashes": {
"type": "array",
"items": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32
},
"fieldNumber": 4
}
}
}
},
{
"moduleCommand": "interoperability:registerSidechain",
"schema": {
"$id": "/modules/interoperability/mainchain/sidechainRegistration",
"type": "object",
"required": [
"chainID",
"name",
"sidechainValidators",
"sidechainCertificateThreshold"
],
"properties": {
"chainID": {
"dataType": "bytes",
"fieldNumber": 1,
"minLength": 4,
"maxLength": 4
},
"name": {
"dataType": "string",
"fieldNumber": 2,
"minLength": 1,
"maxLength": 32
},
"sidechainValidators": {
"type": "array",
"items": {
"type": "object",
"required": [
"blsKey",
"bftWeight"
],
"properties": {
"blsKey": {
"dataType": "bytes",
"fieldNumber": 1,
"minLength": 48,
"maxLength": 48
},
"bftWeight": {
"dataType": "uint64",
"fieldNumber": 2
}
}
},
"minItems": 1,
"fieldNumber": 3,
"maxItems": 199
},
"sidechainCertificateThreshold": {
"dataType": "uint64",
"fieldNumber": 4
}
}
}
},
{
"moduleCommand": "interoperability:recoverState",
"schema": {
"$id": "/modules/interoperability/mainchain/commands/stateRecovery",
"type": "object",
"required": [
"chainID",
"module",
"storeEntries",
"siblingHashes"
],
"properties": {
"chainID": {
"dataType": "bytes",
"fieldNumber": 1,
"minLength": 4,
"maxLength": 4
},
"module": {
"dataType": "string",
"fieldNumber": 2,
"minLength": 1,
"maxLength": 32
},
"storeEntries": {
"type": "array",
"fieldNumber": 3,
"items": {
"type": "object",
"properties": {
"substorePrefix": {
"dataType": "bytes",
"fieldNumber": 1,
"minLength": 2,
"maxLength": 2
},
"storeKey": {
"dataType": "bytes",
"fieldNumber": 2
},
"storeValue": {
"dataType": "bytes",
"fieldNumber": 3
},
"bitmap": {
"dataType": "bytes",
"fieldNumber": 4
}
},
"required": [
"substorePrefix",
"storeKey",
"storeValue",
"bitmap"
]
}
},
"siblingHashes": {
"type": "array",
"items": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32
},
"fieldNumber": 4
}
}
}
},
{
"moduleCommand": "interoperability:terminateSidechainForLiveness",
"schema": {
"$id": "/modules/interoperability/mainchain/terminateSidechainForLiveness",
"type": "object",
"required": [
"chainID"
],
"properties": {
"chainID": {
"dataType": "bytes",
"fieldNumber": 1,
"minLength": 4,
"maxLength": 4
}
}
}
},
{
"moduleCommand": "legacy:reclaimKLY",
"schema": {
"$id": "/legacy/command/reclaimKLYParams",
"type": "object",
"required": [
"amount"
],
"properties": {
"amount": {
"dataType": "uint64",
"fieldNumber": 1
}
}
}
},
{
"moduleCommand": "legacy:registerKeys",
"schema": {
"$id": "/legacy/command/registerKeysParams",
"type": "object",
"required": [
"blsKey",
"proofOfPossession",
"generatorKey"
],
"properties": {
"blsKey": {
"dataType": "bytes",
"minLength": 48,
"maxLength": 48,
"fieldNumber": 1
},
"proofOfPossession": {
"dataType": "bytes",
"minLength": 96,
"maxLength": 96,
"fieldNumber": 2
},
"generatorKey": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32,
"fieldNumber": 3
}
}
}
},
{
"moduleCommand": "pos:registerValidator",
"schema": {
"$id": "/pos/command/registerValidatorParams",
"type": "object",
"required": [
"name",
"blsKey",
"proofOfPossession",
"generatorKey"
],
"properties": {
"name": {
"dataType": "string",
"fieldNumber": 1
},
"blsKey": {
"dataType": "bytes",
"minLength": 48,
"maxLength": 48,
"fieldNumber": 2
},
"proofOfPossession": {
"dataType": "bytes",
"minLength": 96,
"maxLength": 96,
"fieldNumber": 3
},
"generatorKey": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32,
"fieldNumber": 4
}
}
}
},
{
"moduleCommand": "pos:reportMisbehavior",
"schema": {
"$id": "/pos/command/reportMisbehaviorParams",
"type": "object",
"required": [
"header1",
"header2"
],
"properties": {
"header1": {
"dataType": "bytes",
"fieldNumber": 1
},
"header2": {
"dataType": "bytes",
"fieldNumber": 2
}
}
}
},
{
"moduleCommand": "pos:unlock",
"schema": {
"$id": "/klayr/empty",
"type": "object",
"properties": {}
}
},
{
"moduleCommand": "pos:updateGeneratorKey",
"schema": {
"$id": "/pos/command/updateGeneratorKeyParams",
"type": "object",
"required": [
"generatorKey"
],
"properties": {
"generatorKey": {
"dataType": "bytes",
"fieldNumber": 1,
"minLength": 32,
"maxLength": 32
}
}
}
},
{
"moduleCommand": "pos:stake",
"schema": {
"$id": "/pos/command/stakeValidatorParams",
"type": "object",
"required": [
"stakes"
],
"properties": {
"stakes": {
"type": "array",
"fieldNumber": 1,
"minItems": 1,
"maxItems": 20,
"items": {
"type": "object",
"required": [
"validatorAddress",
"amount"
],
"properties": {
"validatorAddress": {
"dataType": "bytes",
"fieldNumber": 1,
"format": "klayr32"
},
"amount": {
"dataType": "sint64",
"fieldNumber": 2
}
}
}
}
}
}
},
{
"moduleCommand": "pos:changeCommission",
"schema": {
"$id": "/pos/command/changeCommissionCommandParams",
"type": "object",
"required": [
"newCommission"
],
"properties": {
"newCommission": {
"dataType": "uint32",
"fieldNumber": 1,
"maximum": 10000
}
}
}
},
{
"moduleCommand": "pos:claimRewards",
"schema": {
"$id": "/klayr/empty",
"type": "object",
"properties": {}
}
},
{
"moduleCommand": "token:transfer",
"schema": {
"$id": "/klayr/transferParams",
"title": "Transfer transaction params",
"type": "object",
"required": [
"tokenID",
"amount",
"recipientAddress",
"data"
],
"properties": {
"tokenID": {
"dataType": "bytes",
"fieldNumber": 1,
"minLength": 8,
"maxLength": 8
},
"amount": {
"dataType": "uint64",
"fieldNumber": 2
},
"recipientAddress": {
"dataType": "bytes",
"fieldNumber": 3,
"format": "klayr32"
},
"data": {
"dataType": "string",
"fieldNumber": 4,
"minLength": 0,
"maxLength": 64
}
}
}
},
{
"moduleCommand": "token:transferCrossChain",
"schema": {
"$id": "/klayr/ccTransferParams",
"type": "object",
"required": [
"tokenID",
"amount",
"receivingChainID",
"recipientAddress",
"data",
"messageFee",
"messageFeeTokenID"
],
"properties": {
"tokenID": {
"dataType": "bytes",
"fieldNumber": 1,
"minLength": 8,
"maxLength": 8
},
"amount": {
"dataType": "uint64",
"fieldNumber": 2
},
"receivingChainID": {
"dataType": "bytes",
"fieldNumber": 3,
"minLength": 4,
"maxLength": 4
},
"recipientAddress": {
"dataType": "bytes",
"fieldNumber": 4,
"format": "klayr32"
},
"data": {
"dataType": "string",
"fieldNumber": 5,
"minLength": 0,
"maxLength": 64
},
"messageFee": {
"dataType": "uint64",
"fieldNumber": 6
},
"messageFeeTokenID": {
"dataType": "bytes",
"fieldNumber": 7,
"minLength": 8,
"maxLength": 8
}
}
}
}
],
"messages": [
{
"moduleCommand": "auth:registerMultisignature",
"param": "signatures",
"schema": {
"$id": "/auth/command/regMultisigMsg",
"type": "object",
"required": [
"address",
"nonce",
"numberOfSignatures",
"mandatoryKeys",
"optionalKeys"
],
"properties": {
"address": {
"dataType": "bytes",
"fieldNumber": 1,
"minLength": 20,
"maxLength": 20
},
"nonce": {
"dataType": "uint64",
"fieldNumber": 2
},
"numberOfSignatures": {
"dataType": "uint32",
"fieldNumber": 3
},
"mandatoryKeys": {
"type": "array",
"items": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32
},
"fieldNumber": 4
},
"optionalKeys": {
"type": "array",
"items": {
"dataType": "bytes",
"minLength": 32,
"maxLength": 32
},
"fieldNumber": 5
}
}
}
}
]
},
"meta": {}
}
Interoperability
Endpoints related to the Interoperability module.
get.blockchain.apps
Retrieves blockchain applications in the current network. The API supports pagination.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
A unique string value that identifies a blockchain in a network or various blockchains. Can be expressed as CSV. |
none |
00000000 |
|
String |
Name of the blockchain application. |
none |
Klayr |
|
String |
Status of a blockchain.
Possible value can be: |
none |
active |
|
String |
Case-insensitive keyword search by |
none |
klynhqvv8ou5jpjcn3ezazkjgbjp2kdhwvoyz6hfj |
|
Number |
The number of records to be returned for a query. |
10 |
10 |
|
Number |
The number of records a query should skip before selecting records. |
0 |
0 |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.blockchain.apps",
"params": {
}
}
get.blockchain.apps.statistics
Retrieves statistics for the current network blockchain applications.
No parameters are required.
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.blockchain.apps.statistics",
"params": {
}
}
Index Status
Endpoint related to indexing.
get.index.status
Retrieves the current indexing status.
No parameters are required.
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.index.status",
"params": {
}
}
Proxy
Endpoint related to the proxy.
post.invoke
Proxy request to directly invoke application endpoint. Returns endpoint response from the blockchain application in its original form.
The endpoint can be invoked by sending a payload to it.
{
"endpoint": "chain_getBlockByHeight", // Required: Blockchain application endpoint to invoke
"params": { // Optional: Parameters to be passed corresponding to the invoked application endpoint
"height": 10
}
}
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "post.invoke",
"params": {
"endpoint": "chain_getBlockByHeight", // Required: Blockchain application endpoint to invoke
"params": { // Optional: Parameters to be passed corresponding to the invoked application endpoint
"height": 10
}
}
}
Sample responses
{
"data": {
"header": {
"version": 2,
"timestamp": 1684308350,
"height": 10,
"previousBlockID": "28744c27d8360c339fcb2203235425abe5b35b8439a7775be6221845284c6d4d",
"stateRoot": "a6616d10f0b5e6c8410cf5ccccf6fc7bd3467f851151b35e114e362d5a1c515b",
"assetRoot": "ef40a28bf0738d625f773efffb35d8bd67ec5b50af1eb45ac707cf805b0b0958",
"eventRoot": "1cf322810cc88a097ad479b75bd62261fdc5f40febcbcc9b9de9f7e7df18a5c2",
"transactionRoot": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"validatorsHash": "8438b6d8c70e18c79a9215f53b6c4677e2f4bab793479a35c03d8f514f3389b3",
"aggregateCommit": {
"height": 0,
"aggregationBits": "",
"certificateSignature": ""
},
"generatorAddress": "klyzkkm35mnozqckwzt8ajeg2j47tpu2x9bnh4d7a",
"maxHeightPrevoted": 0,
"maxHeightGenerated": 0,
"impliesMaxPrevotes": true,
"signature": "2c231b5b7dfe123b44b749f2107a435d13dd578a9df94d4224a0f61d2c3b22cd81454a128bd83ec56d883e711b668e28af27e2d7b237a10af56378dd3b9d300d",
"id": "876f1e4c54dc05390b862ed930c694b59f5eb9fd6dc22cb07b0d48f60fb1e7fc"
},
"transactions": [],
"assets": [
{
"module": "random",
"data": "0a104cad50c92312e57b0da37c76f071d352"
}
]
},
"meta": {
"endpoint": "chain_getBlockByHeight",
"params": {
"height": 10
}
}
}
{
"error": true,
"message": "Unable to reach a network node."
}
Off-chain APIs
Endpoints related to off-chain APIs.
Application Metadata
Endpoints related to the application’s metadata.
get.blockchain.apps.meta.list
Retrieves a list of blockchain applications for which the metadata exists.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
Name of the blockchain. |
none |
Klayr |
|
String |
Type of network.
Value can be: |
none |
devnet |
|
String |
Case-insensitive keyword search by |
none |
Klayr |
|
Number |
The number of records to be returned for a query. |
10 |
10 |
|
Number |
The number of records a query should skip before selecting records. |
0 |
0 |
|
Enum |
Defines the criteria on which the retrieved data is sorted. Value can be: chainName:asc, chainName:desc, chainID:asc, or chainID:desc |
chainName:asc |
chainName:asc |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.blockchain.apps.meta.list",
"params": {
}
}
Sample responses
{
"data": [
{
"chainName": "Klayr",
"chainID": "03000000",
"networkType": "alphanet"
},
{
"chainName": "Klayr",
"chainID": "02000000",
"networkType": "betanet"
},
{
"chainName": "Klayr",
"chainID": "04000000",
"networkType": "devnet"
},
{
"chainName": "Colecti",
"chainID": "03000002",
"networkType": "alphanet"
},
{
"chainName": "Colecti",
"chainID": "04000002",
"networkType": "devnet"
},
{
"chainName": "Enevti",
"chainID": "03000001",
"networkType": "alphanet"
},
{
"chainName": "Enevti",
"chainID": "04000001",
"networkType": "devnet"
}
],
"meta": {
"count": 7,
"offset": 0,
"total": 7
}
}
get.blockchain.apps.meta
Retrieves metadata for a list of blockchain applications. The information is used by the wallets. The API supports pagination.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
Name of the blockchain. |
none |
Klayr |
|
String |
A unique string value that identifies a blockchain in a network or various blockchains. Can be expressed as CSV. |
none |
00000000 |
|
Boolean |
Boolean value. |
none |
true |
|
String |
Type of network.
Value can be: |
none |
devnet |
|
String |
Case-insensitive keyword search by |
none |
Klayr |
|
Number |
The number of records to be returned for a query. |
10 |
10 |
|
Number |
The number of records a query should skip before selecting records. |
0 |
0 |
|
Enum |
Defines the criteria on which the retrieved data is sorted. Value can be: chainName:asc, chainName:desc, chainID:asc, or chainID:desc |
chainName:asc |
chainName:asc |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.blockchain.apps.meta",
"params": {
}
}
Sample responses
{
"data": [
{
"chainName": "Klayr",
"chainID": "00000000",
"title": "Klayr blockchain application",
"status": "active",
"description": "Klayr is a blockchain application platform.",
"networkType": "mainnet",
"isDefault": true,
"genesisURL": "https://downloads.klayr.xyz/klayr/mainnet/genesis_block.json.tar.gz",
"projectPage": "https://klayr.xyz",
"serviceURLs": [
{
"http": "https://service.klayr.xyz",
"ws": "wss://service.klayr.xyz"
}
],
"logo": {
"png": "https://downloads.klayr.xyz/klayr/images/logo.png",
"svg": "https://downloads.klayr.xyz/klayr/images/logo.svg"
},
"appPage": "https://klayr.xyz",
"backgroundColor": "#0981D1",
"explorers": [
{
"url": "https://klayr.observer",
"txnPage": "https://klayr.observer/transactions"
}
],
"appNodes": [
{
"url": "https://mainnet.klayr.xyz",
"maintainer": "Lightcurve GmbH"
}
]
}
],
"meta": {
"count": 10,
"offset": 10,
"total": 400
}
}
get.blockchain.apps.meta.tokens
Retrieves the metadata for the tokens. The information is used by the wallets. The API supports pagination.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
Name of the blockchain. |
none |
Klayr |
|
String |
A unique string value that identifies a blockchain in a network or various blockchains. Can be expressed as CSV. |
none |
00000000 |
|
String |
Name of a token. |
none |
00000000 |
|
String |
A unique string value that identifies a token. |
none |
0000000000000000 |
|
String |
Type of network.
Value can be: |
none |
devnet |
|
String |
Case-insensitive keyword search by |
none |
Klayr |
|
Number |
The number of records to be returned for a query. |
10 |
10 |
|
Number |
The number of records a query should skip before selecting records. |
0 |
0 |
|
Enum |
Defines the criteria on which the retrieved data is sorted. Value can be: chainName:asc, or chainName:desc. |
chainName:asc |
chainName:asc |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.blockchain.apps.meta.tokens",
"params": {
}
}
Sample responses
{
"data": [
{
"chainID": "00000000",
"chainName": "Klayr",
"tokenID": "Klayr",
"tokenName": "00000000",
"networkType": "mainnet",
"description": "KLY is the utility token of Klayr",
"denomUnits": [
{
"denom": "kly",
"decimals": 8,
"aliases": [
"KLAYR"
]
}
],
"symbol": "KLY",
"displayDenom": "KLY",
"baseDenom": "beddows",
"logo": {
"png": "https://downloads.klayr.xyz/klayr/images/logo.png",
"svg": "https://downloads.klayr.xyz/klayr/images/logo.svg"
}
}
],
"meta": {
"count": 10,
"offset": 10,
"total": 400
}
}
get.blockchain.apps.meta.tokens.supported
Retrieves the metadata for the tokens supported by the specified blockchain application.
The information is used by the wallets.
This endpoint internally queries the /token/summary
for the specified chainID
and considers the supportedTokens
information to collate the relevant metadata.
The API supports pagination.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
A unique string value that identifies a blockchain in a network or various blockchains. Can be expressed as CSV. This is a required field. |
none |
00000000 |
|
Number |
The number of records to be returned for a query. |
10 |
10 |
|
Number |
The number of records a query should skip before selecting records. |
0 |
0 |
|
Enum |
Defines the criteria on which the retrieved data is sorted. Value can be: tokenID:asc, or tokenID:desc. |
tokenID:asc |
tokenID:asc |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.blockchain.apps.meta.tokens.supported",
"params": {
"chainID": "00000000"
}
}
Sample responses
{
"data": [
{
"chainID": "00000000",
"chainName": "Klayr",
"tokenID": "0000000000000000",
"tokenName": "Klayr",
"networkType": "mainnet",
"description": "Default token for the entire Klayr ecosystem",
"logo": {
"png": "https://downloads.klayr.xyz/klayr/images/logo.png",
"svg": "https://downloads.klayr.xyz/klayr/images/logo.svg"
},
"symbol": "KLY",
"displayDenom": "kly",
"baseDenom": "beddows",
"denomUnits": [
{
"denom": "beddows",
"decimals": 0,
"aliases": [
"Beddows"
]
},
{
"denom": "kly",
"decimals": 8,
"aliases": [
"Klayr"
]
}
]
}
],
"meta": {
"count": 1,
"offset": 0,
"total": 1
}
}
Market Prices
Endpoint related to market prices.
get.market.prices
Retrieves current market prices.
No parameters are required.
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.market.prices",
"params": {
}
}
Sample responses
{
"data": [
{
"code": "KLY_BTC",
"from": "KLY",
"rate": "0.00003198",
"to": "BTC",
"updateTimestamp": 1684506600,
"sources": [
"binance"
]
},
{
"code": "KLY_EUR",
"from": "KLY",
"rate": "0.7913",
"to": "EUR",
"updateTimestamp": 1684506600,
"sources": [
"kraken"
]
},
{
"code": "KLY_USD",
"from": "KLY",
"rate": "0.8586",
"to": "USD",
"updateTimestamp": 1684506600,
"sources": [
"kraken"
]
},
{
"code": "BTC_EUR",
"from": "BTC",
"rate": "24890.5300",
"to": "EUR",
"updateTimestamp": 1684506600,
"sources": [
"binance"
]
},
{
"code": "BTC_USD",
"from": "BTC",
"rate": "26839.9290",
"to": "USD",
"updateTimestamp": 1684506600,
"sources": [
"bittrex"
]
}
],
"meta": {
"count": 5
}
}
{
"error": true,
"message": "Service is not ready yet"
}
Account History Export
Endpoint related to account history export.
get.export.transactions
Returns transaction history and scheduling information for an account.
Parameter | Datatype | Description | Default | Sample |
---|---|---|---|---|
|
String |
Address of a blockchain account. |
none |
klynhqvv8ou5jpjcn3ezazkjgbjp2kdhwvoyz6hfj |
|
String |
The public key of a blockchain account. |
none |
b1d6bc6c7edd0673f5fed0681b73de6eb70539c21278b300f07ade277e1962cd |
|
String |
Defines a date interval in the YYYY-MM-DD format. If no interval is provided, then information is retrieved starting from the inception date of the network to the current date. |
none |
2021-07-01:2023-05-26 |
To request Klayr Service endpoints via WS, set up a socket.io connection as suggested in the WS-RPC intro, and send the following request:
{
"jsonrpc": "2.0",
"id": 1,
"method": "get.export.transactions",
"params": {
"address": "klydwsyfmcko6mcd357446yatromr9vzgu7eb8y99"
}
}
Sample responses
In order to export the account history, follow the steps mentioned in status codes 202 and 200. |
If the request is valid, the server will return with the address
of the account and the interval
for which the data export is requested.
{
"data": {
"address": "klydxc4ta5j43jp9ro3f8zqbxta9fn6jwzjucw7yt",
"interval": "2021-03-16:2021-12-06",
},
"meta": {
"ready": false
}
}
After a few seconds, re-request the same API with the same credentials to get a URL for a .xlsx
file.
{
"data": {
"address": "klydxc4ta5j43jp9ro3f8zqbxta9fn6jwzjucw7yt",
"interval": "2021-03-16:2021-12-06",
"fileName": "transactions_klydxc4ta5j43jp9ro3f8zqbxta9fn6jwzjucw7yt_2021-03-16_2021-12-06.csv",
"fileUrl": "/api/v3/exports/transactions_00000000_klykje69szpgmfaefmbf7zvw7ghc6mamdvf9z3cpw_2023-08-30_2023-08-30.xlsx"
},
"meta": {
"ready": true
}
}
Upon receiving a similar response as mentioned above, combine the fileUrl
with the HTTP base URL: https://service.klayr.xyz to download the file as shown in the following URL: