Pastella Daemon RPC API (1.0.0)

Download OpenAPI specification:

License: MIT

Complete REST and JSON-RPC API documentation for the Pastella cryptocurrency daemon.

Base URL

Default RPC port: 21001

JSON-RPC Methods

All JSON-RPC methods are called via POST to /json_rpc with the method name in the request body.

Transaction Types

  • COINBASE: Mining reward transaction
  • TRANSFER: Regular transfer transaction
  • STAKING: Staking-related transaction

RPC Mode Permissions

  • Default: Basic endpoints (mining, network info)
  • BlockExplorerEnabled (--enable-blockexplorer): Blockchain explorer features
  • AllMethodsEnabled (--enable-blockexplorer-detailed): Advanced querying features

General

General daemon information

info - Get daemon information

Returns general information about the daemon and blockchain status. Includes current height, network height, difficulty, and transaction counts.

Responses

Request samples

curl http://localhost:21001/info

Response samples

Content type
application/json
{
  • "status": "OK",
  • "height": 1000,
  • "network_height": 1000,
  • "top_block_hash": "abc123...",
  • "difficulty": 10000,
  • "tx_count": 5000,
  • "tx_pool_size": 10,
  • "version": "1.0.0",
  • "alt_block_count": 5,
  • "outgoing_connections_count": 8,
  • "incoming_connections_count": 3,
  • "white_peerlist_size": 50,
  • "grey_peerlist_size": 20,
  • "last_known_block_index": 1000
}

fee - Get fee information

Returns the developer fee address and amount if configured. This fee is applied to certain transactions to support development.

Responses

Request samples

curl http://localhost:21001/fee

Response samples

Content type
application/json
{
  • "address": "PAS18z7m9DGbJFoVv6HiGoiwxNG5mLoniSEFWkguBKt59JSHPHjYaa",
  • "amount": 1000,
  • "status": "OK"
}

height - Get blockchain height

Returns the current blockchain height and network height. Useful for quick sync status checks.

Responses

Request samples

curl http://localhost:21001/height

Response samples

Content type
application/json
{
  • "status": "OK",
  • "height": 1000,
  • "network_height": 1000
}

Mining

Mining operations

getblocktemplate - Get block template for mining

JSON-RPC Method: getblocktemplate

Note: The actual endpoint is POST http://localhost:21001/json_rpc with the method name in the request body.

Returns a block template that can be used for mining. The template contains all the information needed to construct a new block, including the current difficulty, reserved space for extra nonce, and the miner's wallet address for reward distribution.

Request Body schema: application/json
required
jsonrpc
required
string
Default: "2.0"
method
required
string
Default: "getblocktemplate"
required
object
id
string

Responses

Request samples

Content type
application/json
{
  • "jsonrpc": "2.0",
  • "method": "getblocktemplate",
  • "params": {
    },
  • "id": "1"
}

Response samples

Content type
application/json
{
  • "jsonrpc": "string",
  • "result": {
    },
  • "id": "string"
}

submitblock - Submit mined block

JSON-RPC Method: submitblock

Note: The actual endpoint is POST http://localhost:21001/json_rpc with the method name in the request body.

Submit a mined block to the network. After successfully mining a block using the block template, submit the completed block blob to be added to the blockchain.

Request Body schema: application/json
required
jsonrpc
required
string
Default: "2.0"
method
required
string
Default: "submitblock"
required
object
id
string

Responses

Request samples

Content type
application/json
{
  • "jsonrpc": "2.0",
  • "method": "submitblock",
  • "params": {
    },
  • "id": "1"
}

Response samples

Content type
application/json
{
  • "jsonrpc": "string",
  • "result": {
    },
  • "id": "string"
}

Blocks

Block information

getblockcount - Get total number of blocks

JSON-RPC Method: getblockcount

Note: The actual endpoint is POST http://localhost:21001/json_rpc with the method name in the request body.

Returns the total number of blocks in the blockchain. This is equivalent to the current blockchain height + 1.

Request Body schema: application/json
required
jsonrpc
required
string
Default: "2.0"
method
required
string
Default: "getblockcount"
params
object
id
string

