GRPC API Reference

GRPC API Reference

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.

gRPC Services

Transaction Service

Transaction service defines various RPC methods for interacting with transactions.

GetTransaction

GetTransaction retrieves transaction details based on the provided request parameters.

GetTransactionRequest Request

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

GetTransactionResponse Response

FieldTypeDescription
block_heightuint32The height of the block containing the transaction.
block_timeuint32The UNIX timestamp of the block containing the transaction.
transactionTransactionInfoDetailed information about the transaction.
transaction.idstringThe unique ID of the transaction.
transaction.datastringThe raw transaction data.
transaction.versionint32The version of the transaction.
transaction.lock_timeuint32The lock time for the transaction.
transaction.valueint64The value of the transaction in NanoPAC.
transaction.feeint64The fee for the transaction in NanoPAC.
transaction.payload_typePayloadType(Enum)The type of transaction payload.
Available values:
  • 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.)
transaction.transferPayloadTransfer(OneOf)Transfer transaction payload.
transaction.transfer.senderstringThe sender's address.
transaction.transfer.receiverstringThe receiver's address.
transaction.transfer.amountint64The amount to be transferred in NanoPAC.
transaction.bondPayloadBond(OneOf)Bond transaction payload.
transaction.bond.senderstringThe sender's address.
transaction.bond.receiverstringThe receiver's address.
transaction.bond.stakeint64The stake amount in NanoPAC.
transaction.bond.public_keystringThe public key of the validator.
transaction.sortitionPayloadSortition(OneOf)Sortition transaction payload.
transaction.sortition.addressstringThe validator address associated with the sortition proof.
transaction.sortition.proofstringThe proof for the sortition.
transaction.unbondPayloadUnbond(OneOf)Unbond transaction payload.
transaction.unbond.validatorstringThe address of the validator to unbond from.
transaction.withdrawPayloadWithdraw(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.amountint64The 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.

CalculateFee

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

CalculateFeeRequest Request

FieldTypeDescription
amountint64The amount involved in the transaction, specified in NanoPAC.
payload_typePayloadType(Enum)The type of transaction payload.
Available values:
  • 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.)
fixed_amountboolIndicates if the amount should be fixed and include the fee.

CalculateFeeResponse Response

FieldTypeDescription
amountint64The calculated amount in NanoPAC.
feeint64The calculated transaction fee in NanoPAC.

BroadcastTransaction

BroadcastTransaction broadcasts a signed transaction to the network.

BroadcastTransactionRequest Request

FieldTypeDescription
signed_raw_transactionstringThe signed raw transaction data to be broadcasted.

BroadcastTransactionResponse Response

FieldTypeDescription
idstringThe unique ID of the broadcasted transaction.

GetRawTransferTransaction

GetRawTransferTransaction retrieves raw details of a transfer transaction.

GetRawTransferTransactionRequest Request

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

GetRawTransactionResponse Response

FieldTypeDescription
raw_transactionstringThe raw transaction data.
idstringThe unique ID of the transaction.

GetRawBondTransaction

GetRawBondTransaction retrieves raw details of a bond transaction.

GetRawBondTransactionRequest Request

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

GetRawTransactionResponse Response

FieldTypeDescription
raw_transactionstringThe raw transaction data.
idstringThe unique ID of the transaction.

GetRawUnbondTransaction

GetRawUnbondTransaction retrieves raw details of an unbond transaction.

GetRawUnbondTransactionRequest Request

FieldTypeDescription
lock_timeuint32The 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.

GetRawTransactionResponse Response

FieldTypeDescription
raw_transactionstringThe raw transaction data.
idstringThe unique ID of the transaction.

GetRawWithdrawTransaction

GetRawWithdrawTransaction retrieves raw details of a withdraw transaction.

GetRawWithdrawTransactionRequest Request

FieldTypeDescription
lock_timeuint32The 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.
amountint64The withdrawal amount in NanoPAC. Must be greater than 0.
feeint64The transaction fee in NanoPAC. If not set, it is set to the estimated fee.
memostringA memo string for the transaction.

GetRawTransactionResponse Response

