JSON-RPC API Reference

JSON-RPC API Reference

Every node in the Pactus network can be configured to use the JSON-RPC protocol for communication. Here, you can find the list of all JSON-RPC methods, params and result.

Units

All the amounts are in NanoPAC units, which are atomic and the smallest unit in the Pactus blockchain. Each PAC is equivalent to 1,000,000,000 or 109 NanoPACs.

Packages

For seamless integration with Pactus, you can use these client libraries:

Example

To call JSON-RPC methods, you need to create the JSON-RPC request:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "pactus.network.get_node_info",
  "params": {}
}

Make sure you always add the params field, even if no parameters are needed, and ensure you use curly braces.

Then you use the curl command to send the request to the node:

curl --location 'http://localhost:8545/' \
--header 'Content-Type: application/json' \
--data '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "pactus.network.get_node_info",
    "params": {}
}'

Before sending the request, you need to enable the JSON-RPC service inside the configuration.

Using Basic Auth

If you have enabled the gRPC Basic Authentication, then you need to set the Authorization header.

curl --location 'http://localhost:8545/' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic <BASIC-AUTH-TOKEN>' \
--data '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "pactus.blockchain.get_account",
    "params": {
        "address": "pc1z2r0fmu8sg2ffa0tgrr08gnefcxl2kq7wvquf8z"
    }
}'

JSON-RPC Methods

Transaction Service

Transaction service defines various RPC methods for interacting with transactions.

pactus.transaction.get_transaction

GetTransaction retrieves transaction details based on the provided request parameters.

Parameters

FieldTypeDescription
idstringThe unique ID of the transaction to retrieve.
verbositynumeric(Enum)The verbosity level for transaction details.
Available values:
  • TRANSACTION_VERBOSITY_DATA = 0 (Request transaction data only.)
  • TRANSACTION_VERBOSITY_INFO = 1 (Request detailed transaction information.)

Result

FieldTypeDescription
block_heightnumericThe height of the block containing the transaction.
block_timenumericThe UNIX timestamp of the block containing the transaction.
transactionobject (TransactionInfo)Detailed information about the transaction.
transaction.idstringThe unique ID of the transaction.
transaction.datastringThe raw transaction data in hexadecimal format.
transaction.versionnumericThe version of the transaction.
transaction.lock_timenumericThe lock time for the transaction.
transaction.valuenumericThe value of the transaction in NanoPAC.
transaction.feenumericThe fee for the transaction in NanoPAC.
transaction.payload_typenumeric(Enum)The type of transaction payload.
Available values:
  • PAYLOAD_TYPE_UNSPECIFIED = 0 (Unspecified payload type.)
  • PAYLOAD_TYPE_TRANSFER = 1 (Transfer payload type.)
  • PAYLOAD_TYPE_BOND = 2 (Bond payload type.)
  • PAYLOAD_TYPE_SORTITION = 3 (Sortition payload type.)
  • PAYLOAD_TYPE_UNBOND = 4 (Unbond payload type.)
  • PAYLOAD_TYPE_WITHDRAW = 5 (Withdraw payload type.)
transaction.transferobject (PayloadTransfer)(OneOf)Transfer transaction payload.
transaction.transfer.senderstringThe sender's address.
transaction.transfer.receiverstringThe receiver's address.
transaction.transfer.amountnumericThe amount to be transferred in NanoPAC.
transaction.bondobject (PayloadBond)(OneOf)Bond transaction payload.
transaction.bond.senderstringThe sender's address.
transaction.bond.receiverstringThe receiver's address.
transaction.bond.stakenumericThe stake amount in NanoPAC.
transaction.bond.public_keystringThe public key of the validator.
transaction.sortitionobject (PayloadSortition)(OneOf)Sortition transaction payload.
transaction.sortition.addressstringThe validator address associated with the sortition proof.
transaction.sortition.proofstringThe proof for the sortition.
transaction.unbondobject (PayloadUnbond)(OneOf)Unbond transaction payload.
transaction.unbond.validatorstringThe address of the validator to unbond from.
transaction.withdrawobject (PayloadWithdraw)(OneOf)Withdraw transaction payload.
transaction.withdraw.validator_addressstringThe address of the validator to withdraw from.
transaction.withdraw.account_addressstringThe address of the account to withdraw to.
transaction.withdraw.amountnumericThe withdrawal amount in NanoPAC.
transaction.memostringA memo string for the transaction.
transaction.public_keystringThe public key associated with the transaction.
transaction.signaturestringThe signature for the transaction.

pactus.transaction.calculate_fee

CalculateFee calculates the transaction fee based on the specified amount and payload type.

Parameters

