From 09f6d13e27db18f708c9acd50a1664b3b14b5bb0 Mon Sep 17 00:00:00 2001 From: Mostafa Date: Sat, 4 Apr 2026 14:56:13 +0800 Subject: [PATCH] update API docs --- content/api/grpc.md | 787 ++++++++++++++++---------- content/api/json-rpc.md | 778 +++++++++++++++---------- static/swagger-ui/pactus.swagger.json | 315 ++++++----- 3 files changed, 1161 insertions(+), 719 deletions(-) diff --git a/content/api/grpc.md b/content/api/grpc.md index d0950b1..9c8ba19 100644 --- a/content/api/grpc.md +++ b/content/api/grpc.md @@ -83,6 +83,10 @@ For seamless integration with Pactus, you can use these client libraries: GetBlockchainInfo +
  • + + GetCommitteeInfo +
  • GetConsensusInfo @@ -119,6 +123,10 @@ For seamless integration with Pactus, you can use these client libraries: GetNetworkInfo
  • +
  • + + ListPeers +
  • GetNodeInfo @@ -219,6 +227,18 @@ For seamless integration with Pactus, you can use these client libraries: ListTransactions
  • +
  • + + SetDefaultFee +
  • +
  • + + GetMnemonic +
  • +
  • + + GetPrivateKey +
  • @@ -1763,6 +1783,13 @@ Request Message has no fields. The hash of the last block in the blockchain. + + + last_block_time + int64 + + The timestamp of the last block in Unix format. + total_accounts @@ -1789,7 +1816,66 @@ Request Message has no fields. total_power int64 - The total power of the blockchain. + The total power of the blockchain that is the sum of all validators' stakes, in NanoPAC. + + + + committee_power + int64 + + The power of the committee. + + + + is_pruned + bool + + If the blocks are subject to pruning. + + + + pruning_height + uint32 + + Lowest-height block stored (only present if pruning is enabled) + + + + in_committee + bool + + Indicates whether this node participates in consensus: true if at least one +of its running validators is a member of the current committee. + + + + committee_size + int32 + + The number of validators in the current committee. + + + + + +#### GetCommitteeInfo + +

    GetCommitteeInfo retrieves information about the current committee.

    + +

    GetCommitteeInfoRequest Request

    +Request Message has no fields. + +

    GetCommitteeInfoResponse Response

    + + + + + + + + + @@ -1800,112 +1886,126 @@ Request Message has no fields. - + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + + + + + + - + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    committee_size int32 + The number of validators in the committee.
    committee_validatorstotal_power int64 + The total power of the blockchain that is the sum of all validators' stakes, in NanoPAC. +
    validators repeated ValidatorInfo List of committee validators.
    committee_validators[].hashvalidators[].hash string The hash of the validator.
    committee_validators[].datavalidators[].data string The serialized data of the validator.
    committee_validators[].public_keyvalidators[].public_key string The public key of the validator.
    committee_validators[].numbervalidators[].number int32 The unique number assigned to the validator.
    committee_validators[].stakevalidators[].stake int64 The stake of the validator in NanoPAC.
    committee_validators[].last_bonding_heightvalidators[].last_bonding_height uint32 The height at which the validator last bonded.
    committee_validators[].last_sortition_heightvalidators[].last_sortition_height uint32 The height at which the validator last participated in sortition.
    committee_validators[].unbonding_heightvalidators[].unbonding_height uint32 The height at which the validator will unbond.
    committee_validators[].addressvalidators[].address string The address of the validator.
    committee_validators[].availability_scorevalidators[].availability_score double The availability score of the validator.
    committee_validators[].protocol_versionvalidators[].protocol_version int32 The protocol version of the validator.
    is_prunedvalidators[].is_delegated bool - If the blocks are subject to pruning. + Whether the validator is delegated.
    pruning_height uint32validators[].delegate_owner string - Lowest-height block stored (only present if pruning is enabled) + The address of the stake owner of the validator.
    last_block_timevalidators[].delegate_share int64 - Timestamp of the last block in Unix format + The share of the stake owner of the validator. +
    validators[].delegate_expiry uint32 + The expiry of the stake owner of the validator.
    committee_protocol_versionsprotocol_versions map<int32, double> Map of protocol versions and their percentages in the committee. @@ -2231,6 +2331,34 @@ Request Message has no fields. The protocol version of the validator.
    validator.is_delegated bool + Whether the validator is delegated. +
    validator.delegate_owner string + The address of the stake owner of the validator. +
    validator.delegate_share int64 + The share of the stake owner of the validator. +
    validator.delegate_expiry uint32 + The expiry of the stake owner of the validator. +
    @@ -2344,6 +2472,34 @@ Request Message has no fields. The protocol version of the validator. + + + validator.is_delegated + bool + + Whether the validator is delegated. + + + + validator.delegate_owner + string + + The address of the stake owner of the validator. + + + + validator.delegate_share + int64 + + The share of the stake owner of the validator. + + + + validator.delegate_expiry + uint32 + + The expiry of the stake owner of the validator. + @@ -2695,20 +2851,7 @@ A value of zero means the transaction is unconfirmed and may still in the transa

    GetNetworkInfo retrieves information about the overall network.

    GetNetworkInfoRequest Request

    - - - - - - - - - - - -
    FieldTypeDescription
    only_connected bool - If true, returns only peers that are currently connected. -
    +Request Message has no fields.

    GetNetworkInfoResponse Response

    @@ -2720,7 +2863,7 @@ A value of zero means the transaction is unconfirmed and may still in the transa @@ -2731,98 +2874,205 @@ A value of zero means the transaction is unconfirmed and may still in the transa - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    network_name string - Name of the network. + Name of the P2P network.
    connected_peersmetric_info MetricInfo + Metrics related to node activity. +
    metric_info.total_invalid CounterInfo + Total number of invalid bundles. +
    metric_info.total_invalid.bytes uint64 + Total number of bytes. +
    metric_info.total_invalid.bundles uint64 + Total number of bundles. +
    metric_info.total_sent CounterInfo + Total number of bundles sent. +
    metric_info.total_sent.bytes uint64 + Total number of bytes. +
    metric_info.total_sent.bundles uint64 + Total number of bundles. +
    metric_info.total_received CounterInfo + Total number of bundles received. +
    metric_info.total_received.bytes uint64 + Total number of bytes. +
    metric_info.total_received.bundles uint64 + Total number of bundles. +
    metric_info.message_sent map<int32, CounterInfo> + Number of sent bundles categorized by message type. +
    metric_info.message_received map<int32, CounterInfo> + Number of received bundles categorized by message type. +
    + +#### ListPeers + +

    ListPeers lists all peers in the network.

    + +

    ListPeersRequest Request

    + + + + + + + + + + + +
    FieldTypeDescription
    include_disconnected bool + If true, includes disconnected peers (default: connected peers only). +
    + +

    ListPeersResponse Response

    + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    FieldTypeDescription
    peers repeated PeerInfo - List of connected peers. + List of peers.
    connected_peers[].statuspeers[].status int32 Current status of the peer (e.g., connected, disconnected).
    connected_peers[].monikerpeers[].moniker string Moniker or Human-Readable name of the peer.
    connected_peers[].agentpeers[].agent string Version and agent details of the peer.
    connected_peers[].peer_idpeers[].peer_id string Peer ID of the peer in P2P network.
    connected_peers[].consensus_keyspeers[].consensus_keys repeated string List of consensus keys used by the peer.
    connected_peers[].consensus_addressespeers[].consensus_addresses repeated string List of consensus addresses used by the peer.
    connected_peers[].servicespeers[].services uint32 Bitfield representing the services provided by the peer.
    connected_peers[].last_block_hashpeers[].last_block_hash string Hash of the last block the peer knows.
    connected_peers[].heightpeers[].height uint32 Blockchain height of the peer.
    connected_peers[].last_sentpeers[].last_sent int64 Unix timestamp of the last bundle sent to the peer (UTC).
    connected_peers[].last_receivedpeers[].last_received int64 Unix timestamp of the last bundle received from the peer (UTC).
    connected_peers[].addresspeers[].address string Network address of the peer.
    connected_peers[].directionpeers[].direction Direction (Enum)Connection direction (e.g., inbound, outbound). @@ -2834,147 +3084,69 @@ A value of zero means the transaction is unconfirmed and may still in the transa
    connected_peers[].protocolspeers[].protocols repeated string List of protocols supported by the peer.
    connected_peers[].total_sessionspeers[].total_sessions int32 Total download sessions with the peer.
    connected_peers[].completed_sessionspeers[].completed_sessions int32 Completed download sessions with the peer.
    connected_peers[].metric_infopeers[].metric_info MetricInfo Metrics related to peer activity.
    connected_peers[].metric_info.total_invalidpeers[].metric_info.total_invalid CounterInfo Total number of invalid bundles.
    connected_peers[].metric_info.total_sentpeers[].metric_info.total_sent CounterInfo Total number of bundles sent.
    connected_peers[].metric_info.total_receivedpeers[].metric_info.total_received CounterInfo Total number of bundles received.
    connected_peers[].metric_info.message_sentpeers[].metric_info.message_sent map<int32, CounterInfo> Number of sent bundles categorized by message type.
    connected_peers[].metric_info.message_receivedpeers[].metric_info.message_received map<int32, CounterInfo> Number of received bundles categorized by message type.
    connected_peers[].outbound_hello_sentpeers[].outbound_hello_sent bool Whether the hello message was sent from the outbound connection.
    metric_info MetricInfo - Metrics related to node activity. -
    metric_info.total_invalid CounterInfo - Total number of invalid bundles. -
    metric_info.total_invalid.bytes uint64 - Total number of bytes. -
    metric_info.total_invalid.bundles uint64 - Total number of bundles. -
    metric_info.total_sent CounterInfo - Total number of bundles sent. -
    metric_info.total_sent.bytes uint64 - Total number of bytes. -
    metric_info.total_sent.bundles uint64 - Total number of bundles. -
    metric_info.total_received CounterInfo - Total number of bundles received. -
    metric_info.total_received.bytes uint64 - Total number of bytes. -
    metric_info.total_received.bundles uint64 - Total number of bundles. -
    metric_info.message_sent map<int32, CounterInfo> - Number of sent bundles categorized by message type. -
    metric_info.message_received map<int32, CounterInfo> - Number of received bundles categorized by message type. -
    @@ -3125,6 +3297,13 @@ maximum number of messages to queue before dropping older ones. Current Unix timestamp of the node (UTC). + + + network_name + string + + Name of the P2P network. + @@ -3823,35 +4002,35 @@ Deprecated: Will move into utils.

    - address_info + addr AddressInfo Detailed information about the address. - address_info.address + addr.address string The address string. - address_info.public_key + addr.public_key string The public key associated with the address. - address_info.label + addr.label string A human-readable label associated with the address. - address_info.path + addr.path string The Hierarchical Deterministic (HD) path of the address within the wallet. @@ -3994,35 +4173,35 @@ Note: Generating a new Ed25519 address requires the wallet password.) - address_info + addr AddressInfo Detailed information about the new address. - address_info.address + addr.address string The address string. - address_info.public_key + addr.public_key string The public key associated with the address. - address_info.label + addr.label string A human-readable label associated with the address. - address_info.path + addr.path string The Hierarchical Deterministic (HD) path of the address within the wallet. @@ -4080,35 +4259,35 @@ Note: Generating a new Ed25519 address requires the wallet password.) - data + addrs repeated AddressInfo List of all addresses in the wallet with their details. - data[].address + addrs[].address string The address string. - data[].public_key + addrs[].public_key string The public key associated with the address. - data[].label + addrs[].label string A human-readable label associated with the address. - data[].path + addrs[].path string The Hierarchical Deterministic (HD) path of the address within the wallet. @@ -4304,51 +4483,89 @@ Defaults to 0 if not set. txs - repeated TransactionInfo + repeated WalletTransactionInfo List of transactions for the wallet, filtered by the specified address if provided. - txs[].id + txs[].no + int64 + + A sequence number for the transaction in the wallet. + + + + txs[].tx_id string The unique ID of the transaction. - txs[].data + txs[].sender string - The raw transaction data in hexadecimal format. + The sender's address. - txs[].version - int32 + txs[].receiver + string - The version of the transaction. + The receiver's address. - txs[].lock_time - uint32 + txs[].direction + TxDirection - The lock time for the transaction. + (Enum)The direction of the transaction relative to the wallet. +
    Available values: - txs[].value + txs[].amount int64 - The value of the transaction in NanoPAC. + The amount involved in the transaction in NanoPAC. txs[].fee int64 - The fee for the transaction in NanoPAC. + The transaction fee in NanoPAC. + + + + txs[].memo + string + + A memo string for the transaction. + + + + txs[].status + TransactionStatus + + (Enum)The current status of the transaction. +
    Available values: + + + + txs[].block_height + uint32 + + The block height containing the transaction. @@ -4368,179 +4585,167 @@ Defaults to 0 if not set. - txs[].transfer - PayloadTransfer + txs[].data + bytes - (OneOf)Transfer transaction payload. + The raw transaction data. - txs[].transfer.sender - string - - The sender's address. - - - txs[].transfer.receiver + txs[].comment string - The receiver's address. - - - txs[].transfer.amount - int64 - - The amount to be transferred in NanoPAC. - - - txs[].bond - PayloadBond - - (OneOf)Bond transaction payload. + A comment associated with the transaction in the wallet. - txs[].bond.sender - string - - The sender's address. - - - txs[].bond.receiver - string - - The receiver's address. - - - txs[].bond.stake + txs[].created_at int64 - The stake amount in NanoPAC. - - - txs[].bond.public_key - string - - The public key of the validator. - - - txs[].sortition - PayloadSortition - - (OneOf)Sortition transaction payload. + Unix timestamp of when the transaction was created. - txs[].sortition.address - string - - The validator address associated with the sortition proof. - - - txs[].sortition.proof - string - - The proof for the sortition. - - - txs[].unbond - PayloadUnbond + txs[].updated_at + int64 - (OneOf)Unbond transaction payload. + Unix timestamp of when the transaction was last updated. - - txs[].unbond.validator + + + +#### SetDefaultFee + +

    SetDefaultFee sets the default fee for the wallet.

    + +

    SetDefaultFeeRequest Request

    + + + + + + + - - - - - - - - - - - - - - + + - - - - - - + +
    FieldTypeDescription
    wallet_name string - The address of the validator to unbond from. -
    txs[].withdraw PayloadWithdraw - (OneOf)Withdraw transaction payload. + The name of the wallet to set the default fee.
    txs[].withdraw.validator_address string - The address of the validator to withdraw from. -
    txs[].withdraw.account_address string - The address of the account to withdraw to. -
    txs[].withdraw.amount
    amount int64 - The withdrawal amount in NanoPAC. -
    txs[].batch_transfer PayloadBatchTransfer - (OneOf)Batch Transfer transaction payload. + The default fee amount in NanoPAC.
    txs[].batch_transfer.sender
    + +

    SetDefaultFeeResponse Response

    + + + + + + + - - - + + +
    FieldTypeDescription
    wallet_name string - The sender's address. + The name of the wallet where the default fee was updated.
    txs[].batch_transfer.recipientsrepeated Recipient
    + +#### GetMnemonic + +

    GetMnemonic returns the mnemonic (seed phrase) for the wallet.

    + +

    GetMnemonicRequest Request

    + + + + + + + + - - + + + - - + +
    FieldTypeDescription
    wallet_name string - The list of recipients with their amounts. + The name of the wallet to get the mnemonic.
    txs[].memo
    password string - A memo string for the transaction. + Wallet password.
    txs[].public_key
    + +

    GetMnemonicResponse Response

    + + + + + + + - - + +
    FieldTypeDescription
    mnemonic string - The public key associated with the transaction. + The mnemonic (seed phrase).
    txs[].signature
    + +#### GetPrivateKey + +

    GetPrivateKey returns the private key for a given address.

    + +

    GetPrivateKeyRequest Request

    + + + + + + + - - - + + + - - - + + + - - - + +
    FieldTypeDescription
    wallet_name string - The signature for the transaction. + The name of the wallet containing the address.
    txs[].block_height uint32
    password string - The block height containing the transaction. -A value of zero means the transaction is unconfirmed and may still in the transaction pool. + Wallet password.
    txs[].confirmed bool
    address string - Indicates whether the transaction is confirmed. + The address to get the private key.
    txs[].confirmations int32
    + +

    GetPrivateKeyResponse Response

    + + + + + + + + diff --git a/content/api/json-rpc.md b/content/api/json-rpc.md index d976369..1530fd3 100644 --- a/content/api/json-rpc.md +++ b/content/api/json-rpc.md @@ -133,6 +133,10 @@ curl --location 'http://localhost:8545/' \ pactus.blockchain.get_blockchain_info +
  • + + pactus.blockchain.get_committee_info +
  • pactus.blockchain.get_consensus_info @@ -169,6 +173,10 @@ curl --location 'http://localhost:8545/' \ pactus.network.get_network_info
  • +
  • + + pactus.network.list_peers +
  • pactus.network.get_node_info @@ -269,6 +277,18 @@ curl --location 'http://localhost:8545/' \ pactus.wallet.list_transactions
  • +
  • + + pactus.wallet.set_default_fee +
  • +
  • + + pactus.wallet.get_mnemonic +
  • +
  • + + pactus.wallet.get_private_key +
  • @@ -1800,6 +1820,13 @@ Parameters has no fields. + + + + + @@ -1826,7 +1853,65 @@ Parameters has no fields. + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    private_key string - The number of blocks that have been added to the chain after this transaction was included in a block. -A value of zero means the transaction is unconfirmed and may still in the transaction pool. + The private key in hexadecimal format.
    The hash of the last block in the blockchain.
    last_block_time numeric + The timestamp of the last block in Unix format. +
    total_accountstotal_power numeric - The total power of the blockchain. + The total power of the blockchain that is the sum of all validators' stakes, in NanoPAC. +
    committee_power numeric + The power of the committee. +
    is_pruned boolean + If the blocks are subject to pruning. +
    pruning_height numeric + Lowest-height block stored (only present if pruning is enabled) +
    in_committee boolean + Indicates whether this node participates in consensus: true if at least one +of its running validators is a member of the current committee. +
    committee_size numeric + The number of validators in the current committee. +
    + +#### pactus.blockchain.get_committee_info + +

    GetCommitteeInfo retrieves information about the current committee.

    + +

    Parameters

    +Parameters has no fields. + +

    Result

    + + + + + + + + @@ -1837,112 +1922,126 @@ Parameters has no fields. - + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + - + - + + + + + + + + + + + + + + + + + + + + +
    FieldTypeDescription
    committee_size numeric + The number of validators in the committee.
    committee_validatorstotal_power numeric + The total power of the blockchain that is the sum of all validators' stakes, in NanoPAC. +
    validators repeated object (ValidatorInfo) List of committee validators.
    committee_validators[].hashvalidators[].hash string The hash of the validator.
    committee_validators[].datavalidators[].data string The serialized data of the validator.
    committee_validators[].public_keyvalidators[].public_key string The public key of the validator.
    committee_validators[].numbervalidators[].number numeric The unique number assigned to the validator.
    committee_validators[].stakevalidators[].stake numeric The stake of the validator in NanoPAC.
    committee_validators[].last_bonding_heightvalidators[].last_bonding_height numeric The height at which the validator last bonded.
    committee_validators[].last_sortition_heightvalidators[].last_sortition_height numeric The height at which the validator last participated in sortition.
    committee_validators[].unbonding_heightvalidators[].unbonding_height numeric The height at which the validator will unbond.
    committee_validators[].addressvalidators[].address string The address of the validator.
    committee_validators[].availability_scorevalidators[].availability_score numeric The availability score of the validator.
    committee_validators[].protocol_versionvalidators[].protocol_version numeric The protocol version of the validator.
    is_prunedvalidators[].is_delegated boolean - If the blocks are subject to pruning. + Whether the validator is delegated.
    pruning_heightvalidators[].delegate_owner string + The address of the stake owner of the validator. +
    validators[].delegate_share numeric - Lowest-height block stored (only present if pruning is enabled) + The share of the stake owner of the validator.
    last_block_timevalidators[].delegate_expiry numeric - Timestamp of the last block in Unix format + The expiry of the stake owner of the validator.
    committee_protocol_versionsprotocol_versions map<int32, double> Map of protocol versions and their percentages in the committee. @@ -2265,6 +2364,34 @@ Parameters has no fields. The protocol version of the validator.
    validator.is_delegated boolean + Whether the validator is delegated. +
    validator.delegate_owner string + The address of the stake owner of the validator. +
    validator.delegate_share numeric + The share of the stake owner of the validator. +
    validator.delegate_expiry numeric + The expiry of the stake owner of the validator. +
    @@ -2377,6 +2504,34 @@ Parameters has no fields. The protocol version of the validator. + + + validator.is_delegated + boolean + + Whether the validator is delegated. + + + + validator.delegate_owner + string + + The address of the stake owner of the validator. + + + + validator.delegate_share + numeric + + The share of the stake owner of the validator. + + + + validator.delegate_expiry + numeric + + The expiry of the stake owner of the validator. + @@ -2725,20 +2880,7 @@ A value of zero means the transaction is unconfirmed and may still in the transa

    GetNetworkInfo retrieves information about the overall network.

    Parameters

    - - - - - - - - - - - -
    FieldTypeDescription
    only_connected boolean - If true, returns only peers that are currently connected. -
    +Parameters has no fields.

    Result

    @@ -2749,7 +2891,7 @@ A value of zero means the transaction is unconfirmed and may still in the transa @@ -2760,98 +2902,204 @@ A value of zero means the transaction is unconfirmed and may still in the transa - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    network_name string - Name of the network. + Name of the P2P network.
    connected_peersmetric_info object (MetricInfo) + Metrics related to node activity. +
    metric_info.total_invalid object (CounterInfo) + Total number of invalid bundles. +
    metric_info.total_invalid.bytes numeric + Total number of bytes. +
    metric_info.total_invalid.bundles numeric + Total number of bundles. +
    metric_info.total_sent object (CounterInfo) + Total number of bundles sent. +
    metric_info.total_sent.bytes numeric + Total number of bytes. +
    metric_info.total_sent.bundles numeric + Total number of bundles. +
    metric_info.total_received object (CounterInfo) + Total number of bundles received. +
    metric_info.total_received.bytes numeric + Total number of bytes. +
    metric_info.total_received.bundles numeric + Total number of bundles. +
    metric_info.message_sent map<int32, CounterInfo> + Number of sent bundles categorized by message type. +
    metric_info.message_received map<int32, CounterInfo> + Number of received bundles categorized by message type. +
    + +#### pactus.network.list_peers + +

    ListPeers lists all peers in the network.

    + +

    Parameters

    + + + + + + + + + + + +
    FieldTypeDescription
    include_disconnected boolean + If true, includes disconnected peers (default: connected peers only). +
    + +

    Result

    + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    FieldTypeDescription
    peers repeated object (PeerInfo) - List of connected peers. + List of peers.
    connected_peers[].statuspeers[].status numeric Current status of the peer (e.g., connected, disconnected).
    connected_peers[].monikerpeers[].moniker string Moniker or Human-Readable name of the peer.
    connected_peers[].agentpeers[].agent string Version and agent details of the peer.
    connected_peers[].peer_idpeers[].peer_id string Peer ID of the peer in P2P network.
    connected_peers[].consensus_keyspeers[].consensus_keys repeated string List of consensus keys used by the peer.
    connected_peers[].consensus_addressespeers[].consensus_addresses repeated string List of consensus addresses used by the peer.
    connected_peers[].servicespeers[].services numeric Bitfield representing the services provided by the peer.
    connected_peers[].last_block_hashpeers[].last_block_hash string Hash of the last block the peer knows.
    connected_peers[].heightpeers[].height numeric Blockchain height of the peer.
    connected_peers[].last_sentpeers[].last_sent numeric Unix timestamp of the last bundle sent to the peer (UTC).
    connected_peers[].last_receivedpeers[].last_received numeric Unix timestamp of the last bundle received from the peer (UTC).
    connected_peers[].addresspeers[].address string Network address of the peer.
    connected_peers[].directionpeers[].direction numeric (Enum)Connection direction (e.g., inbound, outbound). @@ -2863,147 +3111,69 @@ A value of zero means the transaction is unconfirmed and may still in the transa
    connected_peers[].protocolspeers[].protocols repeated string List of protocols supported by the peer.
    connected_peers[].total_sessionspeers[].total_sessions numeric Total download sessions with the peer.
    connected_peers[].completed_sessionspeers[].completed_sessions numeric Completed download sessions with the peer.
    connected_peers[].metric_infopeers[].metric_info object (MetricInfo) Metrics related to peer activity.
    connected_peers[].metric_info.total_invalidpeers[].metric_info.total_invalid object (CounterInfo) Total number of invalid bundles.
    connected_peers[].metric_info.total_sentpeers[].metric_info.total_sent object (CounterInfo) Total number of bundles sent.
    connected_peers[].metric_info.total_receivedpeers[].metric_info.total_received object (CounterInfo) Total number of bundles received.
    connected_peers[].metric_info.message_sentpeers[].metric_info.message_sent map<int32, CounterInfo> Number of sent bundles categorized by message type.
    connected_peers[].metric_info.message_receivedpeers[].metric_info.message_received map<int32, CounterInfo> Number of received bundles categorized by message type.
    connected_peers[].outbound_hello_sentpeers[].outbound_hello_sent boolean Whether the hello message was sent from the outbound connection.
    metric_info object (MetricInfo) - Metrics related to node activity. -
    metric_info.total_invalid object (CounterInfo) - Total number of invalid bundles. -
    metric_info.total_invalid.bytes numeric - Total number of bytes. -
    metric_info.total_invalid.bundles numeric - Total number of bundles. -
    metric_info.total_sent object (CounterInfo) - Total number of bundles sent. -
    metric_info.total_sent.bytes numeric - Total number of bytes. -
    metric_info.total_sent.bundles numeric - Total number of bundles. -
    metric_info.total_received object (CounterInfo) - Total number of bundles received. -
    metric_info.total_received.bytes numeric - Total number of bytes. -
    metric_info.total_received.bundles numeric - Total number of bundles. -
    metric_info.message_sent map<int32, CounterInfo> - Number of sent bundles categorized by message type. -
    metric_info.message_received map<int32, CounterInfo> - Number of received bundles categorized by message type. -
    @@ -3153,6 +3323,13 @@ maximum number of messages to queue before dropping older ones. Current Unix timestamp of the node (UTC). + + + network_name + string + + Name of the P2P network. + @@ -3836,35 +4013,35 @@ Deprecated: Will move into utils.

    - address_info + addr object (AddressInfo) Detailed information about the address. - address_info.address + addr.address string The address string. - address_info.public_key + addr.public_key string The public key associated with the address. - address_info.label + addr.label string A human-readable label associated with the address. - address_info.path + addr.path string The Hierarchical Deterministic (HD) path of the address within the wallet. @@ -4005,35 +4182,35 @@ Note: Generating a new Ed25519 address requires the wallet password.) - address_info + addr object (AddressInfo) Detailed information about the new address. - address_info.address + addr.address string The address string. - address_info.public_key + addr.public_key string The public key associated with the address. - address_info.label + addr.label string A human-readable label associated with the address. - address_info.path + addr.path string The Hierarchical Deterministic (HD) path of the address within the wallet. @@ -4090,35 +4267,35 @@ Note: Generating a new Ed25519 address requires the wallet password.) - data + addrs repeated object (AddressInfo) List of all addresses in the wallet with their details. - data[].address + addrs[].address string The address string. - data[].public_key + addrs[].public_key string The public key associated with the address. - data[].label + addrs[].label string A human-readable label associated with the address. - data[].path + addrs[].path string The Hierarchical Deterministic (HD) path of the address within the wallet. @@ -4311,51 +4488,89 @@ Defaults to 0 if not set. txs - repeated object (TransactionInfo) + repeated object (WalletTransactionInfo) List of transactions for the wallet, filtered by the specified address if provided. - txs[].id + txs[].no + numeric + + A sequence number for the transaction in the wallet. + + + + txs[].tx_id string The unique ID of the transaction. - txs[].data + txs[].sender string - The raw transaction data in hexadecimal format. + The sender's address. - txs[].version - numeric + txs[].receiver + string - The version of the transaction. + The receiver's address. - txs[].lock_time + txs[].direction numeric - The lock time for the transaction. + (Enum)The direction of the transaction relative to the wallet. +
    Available values: - txs[].value + txs[].amount numeric - The value of the transaction in NanoPAC. + The amount involved in the transaction in NanoPAC. txs[].fee numeric - The fee for the transaction in NanoPAC. + The transaction fee in NanoPAC. + + + + txs[].memo + string + + A memo string for the transaction. + + + + txs[].status + numeric + + (Enum)The current status of the transaction. +
    Available values: + + + + txs[].block_height + numeric + + The block height containing the transaction. @@ -4375,179 +4590,164 @@ Defaults to 0 if not set. - txs[].transfer - object (PayloadTransfer) + txs[].data + string - (OneOf)Transfer transaction payload. + The raw transaction data. - txs[].transfer.sender - string - - The sender's address. - - - txs[].transfer.receiver + txs[].comment string - The receiver's address. - - - txs[].transfer.amount - numeric - - The amount to be transferred in NanoPAC. - - - txs[].bond - object (PayloadBond) - - (OneOf)Bond transaction payload. + A comment associated with the transaction in the wallet. - txs[].bond.sender - string - - The sender's address. - - - txs[].bond.receiver - string - - The receiver's address. - - - txs[].bond.stake + txs[].created_at numeric - The stake amount in NanoPAC. - - - txs[].bond.public_key - string - - The public key of the validator. - - - txs[].sortition - object (PayloadSortition) - - (OneOf)Sortition transaction payload. + Unix timestamp of when the transaction was created. - txs[].sortition.address - string - - The validator address associated with the sortition proof. - - - txs[].sortition.proof - string - - The proof for the sortition. - - - txs[].unbond - object (PayloadUnbond) + txs[].updated_at + numeric - (OneOf)Unbond transaction payload. + Unix timestamp of when the transaction was last updated. - - txs[].unbond.validator + + + +#### pactus.wallet.set_default_fee + +

    SetDefaultFee sets the default fee for the wallet.

    + +

    Parameters

    + + + + + + + - - - - - - - - - - - - - - + + - - - - - - + +
    FieldTypeDescription
    wallet_name string - The address of the validator to unbond from. -
    txs[].withdraw object (PayloadWithdraw) - (OneOf)Withdraw transaction payload. + The name of the wallet to set the default fee.
    txs[].withdraw.validator_address string - The address of the validator to withdraw from. -
    txs[].withdraw.account_address string - The address of the account to withdraw to. -
    txs[].withdraw.amount
    amount numeric - The withdrawal amount in NanoPAC. -
    txs[].batch_transfer object (PayloadBatchTransfer) - (OneOf)Batch Transfer transaction payload. + The default fee amount in NanoPAC.
    txs[].batch_transfer.sender
    + +

    Result

    + + + + + + - - - + + +
    FieldTypeDescription
    wallet_name string - The sender's address. + The name of the wallet where the default fee was updated.
    txs[].batch_transfer.recipientsrepeated object (Recipient)
    + +#### pactus.wallet.get_mnemonic + +

    GetMnemonic returns the mnemonic (seed phrase) for the wallet.

    + +

    Parameters

    + + + + + + + + - - + + + - - + +
    FieldTypeDescription
    wallet_name string - The list of recipients with their amounts. + The name of the wallet to get the mnemonic.
    txs[].memo
    password string - A memo string for the transaction. + Wallet password.
    txs[].public_key
    + +

    Result

    + + + + + + - - + +
    FieldTypeDescription
    mnemonic string - The public key associated with the transaction. + The mnemonic (seed phrase).
    txs[].signature
    + +#### pactus.wallet.get_private_key + +

    GetPrivateKey returns the private key for a given address.

    + +

    Parameters

    + + + + + + + - - - + + + - - - + + + - - - + +
    FieldTypeDescription
    wallet_name string - The signature for the transaction. + The name of the wallet containing the address.
    txs[].block_height numeric
    password string - The block height containing the transaction. -A value of zero means the transaction is unconfirmed and may still in the transaction pool. + Wallet password.
    txs[].confirmed boolean
    address string - Indicates whether the transaction is confirmed. + The address to get the private key.
    txs[].confirmations numeric
    + +

    Result

    + + + + + + + diff --git a/static/swagger-ui/pactus.swagger.json b/static/swagger-ui/pactus.swagger.json index 7e127c5..c112981 100644 --- a/static/swagger-ui/pactus.swagger.json +++ b/static/swagger-ui/pactus.swagger.json @@ -345,6 +345,29 @@ ] } }, + "/pactus/blockchain/get_committee_info": { + "get": { + "summary": "GetCommitteeInfo retrieves information about the current committee.", + "operationId": "Blockchain_GetCommitteeInfo", + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "$ref": "#/definitions/pactusGetCommitteeInfoResponse" + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "$ref": "#/definitions/rpcStatus" + } + } + }, + "tags": [ + "Blockchain" + ] + } + }, "/pactus/blockchain/get_consensus_info": { "get": { "summary": "GetConsensusInfo retrieves information about the consensus instances.", @@ -548,15 +571,6 @@ } } }, - "parameters": [ - { - "name": "onlyConnected", - "description": "If true, returns only peers that are currently connected.", - "in": "query", - "required": false, - "type": "boolean" - } - ], "tags": [ "Network" ] @@ -1863,16 +1877,6 @@ }, "description": "Response message contains the decoded transaction." }, - "pactusDirection": { - "type": "string", - "enum": [ - "DIRECTION_UNKNOWN", - "DIRECTION_INBOUND", - "DIRECTION_OUTBOUND" - ], - "default": "DIRECTION_UNKNOWN", - "description": "Direction represents the connection direction between peers.\n\n - DIRECTION_UNKNOWN: Unknown direction (default value).\n - DIRECTION_INBOUND: Inbound connection - peer connected to us.\n - DIRECTION_OUTBOUND: Outbound connection - we connected to peer." - }, "pactusGetAccountResponse": { "type": "object", "properties": { @@ -1890,7 +1894,7 @@ "type": "string", "description": "The name of the wallet containing the address." }, - "addressInfo": { + "addr": { "$ref": "#/definitions/pactusAddressInfo", "description": "Detailed information about the address." } @@ -1970,6 +1974,11 @@ "type": "string", "description": "The hash of the last block in the blockchain." }, + "lastBlockTime": { + "type": "string", + "format": "int64", + "description": "The timestamp of the last block in Unix format." + }, "totalAccounts": { "type": "integer", "format": "int32", @@ -1988,21 +1997,13 @@ "totalPower": { "type": "string", "format": "int64", - "description": "The total power of the blockchain." + "description": "The total power of the blockchain that is the sum of all validators' stakes, in NanoPAC." }, "committeePower": { "type": "string", "format": "int64", "description": "The power of the committee." }, - "committeeValidators": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/pactusValidatorInfo" - }, - "description": "List of committee validators." - }, "isPruned": { "type": "boolean", "description": "If the blocks are subject to pruning." @@ -2012,12 +2013,45 @@ "format": "int64", "title": "Lowest-height block stored (only present if pruning is enabled)" }, - "lastBlockTime": { + "inCommittee": { + "type": "boolean", + "description": "Indicates whether this node participates in consensus: true if at least one\nof its running validators is a member of the current committee." + }, + "committeeSize": { + "type": "integer", + "format": "int32", + "description": "The number of validators in the current committee." + } + }, + "description": "Response message contains general blockchain information." + }, + "pactusGetCommitteeInfoResponse": { + "type": "object", + "properties": { + "committeeSize": { + "type": "integer", + "format": "int32", + "description": "The number of validators in the committee." + }, + "committeePower": { + "type": "string", + "format": "int64", + "description": "The power of the committee." + }, + "totalPower": { "type": "string", "format": "int64", - "title": "Timestamp of the last block in Unix format" + "description": "The total power of the blockchain that is the sum of all validators' stakes, in NanoPAC." + }, + "validators": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/pactusValidatorInfo" + }, + "description": "List of committee validators." }, - "committeeProtocolVersions": { + "protocolVersions": { "type": "object", "additionalProperties": { "type": "number", @@ -2026,7 +2060,7 @@ "description": "Map of protocol versions and their percentages in the committee." } }, - "description": "Response message contains general blockchain information." + "description": "Response message contains committee information." }, "pactusGetConsensusInfoResponse": { "type": "object", @@ -2051,21 +2085,13 @@ "properties": { "networkName": { "type": "string", - "description": "Name of the network." + "description": "Name of the P2P network." }, "connectedPeersCount": { "type": "integer", "format": "int64", "description": "Number of connected peers." }, - "connectedPeers": { - "type": "array", - "items": { - "type": "object", - "$ref": "#/definitions/pactusPeerInfo" - }, - "description": "List of connected peers." - }, "metricInfo": { "$ref": "#/definitions/pactusMetricInfo", "description": "Metrics related to node activity." @@ -2102,7 +2128,7 @@ "type": "string", "description": "The name of the wallet where address was generated." }, - "addressInfo": { + "addr": { "$ref": "#/definitions/pactusAddressInfo", "description": "Detailed information about the new address." } @@ -2177,6 +2203,10 @@ "type": "string", "format": "uint64", "description": "Current Unix timestamp of the node (UTC)." + }, + "networkName": { + "type": "string", + "description": "Name of the P2P network." } }, "description": "Response message contains information about a specific node in the network." @@ -2508,7 +2538,7 @@ "type": "string", "description": "The name of the queried wallet." }, - "data": { + "addrs": { "type": "array", "items": { "type": "object", @@ -2530,7 +2560,7 @@ "type": "array", "items": { "type": "object", - "$ref": "#/definitions/pactusTransactionInfo" + "$ref": "#/definitions/pactusWalletTransactionInfo" }, "description": "List of transactions for the wallet, filtered by the specified address if provided." } @@ -2719,100 +2749,6 @@ }, "description": "Payload for a withdraw transaction." }, - "pactusPeerInfo": { - "type": "object", - "properties": { - "status": { - "type": "integer", - "format": "int32", - "description": "Current status of the peer (e.g., connected, disconnected)." - }, - "moniker": { - "type": "string", - "description": "Moniker or Human-Readable name of the peer." - }, - "agent": { - "type": "string", - "description": "Version and agent details of the peer." - }, - "peerId": { - "type": "string", - "description": "Peer ID of the peer in P2P network." - }, - "consensusKeys": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of consensus keys used by the peer." - }, - "consensusAddresses": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of consensus addresses used by the peer." - }, - "services": { - "type": "integer", - "format": "int64", - "description": "Bitfield representing the services provided by the peer." - }, - "lastBlockHash": { - "type": "string", - "description": "Hash of the last block the peer knows." - }, - "height": { - "type": "integer", - "format": "int64", - "description": "Blockchain height of the peer." - }, - "lastSent": { - "type": "string", - "format": "int64", - "description": "Unix timestamp of the last bundle sent to the peer (UTC)." - }, - "lastReceived": { - "type": "string", - "format": "int64", - "description": "Unix timestamp of the last bundle received from the peer (UTC)." - }, - "address": { - "type": "string", - "description": "Network address of the peer." - }, - "direction": { - "$ref": "#/definitions/pactusDirection", - "description": "Connection direction (e.g., inbound, outbound)." - }, - "protocols": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of protocols supported by the peer." - }, - "totalSessions": { - "type": "integer", - "format": "int32", - "description": "Total download sessions with the peer." - }, - "completedSessions": { - "type": "integer", - "format": "int32", - "description": "Completed download sessions with the peer." - }, - "metricInfo": { - "$ref": "#/definitions/pactusMetricInfo", - "description": "Metrics related to peer activity." - }, - "outboundHelloSent": { - "type": "boolean", - "description": "Whether the hello message was sent from the outbound connection." - } - }, - "description": "PeerInfo contains information about a peer in the network." - }, "pactusPingResponse": { "type": "object", "description": "Response message for ping - intentionally empty for measuring round-trip time.\n\nEmpty response payload for measuring round-trip time" @@ -3128,6 +3064,16 @@ }, "description": "Information about a transaction." }, + "pactusTransactionStatus": { + "type": "string", + "enum": [ + "TRANSACTION_STATUS_PENDING", + "TRANSACTION_STATUS_CONFIRMED", + "TRANSACTION_STATUS_FAILED" + ], + "default": "TRANSACTION_STATUS_PENDING", + "description": "TransactionStatus defines the status of a transaction.\n\n - TRANSACTION_STATUS_PENDING: Pending status for transactions in the mempool.\n - TRANSACTION_STATUS_CONFIRMED: Confirmed status for transactions included in a block.\n - TRANSACTION_STATUS_FAILED: Failed status for transactions that were not successful." + }, "pactusTransactionVerbosity": { "type": "string", "enum": [ @@ -3248,6 +3194,24 @@ "type": "integer", "format": "int32", "description": "The protocol version of the validator." + }, + "isDelegated": { + "type": "boolean", + "description": "Whether the validator is delegated." + }, + "delegateOwner": { + "type": "string", + "description": "The address of the stake owner of the validator." + }, + "delegateShare": { + "type": "string", + "format": "int64", + "description": "The share of the stake owner of the validator." + }, + "delegateExpiry": { + "type": "integer", + "format": "int64", + "description": "The expiry of the stake owner of the validator." } }, "description": "Message contains information about a validator." @@ -3326,6 +3290,79 @@ "default": "VOTE_TYPE_UNSPECIFIED", "description": "Enumeration for types of votes.\n\n - VOTE_TYPE_UNSPECIFIED: Unspecified vote type.\n - VOTE_TYPE_PREPARE: Prepare vote type.\n - VOTE_TYPE_PRECOMMIT: Precommit vote type.\n - VOTE_TYPE_CP_PRE_VOTE: Change-proposer:pre-vote vote type.\n - VOTE_TYPE_CP_MAIN_VOTE: Change-proposer:main-vote vote type.\n - VOTE_TYPE_CP_DECIDED: Change-proposer:decided vote type." }, + "pactusWalletTransactionInfo": { + "type": "object", + "properties": { + "no": { + "type": "string", + "format": "int64", + "description": "A sequence number for the transaction in the wallet." + }, + "txId": { + "type": "string", + "description": "The unique ID of the transaction." + }, + "sender": { + "type": "string", + "description": "The sender's address." + }, + "receiver": { + "type": "string", + "description": "The receiver's address." + }, + "direction": { + "$ref": "#/definitions/pactusTxDirection", + "description": "The direction of the transaction relative to the wallet." + }, + "amount": { + "type": "string", + "format": "int64", + "description": "The amount involved in the transaction in NanoPAC." + }, + "fee": { + "type": "string", + "format": "int64", + "description": "The transaction fee in NanoPAC." + }, + "memo": { + "type": "string", + "description": "A memo string for the transaction." + }, + "status": { + "$ref": "#/definitions/pactusTransactionStatus", + "description": "The current status of the transaction." + }, + "blockHeight": { + "type": "integer", + "format": "int64", + "description": "The block height containing the transaction." + }, + "payloadType": { + "$ref": "#/definitions/pactusPayloadType", + "description": "The type of transaction payload." + }, + "data": { + "type": "string", + "format": "byte", + "description": "The raw transaction data." + }, + "comment": { + "type": "string", + "description": "A comment associated with the transaction in the wallet." + }, + "createdAt": { + "type": "string", + "format": "int64", + "description": "Unix timestamp of when the transaction was created." + }, + "updatedAt": { + "type": "string", + "format": "int64", + "description": "Unix timestamp of when the transaction was last updated." + } + }, + "description": "WalletTransactionInfo contains information about a transaction in a wallet." + }, "pactusZMQPublisherInfo": { "type": "object", "properties": {
    FieldTypeDescription
    private_key string - The number of blocks that have been added to the chain after this transaction was included in a block. -A value of zero means the transaction is unconfirmed and may still in the transaction pool. + The private key in hexadecimal format.