FieldTypeDescription
raw_transactionstringThe raw transaction data.
idstringThe unique ID of the transaction.

Blockchain Service

Blockchain service defines RPC methods for interacting with the blockchain.

GetBlock

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

GetBlockRequest Request

FieldTypeDescription
heightuint32The height of the block to retrieve.
verbosityBlockVerbosity(Enum)The verbosity level for block information.
Available values:
  • BLOCK_DATA = 0 (Request only block data.)
  • BLOCK_INFO = 1 (Request block information and transaction IDs.)
  • BLOCK_TRANSACTIONS = 2 (Request block information and detailed transaction data.)

GetBlockResponse Response

FieldTypeDescription
heightuint32The height of the block.
hashstringThe hash of the block.
datastringBlock data, available only if verbosity level is set to BLOCK_DATA.
block_timeuint32The timestamp of the block.
headerBlockHeaderInfoHeader information of the block.
header.versionint32The 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_certCertificateInfoCertificate information of the previous block.
prev_cert.hashstringThe hash of the certificate.
prev_cert.roundint32The round of the certificate.
prev_cert.committersrepeated int32List of committers in the certificate.
prev_cert.absenteesrepeated int32List of absentees in the certificate.
prev_cert.signaturestringThe signature of the certificate.
txsrepeated TransactionInfoList 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.
txs[].versionint32The version of the transaction.
txs[].lock_timeuint32The lock time for the transaction.
txs[].valueint64The value of the transaction in NanoPAC.
txs[].feeint64The fee for the transaction in NanoPAC.
txs[].payload_typePayloadType(Enum)The type of transaction payload.
Available values:
  • 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.)
txs[].transferPayloadTransfer(OneOf)Transfer transaction payload.
txs[].transfer.senderstringThe sender's address.
txs[].transfer.receiverstringThe receiver's address.
txs[].transfer.amountint64The amount to be transferred in NanoPAC.
txs[].bondPayloadBond(OneOf)Bond transaction payload.
txs[].bond.senderstringThe sender's address.
txs[].bond.receiverstringThe receiver's address.
txs[].bond.stakeint64The stake amount in NanoPAC.
txs[].bond.public_keystringThe public key of the validator.
txs[].sortitionPayloadSortition(OneOf)Sortition transaction payload.
txs[].sortition.addressstringThe validator address associated with the sortition proof.
txs[].sortition.proofstringThe proof for the sortition.
txs[].unbondPayloadUnbond(OneOf)Unbond transaction payload.
txs[].unbond.validatorstringThe address of the validator to unbond from.
txs[].withdrawPayloadWithdraw(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.amountint64The 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.

GetBlockHash

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

GetBlockHashRequest Request

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

GetBlockHashResponse Response

FieldTypeDescription
hashstringThe hash of the block.

GetBlockHeight

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

GetBlockHeightRequest Request

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

GetBlockHeightResponse Response

FieldTypeDescription
heightuint32The height of the block.

GetBlockchainInfo

GetBlockchainInfo retrieves general information about the blockchain.

GetBlockchainInfoRequest Request

Message has no fields.

GetBlockchainInfoResponse Response

FieldTypeDescription
last_block_heightuint32The height of the last block in the blockchain.
last_block_hashstringThe hash of the last block in the blockchain.
total_accountsint32The total number of accounts in the blockchain.
total_validatorsint32The total number of validators in the blockchain.
total_powerint64The total power of the blockchain.
committee_powerint64The power of the committee.
committee_validatorsrepeated ValidatorInfoList 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[].numberint32The unique number assigned to the validator.
committee_validators[].stakeint64The stake of the validator in NanoPAC.
committee_validators[].last_bonding_heightuint32The height at which the validator last bonded.
committee_validators[].last_sortition_heightuint32The height at which the validator last participated in sortition.
committee_validators[].unbonding_heightuint32The height at which the validator will unbond.
committee_validators[].addressstringThe address of the validator.
committee_validators[].availability_scoredoubleThe availability score of the validator.
is_prunedboolIf the blocks are subject to pruning.
pruning_heightuint32Lowest-height block stored (only present if pruning is enabled)
last_block_timeint64Timestamp of the last block in Unix format

GetConsensusInfo

GetConsensusInfo retrieves information about the consensus instances.

GetConsensusInfoRequest Request

Message has no fields.

GetConsensusInfoResponse Response

FieldTypeDescription
proposalProposalInfoThe proposal of the consensus info.
proposal.heightuint32The height of the proposal.
proposal.roundint32The round of the proposal.
proposal.block_datastringThe block data of the proposal.
proposal.signaturestringThe signature of the proposal, signed by the proposer.
instancesrepeated ConsensusInfoList of consensus instances.
instances[].addressstringThe address of the consensus instance.
instances[].activeboolIndicates whether the consensus instance is active and part of the committee.
instances[].heightuint32The height of the consensus instance.
instances[].roundint32The round of the consensus instance.
instances[].votesrepeated VoteInfoList of votes in the consensus instance.
instances[].votes[].typeVoteType(Enum)The type of the vote.
Available values:
  • 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.)