FieldTypeDescription
amountnumericThe amount involved in the transaction, specified in NanoPAC.
payload_typenumeric(Enum)The type of transaction payload.
Available values:
  • PAYLOAD_TYPE_UNSPECIFIED = 0 (Unspecified payload type.)
  • PAYLOAD_TYPE_TRANSFER = 1 (Transfer payload type.)
  • PAYLOAD_TYPE_BOND = 2 (Bond payload type.)
  • PAYLOAD_TYPE_SORTITION = 3 (Sortition payload type.)
  • PAYLOAD_TYPE_UNBOND = 4 (Unbond payload type.)
  • PAYLOAD_TYPE_WITHDRAW = 5 (Withdraw payload type.)
fixed_amountbooleanIndicates if the amount should be fixed and include the fee.

Result

FieldTypeDescription
amountnumericThe calculated amount in NanoPAC.
feenumericThe calculated transaction fee in NanoPAC.

pactus.transaction.broadcast_transaction

BroadcastTransaction broadcasts a signed transaction to the network.

Parameters

FieldTypeDescription
signed_raw_transactionstringThe signed raw transaction data to be broadcasted.

Result

FieldTypeDescription
idstringThe unique ID of the broadcasted transaction.

pactus.transaction.get_raw_transfer_transaction

GetRawTransferTransaction retrieves raw details of a transfer transaction.

Parameters

FieldTypeDescription
lock_timenumericThe lock time for the transaction. If not set, defaults to the last block height.
senderstringThe sender's account address.
receiverstringThe receiver's account address.
amountnumericThe amount to be transferred, specified in NanoPAC. Must be greater than 0.
feenumericThe transaction fee in NanoPAC. If not set, it is set to the estimated fee.
memostringA memo string for the transaction.

Result

FieldTypeDescription
raw_transactionstringThe raw transaction data in hexadecimal format.
idstringThe unique ID of the transaction.

pactus.transaction.get_raw_bond_transaction

GetRawBondTransaction retrieves raw details of a bond transaction.

Parameters

FieldTypeDescription
lock_timenumericThe lock time for the transaction. If not set, defaults to the last block height.
senderstringThe sender's account address.
receiverstringThe receiver's validator address.
stakenumericThe stake amount in NanoPAC. Must be greater than 0.
public_keystringThe public key of the validator.
feenumericThe transaction fee in NanoPAC. If not set, it is set to the estimated fee.
memostringA memo string for the transaction.

Result

FieldTypeDescription
raw_transactionstringThe raw transaction data in hexadecimal format.
idstringThe unique ID of the transaction.

pactus.transaction.get_raw_unbond_transaction

GetRawUnbondTransaction retrieves raw details of an unbond transaction.

Parameters

FieldTypeDescription
lock_timenumericThe lock time for the transaction. If not set, defaults to the last block height.
validator_addressstringThe address of the validator to unbond from.
memostringA memo string for the transaction.

Result

FieldTypeDescription
raw_transactionstringThe raw transaction data in hexadecimal format.
idstringThe unique ID of the transaction.

pactus.transaction.get_raw_withdraw_transaction

GetRawWithdrawTransaction retrieves raw details of a withdraw transaction.

Parameters

FieldTypeDescription
lock_timenumericThe lock time for the transaction. If not set, defaults to the last block height.
validator_addressstringThe address of the validator to withdraw from.
account_addressstringThe address of the account to withdraw to.
amountnumericThe withdrawal amount in NanoPAC. Must be greater than 0.
feenumericThe transaction fee in NanoPAC. If not set, it is set to the estimated fee.
memostringA memo string for the transaction.

Result

FieldTypeDescription
raw_transactionstringThe raw transaction data in hexadecimal format.
idstringThe unique ID of the transaction.

pactus.transaction.decode_raw_transaction

DecodeRawTransaction accepts raw transaction and returns decoded transaction.

Parameters

FieldTypeDescription
raw_transactionstringThe raw transaction data in hexadecimal format.

Result

FieldTypeDescription
transactionobject (TransactionInfo)The decoded transaction information.
transaction.idstringThe unique ID of the transaction.
transaction.datastringThe raw transaction data in hexadecimal format.
transaction.versionnumericThe version of the transaction.
transaction.lock_timenumericThe lock time for the transaction.
transaction.valuenumericThe value of the transaction in NanoPAC.
transaction.feenumericThe fee for the transaction in NanoPAC.
transaction.payload_typenumeric(Enum)The type of transaction payload.
Available values:
  • PAYLOAD_TYPE_UNSPECIFIED = 0 (Unspecified payload type.)
  • PAYLOAD_TYPE_TRANSFER = 1 (Transfer payload type.)
  • PAYLOAD_TYPE_BOND = 2 (Bond payload type.)
  • PAYLOAD_TYPE_SORTITION = 3 (Sortition payload type.)
  • PAYLOAD_TYPE_UNBOND = 4 (Unbond payload type.)
  • PAYLOAD_TYPE_WITHDRAW = 5 (Withdraw payload type.)