Responses

Request samples

Content type
application/json
{
  • "jsonrpc": "2.0",
  • "method": "getblockcount",
  • "params": { },
  • "id": "1"
}

Response samples

Content type
application/json
{
  • "jsonrpc": "string",
  • "result": {
    },
  • "id": "string"
}

getlastblockheader - Get last block header

JSON-RPC Method: getlastblockheader

Note: The actual endpoint is POST http://localhost:21001/json_rpc with the method name in the request body.

Returns detailed information about the most recent block in the blockchain.

Request Body schema: application/json
required
jsonrpc
required
string
Default: "2.0"
method
required
string
Default: "getlastblockheader"
params
object
id
string

Responses

Request samples

Content type
application/json
{
  • "jsonrpc": "2.0",
  • "method": "getlastblockheader",
  • "params": { },
  • "id": "1"
}

Response samples

Content type
application/json
{
  • "jsonrpc": "string",
  • "result": {
    },
  • "id": "string"
}

getblockheaderbyhash - Get block header by hash

JSON-RPC Method: getblockheaderbyhash

Note: The actual endpoint is POST http://localhost:21001/json_rpc with the method name in the request body.

Returns detailed header information for a specific block given its hash.

Request Body schema: application/json
required
jsonrpc
required
string
Default: "2.0"
method
required
string
Default: "getblockheaderbyhash"
required
object
id
string

Responses

Request samples

Content type
application/json
{
  • "jsonrpc": "2.0",
  • "method": "getblockheaderbyhash",
  • "params": {
    },
  • "id": "1"
}

Response samples

Content type
application/json
{
  • "jsonrpc": "string",
  • "result": {
    },
  • "id": "string"
}

getblockheaderbyheight - Get block header by height

JSON-RPC Method: getblockheaderbyheight

Note: The actual endpoint is POST http://localhost:21001/json_rpc with the method name in the request body.

Returns detailed header information for a block at a specific height.

Request Body schema: application/json
required
jsonrpc
required
string
Default: "2.0"
method
required
string
Default: "getblockheaderbyheight"
required
object
id
string

Responses

Request samples

Content type
application/json
{
  • "jsonrpc": "2.0",
  • "method": "getblockheaderbyheight",
  • "params": {
    },
  • "id": "1"
}

Response samples

Content type
application/json
{
  • "jsonrpc": "string",
  • "result": {
    },
  • "id": "string"
}

f_blocks_list_json - Get block by height

JSON-RPC Method: f_blocks_list_json

Note: The actual endpoint is POST http://localhost:21001/json_rpc with the method name in the request body.

Returns full block information for a single block specified by height. Requires --enable-blockexplorer flag.

Request Body schema: application/json
required
jsonrpc
required
string
Default: "2.0"
method
required
string
Default: "f_blocks_list_json"
required
object
id
string

Responses

Request samples

Content type
application/json
{
  • "jsonrpc": "2.0",
  • "method": "f_blocks_list_json",
  • "params": {
    },
  • "id": "1"
}

Response samples

Content type
application/json
{
  • "jsonrpc": "string",
  • "result": {
    },
  • "id": "string"
}

f_block_json - Get full block details

JSON-RPC Method: f_block_json

Note: The actual endpoint is POST http://localhost:21001/json_rpc with the method name in the request body.

Returns complete block information including all transactions with their types (COINBASE, TRANSFER, STAKING). Requires --enable-blockexplorer flag.

Request Body schema: application/json
required
jsonrpc
required
string
Default: "2.0"
method
required
string
Default: "f_block_json"
required
object
id
string

Responses

Request samples

Content type
application/json
{
  • "jsonrpc": "2.0",
  • "method": "f_block_json",
  • "params": {
    },
  • "id": "1"
}

Response samples

Content type
application/json
{
  • "jsonrpc": "string",
  • "result": {
    },
  • "id": "string"
}

Transactions

Transaction queries and submission

sendrawtransaction - Submit transaction to network

Submits a raw transaction (in hex format) to the network. The transaction will be validated and added to the mempool if valid. Requires daemon to be synced.