instances[].votes[].voterstringThe address of the voter.
instances[].votes[].block_hashstringThe hash of the block being voted on.
instances[].votes[].roundint32The consensus round of the vote.
instances[].votes[].cp_roundint32The change-proposer round of the vote.
instances[].votes[].cp_valueint32The change-proposer value of the vote.

GetAccount

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

GetAccountRequest Request

FieldTypeDescription
addressstringThe address of the account to retrieve information for.

GetAccountResponse Response

FieldTypeDescription
accountAccountInfoDetailed information about the account.
account.hashstringThe hash of the account.
account.datastringThe serialized data of the account.
account.numberint32The unique number assigned to the account.
account.balanceint64The balance of the account in NanoPAC.
account.addressstringThe address of the account.

GetValidator

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

GetValidatorRequest Request

FieldTypeDescription
addressstringThe address of the validator to retrieve information for.

GetValidatorResponse Response

FieldTypeDescription
validatorValidatorInfoDetailed 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.numberint32The unique number assigned to the validator.
validator.stakeint64The stake of the validator in NanoPAC.
validator.last_bonding_heightuint32The height at which the validator last bonded.
validator.last_sortition_heightuint32The height at which the validator last participated in sortition.
validator.unbonding_heightuint32The height at which the validator will unbond.
validator.addressstringThe address of the validator.
validator.availability_scoredoubleThe availability score of the validator.

GetValidatorByNumber

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

GetValidatorByNumberRequest Request

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

GetValidatorResponse Response

FieldTypeDescription
validatorValidatorInfoDetailed 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.numberint32The unique number assigned to the validator.
validator.stakeint64The stake of the validator in NanoPAC.
validator.last_bonding_heightuint32The height at which the validator last bonded.
validator.last_sortition_heightuint32The height at which the validator last participated in sortition.
validator.unbonding_heightuint32The height at which the validator will unbond.
validator.addressstringThe address of the validator.
validator.availability_scoredoubleThe availability score of the validator.

GetValidatorAddresses

GetValidatorAddresses retrieves a list of all validator addresses.

GetValidatorAddressesRequest Request

Message has no fields.

GetValidatorAddressesResponse Response

FieldTypeDescription
addressesrepeated stringList of validator addresses.

GetPublicKey

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

GetPublicKeyRequest Request

FieldTypeDescription
addressstringThe address for which to retrieve the public key.

GetPublicKeyResponse Response

FieldTypeDescription
public_keystringThe public key associated with the provided address.

GetTxPoolContent

GetTxPoolContent retrieves current transactions in the transaction pool.

GetTxPoolContentRequest Request

FieldTypeDescription
payload_typePayloadType(Enum)The type of transactions to retrieve from the transaction pool. 0 means all types.
Available values:
  • 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.)

GetTxPoolContentResponse Response

FieldTypeDescription
txsrepeated TransactionInfoList of transactions currently in the pool.
txs[].idstringThe unique ID of the transaction.
txs[].datastringThe raw transaction data.
txs[].versionint32The version of the transaction.
txs[].lock_timeuint32The lock time for the transaction.
txs[].valueint64The value of the transaction in NanoPAC.
txs[].feeint64The fee for the transaction in NanoPAC.
txs[].payload_typePayloadType(Enum)The type of transaction payload.
Available values:
  • 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.)
