io.github.gstojsic.bitcoin.proxy.BlockchainRpcAsync Maven / Gradle / Ivy
Show all versions of proxy Show documentation
package io.github.gstojsic.bitcoin.proxy;
import io.github.gstojsic.bitcoin.proxy.json.model.Block1;
import io.github.gstojsic.bitcoin.proxy.json.model.Block2;
import io.github.gstojsic.bitcoin.proxy.json.model.BlockFilter;
import io.github.gstojsic.bitcoin.proxy.json.model.BlockHeader;
import io.github.gstojsic.bitcoin.proxy.json.model.BlockStats;
import io.github.gstojsic.bitcoin.proxy.json.model.BlockchainInfo;
import io.github.gstojsic.bitcoin.proxy.json.model.ChainTipData;
import io.github.gstojsic.bitcoin.proxy.json.model.ChainTxStats;
import io.github.gstojsic.bitcoin.proxy.json.model.DumpFile;
import io.github.gstojsic.bitcoin.proxy.json.model.MempoolData;
import io.github.gstojsic.bitcoin.proxy.json.model.MempoolInfo;
import io.github.gstojsic.bitcoin.proxy.json.model.MempoolWithSeq;
import io.github.gstojsic.bitcoin.proxy.json.model.ScanTxOutResult;
import io.github.gstojsic.bitcoin.proxy.json.model.ScanTxOutsetStatus;
import io.github.gstojsic.bitcoin.proxy.json.model.TransactionOutput;
import io.github.gstojsic.bitcoin.proxy.json.model.TransactionOutputSetInfo;
import io.github.gstojsic.bitcoin.proxy.json.model.TxSpendingPrevOutInfo;
import io.github.gstojsic.bitcoin.proxy.model.BlockStatOptions;
import io.github.gstojsic.bitcoin.proxy.model.HashType;
import io.github.gstojsic.bitcoin.proxy.model.PsbtDescriptor;
import io.github.gstojsic.bitcoin.proxy.model.Transaction;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.CompletableFuture;
public interface BlockchainRpcAsync {
/**
* Calls getbestblockhash method on the bitcoin node which returns the hash of the best (tip) block in the
* most-work fully-validated chain.
* Get more info with:
* client.help(Command.getbestblockhash);
*
* @return the block hash, hex-encoded
*/
CompletableFuture getBestBlockhash();
/**
* Calls getblock method on the bitcoin node which returns a string that is serialized, hex-encoded data for
* block ‘hash’.
* Get more info with:
* client.help(Command.getblock);
*
* @param blockhash The block hash
* @return A string that is serialized, hex-encoded data for block ‘hash’
*/
CompletableFuture getBlock(String blockhash);
/**
* Calls getblock method on the bitcoin node which returns an Object with information about block ‘hash’
* Get more info with:
* client.help(Command.getblock);
*
* @param blockhash The block hash
* @return an Object with information about block ‘hash’. See {@link Block1} docs
*/
CompletableFuture getBlockVerbose1(String blockhash);
/**
* Calls getblock method on the bitcoin node which returns an Object with information about block ‘hash’
* and information about each transaction.
* Get more info with:
* client.help(Command.getblock);
*
* @param blockhash The block hash
* @return an Object with information about block ‘hash’ and information about each transaction.
* For more info check {@link Block2} docs
*/
CompletableFuture getBlockVerbose2(String blockhash);
/**
* Calls getblock method on the bitcoin node which returns an Object with information about blockhash and
* information about each transaction, including prevout information for inputs (only for unpruned blocks in the
* current best chain).
* Get more info with:
* client.help(Command.getblock);
*
* @param blockhash The block hash
* @return an Object with information about blockhash and information about each transaction, including prevout
* information for inputs (only for unpruned blocks in the current best chain). See {@link Block2} docs
*/
CompletableFuture getBlockVerbose3(String blockhash);
/**
* Calls getblockchaininfo method on the bitcoin node which returns an object containing various state info
* regarding blockchain processing.
* Get more info with:
* client.help(Command.getblockchaininfo);
*
* @return an object containing various state info regarding blockchain processing. See {@link BlockchainInfo} docs
*/
CompletableFuture getBlockchainInfo();
/**
* Calls getblockcount method on the bitcoin node which returns the height of the most-work fully-validated chain.
* Get more info with:
* client.help(Command.getblockcount);
*
* @return the height of the most-work fully-validated chain
*/
CompletableFuture getBlockCount();
/**
* Calls getblockfilter method on the bitcoin node which returns a BIP 157 content filter for a particular block.
* Get more info with:
* client.help(Command.getblockfilter);
*
* @param blockhash The hash of the block
* @param filterType The type name of the filter
* @return a BIP 157 content filter for a particular block. See {@link BlockFilter} docs
*/
CompletableFuture getBlockFilter(String blockhash, String filterType);
/**
* Calls getblockhash method on the bitcoin node which returns the hash of block in best-block-chain at height provided.
* Get more info with:
* client.help(Command.getblockhash);
*
* @param height The height index
* @return the hash of block in best-block-chain at height provided.
*/
CompletableFuture getBlockhash(int height);
/**
* Calls getblockheader method on the bitcoin node which returns a string that is serialized, hex-encoded data for blockheader ‘hash’.
* Get more info with:
* client.help(Command.getblockheader);
*
* @param blockhash The block hash
* @return a string that is serialized, hex-encoded data for blockheader ‘hash’.
*/
CompletableFuture getBlockHeader(String blockhash);
/**
* Calls getblockheader method on the bitcoin node which returns an Object with information about blockheader ‘hash’.
* Get more info with:
* client.help(Command.getblockheader);
*
* @param blockhash The block hash
* @return an Object with information about blockheader ‘hash’. See {@link BlockFilter} docs
*/
CompletableFuture getBlockHeaderVerbose(String blockhash);
/**
* Calls getblockstats method on the bitcoin node which returns per block statistics for a given window. All amounts are in satoshis.
* Get more info with:
* client.help(Command.getblockstats);
*
* @param hash The block hash of the target block
* @param options stats options. default is all values
* @return per block statistics for a given window. See {@link BlockStats} docs
*/
CompletableFuture getBlockStats(String hash, Set options);
/**
* Calls getblockstats method on the bitcoin node which returns per block statistics for a given window. All amounts are in satoshis.
* Get more info with:
* client.help(Command.getblockstats);
*
* @param height The height of the target block
* @param options stats options. default is all values
* @return per block statistics for a given window. See {@link BlockStats} docs
*/
CompletableFuture getBlockStats(int height, Set options);
/**
* Calls getchaintips method on the bitcoin node which returns information about all known tips in the block tree,
* including the main chain as well as orphaned branches.
* Get more info with:
* client.help(Command.getchaintips);
*
* @return information about all known tips in the block tree including the main chain as well as orphaned branches.
* See {@link ChainTipData} docs
*/
CompletableFuture> getChainTips();
/**
* Calls getchaintxstats method on the bitcoin node which returns statistics about the total number and rate of
* transactions in the chain.
* Get more info with:
* client.help(Command.getchaintxstats);
*
* @param nBlocks Size of the window in number of blocks
* @param blockhash The hash of the block that ends the window.
* @return statistics about the total number and rate of transactions in the chain. See {@link ChainTxStats} docs
*/
CompletableFuture getChainTxStats(Integer nBlocks, String blockhash);
/**
* Calls getdifficulty method on the bitcoin node which returns the proof-of-work difficulty as a multiple of
* the minimum difficulty.
* Get more info with:
* client.help(Command.getdifficulty);
*
* @return the proof-of-work difficulty as a multiple of the minimum difficulty.
*/
CompletableFuture getDifficulty();
/**
* Calls getmempoolancestors method on the bitcoin node which returns all in-mempool ancestors.
* Get more info with:
* client.help(Command.getmempoolancestors);
*
* @param txId The transaction id (must be in mempool)
* @return list of in mempool ancestor transactions
*/
CompletableFuture> getMempoolAncestors(String txId);
/**
* Calls getmempoolancestors method on the bitcoin node which returns all in-mempool ancestors.
* Get more info with:
* client.help(Command.getmempoolancestors);
*
* @param txId The transaction id (must be in mempool)
* @return map of in mempool ancestor transactions. Key is transactionId, for value see {@link MempoolData} docs
*/
CompletableFuture