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
numberthat represents the page - second parameter of type
numberthat represents the number of entries
{
"jsonrpc": "2.0",
"id": 22,
"method": "embedded.token.getAll",
"params": [0, 5]
}
Response
An array of entries:
countof typenumber: total number of ZTS tokenslistof typearray: array containing information about each token ordered by creation time. Each entry is defined by the following fields:nameof typestring: name of the ZTS tokensymbolof typestring: symbol of the ZTS tokendomainof typestring: that represent a valid web domaintotalSupplyof typenumber: circulating supplydecimalsof typenumber: number of decimalsownerof typestring: address that issued this tokentokenStandardof typestring: unique identifier of this ZTSmaxSupplyof typenumber: maximum supplyisBurnableof typebool:trueif it can be burned by any holder,falseif it can be burned only by its ownerisMintableof typebool:trueif the owner can increase the supply by minting,falseotherwiseisUtilityof typebool:trueif the token is utilty,falseotherwise
{
"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
stringthat represents the address - second parameter of type
numberthat represents the page index - third parameter of type
numberthat 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
}
}