Request Body schema: application/json
required
tx_as_hex
required
string

Transaction data in hexadecimal format

Responses

Request samples

Content type
application/json
{
  • "tx_as_hex": "010201abc..."
}

Response samples

Content type
application/json
{
  • "status": "OK",
  • "transactionHash": "abc123...",
  • "error": "Transaction fee is too low"
}

get_transactions_status - Get transaction status

Checks whether transactions are in the mempool or blockchain. Useful for tracking transaction confirmation.

Request Body schema: application/json
required
transactionHashes
required
Array of strings

List of transaction hashes to check

Responses

Request samples

Content type
application/json
{
  • "transactionHashes": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "transactionsInPool": [
    ],
  • "transactionsInBlock": [
    ],
  • "unknownTransactions": [
    ]
}

get_pool_changes_lite - Get pool changes (light)

Returns changes to the transaction pool (mempool) since last check. Used for efficient wallet synchronization.

Request Body schema: application/json
required
knownPoolTxHashes
required
Array of strings

Transaction hashes known to be in pool

Responses

Request samples

Content type
application/json
{
  • "knownPoolTxHashes": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "addedTxs": [ ],
  • "deletedTxs": [
    ]
}

getrawtransaction - Get raw transaction data

Returns raw binary transaction data in hex format.

Request Body schema: application/json
required
transactionHashes
required
Array of strings

List of transaction hashes

Responses

Request samples

Content type
application/json
{
  • "transactionHashes": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "transactions": [
    ],
  • "missedTransactions": [
    ]
}

f_transaction_json - Get transaction details

JSON-RPC Method: f_transaction_json

Note: The actual endpoint is POST http://localhost:21001/json_rpc with the method name in the request body.

Returns complete transaction information including inputs, outputs, addresses, and UTXO references. Requires --enable-blockexplorer flag.

Request Body schema: application/json
required
jsonrpc
required
string
Default: "2.0"
method
required
string
Default: "f_transaction_json"
required
object
id
string

Responses

Request samples

Content type
application/json
{
  • "jsonrpc": "2.0",
  • "method": "f_transaction_json",
  • "params": {
    },
  • "id": "1"
}

Response samples

Content type
application/json
{
  • "jsonrpc": "string",
  • "result": {
    },
  • "id": "string"
}

f_on_transactions_pool_json - Get mempool transactions

JSON-RPC Method: f_on_transactions_pool_json

Note: The actual endpoint is POST http://localhost:21001/json_rpc with the method name in the request body.

Returns all transactions currently in the memory pool (mempool). Requires --enable-blockexplorer flag.

Request Body schema: application/json
required
jsonrpc
required
string
Default: "2.0"
method
required
string
Default: "f_on_transactions_pool_json"
params
object
id
string

Responses

Request samples

Content type
application/json
{
  • "jsonrpc": "2.0",
  • "method": "f_on_transactions_pool_json",
  • "params": { },
  • "id": "1"
}

Response samples

Content type
application/json
{
  • "jsonrpc": "string",
  • "result": {
    },
  • "id": "string"
}

Wallet

Wallet operations and synchronization

getwalletsyncdata - Get wallet synchronization data

Returns blockchain data optimized for wallet synchronization. This includes blocks, transactions, and checkpoints.

Request Body schema: application/json
required
blockHashCheckpoints
Array of strings

Known block hashes to use as checkpoints

startHeight
integer
Default: 0

Starting block height

startTimestamp
integer
Default: 0

Starting timestamp (Unix epoch)

blockCount
integer <= 1000
Default: 100

Number of blocks to return

skipCoinbaseTransactions
boolean
Default: false

Whether to exclude coinbase transactions

Responses

Request samples

Content type
application/json
{
  • "startHeight": 1000,
  • "blockCount": 100,
  • "skipCoinbaseTransactions": false
}

Response samples

Content type
application/json
{
  • "items": [ ],
  • "topBlock": { }
}

richlist - Get richest addresses

JSON-RPC Method: richlist

Note: The actual endpoint is POST http://localhost:21001/json_rpc with the method name in the request body.

