Nerve Public-Service API
Listening Port
The default port for public-service is 7003.
Default URL: https:public.nerve.network
Interface Description
Charset Encoding
UTF-8
interview method -- JSON call details
json-rpcaccess methodAdd request header Content-Type: application/json;charset=UTF-8
HttpMethod: POST
URL: http://{ip}:{port}
Example: http://127.0.0.1:7003
Example json data request:
{
"jsonrpc":"2.0",
"method": "methodCMD", //interface name
"params":[], //All interface parameters are passed as arrays, and the order of the parameters cannot be changed. If the parameters are not required, they must also be filled in null placeholders.
"id":1234
}Usage example using linux command curl, issued to a chainbox instance.:
When using Postman:
type the URL of the API (http://127.0.0.1:7003)
Change method to POST.
In the parameter section click on "raw" and select format as "JSON" and add the json request in the testarea provided.
In the headers section add "Content-Type" as header and "application/json;charset=UTF-8" as the value.
Test by comparing the output to the curl output.
Remote Procedure Call Examples
JSON-RPC
Return Format
Sample Calls
Token Swap
It involves the interface with tokens. To avoid losing decimal precision, the NULS token value is stored in JAVA BigInteger format. The interface layer shifts the token value 8 bits, to take advantage of the extra precision, such that 1 NULS = 100,000,000.
Return Definition
Transaction Type (txType)
Asset Information (assetInfo)
Block Header Information (blockHeaderInfo)
Transaction Information (txInfo)
Account Information (accountInfo)
Asset Information (accountLedgerInfo)
Consensus Node Information (consensusInfo)
Stake Information (depositInfo)
Calls Categorized by Blockchain Function
Chain Related [chain]
Get chain information
Request:
Return:
Get general information after running the chain
Request:
Return:
Get information about chain registering cross chain
Request:
Return:
Block Related [block]
Get latest block header
Request:
Return:
Get block header by height
Request:
Return:
Get block header with block hash
Request:
Return:
Get block by height
Request:
Return:
Get block by block hash
Request:
Return:
Get block header list
Request:
Return:
Account Related [account]
Get account information
Request:
Return:
Get account information by alias
Request:
Return:
Get ranking of accounts holding tokens
Request:
Return:
Get account ledger list
Request:
Return:
Get account cross-chain ledger list
Request:
Return:
Get single asset balance of the account
Request:
Return:
Get account freezes list
Request:
Return:
Query whether the alias is usable
Request:
Return:
Transaction Related [transaction]
Get transaction details
Request:
Return:
Get transaction list
Request:
Return:
Get transactions included in block
Request:
Return:
Get transaction list of an account
Request:
Return:
Query whether transaction assembled offline is valid
Request:
Return:
Broadcast transaction assembled offline
Request:
Return:
Consensus Related [consensus]
Get available consensus nodes
Request:
Return:
Get all consensus nodes(including those that have quit or have been fined by red card)
Request:
Return:
Get nodes staked by account
Request:
Return:
Get consensus node information
Request:
Return:
Get consensus nodes created by account
Request:
Return:
Get node staking information
Request:
Return:
#Get node's stake history
Request:
Return:
#Query account's stake list
Request:
Return:
Get account's stake amount
Request:
Return:
Get punishment list
Request:
Return:
Get round list
Request:
Return:
Contract Related [contract]
Get contract details
Request:
Return:
Get contract list
Request:
Return:
Get contract-related transaction list
Request:
Return:
Get nrc20-contract transfers
Request:
Return:
Get account's nrc20 transfers
Request:
Return:
Statistics Related [statistical]
Get statistics on transaction count
Request:
Return:
Get statistics on consensus node count
Request:
Return:
Get statistics on consensus rewards
Request:
Return:
Get statistics on annualized reward rate
Request:
Return:
Last updated