txs[].transferPayloadTransfer(OneOf)Transfer transaction payload.
txs[].transfer.senderstringThe sender's address.
txs[].transfer.receiverstringThe receiver's address.
txs[].transfer.amountint64The amount to be transferred in NanoPAC.
txs[].bondPayloadBond(OneOf)Bond transaction payload.
txs[].bond.senderstringThe sender's address.
txs[].bond.receiverstringThe receiver's address.
txs[].bond.stakeint64The stake amount in NanoPAC.
txs[].bond.public_keystringThe public key of the validator.
txs[].sortitionPayloadSortition(OneOf)Sortition transaction payload.
txs[].sortition.addressstringThe validator address associated with the sortition proof.
txs[].sortition.proofstringThe proof for the sortition.
txs[].unbondPayloadUnbond(OneOf)Unbond transaction payload.
txs[].unbond.validatorstringThe address of the validator to unbond from.
txs[].withdrawPayloadWithdraw(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.amountint64The 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.

GetNetworkInfo

GetNetworkInfo retrieves information about the overall network.

GetNetworkInfoRequest Request

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

GetNetworkInfoResponse Response

FieldTypeDescription
network_namestringName of the network.
connected_peers_countuint32Number of connected peers.
connected_peersrepeated PeerInfoList of connected peers.
connected_peers[].statusint32Current status of the peer (e.g., connected, disconnected).
connected_peers[].monikerstringMoniker of the peer.
connected_peers[].agentstringVersion and agent details of the peer.
connected_peers[].peer_idstringPeer ID of the peer.
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[].servicesuint32Bitfield representing the services provided by the peer.
connected_peers[].last_block_hashstringHash of the last block the peer knows.
connected_peers[].heightuint32Blockchain height of the peer.
connected_peers[].last_sentint64Time the last bundle sent to the peer (in epoch format).
connected_peers[].last_receivedint64Time 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_sessionsint32Total download sessions with the peer.
connected_peers[].completed_sessionsint32Completed download sessions with the peer.
connected_peers[].metric_infoMetricInfoMetrics related to peer activity.
connected_peers[].metric_info.TotalInvalidCounterInfoTotal number of invalid bundles.
connected_peers[].metric_info.TotalSentCounterInfoTotal number of bundles sent.
connected_peers[].metric_info.TotalReceivedCounterInfoTotal number of bundles received.
connected_peers[].metric_info.MessageSentmap<int32, CounterInfo>Number of sent bundles categorized by message type.
connected_peers[].metric_info.MessageReceivedmap<int32, CounterInfo>Number of received bundles categorized by message type.
metric_infoMetricInfoMetrics related to node activity.
metric_info.TotalInvalidCounterInfoTotal number of invalid bundles.
metric_info.TotalInvalid.Bytesuint64Total number of bytes.
metric_info.TotalInvalid.Bundlesuint64Total number of bundles.
metric_info.TotalSentCounterInfoTotal number of bundles sent.
metric_info.TotalSent.Bytesuint64Total number of bytes.
metric_info.TotalSent.Bundlesuint64Total number of bundles.
metric_info.TotalReceivedCounterInfoTotal number of bundles received.
metric_info.TotalReceived.Bytesuint64Total number of bytes.
metric_info.TotalReceived.Bundlesuint64Total number of bundles.
metric_info.MessageSentmap<int32, CounterInfo>Number of sent bundles categorized by message type.
metric_info.MessageReceivedmap<int32, CounterInfo>Number of received bundles categorized by message type.

GetNodeInfo

GetNodeInfo retrieves information about a specific node in the network.

GetNodeInfoRequest Request

Message has no fields.

GetNodeInfoResponse Response

FieldTypeDescription
monikerstringMoniker of the node.
agentstringVersion and agent details of the node.
peer_idstringPeer ID of the node.
started_atuint64Time the node was started (in epoch format).
reachabilitystringReachability status of the node.
servicesint32Bitfield 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_offsetdoubleOffset between the node's clock and the network's clock (in seconds).
connection_infoConnectionInfoInformation about the node's connections.
connection_info.connectionsuint64Total number of connections.
connection_info.inbound_connectionsuint64Number of inbound connections.
connection_info.outbound_connectionsuint64Number of outbound connections.

Utils Service

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

SignMessageWithPrivateKey

SignMessageWithPrivateKey signs message with provided private key.

SignMessageWithPrivateKeyRequest Request

FieldTypeDescription
private_keystringThe private key to sign the message.
messagestringThe message to sign.

SignMessageWithPrivateKeyResponse Response

FieldTypeDescription
signaturestringThe signature of the message.

VerifyMessage

VerifyMessage verifies signature with public key and message.

VerifyMessageRequest Request

FieldTypeDescription
messagestringThe signed message.
signaturestringThe signature of the message.
public_keystringThe public key of the signer.

VerifyMessageResponse Response

FieldTypeDescription
is_validboolIndicates if the signature is valid (true) or not (false).

BLSPublicKeyAggregation

BLSPublicKeyAggregation aggregates bls public keys.

BLSPublicKeyAggregationRequest Request

FieldTypeDescription
public_keysrepeated stringThe public keys to aggregate.

BLSPublicKeyAggregationResponse Response

FieldTypeDescription
public_keystringThe aggregated public key.

BLSSignatureAggregation

BLSSignatureAggregation aggregates bls signatures.

BLSSignatureAggregationRequest Request

FieldTypeDescription
signaturesrepeated stringThe signatures to aggregate.

BLSSignatureAggregationResponse Response

FieldTypeDescription
signaturestringThe aggregated signature.

Wallet Service

Define the Wallet service with various RPC methods for wallet management.

CreateWallet

CreateWallet creates a new wallet with the specified parameters.

CreateWalletRequest Request

FieldTypeDescription
wallet_namestringThe name of the new wallet.
passwordstringThe password for securing the wallet.

CreateWalletResponse Response

FieldTypeDescription
mnemonicstringThe mnemonic for wallet recovery.

RestoreWallet

RestoreWallet restores an existing wallet with the given mnemonic.

RestoreWalletRequest Request

FieldTypeDescription
wallet_namestringThe name of the wallet to restore.
mnemonicstringThe mnemonic for wallet recovery.
passwordstringThe password for securing the wallet.

RestoreWalletResponse Response

FieldTypeDescription
wallet_namestringThe name of the restored wallet.

LoadWallet

LoadWallet loads an existing wallet with the given name.

LoadWalletRequest Request

FieldTypeDescription
wallet_namestringThe name of the wallet to load.

LoadWalletResponse Response

FieldTypeDescription
wallet_namestringThe name of the loaded wallet.

UnloadWallet

UnloadWallet unloads a currently loaded wallet with the specified name.

UnloadWalletRequest Request

FieldTypeDescription
wallet_namestringThe name of the wallet to unload.

UnloadWalletResponse Response

FieldTypeDescription
wallet_namestringThe name of the unloaded wallet.

GetTotalBalance

GetTotalBalance returns the total available balance of the wallet.

GetTotalBalanceRequest Request

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

GetTotalBalanceResponse Response

FieldTypeDescription
wallet_namestringThe name of the wallet.
total_balanceint64The total balance of the wallet in NanoPAC.

SignRawTransaction

SignRawTransaction signs a raw transaction for a specified wallet.

SignRawTransactionRequest Request

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

SignRawTransactionResponse Response

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

GetValidatorAddress

GetValidatorAddress retrieves the validator address associated with a public key.

GetValidatorAddressRequest Request

FieldTypeDescription
public_keystringThe public key for which the validator address is requested.

GetValidatorAddressResponse Response

FieldTypeDescription
addressstringThe validator address associated with the public key.

GetNewAddress

GetNewAddress generates a new address for the specified wallet.

GetNewAddressRequest Request

FieldTypeDescription
wallet_namestringThe name of the wallet to generate a new address.
address_typeAddressType(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.)
  • 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 ADDRESS_TYPE_ED25519_ACCOUNT.

GetNewAddressResponse Response

FieldTypeDescription
wallet_namestringThe name of the wallet from which the address is generated.
address_infoAddressInfoInformation about the newly generated address.
address_info.addressstringThe address string.
address_info.public_keystringThe public key associated with the address.
address_info.labelstringA label associated with the address.
address_info.pathstringThe Hierarchical Deterministic path of the address within the wallet.

GetAddressHistory

GetAddressHistory retrieves the transaction history of an address.

GetAddressHistoryRequest Request

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

GetAddressHistoryResponse Response

FieldTypeDescription
history_inforepeated HistoryInfoArray of history information for the address.
history_info[].transaction_idstringThe transaction ID hash.
history_info[].timeuint32The timestamp of the transaction.
history_info[].payload_typestringThe payload type of the transaction.
history_info[].descriptionstringA description of the transaction.
history_info[].amountint64The amount involved in the transaction.

SignMessage

SignMessage signs an arbitrary message.

SignMessageRequest Request

FieldTypeDescription
wallet_namestringThe name of the wallet.
passwordstringThe password for unlocking the wallet for signing.
addressstringThe account address associated with the private key.
messagestringThe arbitrary message to be signed.

SignMessageResponse Response

FieldTypeDescription
signaturestringSignature of the message.

GetTotalStake

GetTotalStake return total stake of wallet.

GetTotalStakeRequest Request

FieldTypeDescription
wallet_namestringThe name of the wallet.

GetTotalStakeResponse Response

FieldTypeDescription
total_stakeint64
</td>
wallet_namestring
</td>

GetAddressInfo

GetAddressInfo return address information.

GetAddressInfoRequest Request

FieldTypeDescription
wallet_namestringThe name of the wallet to generate a new address.
addressstring
</td>

GetAddressInfoResponse Response

FieldTypeDescription
addressstring
</td>
labelstring
</td>
public_keystring
</td>
pathstring
</td>
wallet_namestring
</td>

SetAddressLabel

SetAddressLabel set label for given address.

SetLabelRequest Request

FieldTypeDescription
wallet_namestringThe name of the wallet to generate a new address.
passwordstringThe password for unlocking the wallet for signing.
addressstring
</td>
labelstring
</td>

SetLabelResponse Response

FieldTypeDescription

ListWallet

ListWallet return list wallet name.

ListWalletRequest Request

Message has no fields.

ListWalletResponse Response

FieldTypeDescription
walletsrepeated string
</td>

GetWalletInfo

GetWalletInfo return wallet information.

GetWalletInfoRequest Request

FieldTypeDescription
wallet_namestring
</td>

GetWalletInfoResponse Response

FieldTypeDescription
wallet_namestring
</td>
versionint64
</td>
networkstring
</td>
encryptedbool
</td>
uuidstring
</td>
created_atint64
</td>

ListAddress

ListAddress return list address in wallet.

ListAddressRequest Request

FieldTypeDescription
wallet_namestring
</td>

ListAddressResponse Response

FieldTypeDescription
datarepeated AddressInfo
</td>
data[].addressstringThe address string.
data[].public_keystringThe public key associated with the address.
data[].labelstringA label associated with the address.
data[].pathstringThe Hierarchical Deterministic path of the address within the wallet.

Scalar Value Types

.proto TypeGoC++RustJavaPythonC#
doublefloat64doublef64doublefloatdouble
floatfloat32floatf32floatfloatfloat
int32int32int32i32intintint
int64int64int64i64longint/longlong
uint32uint32uint32u32intint/longuint
uint64uint64uint64u64longint/longulong
sint32int32int32i32intintint
sint64int64int64i64longint/longlong
fixed32uint32uint32u64intintuint
fixed64uint64uint64u64longint/longulong
sfixed32int32int32i32intintint
sfixed64int64int64i64longint/longlong
boolboolboolboolbooleanbooleanbool
stringstringstringStringStringstr/unicodestring
bytes[]bytestringVecByteStringstrByteString
Last updated on