transaction.transferobject (PayloadTransfer)(OneOf)Transfer transaction payload.
transaction.transfer.senderstringThe sender's address.
transaction.transfer.receiverstringThe receiver's address.
transaction.transfer.amountnumericThe amount to be transferred in NanoPAC.
transaction.bondobject (PayloadBond)(OneOf)Bond transaction payload.
transaction.bond.senderstringThe sender's address.
transaction.bond.receiverstringThe receiver's address.
transaction.bond.stakenumericThe stake amount in NanoPAC.
transaction.bond.public_keystringThe public key of the validator.
transaction.sortitionobject (PayloadSortition)(OneOf)Sortition transaction payload.
transaction.sortition.addressstringThe validator address associated with the sortition proof.
transaction.sortition.proofstringThe proof for the sortition.
transaction.unbondobject (PayloadUnbond)(OneOf)Unbond transaction payload.
transaction.unbond.validatorstringThe address of the validator to unbond from.
transaction.withdrawobject (PayloadWithdraw)(OneOf)Withdraw transaction payload.
transaction.withdraw.validator_addressstringThe address of the validator to withdraw from.
transaction.withdraw.account_addressstringThe address of the account to withdraw to.
transaction.withdraw.amountnumericThe withdrawal amount in NanoPAC.
transaction.memostringA memo string for the transaction.
transaction.public_keystringThe public key associated with the transaction.
transaction.signaturestringThe signature for the transaction.

Blockchain Service

Blockchain service defines RPC methods for interacting with the blockchain.

pactus.blockchain.get_block

GetBlock retrieves information about a block based on the provided request parameters.

Parameters

FieldTypeDescription
heightnumericThe height of the block to retrieve.
verbositynumeric(Enum)The verbosity level for block information.
Available values:
  • BLOCK_VERBOSITY_DATA = 0 (Request only block data.)
  • BLOCK_VERBOSITY_INFO = 1 (Request block information and transaction IDs.)
  • BLOCK_VERBOSITY_TRANSACTIONS = 2 (Request block information and detailed transaction data.)

Result

FieldTypeDescription
heightnumericThe height of the block.
hashstringThe hash of the block.
datastringBlock data, available only if verbosity level is set to BLOCK_DATA.
block_timenumericThe timestamp of the block.
headerobject (BlockHeaderInfo)Header information of the block.
header.versionnumericThe version of the block.
header.prev_block_hashstringThe hash of the previous block.
header.state_rootstringThe state root hash of the blockchain.
header.sortition_seedstringThe sortition seed of the block.
header.proposer_addressstringThe address of the proposer of the block.
prev_certobject (CertificateInfo)Certificate information of the previous block.
prev_cert.hashstringThe hash of the certificate.
prev_cert.roundnumericThe round of the certificate.
prev_cert.committersrepeated numericList of committers in the certificate.
prev_cert.absenteesrepeated numericList of absentees in the certificate.
prev_cert.signaturestringThe signature of the certificate.
txsrepeated object (TransactionInfo)List of transactions in the block, available when verbosity level is set to BLOCK_TRANSACTIONS.
txs[].idstringThe unique ID of the transaction.
txs[].datastringThe raw transaction data in hexadecimal format.
txs[].versionnumericThe version of the transaction.
txs[].lock_timenumericThe lock time for the transaction.
txs[].valuenumericThe value of the transaction in NanoPAC.
txs[].feenumericThe fee for the transaction in NanoPAC.
txs[].payload_typenumeric(Enum)The type of transaction payload.
Available values:
  • PAYLOAD_TYPE_UNSPECIFIED = 0 (Unspecified payload type.)
  • PAYLOAD_TYPE_TRANSFER = 1 (Transfer payload type.)
  • PAYLOAD_TYPE_BOND = 2 (Bond payload type.)
  • PAYLOAD_TYPE_SORTITION = 3 (Sortition payload type.)
  • PAYLOAD_TYPE_UNBOND = 4 (Unbond payload type.)
  • PAYLOAD_TYPE_WITHDRAW = 5 (Withdraw payload type.)
