Plasma RPC API
The Plasma contract manages Plasma generation for transaction processing in the Zenon Network. Plasma is required for sending transactions and can be generated through Proof of Work (PoW) or by fusing QSR.
Methods
- embedded.plasma.get
- embedded.plasma.getEntriesByAddress
- embedded.plasma.getRequiredPoWForAccountBlock
embedded.plasma.get
This API call will return plasma information about an address.
Request
One parameter of type string that represents the address.
{
"jsonrpc": "2.0",
"id": 11,
"method": "embedded.plasma.get",
"params": ["z1qrztagl9rukq3ltdflnvg4zrvpfp84mydfejk9"]
}
Response
currentPlasmaof typenumber: available plasma that can be consumed by the addressmaxPlasmaof typenumber: the maximum plasma that can be accumulatedqsrAmountof typenumber: the amount of QSR fused to the address to generate plasma
{
"jsonrpc": "2.0",
"id": 11,
"result": {
"currentPlasma": 1701000,
"maxPlasma": 1701000,
"qsrAmount": "81000000000"
}
}
embedded.plasma.getEntriesByAddress
This API call will return a list of plasma fusion entries for a given address.
Request
- 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": 10,
"method": "embedded.plasma.getEntriesByAddress",
"params": ["z1qrztagl9rukq3ltdflnvg4zrvpfp84mydfejk9", 0, 5]
}
Response
countof typenumber: the total number of the entrieslist- an array ofQSR fusionentriesqsrAmountof typenumber: the amount of QSR used for the fusionbeneficiaryof typestring: the address that can use the plasmaexpirationHeightof typenumber: the momentum height when the fusion expiresidof typestring: the hash of the fusion entry
{
"jsonrpc": "2.0",
"id": 10,
"result": {
"qsrAmount": "324000000000",
"count": 15,
"list": [
{
"qsrAmount": "15000000000",
"beneficiary": "z1qrztagl9rukq3ltdflnvg4zrvpfp84mydfejk9",
"expirationHeight": 3265557,
"id": "ec8913ffb3aac7eb08aea693b724e19f961ea42be87fd86840a159926a88b8db"
},
{
"qsrAmount": "30000000000",
"beneficiary": "z1qqrzv35d4wk6n7fkfygay5g2zpgxyaamk84rla",
"expirationHeight": 4504195,
"id": "4d9a97679424613c15de8bf8ba3efae31b7cbb77cbbd28e3ec2fbfc416a363bf"
}
]
}
}
embedded.plasma.getRequiredPoWForAccountBlock
This API call will return the required proof-of-work to be computed in order to send a block from an address.
Request
addressof typestring: address used to send the transactionblockTypeof typenumber: the account-block type:1for normal send blocks,2for receivetoAddressof typestring: receiver addressdataof typestring: call data for smart contracts
{
"jsonrpc": "2.0",
"id": 22,
"method": "embedded.plasma.getRequiredPoWForAccountBlock",
"params": {
"address": "z1qph8dkzgq53e7jz5pgyp3njzm9rw0x3n5mxmgj",
"blockType": 2,
"toAddress": "z1qxemdeddedxlyquydytyxxxxxxxxxxxxflaaae",
"data": ""
}
}
Response
availablePlasmaof typenumber: total plasma available to the accountbasePlasmaof typenumber: base plasma cost for the transactionrequiredDifficultyof typenumber: proof-of-work difficulty required to send the transaction
{
"jsonrpc": "2.0",
"id": 22,
"result": {
"availablePlasma": 0,
"basePlasma": 21000,
"requiredDifficulty": 32
}
}
Previous: ← Pillar Contract | Next: Sentinel Contract →