Returns a list of the richest addresses in the blockchain. Requires --enable-blockexplorer flag.

Request Body schema: application/json
required
jsonrpc
required
string
Default: "2.0"
method
required
string
Default: "richlist"
params
object
id
string

Responses

Request samples

Content type
application/json
{
  • "jsonrpc": "2.0",
  • "method": "richlist",
  • "params": { },
  • "id": "1"
}

Response samples

Content type
application/json
{
  • "jsonrpc": "string",
  • "result": {
    },
  • "id": "string"
}

getwalletdetails - Get wallet details

JSON-RPC Method: getwalletdetails

Note: The actual endpoint is POST http://localhost:21001/json_rpc with the method name in the request body.

Returns comprehensive wallet information including balance, transaction history, and address details. Requires --enable-blockexplorer flag.

Request Body schema: application/json
required
jsonrpc
required
string
Default: "2.0"
method
required
string
Default: "getwalletdetails"
required
object
id
string

Responses

Request samples

Content type
application/json
{
  • "jsonrpc": "2.0",
  • "method": "getwalletdetails",
  • "params": {
    },
  • "id": "1"
}

Response samples

Content type
application/json
{
  • "jsonrpc": "string",
  • "result": {
    },
  • "id": "string"
}

UTXO

UTXO queries

getutxos - Get multiple UTXOs

Retrieves UTXO information for multiple transaction outputs.

Request Body schema: application/json
required
required
Array of objects

List of UTXO identifiers

Responses

Request samples

Content type
application/json
{
  • "utxos": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "utxos": [
    ]
}

getutxo - Get UTXO details

JSON-RPC Method: getutxo

Note: The actual endpoint is POST http://localhost:21001/json_rpc with the method name in the request body.

Returns detailed information about a specific Unspent Transaction Output (UTXO). Requires --enable-blockexplorer flag.

Request Body schema: application/json
required
jsonrpc
required
string
Default: "2.0"
method
required
string
Default: "getutxo"
required
object
id
string

Responses

Request samples

Content type
application/json
{
  • "jsonrpc": "2.0",
  • "method": "getutxo",
  • "params": {
    },
  • "id": "1"
}

Response samples

Content type
application/json
{
  • "jsonrpc": "string",
  • "result": {
    },
  • "id": "string"
}

getutxosfortx - Get UTXOs for transaction

JSON-RPC Method: getutxosfortx

Note: The actual endpoint is POST http://localhost:21001/json_rpc with the method name in the request body.

Returns all UTXOs (outputs) created by a specific transaction. Requires --enable-blockexplorer flag.

Request Body schema: application/json
required
jsonrpc
required
string
Default: "2.0"
method
required
string
Default: "getutxosfortx"
required
object
id
string

Responses

Request samples

Content type
application/json
{
  • "jsonrpc": "2.0",
  • "method": "getutxosfortx",
  • "params": {
    },
  • "id": "1"
}

Response samples

Content type
application/json
{
  • "jsonrpc": "string",
  • "result": {
    },
  • "id": "string"
}

Network

Network information

peers - Get peer list

Returns information about connected peers. Includes both white peers (active) and gray peers (recently seen).

Responses

Request samples

curl http://localhost:21001/peers

Response samples

Content type
application/json
{
  • "peers": [
    ],
  • "peers_gray": [
    ],
  • "status": "OK"
}

Staking

Staking operations

getstakingpool - Get staking pool information

Returns comprehensive information about the staking pool status, including total staked amount, available balance, and staking parameters.

Responses

Request samples

curl http://localhost:21001/getstakingpool

Response samples

Content type
application/json
{
  • "status": "OK",
  • "staking_enabled": true,
  • "staking_enable_height": 100000,
  • "current_height": 150000,
  • "minimum_stake": 1000000000000,
  • "total_staked": 50000000000000,
  • "pending_stakes": 0,
  • "total_pool_balance": 55000000000000,
  • "available_balance": 5000000000000,
  • "block_reward_rate": 30
}

getallstakes - Get all stakes (paginated)

Returns all stakes in the system with pagination support.