txs[].transferobject (PayloadTransfer)(OneOf)Transfer transaction payload.
txs[].transfer.senderstringThe sender's address.
txs[].transfer.receiverstringThe receiver's address.
txs[].transfer.amountnumericThe amount to be transferred in NanoPAC.
txs[].bondobject (PayloadBond)(OneOf)Bond transaction payload.
txs[].bond.senderstringThe sender's address.
txs[].bond.receiverstringThe receiver's address.
txs[].bond.stakenumericThe stake amount in NanoPAC.
txs[].bond.public_keystringThe public key of the validator.
txs[].sortitionobject (PayloadSortition)(OneOf)Sortition transaction payload.
txs[].sortition.addressstringThe validator address associated with the sortition proof.
txs[].sortition.proofstringThe proof for the sortition.
txs[].unbondobject (PayloadUnbond)(OneOf)Unbond transaction payload.
txs[].unbond.validatorstringThe address of the validator to unbond from.
txs[].withdrawobject (PayloadWithdraw)(OneOf)Withdraw transaction payload.
txs[].withdraw.validator_addressstringThe address of the validator to withdraw from.
txs[].withdraw.account_addressstringThe address of the account to withdraw to.
txs[].withdraw.amountnumericThe withdrawal amount in NanoPAC.
txs[].memostringA memo string for the transaction.
txs[].public_keystringThe public key associated with the transaction.
txs[].signaturestringThe signature for the transaction.

pactus.blockchain.get_block_hash

GetBlockHash retrieves the hash of a block at the specified height.

Parameters

FieldTypeDescription
heightnumericThe height of the block to retrieve the hash for.

Result

FieldTypeDescription
hashstringThe hash of the block.

pactus.blockchain.get_block_height

GetBlockHeight retrieves the height of a block with the specified hash.

Parameters

FieldTypeDescription
hashstringThe hash of the block to retrieve the height for.

Result

FieldTypeDescription
heightnumericThe height of the block.

pactus.blockchain.get_blockchain_info

GetBlockchainInfo retrieves general information about the blockchain.

Parameters

Parameters has no fields.

Result

FieldTypeDescription
last_block_heightnumericThe height of the last block in the blockchain.
last_block_hashstringThe hash of the last block in the blockchain.
total_accountsnumericThe total number of accounts in the blockchain.
total_validatorsnumericThe total number of validators in the blockchain.
total_powernumericThe total power of the blockchain.
committee_powernumericThe power of the committee.
committee_validatorsrepeated object (ValidatorInfo)List of committee validators.
committee_validators[].hashstringThe hash of the validator.
committee_validators[].datastringThe serialized data of the validator.
committee_validators[].public_keystringThe public key of the validator.
committee_validators[].numbernumericThe unique number assigned to the validator.
committee_validators[].stakenumericThe stake of the validator in NanoPAC.
committee_validators[].last_bonding_heightnumericThe height at which the validator last bonded.
committee_validators[].last_sortition_heightnumericThe height at which the validator last participated in sortition.
committee_validators[].unbonding_heightnumericThe height at which the validator will unbond.
committee_validators[].addressstringThe address of the validator.
committee_validators[].availability_scorenumericThe availability score of the validator.
is_prunedbooleanIf the blocks are subject to pruning.
pruning_heightnumericLowest-height block stored (only present if pruning is enabled)
last_block_timenumericTimestamp of the last block in Unix format

pactus.blockchain.get_consensus_info

GetConsensusInfo retrieves information about the consensus instances.

Parameters

Parameters has no fields.

Result

FieldTypeDescription
proposalobject (ProposalInfo)The proposal of the consensus info.
proposal.heightnumericThe height of the proposal.
proposal.roundnumericThe round of the proposal.
proposal.block_datastringThe block data of the proposal.
proposal.signaturestringThe signature of the proposal, signed by the proposer.
instancesrepeated object (ConsensusInfo)List of consensus instances.
instances[].addressstringThe address of the consensus instance.
instances[].activebooleanIndicates whether the consensus instance is active and part of the committee.
instances[].heightnumericThe height of the consensus instance.
instances[].roundnumericThe round of the consensus instance.
instances[].votesrepeated object (VoteInfo)List of votes in the consensus instance.
instances[].votes[].typenumeric(Enum)The type of the vote.
Available values:
  • VOTE_TYPE_UNSPECIFIED = 0 (Unspecified vote type.)
  • VOTE_TYPE_PREPARE = 1 (Prepare vote type.)
  • VOTE_TYPE_PRECOMMIT = 2 (Precommit vote type.)
  • VOTE_TYPE_CP_PRE_VOTE = 3 (Change-proposer:pre-vote vote type.)
  • VOTE_TYPE_CP_MAIN_VOTE = 4 (Change-proposer:main-vote vote type.)
  • VOTE_TYPE_CP_DECIDED = 5 (Change-proposer:decided vote type.)
instances[].votes[].voterstringThe address of the voter.
instances[].votes[].block_hashstringThe hash of the block being voted on.
instances[].votes[].roundnumericThe consensus round of the vote.
instances[].votes[].cp_roundnumericThe change-proposer round of the vote.
instances[].votes[].cp_valuenumericThe change-proposer value of the vote.

