Proxy RPC
Private
TODO - implement
Public
This document provides a detailed description of all available RPC methods in the PocketNetProxy class. Each method is listed with its parameters, return values, and examples of usage.
Bastyon Proxy API Reference
Available Methods
| Category | Method | Description |
|---|---|---|
| Apps | GetApps | Retrieves a list of applications filtered by the given criteria |
| GetAppScores | Retrieves scores for a list of applications | |
| GetAppComments | Retrieves comments related to a specific application | |
| User & Account | GetUserProfile | Retrieves the profile information of a specific user |
| GetUserState | Retrieves the state information of a specific user | |
| GetUserAddress | Retrieves the addresses associated with a specific username | |
| GetUserStatistic | Retrieves statistics for a specific user based on activity | |
| GetUserSubscribes | Retrieves a list of users that a specific user is subscribed to | |
| GetUserSubscribers | Retrieves a list of subscribers for a specific user | |
| GetAccountSetting | Retrieves account settings information for a given address | |
| GetAddressId | Retrieves the unique identifier (ID) associated with a specific address | |
| GetAddressInfo | Retrieves detailed information about a specific address | |
| GetAddressRegistration | Retrieves the registration status for multiple addresses | |
| GetBalanceHistory | Retrieves the balance history for a list of addresses | |
| GetAccountEarning | Retrieves the earning details of a specific account | |
| GetAccountEarningStats | Retrieves detailed statistics on account earnings | |
| Content & Social | GetContent | Retrieves content based on provided hashes and address |
| GetContents | Retrieves content posted by a specific address | |
| GetComments | Retrieves comments related to a specific post | |
| GetLastComments | Retrieves the most recent comments from the network | |
| GetAccountContents | Retrieves contents associated with a specific account | |
| GetAccountComments | Retrieves comments associated with a specific account | |
| GetAccountPosts | Retrieves posts associated with a specific account | |
| GetAccountFollowers | Retrieves a list of followers for a specific account | |
| GetAccountFollowings | Retrieves a list of accounts that a specific user is following | |
| GetAccountBlockings | Retrieves information about accounts blocked by a specific user | |
| GetAccountBlockers | Retrieves information about accounts that have blocked a specific user | |
| GetBans | Retrieves the ban status of a specific user | |
| GetTags | Retrieves a list of tags used within the network | |
| Scoring | GetAddressScores | Retrieves scores related to a specific address and posts |
| GetPostScores | Retrieves scores for a specific post | |
| GetPageScores | Retrieves scores for multiple posts and comments | |
| Blockchain | GetBlock | Retrieves detailed information about a specific block |
| GetBlockCount | Retrieves the current block count in the network | |
| GetBlockHash | Retrieves the block hash for a given block number | |
| GetBlockTemplate | Retrieves a block template for mining purposes | |
| GetBlockTransactions | Retrieves transactions in a specific block | |
| GetCompactBlock | Retrieves compact block data | |
| GetBlockReward | Retrieves reward information for a specific block | |
| GetBlockchainInfo | Retrieves state of the blockchain | |
| GetBlockSubsidy | Retrieves block subsidy information | |
| GetBestBlockHash | Retrieves the most recent block hash | |
| GetChainTips | Retrieves chain tips information | |
| VerifyChain | Verifies the integrity of the blockchain | |
| Transactions | GetTransaction | Retrieves transaction information |
| GetRawTransaction | Retrieves raw transaction data | |
| DecodeRawTransaction | Decodes raw transaction data | |
| GetAddressTransactions | Retrieves transactions for an address | |
| AddTransaction | Adds a new transaction | |
| GenerateTransaction | Generates a new transaction | |
| TxUnspent | Retrieves unspent transaction outputs | |
| GetTxOut | Retrieves UTXO information | |
| GetTxOutProof | Retrieves UTXO proof | |
| VerifyTxOutProof | Verifies UTXO proof | |
| Network & Node | GetNodeInfo | Retrieves information about the current node |
| GetPeerInfo | Retrieves information about connected peers | |
| GetNetworkInfo | Retrieves network status and nodes information | |
| GetNetworkHashrate | Retrieves current network hash rate | |
| GetTime | Retrieves current network time | |
| GetCoinInfo | Retrieves general coin information | |
| GetMempoolInfo | Retrieves memory pool state | |
| GetRawMempool | Retrieves transactions in memory pool | |
| GetDifficulty | Retrieves current network difficulty | |
| Staking & Mining | GetPosDifficulty | Retrieves Proof-of-Stake difficulty |
| GetNetworkStakeWeight | Retrieves current stake weight | |
| GetStakingStatus | Retrieves staking status | |
| GetMintingInfo | Retrieves minting information | |
| Jury System | GetJury | Retrieves specific jury information |
| GetAllJury | Retrieves all juries in network | |
| GetJuryAssigned | Retrieves jury assignments | |
| GetJuryModerators | Retrieves jury moderators | |
| GetJuryVotes | Retrieves jury votes | |
| GetJuryBalance | Retrieves jury balance | |
| GetJuryList | Retrieves jury list | |
| GetJuryReward | Retrieves jury rewards | |
| GetJuryVotesCount | Retrieves vote counts | |
| GetModeratorStatistics | Retrieves moderator activity statistics | |
| Search & Discovery | Search | Searches content by keywords and type |
| SearchUsers | Searches users by criteria | |
| SearchLinks | Searches content by links | |
| Wallet & Validation | GetWalletInfo | Retrieves wallet information |
| ValidateAddress | Validates network address | |
| CheckStringType | Checks string type in network context | |
| System Info | GetMissedInfo | Retrieves missed blocks and transactions |
Apps Category
GetApps
Retrieves a list of applications filtered by given criteria.
Parameters
interface GetAppsParams {
request: string; // Request string containing filter criteria for apps
}Usage
const response = await api.rpc.getapps({
request: "featured_apps"
} satisfies GetAppsParams);GetAppScores
Retrieves scoring information for applications.
Parameters
interface GetAppScoresParams {
request: string; // Request string specifying which app scores to retrieve
}Usage
const response = await api.rpc.getappscores({
request: "app_scores"
} satisfies GetAppScoresParams);GetAppComments
Retrieves comments associated with a specific application.
Parameters
interface GetAppCommentsParams {
request: string; // Request string specifying which app comments to retrieve
}Usage
const response = await api.rpc.getappcomments({
request: "app_comments"
} satisfies GetAppCommentsParams);User & Account Management
GetUserProfile
Retrieves detailed profile information for a specific user.
Parameters
interface GetUserProfileParams {
address: string; // Blockchain address of the user
shortForm: string; // Format of the response ("basic" or "detailed")
}Usage
const response = await api.rpc.getuserprofile({
address: "user_blockchain_address",
shortForm: "basic"
} satisfies GetUserProfileParams);GetUserState
Retrieves current state information for a specific user.
Parameters
interface GetUserStateParams {
address: string; // Blockchain address of the user
}Usage
const response = await api.rpc.getuserstate({
address: "user_blockchain_address"
} satisfies GetUserStateParams);GetUserAddress
Retrieves blockchain addresses associated with a username.
Parameters
interface GetUserAddressParams {
user_name: string; // Username to look up
count: number; // Number of addresses to return
}Usage
const response = await api.rpc.getuseraddress({
user_name: "username",
count: 1
} satisfies GetUserAddressParams);GetUserStatistic
Retrieves statistical information about user activity.
Parameters
interface GetUserStatisticParams {
addresses: string[]; // Array of blockchain addresses
height: number; // Block height for statistics
depthR: number; // Rating depth to include
depthC: number; // Comments depth to include
cntC: number; // Number of comments to include
}Usage
const response = await api.rpc.getuserstatistic({
addresses: ["address1", "address2"],
height: 1000,
depthR: 10,
depthC: 10,
cntC: 5
} satisfies GetUserStatisticParams);GetAddressId
Retrieves the unique identifier associated with an address.
Parameters
interface GetAddressIdParams {
address: string; // Blockchain address
id: number; // Unique identifier
}Usage
const response = await api.rpc.getaddressid({
address: "blockchain_address",
id: 12345
} satisfies GetAddressIdParams);Content & Social Features
GetContent
Retrieves specific content using provided hashes.
Parameters
interface GetContentParams {
hashes: string[]; // Array of content hashes to retrieve
address: string; // User's blockchain address
last: boolean; // Whether to get only the latest content
}Usage
const response = await api.rpc.getcontent({
hashes: ["hash1", "hash2"],
address: "user_address",
last: true
} satisfies GetContentParams);GetContents
Retrieves all content for a specific address.
Parameters
interface GetContentsParams {
address: string; // User's blockchain address
}Usage
const response = await api.rpc.getcontents({
address: "user_address"
} satisfies GetContentsParams);GetComments
Retrieves comments for a specific post.
Parameters
interface GetCommentsParams {
postid: number; // ID of the post
parentid?: number; // Optional parent comment ID for threaded comments
address?: string; // Optional: filter by commenter address
commend_ids?: string[]; // Optional: specific comment IDs to retrieve
}Usage
const response = await api.rpc.getcomments({
postid: 12345,
parentid: 0,
address: "commenter_address"
} satisfies GetCommentsParams);GetLastComments
Retrieves the most recent comments from the network.
Parameters
interface GetLastCommentsParams {
count: number; // Number of recent comments to retrieve
}Usage
const response = await api.rpc.getlastcomments({
count: 10
} satisfies GetLastCommentsParams);GetAccountContents
Retrieves all content associated with an account.
Parameters
interface GetAccountContentsParams {
address: string; // Account's blockchain address
orderby: string; // Field to order results by
orderdesc: boolean; // Order direction
offset: number; // Pagination offset
limit: number; // Results per page
}Usage
const response = await api.rpc.getaccountcontents({
address: "user_address",
orderby: "date",
orderdesc: true,
offset: 0,
limit: 20
} satisfies GetAccountContentsParams);GetAccountComments
Retrieves all comments made by an account.
Parameters
interface GetAccountCommentsParams {
address: string; // Account's blockchain address
orderby: string; // Field to order results by
orderdesc: boolean; // Order direction
offset: number; // Pagination offset
limit: number; // Results per page
}Usage
const response = await api.rpc.getaccountcomments({
address: "user_address",
orderby: "date",
orderdesc: true,
offset: 0,
limit: 20
} satisfies GetAccountCommentsParams);GetAccountFollowers
Retrieves list of account followers.
Parameters
interface GetUserSubscribesParams {
address: string; // Account's blockchain address
orderby: string; // Field to order results by
orderdesc: boolean; // Order direction
offset: number; // Pagination offset
limit: number; // Results per page
}Usage
const response = await api.rpc.getaccountfollowers({
address: "user_address",
orderby: "date",
orderdesc: true,
offset: 0,
limit: 20
} satisfies GetUserSubscribesParams);GetAccountFollowings
Retrieves list of accounts being followed.
Parameters
interface GetUserSubscribesParams {
address: string; // Account's blockchain address
orderby: string; // Field to order results by
orderdesc: boolean; // Order direction
offset: number; // Pagination offset
limit: number; // Results per page
}Usage
const response = await api.rpc.getaccountfollowings({
address: "user_address",
orderby: "date",
orderdesc: true,
offset: 0,
limit: 20
} satisfies GetUserSubscribesParams);Scoring Features
GetAddressScores
Retrieves scores associated with an address.
Parameters
interface GetAddressScoresParams {
address: string; // User's blockchain address
postHashes: string[]; // Array of post hashes to get scores for
}Usage
const response = await api.rpc.getaddressscores({
address: "user_address",
postHashes: ["hash1", "hash2"]
} satisfies GetAddressScoresParams);Blockchain Operations
GetBlock
Retrieves detailed information about a specific block.
Parameters
interface GetCompactBlockParams {
blockhash: string; // Hash of the block to retrieve
blocknumber: number; // Block number to retrieve
}Usage
const response = await api.rpc.getblock({
blockhash: "block_hash_string",
blocknumber: 12345
} satisfies GetCompactBlockParams);GetBlockCount
Retrieves the current block count in the network.
Parameters
interface GetUserSubscribesParams {
address: string; // Required for authentication
orderby: string; // Ordering field
orderdesc: boolean; // Order direction
offset: number; // Pagination offset
limit: number; // Results per page
}Usage
const response = await api.rpc.getblockcount({
address: "user_address",
orderby: "height",
orderdesc: true,
offset: 0,
limit: 1
} satisfies GetUserSubscribesParams);GetBlockHash
Retrieves the block hash for a given block number.
Parameters
interface GetCompactBlockParams {
blockhash: string; // Previous block hash
blocknumber: number; // Block number to get hash for
}Usage
const response = await api.rpc.getblockhash({
blockhash: "previous_block_hash",
blocknumber: 12345
} satisfies GetCompactBlockParams);GetBlockTemplate
Retrieves a block template for mining purposes.
Parameters
interface GetCompactBlockParams {
blockhash: string; // Previous block hash
blocknumber: number; // Block number for template
}Usage
const response = await api.rpc.getblocktemplate({
blockhash: "previous_block_hash",
blocknumber: 12345
} satisfies GetCompactBlockParams);GetBlockchainInfo
Retrieves detailed information about the state of the blockchain.
Parameters
interface GetPosDifficultyParams {
height?: number; // Optional: specific block height to query
}Usage
const response = await api.rpc.getblockchaininfo({
height: 12345
} satisfies GetPosDifficultyParams);Transaction Operations
GetTransaction
Retrieves detailed information about a specific transaction.
Parameters
interface GetCompactBlockParams {
blockhash: string; // Block hash containing the transaction
blocknumber: number; // Block number containing the transaction
}Usage
const response = await api.rpc.gettransaction({
blockhash: "block_hash",
blocknumber: 12345
} satisfies GetCompactBlockParams);GetRawTransaction
Retrieves raw transaction data.
Parameters
interface GetCompactBlockParams {
blockhash: string; // Block hash containing the transaction
blocknumber: number; // Block number containing the transaction
}Usage
const response = await api.rpc.getrawtransaction({
blockhash: "block_hash",
blocknumber: 12345
} satisfies GetCompactBlockParams);AddTransaction
Adds a new transaction to the network.
Parameters
interface AddTransactionParams {
param1: string; // Transaction parameter
param2: Record<string, any>; // Additional transaction details
}Usage
const response = await api.rpc.addtransaction({
param1: "transaction_data",
param2: {
// Transaction details
type: "transfer",
amount: 100
}
} satisfies AddTransactionParams);GenerateTransaction
Generates a new transaction based on provided details.
Parameters
interface GenerateTransactionParams {
address: string; // Sender's address
privkeys: string[]; // Array of private keys
outcount: number; // Number of outputs
type: string; // Transaction type
payload: Record<string, any>; // Transaction payload
fee: number; // Transaction fee
contentaddress: number; // Content address
confirmations: number; // Required confirmations
locktime: number; // Transaction locktime
}Usage
const response = await api.rpc.generatetransaction({
address: "sender_address",
privkeys: ["key1", "key2"],
outcount: 1,
type: "transfer",
payload: { /* transaction details */ },
fee: 0.001,
contentaddress: 0,
confirmations: 6,
locktime: 0
} satisfies GenerateTransactionParams);Network Operations
GetNodeInfo
Retrieves information about the current node.
Parameters
interface GetNodeInfoParams {
// No parameters required
}Usage
const response = await api.rpc.getnodeinfo();GetPeerInfo
Retrieves information about connected peers in the network.
Parameters
interface GetPeerInfoParams {
// No parameters required
}Usage
const response = await api.rpc.getpeerinfo();GetNetworkInfo
Retrieves network status and node information.
Parameters
interface GetUserSubscribesParams {
address: string; // Required for authentication
orderby: string; // Ordering field
orderdesc: boolean; // Order direction
offset: number; // Pagination offset
limit: number; // Results per page
}Usage
const response = await api.rpc.getnetworkinfo({
address: "user_address",
orderby: "status",
orderdesc: true,
offset: 0,
limit: 20
} satisfies GetUserSubscribesParams);GetNetworkHashrate
Retrieves the current network hash rate.
Parameters
interface GetUserSubscribesParams {
address: string; // Required for authentication
orderby: string; // Ordering field
orderdesc: boolean; // Order direction
offset: number; // Pagination offset
limit: number; // Results per page
}Usage
const response = await api.rpc.getnetworkhashrate({
address: "user_address",
orderby: "hashrate",
orderdesc: true,
offset: 0,
limit: 1
} satisfies GetUserSubscribesParams);Jury System
GetJury
Retrieves information about a specific jury.
Parameters
interface GetJuryParams {
jury: string; // Jury identifier
}Usage
const response = await api.rpc.getjury({
jury: "jury_id"
} satisfies GetJuryParams);GetAllJury
Retrieves information about all juries in the network.
Parameters
interface GetAllJuryParams {
// No parameters required
}Usage
const response = await api.rpc.getalljury();GetJuryAssigned
Retrieves jury assignments for a specific user.
Parameters
interface GetJuryAssignedParams {
address: string; // Moderator's address
verdict: boolean; // Verdict filter
topHeight: number; // Maximum block height
pageStart: number; // Pagination start
pageSize: number; // Items per page
orderBy: string; // Sort field
desc: boolean; // Sort direction
}Usage
const response = await api.rpc.getjuryassigned({
address: "moderator_address",
verdict: true,
topHeight: 12345,
pageStart: 0,
pageSize: 10,
orderBy: "date",
desc: true
} satisfies GetJuryAssignedParams);GetJuryModerators
Retrieves list of moderators for a specific jury.
Parameters
interface GetJuryModeratorsParams {
jury: string; // Jury identifier
}Usage
const response = await api.rpc.getjurymoderators({
jury: "jury_id"
} satisfies GetJuryModeratorsParams);GetJuryVotes
Retrieves voting information for a specific jury.
Parameters
interface GetJuryParams {
jury: string; // Jury identifier
}Usage
const response = await api.rpc.getjuryvotes({
jury: "jury_id"
} satisfies GetJuryParams);Search & Discovery
Search
Searches for content within the network.
Parameters
interface SearchParams {
keyword: string; // Search keyword
type: string; // Content type to search
topBlock?: number; // Optional: maximum block height
pageStart?: number; // Optional: pagination start
pageSize?: number; // Optional: items per page
address?: string; // Optional: address filter
}Usage
const response = await api.rpc.search({
keyword: "search_term",
type: "content",
pageSize: 20,
pageStart: 0
} satisfies SearchParams);SearchUsers
Searches for users based on criteria.
Parameters
interface SearchUsersParams {
keyword: string; // Search keyword
fieldtype: string; // Field to search in
orderbyrank: number; // Ranking order
}Usage
const response = await api.rpc.searchusers({
keyword: "username",
fieldtype: "name",
orderbyrank: 1
} satisfies SearchUsersParams);SearchLinks
Searches for content based on links.
Parameters
interface SearchLinksParams {
links: string; // Links to search for
contenttypes: string[]; // Content types to include
height: number; // Block height limit
count: number; // Number of results
}Usage
const response = await api.rpc.searchlinks({
links: "link_pattern",
contenttypes: ["post", "comment"],
height: 12345,
count: 20
} satisfies SearchLinksParams);