Token RPC API
embedded.token
embedded.token.getAll
This API call will return a list of all ZTS tokens
Request
2 parameters:
- first parameter of type
number
that represents the page - second parameter of type
number
that represents the number of entries
{
"jsonrpc": "2.0",
"id": 22,
"method": "embedded.token.getAll",
"params": [0, 5]
}
Response
An array of entries
:
count
of typenumber
: total number of ZTS tokenslist
of typearray
: array containing information about each token ordered by creation time. Each entry is defined by the following fields:name
of typestring
: name of the ZTS tokensymbol
of typestring
: symbol of the ZTS tokendomain
of typestring
: that represent a valid web domaintotalSupply
of typenumber
: circulating supplydecimals
of typenumber
: number of decimalsowner
of typestring
: address that issued this tokentokenStandard
of typestring
: unique identifier of this ZTSmaxSupply
of typenumber
: maximum supplyisBurnable
of typebool
:true
if it can be burned by any holder,false
if it can be burned only by its ownerisMintable
of typebool
:true
if the owner can increase the supply by minting,false
otherwiseisUtility
of typebool
:true
if the token is utilty,false
otherwise
{
"jsonrpc": "2.0",
"id": 22,
"result": {
"count": 200,
"list": [
{
"name": "testToken1",
"symbol": "test1",
"domain": "zenon.network",
"totalSupply": 3000305500000000000,
"decimals": 8,
"owner": "z1qz5p95pa8c6wq9pvfkg642gjv4nnaayx6vhm2w",
"tokenStandard": "zts10mxtv874tre00stfd6uelu",
"maxSupply": 4611686018427387903,
"isBurnable": true,
"isMintable": true,
"isUtility": true
},
{
"name": "testToken2",
"symbol": "test2",
"domain": "zenon.network",
"totalSupply": 3000038061600000000,
"decimals": 8,
"owner": "z1qz5p95pa8c6wq9pvfkg642gjv4nnaayx6vhm2w",
"tokenStandard": "zts1nl8h22r2ynw9jyeg5q5ssq",
"maxSupply": 4611686018427387903,
"isBurnable": false,
"isMintable": true,
"isUtility": true
}
]
}
}
embedded.token.getByOwner
This API call will return the list of ZTS issued by an address
Request
3 parameters:
- first parameter of type
string
that represents the address - second parameter of type
number
that represents the page index - third parameter of type
number
that represents the number of entries to be displayed on this page
{
"jsonrpc": "2.0",
"id": 24,
"method": "embedded.token.getByOwner",
"params": ["z1qrztagl9rukq3ltdflnvg4zrvpfp84mydfejk9", 0, 5]
}
Response
Same information as embedded.token.getAll
{
"jsonrpc": "2.0",
"id": 24,
"result": {
"count": 1,
"list": [
{
"name": "testToken2",
"symbol": "test2",
"domain": "zenon.network",
"totalSupply": 3000038061600000000,
"decimals": 8,
"owner": "z1qz5p95pa8c6wq9pvfkg642gjv4nnaayx6vhm2w",
"tokenStandard": "zts1nl8h22r2ynw9jyeg5q5ssq",
"maxSupply": 4611686018427387903,
"isBurnable": true,
"isMintable": true,
"isUtility": true
}
]
}
}
embedded.token.getByZts
This API call will return the ZTS with the specified unique indentifier
Request
One parameter of type string
that represents the ZTS
{
"jsonrpc": "2.0",
"id": 23,
"method": "embedded.token.getByZts",
"params": ["zts1nl8h22r2ynw9jyeg5q5ssq"]
}
Response
Same information as embedded.token.getAll
{
"id": 23,
"jsonrpc": "2.0",
"result": {
"name": "testToken1",
"symbol": "test1",
"domain": "zenon.network",
"totalSupply": 500,
"decimals": 8,
"owner": "z1qz3f6svf805tewktk5yf9tn8cdhe2236wdnugk",
"tokenStandard": "zts1nl8h22r2ynw9jyeg5q5ssq",
"maxSupply": 1000,
"isBurnable": true,
"isMintable": true,
"isUtility": true
}
}