pactus.blockchain.get_account

GetAccount retrieves information about an account based on the provided address.

Parameters

FieldTypeDescription
addressstringThe address of the account to retrieve information for.

Result

FieldTypeDescription
accountobject (AccountInfo)Detailed information about the account.
account.hashstringThe hash of the account.
account.datastringThe serialized data of the account.
account.numbernumericThe unique number assigned to the account.
account.balancenumericThe balance of the account in NanoPAC.
account.addressstringThe address of the account.

pactus.blockchain.get_validator

GetValidator retrieves information about a validator based on the provided address.

Parameters

FieldTypeDescription
addressstringThe address of the validator to retrieve information for.

Result

FieldTypeDescription
validatorobject (ValidatorInfo)Detailed information about the validator.
validator.hashstringThe hash of the validator.
validator.datastringThe serialized data of the validator.
validator.public_keystringThe public key of the validator.
validator.numbernumericThe unique number assigned to the validator.
validator.stakenumericThe stake of the validator in NanoPAC.
validator.last_bonding_heightnumericThe height at which the validator last bonded.
validator.last_sortition_heightnumericThe height at which the validator last participated in sortition.
validator.unbonding_heightnumericThe height at which the validator will unbond.
validator.addressstringThe address of the validator.
validator.availability_scorenumericThe availability score of the validator.

pactus.blockchain.get_validator_by_number

GetValidatorByNumber retrieves information about a validator based on the provided number.

Parameters

FieldTypeDescription
numbernumericThe unique number of the validator to retrieve information for.

Result

FieldTypeDescription
validatorobject (ValidatorInfo)Detailed information about the validator.
validator.hashstringThe hash of the validator.
validator.datastringThe serialized data of the validator.
validator.public_keystringThe public key of the validator.
validator.numbernumericThe unique number assigned to the validator.
validator.stakenumericThe stake of the validator in NanoPAC.
validator.last_bonding_heightnumericThe height at which the validator last bonded.
validator.last_sortition_heightnumericThe height at which the validator last participated in sortition.
validator.unbonding_heightnumericThe height at which the validator will unbond.
validator.addressstringThe address of the validator.
validator.availability_scorenumericThe availability score of the validator.

pactus.blockchain.get_validator_addresses

GetValidatorAddresses retrieves a list of all validator addresses.

Parameters

Parameters has no fields.

Result

FieldTypeDescription
addressesrepeated stringList of validator addresses.

pactus.blockchain.get_public_key

GetPublicKey retrieves the public key of an account based on the provided address.

Parameters

FieldTypeDescription
addressstringThe address for which to retrieve the public key.

Result

FieldTypeDescription
public_keystringThe public key associated with the provided address.

pactus.blockchain.get_tx_pool_content

GetTxPoolContent retrieves current transactions in the transaction pool.

Parameters

FieldTypeDescription
payload_typenumeric(Enum)The type of transactions to retrieve from the transaction pool. 0 means all types.
Available values:
  • PAYLOAD_TYPE_UNSPECIFIED = 0 (Unspecified payload type.)
  • PAYLOAD_TYPE_TRANSFER = 1 (Transfer payload type.)
  • PAYLOAD_TYPE_BOND = 2 (Bond payload type.)
  • PAYLOAD_TYPE_SORTITION = 3 (Sortition payload type.)
  • PAYLOAD_TYPE_UNBOND = 4 (Unbond payload type.)
  • PAYLOAD_TYPE_WITHDRAW = 5 (Withdraw payload type.)

Result

FieldTypeDescription
txsrepeated object (TransactionInfo)List of transactions currently in the pool.
txs[].idstringThe unique ID of the transaction.
txs[].datastringThe raw transaction data in hexadecimal format.
txs[].versionnumericThe version of the transaction.
txs[].lock_timenumericThe lock time for the transaction.
txs[].valuenumericThe value of the transaction in NanoPAC.
txs[].feenumericThe fee for the transaction in NanoPAC.
txs[].payload_typenumeric(Enum)The type of transaction payload.
Available values:
  • PAYLOAD_TYPE_UNSPECIFIED = 0 (Unspecified payload type.)
  • PAYLOAD_TYPE_TRANSFER = 1 (Transfer payload type.)
  • PAYLOAD_TYPE_BOND = 2 (Bond payload type.)
  • PAYLOAD_TYPE_SORTITION = 3 (Sortition payload type.)
  • PAYLOAD_TYPE_UNBOND = 4 (Unbond payload type.)
  • PAYLOAD_TYPE_WITHDRAW = 5 (Withdraw payload type.)
