Class FullNodeProxy
Proxy that communicates with the full node
public sealed class FullNodeProxy : ServiceProxy, IServiceProxy
  - Inheritance
 - 
      
      
      FullNodeProxy
 
- Implements
 
- Inherited Members
 
- Extension Methods
 
Remarks
ctor
Constructors
FullNodeProxy(IRpcClient, string)
Proxy that communicates with the full node
public FullNodeProxy(IRpcClient rpcClient, string originService)
  Parameters
rpcClientIRpcClientIRpcClient instance to use for rpc communication
originServicestring
Remarks
ctor
Methods
GetAdditionsAndRemovals(string, CancellationToken)
Retrieves the additions and removals (state transitions) for a certain block. Returns coin records for each addition and removal.
public Task<(IEnumerable<CoinRecord> Additions, IEnumerable<CoinRecord> Removals)> GetAdditionsAndRemovals(string headerhash, CancellationToken cancellationToken = default)
  Parameters
headerhashstringThe header hash
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(IEnumerable<CoinRecord> Additions, IEnumerable<CoinRecord> Removals)>
 A list of additions and a list of removals
GetAggsigAdditionalData(CancellationToken)
Retrieves aggregated signature additional data.
public Task<string> GetAggsigAdditionalData(CancellationToken cancellationToken = default)
  Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetAllMempoolItems(CancellationToken)
Returns all items in the mempool.
public Task<IDictionary<string, MempoolItem>> GetAllMempoolItems(CancellationToken cancellationToken = default)
  Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<IDictionary<string, MempoolItem>>
 A dictionary of mempool items
GetAllMempoolTxIds(CancellationToken)
Returns a list of all transaction IDs (spend bundle hashes) in the mempool.
public Task<IEnumerable<string>> GetAllMempoolTxIds(CancellationToken cancellationToken = default)
  Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<string>>
 a list of tx_ids
GetAverageBlockTime(CancellationToken)
Estimates the average time it is taking to process the last 500 blocks
public Task<TimeSpan> GetAverageBlockTime(CancellationToken cancellationToken = default)
  Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetBlock(string, CancellationToken)
Get a block by a header hash
public Task<FullBlock> GetBlock(string headerhash, CancellationToken cancellationToken = default)
  Parameters
headerhashstringThe header hash
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetBlockCountMetrics(CancellationToken)
Retrieves aggregate information about blocks.
public Task<BlockCountMetrics> GetBlockCountMetrics(CancellationToken cancellationToken = default)
  Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetBlockRecord(string, CancellationToken)
Get a block record by a header hash
public Task<BlockRecord> GetBlockRecord(string headerhash, CancellationToken cancellationToken = default)
  Parameters
headerhashstringThe header hash
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<BlockRecord>
 The BlockRecord
GetBlockRecordByHeight(uint, CancellationToken)
Retrieves a block record by height (assuming the height is less then or equal peak height)
public Task<BlockRecord> GetBlockRecordByHeight(uint height, CancellationToken cancellationToken = default)
  Parameters
heightuintthe height to get
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<BlockRecord>
 The BlockRecord
GetBlockRecords(uint, uint, CancellationToken)
Retrieves block records in a range
public Task<IEnumerable<BlockRecord>> GetBlockRecords(uint start, uint end, CancellationToken cancellationToken = default)
  Parameters
startuintStart height
enduintEnd Height - non-inclusive
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<BlockRecord>>
 list of BlockRecords
GetBlockSpends(string, CancellationToken)
Retrieves every coin that was spent in a block
public Task<IEnumerable<CoinSpend>> GetBlockSpends(string headerhash, CancellationToken cancellationToken = default)
  Parameters
headerhashstringThe block's header_hash
cancellationTokenCancellationToken
Returns
Exceptions
GetBlockSpendsWithConditions(string, CancellationToken)
Retrieves the spends in the given block, including its conditions.
public Task<IEnumerable<BlockSpendWithConditions>> GetBlockSpendsWithConditions(string headerHash, CancellationToken cancellationToken = default)
  Parameters
headerHashstringcancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetBlockchainState(CancellationToken)
Returns a summary of the node's view of the blockchain.
public Task<BlockchainState> GetBlockchainState(CancellationToken cancellationToken = default)
  Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetBlocks(uint, uint, bool?, bool?, CancellationToken)
Get the blocks between a start and end height
public Task<IEnumerable<FullBlock>> GetBlocks(uint start, uint end, bool? excludeHeaderhash = null, bool? excludeReorged = null, CancellationToken cancellationToken = default)
  Parameters
startuintStart height
enduintEnd Height - non-inclusive
excludeHeaderhashbool?Flag indicating whether to include the header hash in the result or not
excludeReorgedbool?cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<FullBlock>>
 A list of FullBlocks
