pub trait CoreRPCLike {
Show 20 methods
// Required methods
fn get_block_hash(&self, height: CoreHeight) -> Result<BlockHash, Error>;
fn get_block_header(&self, block_hash: &BlockHash) -> Result<Header, Error>;
fn get_block_time_from_height(
&self,
height: CoreHeight,
) -> Result<TimestampMillis, Error>;
fn get_best_chain_lock(&self) -> Result<ChainLock, Error>;
fn submit_chain_lock(&self, chain_lock: &ChainLock) -> Result<u32, Error>;
fn get_transaction(&self, tx_id: &Txid) -> Result<Transaction, Error>;
fn get_asset_unlock_statuses(
&self,
indices: &[u64],
core_chain_locked_height: u32,
) -> Result<Vec<AssetUnlockStatusResult>, Error>;
fn get_transaction_extended_info(
&self,
tx_id: &Txid,
) -> Result<GetRawTransactionResult, Error>;
fn get_fork_info(&self, name: &str) -> Result<Option<SoftforkInfo>, Error>;
fn get_block(&self, block_hash: &BlockHash) -> Result<Block, Error>;
fn get_block_json(&self, block_hash: &BlockHash) -> Result<Value, Error>;
fn get_chain_tips(&self) -> Result<GetChainTipsResult, Error>;
fn get_quorum_listextended(
&self,
height: Option<CoreHeight>,
) -> Result<ExtendedQuorumListResult, Error>;
fn get_quorum_info(
&self,
quorum_type: QuorumType,
hash: &QuorumHash,
include_secret_key_share: Option<bool>,
) -> Result<QuorumInfoResult, Error>;
fn get_protx_diff_with_masternodes(
&self,
base_block: Option<u32>,
block: u32,
) -> Result<MasternodeListDiff, Error>;
fn verify_instant_lock(
&self,
instant_lock: &InstantLock,
max_height: Option<u32>,
) -> Result<bool, Error>;
fn verify_chain_lock(&self, chain_lock: &ChainLock) -> Result<bool, Error>;
fn masternode_sync_status(&self) -> Result<MnSyncStatus, Error>;
fn send_raw_transaction(&self, transaction: &[u8]) -> Result<Txid, Error>;
// Provided method
fn get_optional_transaction_extended_info(
&self,
transaction_id: &Txid,
) -> Result<Option<GetRawTransactionResult>, Error> { ... }
}Expand description
Core RPC interface
Required Methods§
Sourcefn get_block_hash(&self, height: CoreHeight) -> Result<BlockHash, Error>
fn get_block_hash(&self, height: CoreHeight) -> Result<BlockHash, Error>
Get block hash by height
Sourcefn get_block_header(&self, block_hash: &BlockHash) -> Result<Header, Error>
fn get_block_header(&self, block_hash: &BlockHash) -> Result<Header, Error>
Get block hash by height
Sourcefn get_block_time_from_height(
&self,
height: CoreHeight,
) -> Result<TimestampMillis, Error>
fn get_block_time_from_height( &self, height: CoreHeight, ) -> Result<TimestampMillis, Error>
Get block time of a chain locked core height
Sourcefn get_best_chain_lock(&self) -> Result<ChainLock, Error>
fn get_best_chain_lock(&self) -> Result<ChainLock, Error>
Get the best chain lock
Sourcefn submit_chain_lock(&self, chain_lock: &ChainLock) -> Result<u32, Error>
fn submit_chain_lock(&self, chain_lock: &ChainLock) -> Result<u32, Error>
Submit a chain lock
Sourcefn get_transaction(&self, tx_id: &Txid) -> Result<Transaction, Error>
fn get_transaction(&self, tx_id: &Txid) -> Result<Transaction, Error>
Get transaction
Sourcefn get_asset_unlock_statuses(
&self,
indices: &[u64],
core_chain_locked_height: u32,
) -> Result<Vec<AssetUnlockStatusResult>, Error>
fn get_asset_unlock_statuses( &self, indices: &[u64], core_chain_locked_height: u32, ) -> Result<Vec<AssetUnlockStatusResult>, Error>
Get asset unlock statuses
Sourcefn get_transaction_extended_info(
&self,
tx_id: &Txid,
) -> Result<GetRawTransactionResult, Error>
fn get_transaction_extended_info( &self, tx_id: &Txid, ) -> Result<GetRawTransactionResult, Error>
Get transaction
Sourcefn get_fork_info(&self, name: &str) -> Result<Option<SoftforkInfo>, Error>
fn get_fork_info(&self, name: &str) -> Result<Option<SoftforkInfo>, Error>
Get block by hash
Sourcefn get_block_json(&self, block_hash: &BlockHash) -> Result<Value, Error>
fn get_block_json(&self, block_hash: &BlockHash) -> Result<Value, Error>
Get block by hash in JSON format
Sourcefn get_chain_tips(&self) -> Result<GetChainTipsResult, Error>
fn get_chain_tips(&self) -> Result<GetChainTipsResult, Error>
Get chain tips
Sourcefn get_quorum_listextended(
&self,
height: Option<CoreHeight>,
) -> Result<ExtendedQuorumListResult, Error>
fn get_quorum_listextended( &self, height: Option<CoreHeight>, ) -> Result<ExtendedQuorumListResult, Error>
Get list of quorums by type at a given height.
See https://dashcore.readme.io/v19.0.0/docs/core-api-ref-remote-procedure-calls-evo#quorum-listextended
Sourcefn get_quorum_info(
&self,
quorum_type: QuorumType,
hash: &QuorumHash,
include_secret_key_share: Option<bool>,
) -> Result<QuorumInfoResult, Error>
fn get_quorum_info( &self, quorum_type: QuorumType, hash: &QuorumHash, include_secret_key_share: Option<bool>, ) -> Result<QuorumInfoResult, Error>
Get quorum information.
See https://dashcore.readme.io/v19.0.0/docs/core-api-ref-remote-procedure-calls-evo#quorum-info
Sourcefn get_protx_diff_with_masternodes(
&self,
base_block: Option<u32>,
block: u32,
) -> Result<MasternodeListDiff, Error>
fn get_protx_diff_with_masternodes( &self, base_block: Option<u32>, block: u32, ) -> Result<MasternodeListDiff, Error>
Get the difference in masternode list, return masternodes as diff elements
Sourcefn verify_instant_lock(
&self,
instant_lock: &InstantLock,
max_height: Option<u32>,
) -> Result<bool, Error>
fn verify_instant_lock( &self, instant_lock: &InstantLock, max_height: Option<u32>, ) -> Result<bool, Error>
Verify Instant Lock signature
If max_height is provided the chain lock will be verified
against quorums available at this height
Sourcefn verify_chain_lock(&self, chain_lock: &ChainLock) -> Result<bool, Error>
fn verify_chain_lock(&self, chain_lock: &ChainLock) -> Result<bool, Error>
Verify a chain lock signature
Sourcefn masternode_sync_status(&self) -> Result<MnSyncStatus, Error>
fn masternode_sync_status(&self) -> Result<MnSyncStatus, Error>
Returns masternode sync status
Sourcefn send_raw_transaction(&self, transaction: &[u8]) -> Result<Txid, Error>
fn send_raw_transaction(&self, transaction: &[u8]) -> Result<Txid, Error>
Sends raw transaction to the network
Provided Methods§
Sourcefn get_optional_transaction_extended_info(
&self,
transaction_id: &Txid,
) -> Result<Option<GetRawTransactionResult>, Error>
fn get_optional_transaction_extended_info( &self, transaction_id: &Txid, ) -> Result<Option<GetRawTransactionResult>, Error>
Get optional transaction extended info Returns None if transaction doesn’t exists