txs[].transferobject (PayloadTransfer)(OneOf)Transfer transaction payload.
txs[].transfer.senderstringThe sender's address.
txs[].transfer.receiverstringThe receiver's address.
txs[].transfer.amountnumericThe amount to be transferred in NanoPAC.
txs[].bondobject (PayloadBond)(OneOf)Bond transaction payload.
txs[].bond.senderstringThe sender's address.
txs[].bond.receiverstringThe receiver's address.
txs[].bond.stakenumericThe stake amount in NanoPAC.
txs[].bond.public_keystringThe public key of the validator.
txs[].sortitionobject (PayloadSortition)(OneOf)Sortition transaction payload.
txs[].sortition.addressstringThe validator address associated with the sortition proof.
txs[].sortition.proofstringThe proof for the sortition.
txs[].unbondobject (PayloadUnbond)(OneOf)Unbond transaction payload.
txs[].unbond.validatorstringThe address of the validator to unbond from.
txs[].withdrawobject (PayloadWithdraw)(OneOf)Withdraw transaction payload.
txs[].withdraw.validator_addressstringThe address of the validator to withdraw from.
txs[].withdraw.account_addressstringThe address of the account to withdraw to.
txs[].withdraw.amountnumericThe withdrawal amount in NanoPAC.
txs[].memostringA memo string for the transaction.
txs[].public_keystringThe public key associated with the transaction.
txs[].signaturestringThe signature for the transaction.

Network Service

Network service provides RPCs for retrieving information about the network.

pactus.network.get_network_info

GetNetworkInfo retrieves information about the overall network.

Parameters

FieldTypeDescription
only_connectedbooleanIf true, returns only peers that are currently connected.

Result

FieldTypeDescription
network_namestringName of the network.
connected_peers_countnumericNumber of connected peers.
connected_peersrepeated object (PeerInfo)List of connected peers.
connected_peers[].statusnumericCurrent status of the peer (e.g., connected, disconnected).
connected_peers[].monikerstringMoniker or Human-Readable name of the peer.
connected_peers[].agentstringVersion and agent details of the peer.
connected_peers[].peer_idstringPeer ID of the peer in P2P network.
connected_peers[].consensus_keysrepeated stringList of consensus keys used by the peer.
connected_peers[].consensus_addressesrepeated stringList of consensus addresses used by the peer.
connected_peers[].servicesnumericBitfield representing the services provided by the peer.
connected_peers[].last_block_hashstringHash of the last block the peer knows.
connected_peers[].heightnumericBlockchain height of the peer.
connected_peers[].last_sentnumericTime the last bundle sent to the peer (in epoch format).
connected_peers[].last_receivednumericTime the last bundle received from the peer (in epoch format).
connected_peers[].addressstringNetwork address of the peer.
connected_peers[].directionstringConnection direction (e.g., inbound, outbound).
connected_peers[].protocolsrepeated stringList of protocols supported by the peer.
connected_peers[].total_sessionsnumericTotal download sessions with the peer.
connected_peers[].completed_sessionsnumericCompleted download sessions with the peer.
connected_peers[].metric_infoobject (MetricInfo)Metrics related to peer activity.
connected_peers[].metric_info.total_invalidobject (CounterInfo)Total number of invalid bundles.
connected_peers[].metric_info.total_sentobject (CounterInfo)Total number of bundles sent.
connected_peers[].metric_info.total_receivedobject (CounterInfo)Total number of bundles received.
connected_peers[].metric_info.message_sentmap<int32, CounterInfo>Number of sent bundles categorized by message type.
connected_peers[].metric_info.message_receivedmap<int32, CounterInfo>Number of received bundles categorized by message type.
metric_infoobject (MetricInfo)Metrics related to node activity.
metric_info.total_invalidobject (CounterInfo)Total number of invalid bundles.
metric_info.total_invalid.bytesnumericTotal number of bytes.
metric_info.total_invalid.bundlesnumericTotal number of bundles.
metric_info.total_sentobject (CounterInfo)Total number of bundles sent.
metric_info.total_sent.bytesnumericTotal number of bytes.
metric_info.total_sent.bundlesnumericTotal number of bundles.
metric_info.total_receivedobject (CounterInfo)Total number of bundles received.
metric_info.total_received.bytesnumericTotal number of bytes.
metric_info.total_received.bundlesnumericTotal number of bundles.
metric_info.message_sentmap<int32, CounterInfo>Number of sent bundles categorized by message type.
metric_info.message_receivedmap<int32, CounterInfo>Number of received bundles categorized by message type.

pactus.network.get_node_info

GetNodeInfo retrieves information about a specific node in the network.

Parameters

Parameters has no fields.

Result