GetCoinRecordByName(string, CancellationToken)
Retrieves a coin record by its name/id.
public Task<CoinRecord> GetCoinRecordByName(string name, CancellationToken cancellationToken = default)
  Parameters
namestringThe coin name
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetCoinRecordsByHint(string, bool, uint?, uint?, CancellationToken)
Retrieves a coin record by hint
public Task<IEnumerable<CoinRecord>> GetCoinRecordsByHint(string hint, bool includeSpentCoins, uint? startHeight = null, uint? endHeight = null, CancellationToken cancellationToken = default)
  Parameters
hintstringThe hint
includeSpentCoinsboolwhether to include spent coins too, instead of just unspent
startHeightuint?confirmation start height for search
endHeightuint?confirmation end height for search
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<CoinRecord>>
 A list of CoinRecords
GetCoinRecordsByNames(IEnumerable<string>, bool, uint?, uint?, CancellationToken)
Retrieves the coins for given coin IDs
public Task<IEnumerable<CoinRecord>> GetCoinRecordsByNames(IEnumerable<string> names, bool includeSpentCoins, uint? startHeight = null, uint? endHeight = null, CancellationToken cancellationToken = default)
  Parameters
namesIEnumerable<string>The coin names
includeSpentCoinsboolFlag indicating whether to include spent coins or not
startHeightuint?confirmation start height for search
endHeightuint?confirmation end height for search
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<CoinRecord>>
 A list of CoinRecords
GetCoinRecordsByParentIds(IEnumerable<string>, bool, uint?, uint?, CancellationToken)
Retrieves the coins for a given list of parent ids
public Task<IEnumerable<CoinRecord>> GetCoinRecordsByParentIds(IEnumerable<string> parentIds, bool includeSpentCoins, uint? startHeight = null, uint? endHeight = null, CancellationToken cancellationToken = default)
  Parameters
parentIdsIEnumerable<string>The list of parent ids hashes
includeSpentCoinsboolwhether to include spent coins too, instead of just unspent
startHeightuint?confirmation start height for search
endHeightuint?confirmation end height for search
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<CoinRecord>>
 A list of CoinRecords
GetCoinRecordsByPuzzleHash(string, bool, uint?, uint?, CancellationToken)
Retrieves the coins for a given puzzlehash
public Task<IEnumerable<CoinRecord>> GetCoinRecordsByPuzzleHash(string puzzlehash, bool includeSpentCoins, uint? startHeight, uint? endHeight, CancellationToken cancellationToken = default)
  Parameters
puzzlehashstringThe puzzle hash
includeSpentCoinsboolwhether to include spent coins too, instead of just unspent
startHeightuint?confirmation start height for search
endHeightuint?confirmation end height for search
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<CoinRecord>>
 A list of CoinRecords
GetCoinRecordsByPuzzleHashes(IEnumerable<string>, bool, uint?, uint?, CancellationToken)
Retrieves the coins for a given list of puzzlehashes, by default returns unspent coins.
public Task<IEnumerable<CoinRecord>> GetCoinRecordsByPuzzleHashes(IEnumerable<string> puzzlehashes, bool includeSpentCoins, uint? startHeight = null, uint? endHeight = null, CancellationToken cancellationToken = default)
  Parameters
puzzlehashesIEnumerable<string>The list of puzzle hashes
includeSpentCoinsboolwhether to include spent coins too, instead of just unspent
startHeightuint?confirmation start height for search
endHeightuint?confirmation end height for search
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<CoinRecord>>
 A list of CoinRecords
GetFeeEstimate(ulong, IEnumerable<int>, CancellationToken)
Estimate a spend fee
public Task<(IEnumerable<ulong> estimates, IEnumerable<int> targetTimes, float currentFeeRate, ulong mempoolSize, ulong mempoolFees, int numSpends, ulong mempoolMaxSize, bool synced, uint peakHeight, ulong lastPeakTimestamp, ulong nodeTimeUtc, ulong lastBlockCost, ulong feesLastBlock, float feeRateLastBlock, uint lastTxBlockHeight)> GetFeeEstimate(ulong cost, IEnumerable<int> targetTimes, CancellationToken cancellationToken = default)
  Parameters
costulongtargetTimesIEnumerable<int>Array of target times
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(IEnumerable<ulong> estimates, IEnumerable<int> targetTimes, float currentFeeRate, ulong mempoolSize, ulong mempoolFees, int numSpends, ulong mempoolMaxSize, bool synced, uint peakHeight, ulong lastPeakTimestamp, ulong nodeTimeUtc, ulong lastBlockCost, ulong feesLastBlock, float feeRateLastBlock, uint lastTxBlockHeight)>
 Fee estimate details
