Each node in the Pactus network can be configured to use the gRPC protocol for communication. Here you can find the list of all gRPC methods and messages.
All the amounts and values in gRPC endpoints 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.
Transaction service defines various RPC methods for interacting with
transactions.
GetTransaction retrieves transaction details based on the provided request
parameters.
CalculateFee calculates the transaction fee based on the specified amount
and payload type.
BroadcastTransaction broadcasts a signed transaction to the network.
GetRawTransferTransaction retrieves raw details of a transfer transaction.
GetRawBondTransaction retrieves raw details of a bond transaction.
GetRawUnbondTransaction retrieves raw details of an unbond transaction.
GetRawWithdrawTransaction retrieves raw details of a withdraw transaction.
Blockchain service defines RPC methods for interacting with the blockchain.
GetBlock retrieves information about a block based on the provided request
parameters.
GetBlockHash retrieves the hash of a block at the specified height.
GetBlockHeight retrieves the height of a block with the specified hash.
GetBlockchainInfo retrieves general information about the blockchain.
GetConsensusInfo retrieves information about the consensus instances.
GetAccount retrieves information about an account based on the provided
address.
GetValidator retrieves information about a validator based on the provided
address.
GetValidatorByNumber retrieves information about a validator based on the
provided number.
GetValidatorAddresses retrieves a list of all validator addresses.
GetPublicKey retrieves the public key of an account based on the provided
address.
Network service provides RPCs for retrieving information about the network.
GetNetworkInfo retrieves information about the overall network.
GetNodeInfo retrieves information about a specific node in the network.
Define the Wallet service with various RPC methods for wallet management.
CreateWallet creates a new wallet with the specified parameters.
LoadWallet loads an existing wallet with the given name.
UnloadWallet unloads a currently loaded wallet with the specified name.
LockWallet locks a currently loaded wallet with the provided password and
timeout.
UnlockWallet unlocks a locked wallet with the provided password and
timeout.
GetTotalBalance returns the total available balance of the wallet.
SignRawTransaction signs a raw transaction for a specified wallet.
GetValidatorAddress retrieves the validator address associated with a
public key.
GetNewAddress generates a new address for the specified wallet.
GetAddressHistory retrieve transaction history of an address.
Request message for broadcasting a signed transaction.
Field | Type | Description |
signed_raw_transaction | bytes | Signed raw transaction data. |
Response message containing the ID of the broadcasted transaction.
Field | Type | Description |
id | bytes | Transaction ID. |
Request message for calculating transaction fee.
Field | Type | Description |
amount | int64 | Transaction amount in NanoPAC. |
payload_type | PayloadType | Type of transaction payload. |
fixed_amount | bool | Indicates that amount should be fixed and includes the fee. |
Response message containing the calculated transaction fee.
Field | Type | Description |
amount | int64 | Calculated amount in NanoPAC. |
fee | int64 | Calculated transaction fee in NanoPAC. |
Request message for retrieving raw details of a bond transaction.
Field | Type | Description |
lock_time | uint32 | Lock time for the transaction. If not explicitly set, it sets to the last block height. |
sender | string | Sender's account address. |
receiver | string | Receiver's validator address. |
stake | int64 | Stake amount in NanoPAC. It should be greater than 0. |
public_key | string | Public key of the validator. |
fee | int64 | Transaction fee in NanoPAC. If not explicitly set, it is calculated based on the stake. |
memo | string | Transaction memo. |
Response message containing raw transaction data.
Field | Type | Description |
raw_transaction | bytes | Raw transaction data. |
Request message for retrieving raw details of a transfer transaction.
Field | Type | Description |
lock_time | uint32 | Lock time for the transaction. If not explicitly set, it sets to the last block height. |
sender | string | Sender's account address. |
receiver | string | Receiver's account address. |
amount | int64 | Transfer amount in NanoPAC. It should be greater than 0. |
fee | int64 | Transaction fee in NanoPAC. If not explicitly set, it is calculated based on the amount. |
memo | string | Transaction memo. |
Request message for retrieving raw details of an unbond transaction.
Field | Type | Description |
lock_time | uint32 | Lock time for the transaction. If not explicitly set, it sets to the last block height. |
validator_address | string | Address of the validator to unbond from. |
memo | string | Transaction memo. |
Request message for retrieving raw details of a withdraw transaction.
Field | Type | Description |
lock_time | uint32 | Lock time for the transaction. If not explicitly set, it sets to the last block height. |
validator_address | string | Address of the validator to withdraw from. |
account_address | string | Address of the account to withdraw to. |
amount | int64 | Withdrawal amount in NanoPAC. It should be greater than 0. |
fee | int64 | Transaction fee in NanoPAC. If not explicitly set, it is calculated based on the amount. |
memo | string | Transaction memo. |
Request message for retrieving transaction details.
Field | Type | Description |
id | bytes | Transaction ID. |
verbosity | TransactionVerbosity | Verbosity level for transaction details. |
Response message containing details of a transaction.
Field | Type | Description |
block_height | uint32 | Height of the block containing the transaction. |
block_time | uint32 | Time of the block containing the transaction. |
transaction | TransactionInfo | Information about the transaction. |
Payload for a bond transaction.
Field | Type | Description |
sender | string | Sender's address. |
receiver | string | Receiver's address. |
stake | int64 | Stake amount in NanoPAC. |
Payload for a sortition transaction.
Field | Type | Description |
address | string | Address associated with the sortition. |
proof | bytes | Proof for the sortition. |
Payload for a transfer transaction.
Field | Type | Description |
sender | string | Sender's address. |
receiver | string | Receiver's address. |
amount | int64 | Transaction amount in NanoPAC. |
Payload for an unbond transaction.
Field | Type | Description |
validator | string | Address of the validator to unbond from. |
Payload for a withdraw transaction.
Field | Type | Description |
from | string | Address to withdraw from. |
to | string | Address to withdraw to. |
amount | int64 | Withdrawal amount in NanoPAC. |
Information about a transaction.
Field | Type | Description |
id | bytes | Transaction ID. |
data | bytes | Transaction data. |
version | int32 | Transaction version. |
lock_time | uint32 | Lock time for the transaction. |
value | int64 | Transaction value in NanoPAC. |
fee | int64 | Transaction fee in NanoPAC. |
payload_type | PayloadType | Type of transaction payload. |
transfer | PayloadTransfer | Transfer payload. |
bond | PayloadBond | Bond payload. |
sortition | PayloadSortition | Sortition payload. |
unbond | PayloadUnbond | Unbond payload. |
withdraw | PayloadWithdraw | Withdraw payload. |
memo | string | Transaction memo. |
public_key | string | Public key associated with the transaction. |
signature | bytes | Transaction signature. |
Message containing information about an account.
Field | Type | Description |
hash | bytes | Hash of the account. |
data | bytes | Account data. |
number | int32 | Account number. |
balance | int64 | Account balance in NanoPAC. |
address | string | Address of the account. |
Message containing information about the header of a block.
Field | Type | Description |
version | int32 | Block version. |
prev_block_hash | bytes | Hash of the previous block. |
state_root | bytes | State root of the block. |
sortition_seed | bytes | Sortition seed of the block. |
proposer_address | string | Address of the proposer of the block. |
Message containing information about a certificate.
Field | Type | Description |
hash | bytes | Hash of the certificate. |
round | int32 | Round of the certificate. |
committers | repeated int32 | List of committers in the certificate. |
absentees | repeated int32 | List of absentees in the certificate. |
signature | bytes | Certificate signature. |
Message containing information about consensus.
Field | Type | Description |
address | string | Address of the consensus instance. |
Active | bool | Whether the consensus instance is active. |
height | uint32 | Height of the consensus instance. |
round | int32 | Round of the consensus instance. |
votes | repeated VoteInfo | List of votes in the consensus instance. |
Message to request account information based on an address.
Field | Type | Description |
address | string | Address of the account. |
Message containing the response with account information.
Field | Type | Description |
account | AccountInfo | Account information. |
Message to request block hash based on height.
Field | Type | Description |
height | uint32 | Height of the block. |
Message containing the response with the block hash.
Field | Type | Description |
hash | bytes | Hash of the block. |
Message to request block height based on hash.
Field | Type | Description |
hash | bytes | Hash of the block. |
Message containing the response with the block height.
Field | Type | Description |
height | uint32 | Height of the block. |
Message to request block information based on height and verbosity.
Field | Type | Description |
height | uint32 | Height of the block. |
verbosity | BlockVerbosity | Verbosity level for block information. |
Message containing the response with block information.
Field | Type | Description |
height | uint32 | Height of the block. |
hash | bytes | Hash of the block. |
data | bytes | Block data, only available if the verbosity level is set to BLOCK_DATA. |
block_time | uint32 | Block timestamp. |
header | BlockHeaderInfo | Block header information. |
prev_cert | CertificateInfo | Certificate information of the previous block. |
txs | repeated TransactionInfo | List of transactions in the block. Transaction information is available when the verbosity level is set to BLOCK_TRANSACTIONS. |
Message to request general information about the blockchain.
Message has no fields.
Message containing the response with general blockchain information.
Field | Type | Description |
last_block_height | uint32 | Height of the last block. |
last_block_hash | bytes | Hash of the last block. |
total_accounts | int32 | Total number of accounts. |
total_validators | int32 | Total number of validators. |
total_power | int64 | Total power in the blockchain. |
committee_power | int64 | Power of the committee. |
committee_validators | repeated ValidatorInfo | List of committee validators. |
Message to request consensus information.
Message has no fields.
Message containing the response with consensus information.
Field | Type | Description |
instances | repeated ConsensusInfo | List of consensus instances. |
Message to request public key based on an address.
Field | Type | Description |
address | string | Address for which public key is requested. |
Message containing the response with the public key.
Field | Type | Description |
public_key | string | Public key of the account. |
Message to request validator addresses.
Message has no fields.
Message containing the response with a list of validator addresses.
Field | Type | Description |
addresses | repeated string | List of validator addresses. |
Message to request validator information based on a validator number.
Field | Type | Description |
number | int32 | Validator number. |
Message to request validator information based on an address.
Field | Type | Description |
address | string | Address of the validator. |
Message containing the response with validator information.
Field | Type | Description |
validator | ValidatorInfo | Validator information. |
Message containing information about a validator.
Field | Type | Description |
hash | bytes | Hash of the validator. |
data | bytes | Validator data. |
public_key | string | Public key of the validator. |
number | int32 | Validator number. |
stake | int64 | Validator stake in NanoPAC. |
last_bonding_height | uint32 | Last bonding height. |
last_sortition_height | uint32 | Last sortition height. |
unbonding_height | uint32 | Unbonding height. |
address | string | Address of the validator. |
availability_score | double | Availability score of the validator. |
Message containing information about a vote.
Field | Type | Description |
type | VoteType | Type of the vote. |
voter | string | Voter's address. |
block_hash | bytes | Hash of the block being voted on. |
round | int32 | Round of the vote. |
cp_round | int32 | Consensus round of the vote. |
cp_value | int32 | Consensus value of the vote. |
Request message for retrieving overall network information.
Message has no fields.
Response message containing information about the overall network.
Field | Type | Description |
network_name | string | Name of the network. |
total_sent_bytes | uint32 | Total bytes sent across the network. |
total_received_bytes | uint32 | Total bytes received across the network. |
connected_peers_count | uint32 | Number of connected peers. |
connected_peers | repeated PeerInfo | List of connected peers. |
sent_bytes | repeated GetNetworkInfoResponse.SentBytesEntry | Bytes sent per peer ID. |
received_bytes | repeated GetNetworkInfoResponse.ReceivedBytesEntry | Bytes received per peer ID. |
Field | Type | Description |
key | uint32 | |
value | uint64 |
Field | Type | Description |
key | uint32 | |
value | uint64 |
Request message for retrieving information about a specific node in the
network.
Message has no fields.
Response message containing information about a specific node in the network.
Field | Type | Description |
moniker | string | Moniker of the node. |
agent | string | Agent information of the node. |
peer_id | bytes | Peer ID of the node. |
started_at | uint64 | Timestamp when the node started. |
reachability | string | Reachability status of the node. |
services | repeated int32 | List of services provided by the node. |
services_names | repeated string | Names of services provided by the node. |
addrs | repeated string | List of addresses associated with the node. |
protocols | repeated string | List of protocols supported by the node. |
Information about a peer in the network.
Field | Type | Description |
status | int32 | Status of the peer. |
moniker | string | Moniker of the peer. |
agent | string | Agent information of the peer. |
peer_id | bytes | Peer ID of the peer. |
consensus_keys | repeated string | Consensus keys used by the peer. |
consensus_address | repeated string | Consensus address of the peer. |
services | uint32 | Services provided by the peer. |
last_block_hash | bytes | Hash of the last block the peer knows. |
height | uint32 | Height of the peer in the blockchain. |
received_messages | int32 | Count of received messages. |
invalid_messages | int32 | Count of invalid messages received. |
last_sent | int64 | Timestamp of the last sent message. |
last_received | int64 | Timestamp of the last received message. |
sent_bytes | repeated PeerInfo.SentBytesEntry | Bytes sent per message type. |
received_bytes | repeated PeerInfo.ReceivedBytesEntry | Bytes received per message type. |
address | string | Network address of the peer. |
direction | string | Direction of connection with the peer. |
protocols | repeated string | List of protocols supported by the peer. |
total_sessions | int32 | Total sessions with the peer. |
completed_sessions | int32 | Completed sessions with the peer. |
Field | Type | Description |
key | int32 | |
value | int64 |
Field | Type | Description |
key | int32 | |
value | int64 |
Message of address information.
Field | Type | Description |
address | string | |
public_key | string | |
label | string | |
path | string |
Request message for creating a new wallet.
Field | Type | Description |
wallet_name | string | Name of the new wallet. |
mnemonic | string | Mnemonic for wallet recovery. |
language | string | Language for the mnemonic. |
password | string | Password for securing the wallet. |
Response message containing the name of the created wallet.
Field | Type | Description |
wallet_name | string | Name of the created wallet. |
Request message to get an address transaction history.
Field | Type | Description |
wallet_name | string | Name of the wallet. |
address | string | Address to get the transaction history of it. |
Response message to get an address transaction history.
Field | Type | Description |
history_info | repeated HistoryInfo | Array of address history and activities. |
Request message for generating a new address.
Field | Type | Description |
wallet_name | string | Name of the wallet for which the new address is requested. |
address_type | AddressType | Address type for the new address. |
label | string | Label for the new address. |
Response message containing the new address.
Field | Type | Description |
wallet_name | string | Name of the wallet. |
address_info | AddressInfo | Address information. |
Request message for obtaining the available balance of a wallet.
Field | Type | Description |
wallet_name | string | Name of the wallet. |
Response message containing the available balance of the wallet.
Field | Type | Description |
wallet_name | string | Name of the wallet. |
total_balance | int64 | The total balance of the wallet in NanoPAC. |
Request message for obtaining the validator address associated with a public
key.
Field | Type | Description |
public_key | string | Public key for which the validator address is requested. |
Response message containing the validator address corresponding to a public
key.
Field | Type | Description |
address | string | Validator address associated with the public key. |
Message of address history information.
Field | Type | Description |
transaction_id | string | Hash of transaction. |
time | uint32 | transaction timestamp. |
payload_type | string | payload type of transaction. |
description | string | description of transaction. |
amount | int64 | amount of transaction. |
Request message for loading an existing wallet.
Field | Type | Description |
wallet_name | string | Name of the wallet to load. |
Response message containing the name of the loaded wallet.
Field | Type | Description |
wallet_name | string | Name of the loaded wallet. |
Request message for locking a currently loaded wallet.
Field | Type | Description |
wallet_name | string | Name of the wallet to lock. |
Response message containing the name of the locked wallet.
Field | Type | Description |
wallet_name | string | Name of the locked wallet. |
Request message for signing a raw transaction.
Field | Type | Description |
wallet_name | string | Name of the wallet used for signing. |
raw_transaction | bytes | Raw transaction data to be signed. |
password | string | Password for unlocking the wallet for signing. |
Response message containing the transaction ID and signed raw transaction.
Field | Type | Description |
transaction_id | bytes | ID of the signed transaction. |
signed_raw_transaction | bytes | Signed raw transaction data. |
Request message for unloading a currently loaded wallet.
Field | Type | Description |
wallet_name | string | Name of the wallet to unload. |
Response message containing the name of the unloaded wallet.
Field | Type | Description |
wallet_name | string | Name of the unloaded wallet. |
Request message for unlocking a wallet.
Field | Type | Description |
wallet_name | string | Name of the wallet to unlock. |
password | string | Password for unlocking the wallet. |
timeout | int32 | Timeout duration for the unlocked state. |
Response message containing the name of the unlocked wallet.
Field | Type | Description |
wallet_name | string | Name of the unlocked wallet. |
Enumeration for different types of transaction payloads.
Name | Number | Description |
UNKNOWN | 0 | Unknown payload type. |
TRANSFER_PAYLOAD | 1 | Transfer payload type. |
BOND_PAYLOAD | 2 | Bond payload type. |
SORTITION_PAYLOAD | 3 | Sortition payload type. |
UNBOND_PAYLOAD | 4 | Unbond payload type. |
WITHDRAW_PAYLOAD | 5 | Withdraw payload type. |
Enumeration for verbosity level when requesting transaction details.
Name | Number | Description |
TRANSACTION_DATA | 0 | Request transaction data only. |
TRANSACTION_INFO | 1 | Request transaction details. |
Enumeration for verbosity level when requesting block information.
Name | Number | Description |
BLOCK_DATA | 0 | Request block data only. |
BLOCK_INFO | 1 | Request block information and transaction IDs. |
BLOCK_TRANSACTIONS | 2 | Request block information and transaction details. |
Enumeration for types of votes.
Name | Number | Description |
VOTE_UNKNOWN | 0 | Unknown vote type. |
VOTE_PREPARE | 1 | Prepare vote type. |
VOTE_PRECOMMIT | 2 | Precommit vote type. |
VOTE_CHANGE_PROPOSER | 3 | Change proposer vote type. |
Enum for the address type.
Name | Number | Description |
ADDRESS_TYPE_TREASURY | 0 | |
ADDRESS_TYPE_VALIDATOR | 1 | |
ADDRESS_TYPE_BLS_ACCOUNT | 2 |
.proto Type | C++ | Java | Python | Go | C# | PHP |
double | double | double | float | float64 | double | float |
float | float | float | float | float32 | float | float |
int32 | int32 | int | int | int32 | int | integer |
int64 | int64 | long | int/long | int64 | long | integer/string |
uint32 | uint32 | int | int/long | uint32 | uint | integer |
uint64 | uint64 | long | int/long | uint64 | ulong | integer/string |
sint32 | int32 | int | int | int32 | int | integer |
sint64 | int64 | long | int/long | int64 | long | integer/string |
fixed32 | uint32 | int | int | uint32 | uint | integer |
fixed64 | uint64 | long | int/long | uint64 | ulong | integer/string |
sfixed32 | int32 | int | int | int32 | int | integer |
sfixed64 | int64 | long | int/long | int64 | long | integer/string |
bool | bool | boolean | boolean | bool | bool | boolean |
string | string | String | str/unicode | string | string | string |
bytes | string | ByteString | str | []byte | ByteString | string |