-
Notifications
You must be signed in to change notification settings - Fork 14
API
Steven Masley edited this page Oct 14, 2019
·
19 revisions
This document defines the Remote Procedure Call API for pegnetd
. The RPC encompasses methods to read balances, transactions, and conversions on pegnet.
The API will follow JSON-RPC 2.0 Specification.
This standard covers RPC API version v1
Get the total supply for each pegnet asset.
curl -X POST --data-binary \
'{"jsonrpc": "2.0", "id": 0, "method":"get-pegnet-issuance"}' \
-H 'content-type:text/plain;' http://localhost:8070/v1
{
"jsonrpc":"2.0",
"result":{
"syncstatus":{
"syncheight":214299,
"factomheight":214299
},
"issuance":{
"PEG":5064716249706472,
"pADA":9174741510,
"pBNB":23964155,
"pBRL":1915004591,
"pCAD":505757599,
"pCHF":2031773352,
"pCNY":2716169709,
"pDASH":5317841,
"pDCR":21694146,
"pETH":1838430641,
"pEUR":427187617,
"pFCT":3846027468077,
"pGBP":308496745,
"pHKD":2980001159,
"pINR":26981732013,
"pJPY":40694137315,
"pKRW":454720374337,
"pLTC":6640888,
"pMXN":7428080364,
"pPHP":19717349003,
"pRVN":14391145402388,
"pSGD":524774284,
"pUSD":368327645950,
"pXAG":10029803207,
"pXAU":144804349,
"pXBC":1623103,
"pXBT":42136027,
"pXLM":6158039443,
"pXMR":6690407,
"pZEC":10101202
}
},
"id":0
}
Get the pegnet asset balances for a given address. All balances are in their fixed point values, meaning a balance of 1e8 == 1 pAsset. In this example response, the address has 9401 PEG.
curl -X POST --data-binary \
'{"jsonrpc": "2.0", "id": 0, "method":"get-pegnet-balances",
"params":{"address":"FA28MV2VvvsdjjgXoHwsadtMWqM5mt7bZU3hMjLuDLLN1DBhK48g"}}' \
-H 'content-type:text/plain;' http://localhost:8070/v1
{
"jsonrpc":"2.0",
"result":{
"PEG":940100000000,
"pADA":0,
"pBNB":0,
"pBRL":0,
"pCAD":0,
"pCHF":0,
"pCNY":0,
"pDASH":0,
"pDCR":0,
"pETH":0,
"pEUR":0,
"pFCT":0,
"pGBP":0,
"pHKD":0,
"pINR":0,
"pJPY":0,
"pKRW":0,
"pLTC":0,
"pMXN":0,
"pPHP":0,
"pRVN":0,
"pSGD":0,
"pUSD":0,
"pXAG":0,
"pXAU":0,
"pXBC":0,
"pXBT":0,
"pXLM":0,
"pXMR":0,
"pZEC":0
},
"id":0
}