FieldTypeDescription
monikerstringMoniker or Human-readable name identifying this node in the network.
agentstringVersion and agent details of the node.
peer_idstringPeer ID of the node.
started_atnumericTime the node was started (in epoch format).
reachabilitystringReachability status of the node.
servicesnumericBitfield representing the services provided by the node.
services_namesstringNames of services provided by the node.
local_addrsrepeated stringList of addresses associated with the node.
protocolsrepeated stringList of protocols supported by the node.
clock_offsetnumericOffset between the node's clock and the network's clock (in seconds).
connection_infoobject (ConnectionInfo)Information about the node's connections.
connection_info.connectionsnumericTotal number of connections.
connection_info.inbound_connectionsnumericNumber of inbound connections.
connection_info.outbound_connectionsnumericNumber of outbound connections.
zmq_publishersrepeated object (ZMQPublisherInfo)List of active ZeroMQ publishers.
zmq_publishers[].topicstringThe topic associated with the publisher.
zmq_publishers[].addressstringThe address of the publisher.
zmq_publishers[].hwmnumericThe high-water mark (HWM) for the publisher, indicating the maximum number of messages to queue before dropping older ones.

Utils Service

Utils service defines RPC methods for utility functions such as message signing, verification, and etc.

pactus.utils.sign_message_with_private_key

SignMessageWithPrivateKey signs a message with the provided private key.

Parameters

FieldTypeDescription
private_keystringThe private key to sign the message.
messagestringThe message content to be signed.

Result

FieldTypeDescription
signaturestringThe resulting signature in hexadecimal format.

pactus.utils.verify_message

VerifyMessage verifies a signature against the public key and message.

Parameters

FieldTypeDescription
messagestringThe original message content that was signed.
signaturestringThe signature to verify in hexadecimal format.
public_keystringThe public key of the signer.

Result

FieldTypeDescription
is_validbooleanBoolean indicating whether the signature is valid for the given message and public key.

pactus.utils.public_key_aggregation

PublicKeyAggregation aggregates multiple BLS public keys into a single key.

Parameters

FieldTypeDescription
public_keysrepeated stringList of BLS public keys to be aggregated.

Result

FieldTypeDescription
public_keystringThe aggregated BLS public key.
addressstringThe blockchain address derived from the aggregated public key.

pactus.utils.signature_aggregation

SignatureAggregation aggregates multiple BLS signatures into a single signature.

Parameters

FieldTypeDescription
signaturesrepeated stringList of BLS signatures to be aggregated.

Result

FieldTypeDescription
signaturestringThe aggregated BLS signature in hexadecimal format.

Wallet Service

Wallet service provides RPC methods for wallet management operations.

pactus.wallet.create_wallet

CreateWallet creates a new wallet with the specified parameters.

Parameters

FieldTypeDescription
wallet_namestringThe name for the new wallet.
passwordstringPassword to secure the new wallet.

Result

FieldTypeDescription
mnemonicstringThe mnemonic (seed phrase) for wallet recovery.

pactus.wallet.restore_wallet

RestoreWallet restores an existing wallet with the given mnemonic.

Parameters

FieldTypeDescription
wallet_namestringThe name for the restored wallet.
mnemonicstringThe mnemonic (seed phrase) for wallet recovery.
passwordstringPassword to secure the restored wallet.

Result

FieldTypeDescription
wallet_namestringThe name of the restored wallet.

pactus.wallet.load_wallet

LoadWallet loads an existing wallet with the given name.

Parameters

FieldTypeDescription
wallet_namestringThe name of the wallet to load.

Result

FieldTypeDescription
wallet_namestringThe name of the loaded wallet.

pactus.wallet.unload_wallet

UnloadWallet unloads a currently loaded wallet with the specified name.

Parameters

FieldTypeDescription
wallet_namestringThe name of the wallet to unload.

Result

FieldTypeDescription
wallet_namestringThe name of the unloaded wallet.

pactus.wallet.get_total_balance

GetTotalBalance returns the total available balance of the wallet.

Parameters

FieldTypeDescription
wallet_namestringThe name of the wallet to get the total balance.

Result

FieldTypeDescription
wallet_namestringThe name of the queried wallet.
total_balancenumericThe total balance of the wallet in NanoPAC.

pactus.wallet.sign_raw_transaction

SignRawTransaction signs a raw transaction for a specified wallet.

Parameters

FieldTypeDescription
wallet_namestringThe name of the wallet used for signing.
raw_transactionstringThe raw transaction data to be signed.
passwordstringWallet password required for signing.

Result

FieldTypeDescription
transaction_idstringThe ID of the signed transaction.
signed_raw_transactionstringThe signed raw transaction data.

pactus.wallet.get_validator_address

GetValidatorAddress retrieves the validator address associated with a public key.

Parameters

FieldTypeDescription
public_keystringThe public key of the validator.

Result