query Parameters
page
integer >= 0
Default: 0

Page number for pagination

limit
integer [ 1 .. 1000 ]
Default: 100

Number of stakes per page

Responses

Request samples

curl "http://localhost:21001/getallstakes?page=0&limit=100"

Response samples

Content type
application/json
{
  • "status": "OK",
  • "stakes": [
    ],
  • "total_stakes": 500,
  • "page": 0,
  • "limit": 100,
  • "total_staked": 50000000000000
}

getallstakes - Get all stakes (paginated) (POST)

Returns all stakes in the system with pagination support.

Request Body schema: application/json
optional
page
integer >= 0
Default: 0

Page number for pagination

limit
integer [ 1 .. 1000 ]
Default: 100

Number of stakes per page

Responses

Request samples

Content type
application/json
{
  • "page": 0,
  • "limit": 100
}

Response samples

Content type
application/json
{
  • "status": "OK",
  • "stakes": [
    ],
  • "total_stakes": 500,
  • "page": 0,
  • "limit": 100,
  • "total_staked": 50000000000000
}

getpendingrewards - Get pending staking rewards

Returns pending rewards for a staking address.

Request Body schema: application/json
required
address
required
string

Staking address

Responses

Request samples

Content type
application/json
{
  • "address": "PAS18z7m9DGbJFoVv6HiGoiwxNG5mLoniSEFWkguBKt59JSHPHjYaa"
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "address": "string",
  • "pending_rewards": 50000000,
  • "available_for_withdrawal": 45000000,
  • "total_staked": 1000000000000
}

getuserstakes - Get user stake information

Returns detailed information about stakes. Can query either by transaction hashes or by wallet address.

Request Body schema: application/json
required
One of
staking_hashes
required
Array of strings non-empty

List of staking transaction hashes

Responses

Request samples

Content type
application/json
Example
{
  • "staking_hashes": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "stake_count": 2,
  • "stakes": [
    ]
}

updatestakingrewards - Update staking rewards (NOT IMPLEMENTED) Deprecated

WARNING: This endpoint is documented but not currently implemented in the codebase.

This endpoint was intended to manually trigger reward calculation for all stakes. Rewards are calculated automatically each block and this endpoint is not functional.

Request Body schema: application/json
optional
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "status": "string",
  • "message": "Staking rewards updated successfully",
  • "current_height": 150000
}

Governance

Governance and voting operations

getproposals - Get governance proposals

Returns governance proposals. Can filter for active proposals only.

query Parameters
active_only
boolean
Default: false

Whether to return only active proposals

Responses

Request samples

curl "http://localhost:21001/getproposals?active_only=true"

Response samples

Content type
application/json
{
  • "status": "OK",
  • "proposals": [
    ]
}

getproposals - Get governance proposals (POST)

Returns governance proposals. Can filter for active proposals only.

Request Body schema: application/json
optional
active_only
boolean
Default: false

Whether to return only active proposals

Responses

Request samples

Content type
application/json
{
  • "active_only": true
}

Response samples

Content type
application/json
{
  • "status": "OK",
  • "proposals": [
    ]
}

getproposal - Get specific proposal details

Returns detailed information about a specific governance proposal.

query Parameters
proposal_id
required
integer

Proposal ID to look up

Responses

Request samples

curl "http://localhost:21001/getproposal?proposal_id=1"

Response samples

Content type
application/json
{
  • "status": "OK",
  • "proposal": {
    },
  • "voters": [
    ]
}

getproposal - Get specific proposal details (POST)

Returns detailed information about a specific governance proposal.

Request Body schema: application/json
required
proposal_id
required
integer

Proposal ID to look up

Responses

Request samples

Content type
application/json
{
  • "proposal_id": 1
}

Response samples

Content type
application/json
{
  • "status": "OK",
  • "proposal": {
    },
  • "voters": [
    ]
}

getvotingpower - Get voting power for address

Returns the voting power of a specific address based on their staked amount. Voting power is proportional to the amount staked.

query Parameters
address
required
string

Wallet address to check voting power for

Responses

Request samples

