Package | Description |
---|---|
org.bitcoinj.core |
The core package contains classes for network messages like
Block and
Transaction , peer connectivity via PeerGroup ,
and block chain management. |
org.bitcoinj.core.listeners | |
org.bitcoinj.jni | |
org.bitcoinj.protocols.channels |
Micropayment channels allow for rapid tiny payments to be made to a third party once a channel has been set up, using
some of the advanced features of the Bitcoin protocol.
|
org.bitcoinj.protocols.payments |
The BIP70 payment protocol wraps Bitcoin transactions and adds various useful features like memos, refund addresses
and authentication.
|
org.bitcoinj.script |
Classes for working with and executing Bitcoin script programs, as embedded in inputs and outputs.
|
org.bitcoinj.signers |
Transaction signers know how to calculate signatures over transactions in different contexts, for example, using
local private keys or fetching them from remote servers.
|
org.bitcoinj.wallet |
Classes that support the
Wallet , which knows how to find and save transactions relevant to
a set of keys or scripts, calculate balances, and spend money: the wallet has many features and can be extended
in various ways, please refer to the website for documentation on how to use it. |
org.bitcoinj.wallet.listeners |
Modifier and Type | Field and Description |
---|---|
static Comparator<Transaction> |
Transaction.SORT_TX_BY_HEIGHT
A comparator that can be used to sort transactions by their chain height.
|
static Comparator<Transaction> |
Transaction.SORT_TX_BY_UPDATE_TIME
A comparator that can be used to sort transactions by their updateTime field.
|
Modifier and Type | Method and Description |
---|---|
Transaction |
TransactionInput.getConnectedTransaction()
Returns the connected transaction, assuming the input was connected with
TransactionInput.connect(TransactionOutput) or variants at some point. |
Transaction |
TransactionConfidence.getOverridingTransaction()
If this transaction has been overridden by a double spend (is dead), this call returns the overriding transaction.
|
Transaction |
TransactionInput.getParentTransaction() |
Transaction |
TransactionOutput.getParentTransaction()
Returns the transaction that owns this output.
|
Transaction |
RejectedTransactionException.getTransaction()
Return the original Transaction object whose broadcast was rejected.
|
Transaction |
MessageSerializer.makeTransaction(byte[] payloadBytes)
Make a transaction from the payload.
|
Transaction |
MessageSerializer.makeTransaction(byte[] payloadBytes,
int offset)
Make a transaction from the payload.
|
abstract Transaction |
MessageSerializer.makeTransaction(byte[] payloadBytes,
int offset,
int length,
byte[] hash)
Make a transaction from the payload.
|
Transaction |
BitcoinSerializer.makeTransaction(byte[] payloadBytes,
int offset,
int length,
byte[] hash)
Make a transaction from the payload.
|
Modifier and Type | Method and Description |
---|---|
ListenableFuture<Transaction> |
TransactionBroadcast.broadcast() |
ListenableFuture<List<Transaction>> |
Peer.downloadDependencies(Transaction tx)
Returns a future that wraps a list of all transactions that the given transaction depends on, recursively.
|
ListenableFuture<Transaction> |
TransactionBroadcast.future() |
Map<Sha256Hash,Transaction> |
FilteredBlock.getAssociatedTransactions()
Gets the set of transactions which were provided using provideTransaction() which match in getTransactionHashes()
|
ListenableFuture<Transaction> |
Peer.getPeerMempoolTransaction(Sha256Hash hash)
Asks the connected peer for the given transaction from its memory pool.
|
Map<Sha256Hash,Transaction> |
TransactionBag.getTransactionPool(WalletTransaction.Pool pool)
Returns transactions from a specific pool.
|
List<Transaction> |
StoredUndoableBlock.getTransactions()
Get the full list of transactions if it is stored, otherwise null.
|
List<Transaction> |
Block.getTransactions()
Returns an immutable list of transactions held in this block, or null if this object represents just a header.
|
Modifier and Type | Method and Description |
---|---|
void |
InventoryMessage.addTransaction(Transaction tx) |
void |
Block.addTransaction(Transaction t)
Adds a transaction to this block.
|
boolean |
BloomFilter.applyAndUpdate(Transaction tx) |
TransactionBroadcast |
TransactionBroadcaster.broadcastTransaction(Transaction tx)
Broadcast the given transaction on the network
|
TransactionBroadcast |
PeerGroup.broadcastTransaction(Transaction tx)
Calls
PeerGroup.broadcastTransaction(Transaction,int) with getMinBroadcastConnections() as the number
of connections to wait for before commencing broadcast. |
TransactionBroadcast |
PeerGroup.broadcastTransaction(Transaction tx,
int minConnections)
Given a transaction, sends it un-announced to one peer and then waits for it to be received back from other
peers.
|
TransactionInput.ConnectionResult |
TransactionInput.connect(Transaction transaction,
TransactionInput.ConnectMode mode)
Connects this input to the relevant output of the referenced transaction.
|
static TransactionBroadcast |
TransactionBroadcast.createMockBroadcast(Transaction tx,
SettableFuture<Transaction> future) |
ListenableFuture<List<Transaction>> |
Peer.downloadDependencies(Transaction tx)
Returns a future that wraps a list of all transactions that the given transaction depends on, recursively.
|
protected ListenableFuture<Object> |
Peer.downloadDependenciesInternal(int maxDepth,
int depth,
Transaction tx,
Object marker,
List<Transaction> results) |
EnumSet<Script.VerifyFlag> |
NetworkParameters.getTransactionVerificationFlags(Block block,
Transaction transaction,
VersionTally tally,
Integer height)
The flags indicating which script validation tests should be applied to
the given transaction.
|
protected void |
Peer.processTransaction(Transaction tx) |
boolean |
FilteredBlock.provideTransaction(Transaction tx)
Provide this FilteredBlock with a transaction which is in its Merkle tree.
|
void |
TransactionConfidence.setOverridingTransaction(Transaction overridingTransaction)
Called when the transaction becomes newly dead, that is, we learn that one of its inputs has already been spent
in such a way that the double-spending transaction takes precedence over this one.
|
static InventoryMessage |
InventoryMessage.with(Transaction... txns)
Creates a new inv message for the given transactions.
|
Modifier and Type | Method and Description |
---|---|
TransactionInput.ConnectionResult |
TransactionInput.connect(Map<Sha256Hash,Transaction> transactions,
TransactionInput.ConnectMode mode)
Connects this input to the relevant output of the referenced transaction if it's in the given map.
|
static TransactionBroadcast |
TransactionBroadcast.createMockBroadcast(Transaction tx,
SettableFuture<Transaction> future) |
protected ListenableFuture<Object> |
Peer.downloadDependenciesInternal(int maxDepth,
int depth,
Transaction tx,
Object marker,
List<Transaction> results) |
Constructor and Description |
---|
RejectedTransactionException(Transaction tx,
RejectMessage rejectMessage) |
TransactionInput(NetworkParameters params,
Transaction parentTransaction,
byte[] scriptBytes)
Creates an input that connects to nothing - used only in creation of coinbase transactions.
|
TransactionInput(NetworkParameters params,
Transaction parentTransaction,
byte[] payload,
int offset)
Deserializes an input message.
|
TransactionInput(NetworkParameters params,
Transaction parentTransaction,
byte[] payload,
int offset,
MessageSerializer serializer)
Deserializes an input message.
|
TransactionInput(NetworkParameters params,
Transaction parentTransaction,
byte[] scriptBytes,
TransactionOutPoint outpoint) |
TransactionInput(NetworkParameters params,
Transaction parentTransaction,
byte[] scriptBytes,
TransactionOutPoint outpoint,
Coin value) |
TransactionOutPoint(NetworkParameters params,
long index,
Transaction fromTx) |
TransactionOutput(NetworkParameters params,
Transaction parent,
byte[] payload,
int offset)
Deserializes a transaction output message.
|
TransactionOutput(NetworkParameters params,
Transaction parent,
byte[] payload,
int offset,
MessageSerializer serializer)
Deserializes a transaction output message.
|
TransactionOutput(NetworkParameters params,
Transaction parent,
Coin value,
Address to)
Creates an output that sends 'value' to the given address (public key hash).
|
TransactionOutput(NetworkParameters params,
Transaction parent,
Coin value,
byte[] scriptBytes) |
TransactionOutput(NetworkParameters params,
Transaction parent,
Coin value,
ECKey to)
Creates an output that sends 'value' to the given public key using a simple CHECKSIG script (no addresses).
|
Constructor and Description |
---|
Block(NetworkParameters params,
long version,
Sha256Hash prevBlockHash,
Sha256Hash merkleRoot,
long time,
long difficultyTarget,
long nonce,
List<Transaction> transactions)
Construct a block initialized with all the given fields.
|
StoredUndoableBlock(Sha256Hash hash,
List<Transaction> transactions) |
Modifier and Type | Method and Description |
---|---|
void |
OnTransactionBroadcastListener.onTransaction(Peer peer,
Transaction t)
Called when a new transaction is broadcast over the network.
|
void |
AbstractPeerEventListener.onTransaction(Peer peer,
Transaction t)
Deprecated.
|
void |
TransactionConfidenceEventListener.onTransactionConfidenceChanged(Wallet wallet,
Transaction tx)
Called when a transaction changes its confidence level.
|
void |
TransactionReceivedInBlockListener.receiveFromBlock(Transaction tx,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset)
Called by the
BlockChain when we receive a new block that contains a relevant transaction. |
void |
AbstractBlockChainListener.receiveFromBlock(Transaction tx,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
NativeWalletCoinsReceivedEventListener.onCoinsReceived(Wallet wallet,
Transaction tx,
Coin prevBalance,
Coin newBalance) |
void |
NativeWalletEventListener.onCoinsReceived(Wallet wallet,
Transaction tx,
Coin prevBalance,
Coin newBalance) |
void |
NativeWalletEventListener.onCoinsSent(Wallet wallet,
Transaction tx,
Coin prevBalance,
Coin newBalance) |
void |
NativeWalletCoinsSentEventListener.onCoinsSent(Wallet wallet,
Transaction tx,
Coin prevBalance,
Coin newBalance) |
void |
NativePeerEventListener.onTransaction(Peer peer,
Transaction t) |
void |
NativeWalletEventListener.onTransactionConfidenceChanged(Wallet wallet,
Transaction tx) |
void |
NativeTransactionConfidenceEventListener.onTransactionConfidenceChanged(Wallet wallet,
Transaction tx) |
void |
NativeBlockChainListener.receiveFromBlock(Transaction tx,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset) |
Modifier and Type | Field and Description |
---|---|
protected Transaction |
PaymentChannelServerState.contract |
Modifier and Type | Method and Description |
---|---|
Transaction |
PaymentChannelV1ClientState.getCompletedRefundTransaction()
Once the servers signature over the refund transaction has been received and provided using
PaymentChannelV1ClientState.provideRefundSignature(byte[], KeyParameter) then this
method can be called to receive the now valid and broadcastable refund transaction. |
Transaction |
PaymentChannelV1ClientState.getContract()
Returns the transaction that locks the money to the agreement of both parties.
|
Transaction |
PaymentChannelV2ClientState.getContract() |
Transaction |
PaymentChannelServerState.getContract()
Gets the multisig contract which was used to initialize this channel
|
abstract Transaction |
PaymentChannelClientState.getContract()
Gets the contract which was used to initialize this channel
|
protected Transaction |
PaymentChannelV1ClientState.getContractInternal() |
protected Transaction |
PaymentChannelV2ClientState.getContractInternal() |
protected abstract Transaction |
PaymentChannelClientState.getContractInternal()
Gets the contract without changing the state machine
|
Transaction |
PaymentChannelV1ClientState.getIncompleteRefundTransaction()
Returns a partially signed (invalid) refund transaction that should be passed to the server.
|
Modifier and Type | Method and Description |
---|---|
ListenableFuture<Transaction> |
PaymentChannelV2ServerState.close() |
abstract ListenableFuture<Transaction> |
PaymentChannelServerState.close()
Closes this channel and broadcasts the highest value payment transaction on the network.
|
ListenableFuture<Transaction> |
PaymentChannelV1ServerState.close()
Closes this channel and broadcasts the highest value payment transaction on the network.
|
Modifier and Type | Method and Description |
---|---|
boolean |
PaymentChannelClientState.isSettlementTransaction(Transaction tx)
Returns true if the tx is a valid settlement transaction.
|
ListenableFuture<PaymentChannelServerState> |
PaymentChannelServerState.provideContract(Transaction contract)
Called when the client provides the multi-sig contract.
|
byte[] |
PaymentChannelV1ServerState.provideRefundTransaction(Transaction refundTx,
byte[] clientMultiSigPubKey)
Called when the client provides the refund transaction.
|
protected void |
PaymentChannelV2ServerState.verifyContract(Transaction contract) |
protected void |
PaymentChannelServerState.verifyContract(Transaction contract)
Verifies that the given contract meets a set of extra requirements
|
Modifier and Type | Method and Description |
---|---|
static List<Transaction> |
PaymentProtocol.parseTransactionsFromPaymentMessage(NetworkParameters params,
Protos.Payment paymentMessage)
Parse transactions from payment message.
|
Modifier and Type | Method and Description |
---|---|
static Protos.Payment |
PaymentProtocol.createPaymentMessage(List<Transaction> transactions,
Coin refundAmount,
Address refundAddress,
String memo,
byte[] merchantData)
Create a payment message with one standard pay to address output.
|
static Protos.Payment |
PaymentProtocol.createPaymentMessage(List<Transaction> transactions,
List<Protos.Output> refundOutputs,
String memo,
byte[] merchantData)
Create a payment message.
|
Protos.Payment |
PaymentSession.getPayment(List<Transaction> txns,
Address refundAddr,
String memo)
Generates a Payment message based on the information in the PaymentRequest.
|
ListenableFuture<PaymentProtocol.Ack> |
PaymentSession.sendPayment(List<Transaction> txns,
Address refundAddr,
String memo)
Generates a Payment message and sends the payment to the merchant who sent the PaymentRequest.
|
Modifier and Type | Method and Description |
---|---|
void |
Script.correctlySpends(Transaction txContainingThis,
long scriptSigIndex,
Script scriptPubKey)
Deprecated.
Use
Script.correctlySpends(org.bitcoinj.core.Transaction, long, org.bitcoinj.script.Script, java.util.Set)
instead so that verification flags do not change as new verification options
are added. |
void |
Script.correctlySpends(Transaction txContainingThis,
long scriptSigIndex,
Script scriptPubKey,
Set<Script.VerifyFlag> verifyFlags)
Verifies that this script (interpreted as a scriptSig) correctly spends the given scriptPubKey.
|
static void |
Script.executeScript(Transaction txContainingThis,
long index,
Script script,
LinkedList<byte[]> stack,
boolean enforceNullDummy)
|
static void |
Script.executeScript(Transaction txContainingThis,
long index,
Script script,
LinkedList<byte[]> stack,
Set<Script.VerifyFlag> verifyFlags)
Exposes the script interpreter.
|
Modifier and Type | Field and Description |
---|---|
Transaction |
TransactionSigner.ProposedTransaction.partialTx |
Constructor and Description |
---|
ProposedTransaction(Transaction partialTx) |
Modifier and Type | Field and Description |
---|---|
protected Transaction |
DefaultRiskAnalysis.nonFinal |
protected Transaction |
DefaultRiskAnalysis.tx |
Transaction |
SendRequest.tx
A transaction, probably incomplete, that describes the outline of what you want to do.
|
Transaction |
Wallet.SendResult.tx
The Bitcoin transaction message that moves the money.
|
Modifier and Type | Field and Description |
---|---|
ListenableFuture<Transaction> |
Wallet.SendResult.broadcastComplete
A future that will complete once the tx message has been successfully broadcast to the network.
|
protected List<Transaction> |
DefaultRiskAnalysis.dependencies |
protected Map<Sha256Hash,Transaction> |
Wallet.transactions |
protected Map<com.google.protobuf.ByteString,Transaction> |
WalletProtobufSerializer.txMap |
Modifier and Type | Method and Description |
---|---|
Transaction |
Wallet.createSend(Address address,
Coin value)
Statelessly creates a transaction that sends the given value to address.
|
Transaction |
DefaultRiskAnalysis.getNonFinal()
Returns the transaction that was found to be non-final, or null.
|
Transaction |
DefaultRiskAnalysis.getNonStandard()
Returns the transaction that was found to be non-standard, or null.
|
Transaction |
WalletTransaction.getTransaction() |
Transaction |
Wallet.getTransaction(Sha256Hash hash)
Returns a transaction object given its hash, if it exists in this wallet, or null otherwise.
|
Transaction |
Wallet.sendCoins(Peer peer,
SendRequest request)
Sends coins to the given address, via the given
Peer . |
Transaction |
Wallet.sendCoinsOffline(SendRequest request)
Sends coins to the given address but does not broadcast the resulting pending transaction.
|
Modifier and Type | Method and Description |
---|---|
ListenableFuture<List<Transaction>> |
Wallet.doMaintenance(org.spongycastle.crypto.params.KeyParameter aesKey,
boolean signAndSend)
A wallet app should call this from time to time in order to let the wallet craft and send transactions needed
to re-organise coins internally.
|
Collection<Transaction> |
Wallet.getPendingTransactions()
Returns an immutable view of the transactions currently waiting for network confirmations.
|
List<Transaction> |
Wallet.getRecentTransactions(int numTransactions,
boolean includeDead)
Returns an list of N transactions, ordered by increasing age.
|
Map<Sha256Hash,Transaction> |
Wallet.getTransactionPool(WalletTransaction.Pool pool)
Returns transactions from a specific pool.
|
Set<Transaction> |
Wallet.getTransactions(boolean includeDead)
Returns a set of all transactions in the wallet.
|
List<Transaction> |
Wallet.getTransactionsByTime()
Returns all non-dead, active transactions ordered by recency.
|
ListenableFuture<List<Transaction>> |
Wallet.maybeDoMaintenance(org.spongycastle.crypto.params.KeyParameter aesKey,
boolean andSend)
Deprecated.
Renamed to doMaintenance
|
Modifier and Type | Method and Description |
---|---|
static SendRequest |
SendRequest.childPaysForParent(Wallet wallet,
Transaction parentTransaction,
Coin feeRaise)
Construct a SendRequest for a CPFP (child-pays-for-parent) transaction.
|
void |
Wallet.commitTx(Transaction tx)
Updates the wallet with the given transaction: puts it into the pending pool, sets the spent flags and runs
the onCoinsSent/onCoinsReceived event listener.
|
DefaultRiskAnalysis |
DefaultRiskAnalysis.Analyzer.create(Wallet wallet,
Transaction tx,
List<Transaction> dependencies) |
RiskAnalysis |
RiskAnalysis.Analyzer.create(Wallet wallet,
Transaction tx,
List<Transaction> dependencies) |
void |
FilteringCoinSelector.excludeOutputsSpentBy(Transaction tx) |
static SendRequest |
SendRequest.forTx(Transaction tx)
Simply wraps a pre-built incomplete transaction provided by you.
|
boolean |
Wallet.isPendingTransactionRelevant(Transaction tx)
This method is used by a
Peer to find out if a transaction that has been announced is interesting,
that is, whether we should bother downloading its dependencies and exploring the transaction to decide how
risky it is. |
static boolean |
DefaultCoinSelector.isSelectable(Transaction tx) |
static DefaultRiskAnalysis.RuleViolation |
DefaultRiskAnalysis.isStandard(Transaction tx)
Checks if a transaction is considered "standard" by Bitcoin Core's IsStandardTx and AreInputsStandard
functions.
|
boolean |
Wallet.isTransactionRelevant(Transaction tx)
Returns true if the given transaction sends coins to any of our keys, or has inputs spending any of our outputs,
and also returns true if tx has inputs that are spending outputs which are
not ours but which are spent by pending transactions.
|
boolean |
Wallet.isTransactionRisky(Transaction tx,
List<Transaction> dependencies)
Given a transaction and an optional list of dependencies (recursive/flattened), returns true if the given
transaction would be rejected by the analyzer, or false otherwise.
|
boolean |
Wallet.maybeCommitTx(Transaction tx)
Calls
Wallet.commitTx(org.bitcoinj.core.Transaction) if tx is not already in the pending pool |
protected void |
Wallet.queueOnCoinsReceived(Transaction tx,
Coin balance,
Coin newBalance) |
protected void |
Wallet.queueOnCoinsSent(Transaction tx,
Coin prevBalance,
Coin newBalance) |
void |
Wallet.receiveFromBlock(Transaction tx,
StoredBlock block,
AbstractBlockChain.NewBlockType blockType,
int relativityOffset)
Called by the
BlockChain when we receive a new block that sends coins to one of our addresses or
spends coins from one of our addresses (note that a single transaction can do both). |
void |
Wallet.receivePending(Transaction tx,
List<Transaction> dependencies)
Called when we have found a transaction (via network broadcast or otherwise) that is relevant to this wallet
and want to record it.
|
void |
Wallet.receivePending(Transaction tx,
List<Transaction> dependencies,
boolean overrideIsRelevant)
Called when we have found a transaction (via network broadcast or otherwise) that is relevant to this wallet
and want to record it.
|
protected boolean |
DefaultCoinSelector.shouldSelect(Transaction tx)
Sub-classes can override this to just customize whether transactions are usable, but keep age sorting.
|
protected boolean |
AllowUnconfirmedCoinSelector.shouldSelect(Transaction tx) |
Modifier and Type | Method and Description |
---|---|
DefaultRiskAnalysis |
DefaultRiskAnalysis.Analyzer.create(Wallet wallet,
Transaction tx,
List<Transaction> dependencies) |
RiskAnalysis |
RiskAnalysis.Analyzer.create(Wallet wallet,
Transaction tx,
List<Transaction> dependencies) |
boolean |
Wallet.isTransactionRisky(Transaction tx,
List<Transaction> dependencies)
Given a transaction and an optional list of dependencies (recursive/flattened), returns true if the given
transaction would be rejected by the analyzer, or false otherwise.
|
void |
Wallet.receivePending(Transaction tx,
List<Transaction> dependencies)
Called when we have found a transaction (via network broadcast or otherwise) that is relevant to this wallet
and want to record it.
|
void |
Wallet.receivePending(Transaction tx,
List<Transaction> dependencies,
boolean overrideIsRelevant)
Called when we have found a transaction (via network broadcast or otherwise) that is relevant to this wallet
and want to record it.
|
Constructor and Description |
---|
WalletTransaction(WalletTransaction.Pool pool,
Transaction transaction) |
Modifier and Type | Method and Description |
---|---|
void |
WalletCoinsReceivedEventListener.onCoinsReceived(Wallet wallet,
Transaction tx,
Coin prevBalance,
Coin newBalance)
This is called when a transaction is seen that sends coins to this wallet, either because it
was broadcast across the network or because a block was received.
|
void |
AbstractWalletEventListener.onCoinsReceived(Wallet wallet,
Transaction tx,
Coin prevBalance,
Coin newBalance)
Deprecated.
|
void |
AbstractWalletEventListener.onCoinsSent(Wallet wallet,
Transaction tx,
Coin prevBalance,
Coin newBalance)
Deprecated.
|
void |
WalletCoinsSentEventListener.onCoinsSent(Wallet wallet,
Transaction tx,
Coin prevBalance,
Coin newBalance)
This is called when a transaction is seen that sends coins from this wallet, either
because it was broadcast across the network or because a block was received.
|
void |
AbstractWalletEventListener.onTransactionConfidenceChanged(Wallet wallet,
Transaction tx)
Deprecated.
|
Copyright © 2016. All rights reserved.