FieldTypeDescription
addressstringThe validator address associated with the public key.

pactus.wallet.get_new_address

GetNewAddress generates a new address for the specified wallet.

Parameters

FieldTypeDescription
wallet_namestringThe name of the wallet to generate a new address.
address_typenumeric(Enum)The type of address to generate.
Available values:
  • ADDRESS_TYPE_TREASURY = 0 (Treasury address type. Should not be used to generate new addresses.)
  • ADDRESS_TYPE_VALIDATOR = 1 (Validator address type used for validator nodes.)
  • ADDRESS_TYPE_BLS_ACCOUNT = 2 (Account address type with BLS signature scheme.)
  • ADDRESS_TYPE_ED25519_ACCOUNT = 3 (Account address type with Ed25519 signature scheme. Note: Generating a new Ed25519 address requires the wallet password.)
labelstringA label for the new address.
passwordstringPassword for the new address. It's required when address_type is Ed25519 type.

Result

FieldTypeDescription
wallet_namestringThe name of the wallet where address was generated.
address_infoobject (AddressInfo)Detailed information about the new address.
address_info.addressstringThe address string.
address_info.public_keystringThe public key associated with the address.
address_info.labelstringA human-readable label associated with the address.
address_info.pathstringThe Hierarchical Deterministic (HD) path of the address within the wallet.

pactus.wallet.get_address_history

GetAddressHistory retrieves the transaction history of an address.

Parameters

FieldTypeDescription
wallet_namestringThe name of the wallet containing the address.
addressstringThe address to retrieve history for.

Result

FieldTypeDescription
history_inforepeated object (HistoryInfo)List of all historical transactions associated with the address.
history_info[].transaction_idstringThe transaction ID in hexadecimal format.
history_info[].timenumericUnix timestamp of when the transaction was confirmed.
history_info[].payload_typestringThe type of transaction payload.
history_info[].descriptionstringHuman-readable description of the transaction.
history_info[].amountnumericThe transaction amount in NanoPAC.

pactus.wallet.sign_message

SignMessage signs an arbitrary message using a wallet's private key.

Parameters

FieldTypeDescription
wallet_namestringThe name of the wallet to sign with.
passwordstringWallet password required for signing.
addressstringThe address whose private key should be used for signing the message.
messagestringThe arbitrary message to be signed.

Result

FieldTypeDescription
signaturestringThe signature in hexadecimal format.

pactus.wallet.get_total_stake

GetTotalStake returns the total stake amount in the wallet.

Parameters

FieldTypeDescription
wallet_namestringThe name of the wallet to get the total stake.

Result

FieldTypeDescription
wallet_namestringThe name of the queried wallet.
total_stakenumericThe total stake amount in NanoPAC.

pactus.wallet.get_address_info

GetAddressInfo returns detailed information about a specific address.

Parameters

FieldTypeDescription
wallet_namestringThe name of the wallet containing the address.
addressstringThe address to query.

Result

FieldTypeDescription
wallet_namestringThe name of the wallet containing the address.
addressstringThe queried address.
labelstringThe address label.
public_keystringThe public key of the address.
pathstringThe Hierarchical Deterministic (HD) path of the address.

pactus.wallet.set_address_label

SetAddressLabel sets or updates the label for a given address.

Parameters

FieldTypeDescription
wallet_namestringThe name of the wallet containing the address.
passwordstringWallet password required for modification.
addressstringThe address to label.
labelstringThe new label for the address.

Result

FieldTypeDescription

pactus.wallet.list_wallet

ListWallet returns list of all available wallets.

Parameters

Parameters has no fields.

Result

FieldTypeDescription
walletsrepeated stringArray of wallet names.

pactus.wallet.get_wallet_info

GetWalletInfo returns detailed information about a specific wallet.

Parameters

FieldTypeDescription
wallet_namestringThe name of the wallet to query.

Result

FieldTypeDescription
wallet_namestringThe name of the wallet to query.
versionnumericThe wallet format version.
networkstringThe network the wallet is connected to (e.g., mainnet, testnet).
encryptedbooleanIndicates if the wallet is encrypted.
uuidstringA unique identifier of the wallet.
created_atnumericUnix timestamp of wallet creation.

pactus.wallet.list_address

ListAddress returns all addresses in the specified wallet.

Parameters

FieldTypeDescription
wallet_namestringThe name of the queried wallet.

Result

FieldTypeDescription
wallet_namestringThe name of the queried wallet.
datarepeated object (AddressInfo)ist of all addresses in the wallet with their details.
data[].addressstringThe address string.
data[].public_keystringThe public key associated with the address.
data[].labelstringA human-readable label associated with the address.
data[].pathstringThe Hierarchical Deterministic (HD) path of the address within the wallet.
Last updated on