curl "http://localhost:21001/getvotingpower?address=PAS18z7m9DGbJFoVv6HiGoiwxNG5mLoniSEFWkguBKt59JSHPHjYaa"

Response samples

Content type
application/json
{
  • "status": "OK",
  • "address": "PAS18z7m9DGbJFoVv6HiGoiwxNG5mLoniSEFWkguBKt59JSHPHjYaa",
  • "voting_power": 1000000000000,
  • "voting_power_formatted": "1000.00000000",
  • "total_staked": 1000000000000,
  • "total_staked_formatted": "1000.00000000"
}

getvotingpower - Get voting power for address (POST)

Returns the voting power of a specific address based on their staked amount.

Request Body schema: application/json
required
address
required
string

Wallet address to check voting power for

Responses

Request samples

Content type
application/json
{
  • "address": "PAS18z7m9DGbJFoVv6HiGoiwxNG5mLoniSEFWkguBKt59JSHPHjYaa"
}

Response samples

Content type
application/json
{
  • "status": "OK",
  • "address": "PAS18z7m9DGbJFoVv6HiGoiwxNG5mLoniSEFWkguBKt59JSHPHjYaa",
  • "voting_power": 1000000000000,
  • "voting_power_formatted": "1000.00000000",
  • "total_staked": 1000000000000,
  • "total_staked_formatted": "1000.00000000"
}

getnextproposalid - Get next proposal ID

Returns the ID that will be assigned to the next proposal.

Request Body schema: application/json
optional
object

Responses

Request samples

Content type
application/json
{ }

Response samples

Content type
application/json
{
  • "status": "OK",
  • "next_proposal_id": 42
}

getgovernanceproposals - Get governance proposals

JSON-RPC Method: getgovernanceproposals

Note: The actual endpoint is POST http://localhost:21001/json_rpc with the method name in the request body.

Returns governance proposals. Can filter for active proposals only.

Request Body schema: application/json
required
jsonrpc
required
string
Default: "2.0"
method
required
string
Default: "getgovernanceproposals"
object
id
string

Responses

Request samples

Content type
application/json
{
  • "jsonrpc": "2.0",
  • "method": "getgovernanceproposals",
  • "params": {
    },
  • "id": "1"
}

Response samples

Content type
application/json
{
  • "jsonrpc": "string",
  • "result": {
    },
  • "id": "string"
}

getproposaldetails - Get proposal details

JSON-RPC Method: getproposaldetails

Note: The actual endpoint is POST http://localhost:21001/json_rpc with the method name in the request body.

Returns detailed information about a specific governance proposal.

Request Body schema: application/json
required
jsonrpc
required
string
Default: "2.0"
method
required
string
Default: "getproposaldetails"
required
object
id
string

Responses

Request samples

Content type
application/json
{
  • "jsonrpc": "2.0",
  • "method": "getproposaldetails",
  • "params": {
    },
  • "id": "1"
}

Response samples

Content type
application/json
{
  • "jsonrpc": "string",
  • "result": {
    },
  • "id": "string"
}

Advanced

Advanced blockchain querying

queryblockslite - Query blocks (light)

Lightweight block querying for wallet synchronization. Returns minimal block information for efficiency.

Request Body schema: application/json
required
blockIds
required
Array of strings

List of known block hashes

Responses

Request samples

Content type
application/json
{
  • "blockIds": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "items": [ ],
  • "startHeight": 0,
  • "currentHeight": 0
}

queryblocksdetailed - Query blocks (detailed)

Detailed block querying with full transaction information. Requires --enable-blockexplorer-detailed flag.

Request Body schema: application/json
required
blockIds
required
Array of strings

List of known block hashes

Responses

Request samples

Content type
application/json
{
  • "blockIds": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "items": [ ]
}

getrawblocks - Get raw block data

Returns raw binary block data in hex format. Useful for low-level blockchain analysis.

Request Body schema: application/json
required
blockIds
required
Array of strings

List of block hashes

Responses

Request samples

Content type
application/json
{
  • "blockIds": [
    ]
}

Response samples

Content type
application/json
{
  • "status": "string",
  • "blocks": [
    ]
}