GetFeeEstimate(SpendBundle, IEnumerable<int>, CancellationToken)
Estimate a spend fee
public Task<(IEnumerable<int> Estimates, IEnumerable<int> TargetTimes, ulong CurrentFeeRate, ulong MempoolSize, ulong MempoolMaxSize, bool Synced, uint PeakHeight, ulong LastPeakTimestamp, ulong UtcTimestamp)> GetFeeEstimate(SpendBundle spendBundle, IEnumerable<int> targetTimes, CancellationToken cancellationToken = default)
  Parameters
spendBundleSpendBundleThe spend bundle to estimate
targetTimesIEnumerable<int>Array of target times
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(IEnumerable<int> Estimates, IEnumerable<int> TargetTimes, ulong CurrentFeeRate, ulong MempoolSize, ulong MempoolMaxSize, bool Synced, uint PeakHeight, ulong LastPeakTimestamp, ulong UtcTimestamp)>
 Fee estimate details
GetMempoolItemByTxId(string, bool, CancellationToken)
Gets a mempool item by tx id.
public Task<MempoolItem> GetMempoolItemByTxId(string txId, bool includePending = false, CancellationToken cancellationToken = default)
  Parameters
txIdstringTransaction id
includePendingboolIncluding pending transactions
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<MempoolItem>
 The MempoolItem
GetMempoolItemsByCoinName(string, CancellationToken)
Gets a mempool item by coin name.
public Task<IEnumerable<MempoolItem>> GetMempoolItemsByCoinName(string coinName, CancellationToken cancellationToken = default)
  Parameters
coinNamestringCoin name
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetNetworkSpace(string, string, CancellationToken)
Retrieves an estimate of total space validating the chain between two block header hashes.
public Task<BigInteger> GetNetworkSpace(string newerBlockHeaderhash, string olderBlockHeaderhash, CancellationToken cancellationToken = default)
  Parameters
newerBlockHeaderhashstringolderBlockHeaderhashstringcancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<BigInteger>
 BigInteger of network space in bytes
GetPuzzleAndSolution(string, uint, CancellationToken)
Gets a coin solution
public Task<CoinSpend> GetPuzzleAndSolution(string coinId, uint height, CancellationToken cancellationToken = default)
  Parameters
coinIdstringId/name of the coin
heightuintBlock height at which the coin was spent 'spent_block_index'
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
Remarks
coinId is the coin name
GetRecentEOS(string, CancellationToken)
Gets a recent end of slot
public Task<(EndOfSubSlotBundle Eos, double TimeReceived, bool Reverted, DateTime DateTimeReceived)> GetRecentEOS(string challengeHash, CancellationToken cancellationToken = default)
  Parameters
challengeHashstringchallenge hash
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
GetRecentSignagePoint(string, CancellationToken)
Gets a recent signage point
public Task<(SignagePoint SignagePoint, double TimeReceived, bool Reverted, DateTime DateTimeReceived)> GetRecentSignagePoint(string spHash, CancellationToken cancellationToken = default)
  Parameters
spHashstringsignage point hash
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<(SignagePoint SignagePoint, double TimeReceived, bool Reverted, DateTime DateTimeReceived)>
 The SignagePoint
GetUnfinishedBlockHeaders(CancellationToken)
Get unfinished block headers
public Task<IEnumerable<UnfinishedHeaderBlock>> GetUnfinishedBlockHeaders(CancellationToken cancellationToken = default)
  Parameters
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
- Task<IEnumerable<UnfinishedHeaderBlock>>
 A list of UnfinishedHeaderBlocks
OnEventMessage(Message)
protected override void OnEventMessage(Message msg)
  Parameters
msgMessage
PushTx(SpendBundle, CancellationToken)
Pushes a spend bundle to the mempool and blockchain. Returns whether the spend bundle was successfully included into the mempool
public Task<bool> PushTx(SpendBundle spendBundle, CancellationToken cancellationToken = default)
  Parameters
spendBundleSpendBundlecancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
WaitForSync(int, CancellationToken)
Will wait until GetBlockchainState(CancellationToken) indicates that the full node has synced or until the cancellation token is canceled
public Task WaitForSync(int millisecondsDelay = 10000, CancellationToken cancellationToken = default)
  Parameters
millisecondsDelayintThe number of milliseconds to wait each time before checking sync status
cancellationTokenCancellationTokenA token to allow the call to be cancelled
Returns
Exceptions
- TaskCanceledException
 When cancellation token expires or is cancelled
Events
BlockchainStateChanged
Event raised when the blockchain state changes
public event EventHandler<dynamic>? BlockchainStateChanged
  Event Type
- EventHandler<dynamic>
 - Proxy that communicates with the full node