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.jni | |
org.bitcoinj.params |
Network parameters encapsulate some of the differences between different Bitcoin networks such as the main
network, the testnet, regtest mode, unit testing params and so on.
|
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.uri |
Parsing and handling of bitcoin: textual URIs as found in qr codes and web links.
|
org.bitcoinj.utils |
Formatting monetary amounts, representing exchange rates, a program for loading Bitcoin Core saved block files,
a class to control how bitcoinj uses threads and misc other utility classes that don't fit anywhere else.
|
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 Coin |
Coin.CENT
0.01 Bitcoins.
|
static Coin |
Coin.COIN
One Bitcoin.
|
static Coin |
Transaction.DEFAULT_TX_FEE
If using this feePerKb, transactions will get confirmed within the next couple of blocks.
|
static Coin |
Coin.FIFTY_COINS |
static Coin |
NetworkParameters.MAX_MONEY
The maximum money to be generated
|
static Coin |
Coin.MICROCOIN
0.000001 Bitcoins, also known as 1 µBTC or 1 uBTC.
|
static Coin |
Coin.MILLICOIN
0.001 Bitcoins, also known as 1 mBTC.
|
static Coin |
Transaction.MIN_NONDUST_OUTPUT
Any standard (ie pay-to-address) output smaller than this value (in satoshis) will most likely be rejected by the network.
|
Coin |
InsufficientMoneyException.missing
Contains the number of satoshis that would have been required to complete the operation.
|
static Coin |
Coin.NEGATIVE_SATOSHI
Represents a monetary value of minus one satoshi.
|
static Coin |
Transaction.REFERENCE_DEFAULT_MIN_TX_FEE
If feePerKb is lower than this, Bitcoin Core will treat it as if there were no fee.
|
static Coin |
Coin.SATOSHI
A satoshi is the smallest unit that can be transferred.
|
static Coin |
Coin.ZERO
Zero Bitcoins.
|
Modifier and Type | Method and Description |
---|---|
Coin |
Coin.add(Coin value) |
Coin |
Coin.div(int divisor)
Alias for divide
|
Coin |
Coin.div(long divisor)
Alias for divide
|
Coin |
Coin.divide(long divisor) |
Coin[] |
Coin.divideAndRemainder(long divisor) |
Coin |
Block.getBlockInflation(int height)
A utility method that calculates how much new Bitcoin would be created by the block at the given height.
|
Coin |
Transaction.getFee()
The transaction fee is the difference of the value of all inputs and the value of all outputs.
|
Coin |
Context.getFeePerKb()
The default fee per 1000 bytes of transaction data to pay when completing transactions.
|
Coin |
Transaction.getInputSum()
Gets the sum of the inputs, regardless of who owns them.
|
abstract Coin |
NetworkParameters.getMaxMoney()
Returns the number of coins that will be produced in total, on this
network.
|
abstract Coin |
NetworkParameters.getMinNonDustOutput()
Any standard (ie pay-to-address) output smaller than this value will
most likely be rejected by the network.
|
Coin |
TransactionOutput.getMinNonDustValue()
Returns the minimum value for this output to be considered "not dust", i.e.
|
Coin |
TransactionOutput.getMinNonDustValue(Coin feePerKb)
Gets the minimum value for a txout of this size to be considered non-dust by Bitcoin Core
(and thus relayed).
|
Coin |
Transaction.getOutputSum()
Gets the sum of the outputs of the transaction.
|
Coin |
TransactionInput.getValue() |
Coin |
TransactionOutput.getValue()
Returns the value of this output.
|
Coin |
UTXO.getValue()
The value which this Transaction output holds.
|
Coin |
Transaction.getValue(TransactionBag wallet)
Returns the difference of
Transaction.getValueSentToMe(TransactionBag) and Transaction.getValueSentFromMe(TransactionBag) . |
Coin |
Transaction.getValueSentFromMe(TransactionBag wallet)
Calculates the sum of the inputs that are spending coins with keys in the wallet.
|
Coin |
Transaction.getValueSentToMe(TransactionBag transactionBag)
Calculates the sum of the outputs that are sending coins to a key in the wallet.
|
Coin |
Coin.minus(Coin value)
Alias for subtract
|
Coin |
Coin.multiply(long factor) |
Coin |
Coin.negate() |
static Coin |
Coin.parseCoin(String str)
Parses an amount expressed in the way humans are used to.
|
Coin |
Coin.plus(Coin value)
Alias for add
|
Coin |
Coin.shiftLeft(int n) |
Coin |
Coin.shiftRight(int n) |
Coin |
Coin.subtract(Coin value) |
Coin |
Coin.times(int factor)
Alias for multiply
|
Coin |
Coin.times(long factor)
Alias for multiply
|
static Coin |
Coin.valueOf(int coins,
int cents)
Convert an amount expressed in the way humans are used to into satoshis.
|
static Coin |
Coin.valueOf(long satoshis) |
Modifier and Type | Method and Description |
---|---|
Coin |
Coin.add(Coin value) |
TransactionOutput |
Transaction.addOutput(Coin value,
Address address)
Creates an output based on the given address and value, adds it to this transaction, and returns the new output.
|
TransactionOutput |
Transaction.addOutput(Coin value,
ECKey pubkey)
Creates an output that pays to the given pubkey directly (no address) with the given value, adds it to this
transaction, and returns the new output.
|
TransactionOutput |
Transaction.addOutput(Coin value,
Script script)
Creates an output that pays to the given script.
|
int |
Coin.compareTo(Coin other) |
Block |
Block.createNextBlock(Address to,
Coin value) |
Block |
Block.createNextBlockWithCoinbase(long version,
byte[] pubKey,
Coin coinbaseValue,
int height) |
long |
Coin.divide(Coin divisor) |
Coin |
TransactionOutput.getMinNonDustValue(Coin feePerKb)
Gets the minimum value for a txout of this size to be considered non-dust by Bitcoin Core
(and thus relayed).
|
boolean |
Coin.isGreaterThan(Coin other)
Returns true if the monetary value represented by this instance is greater than that
of the given other Coin, otherwise false.
|
boolean |
Coin.isLessThan(Coin other)
Returns true if the monetary value represented by this instance is less than that
of the given other Coin, otherwise false.
|
Coin |
Coin.minus(Coin value)
Alias for subtract
|
Coin |
Coin.plus(Coin value)
Alias for add
|
void |
TransactionOutput.setValue(Coin value)
Sets the value of this output.
|
Coin |
Coin.subtract(Coin value) |
Constructor and Description |
---|
Context(NetworkParameters params,
int eventHorizon,
Coin feePerKb,
boolean ensureMinRequiredFee)
Creates a new custom context object.
|
InsufficientMoneyException(Coin missing) |
InsufficientMoneyException(Coin missing,
String message) |
TransactionInput(NetworkParameters params,
Transaction parentTransaction,
byte[] scriptBytes,
TransactionOutPoint outpoint,
Coin value) |
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).
|
UTXO(Sha256Hash hash,
long index,
Coin value,
int height,
boolean coinbase,
Script script)
Creates a stored transaction output.
|
UTXO(Sha256Hash hash,
long index,
Coin value,
int height,
boolean coinbase,
Script script,
String address)
Creates a stored transaction output.
|
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) |
ListenableFuture<com.google.protobuf.ByteString> |
NativePaymentChannelServerConnectionEventHandler.paymentIncrease(Coin by,
Coin to,
com.google.protobuf.ByteString info) |
Modifier and Type | Method and Description |
---|---|
Coin |
AbstractBitcoinNetParams.getMaxMoney() |
Coin |
AbstractBitcoinNetParams.getMinNonDustOutput() |
Modifier and Type | Field and Description |
---|---|
Coin |
PaymentChannelClientState.IncrementedPayment.amount |
protected Coin |
PaymentChannelServerState.bestValueToMe |
protected Coin |
PaymentChannelClientState.valueToMe |
Modifier and Type | Method and Description |
---|---|
Coin |
StoredPaymentChannelClientStates.getBalanceForServer(Sha256Hash id)
Returns the outstanding amount of money sent back to us for all channels to this server added together.
|
Coin |
PaymentChannelServerState.getBestValueToMe()
Gets the highest payment to ourselves (which we will receive on settle(), not including fees)
|
Coin |
PaymentChannelV2ServerState.getFeePaid() |
abstract Coin |
PaymentChannelServerState.getFeePaid()
Gets the fee paid in the final payment transaction (only available if settle() did not throw an exception)
|
Coin |
PaymentChannelV1ServerState.getFeePaid()
Gets the fee paid in the final payment transaction (only available if settle() did not throw an exception)
|
Coin |
PaymentChannelClient.getMissing()
Returns the amount of satoshis missing when a server requests too much value.
|
Coin |
PaymentChannelV1ClientState.getRefundTxFees() |
Coin |
PaymentChannelV2ClientState.getRefundTxFees() |
abstract Coin |
PaymentChannelClientState.getRefundTxFees()
Returns the fees that will be paid if the refund transaction has to be claimed because the server failed to settle
the channel properly.
|
Coin |
PaymentChannelV1ClientState.getTotalValue()
Gets the total value of this channel (ie the maximum payment possible)
|
Coin |
PaymentChannelV2ClientState.getTotalValue() |
protected Coin |
PaymentChannelServerState.getTotalValue() |
abstract Coin |
PaymentChannelClientState.getTotalValue()
Gets the total value of this channel (ie the maximum payment possible)
|
Coin |
PaymentIncrementAck.getValue() |
Coin |
PaymentChannelClientState.getValueRefunded()
Gets the current amount refunded to us from the multisig contract (ie totalValue-valueSentToServer)
|
Coin |
PaymentChannelClientState.getValueSpent()
Returns the amount of money sent on this channel so far.
|
protected Coin |
PaymentChannelV1ClientState.getValueToMe() |
protected Coin |
PaymentChannelV2ClientState.getValueToMe() |
protected abstract Coin |
PaymentChannelClientState.getValueToMe() |
Modifier and Type | Method and Description |
---|---|
ListenableFuture<PaymentIncrementAck> |
PaymentChannelClient.incrementPayment(Coin size)
Increments the total value which we pay the server.
|
ListenableFuture<PaymentIncrementAck> |
PaymentChannelClientConnection.incrementPayment(Coin size)
Increments the total value which we pay the server.
|
boolean |
PaymentChannelServerState.incrementPayment(Coin refundSize,
byte[] signatureBytes)
Called when the client provides us with a new signature and wishes to increment total payment by size.
|
ListenableFuture<PaymentIncrementAck> |
PaymentChannelClient.incrementPayment(Coin size,
com.google.protobuf.ByteString info,
org.spongycastle.crypto.params.KeyParameter userKey)
Increments the total value which we pay the server.
|
ListenableFuture<PaymentIncrementAck> |
IPaymentChannelClient.incrementPayment(Coin size,
com.google.protobuf.ByteString info,
org.spongycastle.crypto.params.KeyParameter userKey)
Increments the total value which we pay the server.
|
ListenableFuture<PaymentIncrementAck> |
PaymentChannelClientConnection.incrementPayment(Coin size,
com.google.protobuf.ByteString info,
org.spongycastle.crypto.params.KeyParameter userKey)
Increments the total value which we pay the server.
|
PaymentChannelClientState.IncrementedPayment |
PaymentChannelClientState.incrementPaymentBy(Coin size,
org.spongycastle.crypto.params.KeyParameter userKey)
Updates the outputs on the payment contract transaction and re-signs it.
|
protected SendRequest |
PaymentChannelServerState.makeUnsignedChannelContract(Coin valueToMe) |
ListenableFuture<com.google.protobuf.ByteString> |
PaymentChannelServer.ServerConnection.paymentIncrease(Coin by,
Coin to,
com.google.protobuf.ByteString info)
Called when the payment in this channel was successfully incremented by the client
|
abstract ListenableFuture<com.google.protobuf.ByteString> |
ServerConnectionEventHandler.paymentIncrease(Coin by,
Coin to,
com.google.protobuf.ByteString info)
Called when the payment in this channel was successfully incremented by the client
|
Constructor and Description |
---|
PaymentChannelClient(Wallet wallet,
ECKey myKey,
Coin maxValue,
Sha256Hash serverId,
IPaymentChannelClient.ClientConnection conn)
Constructs a new channel manager which waits for
PaymentChannelClient.connectionOpen() before acting. |
PaymentChannelClient(Wallet wallet,
ECKey myKey,
Coin maxValue,
Sha256Hash serverId,
IPaymentChannelClient.ClientConnection conn,
PaymentChannelClient.VersionSelector versionSelector)
Constructs a new channel manager which waits for
PaymentChannelClient.connectionOpen() before acting. |
PaymentChannelClient(Wallet wallet,
ECKey myKey,
Coin maxValue,
Sha256Hash serverId,
long timeWindow,
org.spongycastle.crypto.params.KeyParameter userKeySetup,
IPaymentChannelClient.ClientConnection conn)
Constructs a new channel manager which waits for
PaymentChannelClient.connectionOpen() before acting. |
PaymentChannelClient(Wallet wallet,
ECKey myKey,
Coin maxValue,
Sha256Hash serverId,
long timeWindow,
org.spongycastle.crypto.params.KeyParameter userKeySetup,
IPaymentChannelClient.ClientConnection conn,
PaymentChannelClient.VersionSelector versionSelector)
Constructs a new channel manager which waits for
PaymentChannelClient.connectionOpen() before acting. |
PaymentChannelClientConnection(InetSocketAddress server,
int timeoutSeconds,
Wallet wallet,
ECKey myKey,
Coin maxValue,
String serverId)
Attempts to open a new connection to and open a payment channel with the given host and port, blocking until the
connection is open.
|
PaymentChannelClientConnection(InetSocketAddress server,
int timeoutSeconds,
Wallet wallet,
ECKey myKey,
Coin maxValue,
String serverId,
long timeWindow,
org.spongycastle.crypto.params.KeyParameter userKeySetup)
Attempts to open a new connection to and open a payment channel with the given host and port, blocking until the
connection is open.
|
PaymentChannelClientConnection(InetSocketAddress server,
int timeoutSeconds,
Wallet wallet,
ECKey myKey,
Coin maxValue,
String serverId,
long timeWindow,
org.spongycastle.crypto.params.KeyParameter userKeySetup,
PaymentChannelClient.VersionSelector versionSelector)
Attempts to open a new connection to and open a payment channel with the given host and port, blocking until the
connection is open.
|
PaymentChannelClientConnection(InetSocketAddress server,
int timeoutSeconds,
Wallet wallet,
ECKey myKey,
Coin maxValue,
String serverId,
PaymentChannelClient.VersionSelector versionSelector)
Attempts to open a new connection to and open a payment channel with the given host and port, blocking until the
connection is open.
|
PaymentChannelClientState(Wallet wallet,
ECKey myKey,
ECKey serverKey,
Coin value,
long expiryTimeInSeconds)
Creates a state object for a payment channel client.
|
PaymentChannelServer(TransactionBroadcaster broadcaster,
Wallet wallet,
Coin minAcceptedChannelSize,
long minTimeWindow,
long maxTimeWindow,
PaymentChannelServer.ServerConnection conn)
Creates a new server-side state manager which handles a single client connection.
|
PaymentChannelServer(TransactionBroadcaster broadcaster,
Wallet wallet,
Coin minAcceptedChannelSize,
PaymentChannelServer.ServerConnection conn)
Creates a new server-side state manager which handles a single client connection.
|
PaymentChannelServerListener(TransactionBroadcaster broadcaster,
Wallet wallet,
int timeoutSeconds,
Coin minAcceptedChannelSize,
PaymentChannelServerListener.HandlerFactory eventHandlerFactory)
Sets up a new payment channel server which listens on the given port.
|
PaymentChannelV1ClientState(Wallet wallet,
ECKey myKey,
ECKey serverMultisigKey,
Coin value,
long expiryTimeInSeconds)
Creates a state object for a payment channel client.
|
PaymentChannelV2ClientState(Wallet wallet,
ECKey myKey,
ECKey serverMultisigKey,
Coin value,
long expiryTimeInSeconds) |
PaymentIncrementAck(Coin value,
com.google.protobuf.ByteString info) |
Modifier and Type | Field and Description |
---|---|
Coin |
PaymentProtocol.Output.amount |
Modifier and Type | Method and Description |
---|---|
Coin |
PaymentSession.getValue()
Returns the total amount of bitcoins requested.
|
Constructor and Description |
---|
Output(Coin amount,
byte[] scriptData) |
Modifier and Type | Method and Description |
---|---|
Coin |
BitcoinURI.getAmount() |
Modifier and Type | Method and Description |
---|---|
static String |
BitcoinURI.convertToBitcoinURI(Address address,
Coin amount,
String label,
String message)
Simple Bitcoin URI builder using known good fields.
|
static String |
BitcoinURI.convertToBitcoinURI(NetworkParameters params,
String address,
Coin amount,
String label,
String message)
Simple Bitcoin URI builder using known good fields.
|
Modifier and Type | Field and Description |
---|---|
Coin |
ExchangeRate.coin |
Modifier and Type | Method and Description |
---|---|
Coin |
ExchangeRate.fiatToCoin(Fiat convertFiat)
Convert a fiat amount to a coin amount using this exchange rate.
|
Coin |
MonetaryFormat.parse(String str)
Parse a human readable coin value to a
Coin instance. |
Coin |
BtcFormat.parse(String source)
Parse a
String representation of a Bitcoin monetary value. |
Coin |
BtcFormat.parse(String source,
ParsePosition pos)
Parse a
String representation of a Bitcoin monetary value. |
Modifier and Type | Method and Description |
---|---|
Fiat |
ExchangeRate.coinToFiat(Coin convertCoin)
Convert a coin amount to a fiat amount using this exchange rate.
|
Constructor and Description |
---|
ExchangeRate(Coin coin,
Fiat fiat)
Construct exchange rate.
|
Modifier and Type | Field and Description |
---|---|
Coin |
SendRequest.feePerKb
A transaction can have a fee attached, which is defined as the difference between the input values
and output values.
|
static Coin |
DefaultRiskAnalysis.MIN_ANALYSIS_NONDUST_OUTPUT
Any standard output smaller than this value (in satoshis) will be considered risky, as it's most likely be
rejected by the network.
|
Coin |
CoinSelection.valueGathered |
Modifier and Type | Method and Description |
---|---|
Coin |
Wallet.getBalance()
Returns the AVAILABLE balance of this wallet.
|
Coin |
Wallet.getBalance(CoinSelector selector)
Returns the balance that would be considered spendable by the given coin selector, including watched outputs
(i.e.
|
Coin |
Wallet.getBalance(Wallet.BalanceType balanceType)
Returns the balance of this wallet as calculated by the provided balanceType.
|
Coin |
Wallet.getTotalReceived()
Returns the amount of bitcoin ever received via output.
|
Coin |
Wallet.getTotalSent()
Returns the amount of bitcoin ever sent via output.
|
Coin |
Wallet.getWatchedBalance()
Deprecated.
Use
Wallet.getBalance() instead as including watched balances is now the default behaviour |
Coin |
Wallet.getWatchedBalance(CoinSelector selector)
Deprecated.
Use
Wallet.getBalance(CoinSelector) instead as including watched balances is now the default behaviour |
Modifier and Type | Method and Description |
---|---|
ListenableFuture<Coin> |
Wallet.getBalanceFuture(Coin value,
Wallet.BalanceType type)
Returns a future that will complete when the balance of the given type has becom equal or larger to the given
value.
|
Modifier and Type | Method and Description |
---|---|
org.bitcoinj.wallet.Wallet.FeeCalculation |
Wallet.calculateFee(SendRequest req,
Coin value,
List<TransactionInput> originalInputs,
boolean needAtLeastReferenceFee,
List<TransactionOutput> candidates) |
static SendRequest |
SendRequest.childPaysForParent(Wallet wallet,
Transaction parentTransaction,
Coin feeRaise)
Construct a SendRequest for a CPFP (child-pays-for-parent) transaction.
|
Transaction |
Wallet.createSend(Address address,
Coin value)
Statelessly creates a transaction that sends the given value to address.
|
ListenableFuture<Coin> |
Wallet.getBalanceFuture(Coin value,
Wallet.BalanceType type)
Returns a future that will complete when the balance of the given type has becom equal or larger to the given
value.
|
protected void |
Wallet.queueOnCoinsReceived(Transaction tx,
Coin balance,
Coin newBalance) |
protected void |
Wallet.queueOnCoinsSent(Transaction tx,
Coin prevBalance,
Coin newBalance) |
CoinSelection |
FilteringCoinSelector.select(Coin target,
List<TransactionOutput> candidates) |
CoinSelection |
DefaultCoinSelector.select(Coin target,
List<TransactionOutput> candidates) |
CoinSelection |
CoinSelector.select(Coin target,
List<TransactionOutput> candidates)
Creates a CoinSelection that tries to meet the target amount of value.
|
CoinSelection |
KeyTimeCoinSelector.select(Coin target,
List<TransactionOutput> candidates) |
Wallet.SendResult |
Wallet.sendCoins(TransactionBroadcaster broadcaster,
Address to,
Coin value)
Sends coins to the given address, via the given
PeerGroup . |
static SendRequest |
SendRequest.to(Address destination,
Coin value)
Creates a new SendRequest to the given address for the given value.
|
static SendRequest |
SendRequest.to(NetworkParameters params,
ECKey destination,
Coin value)
Creates a new SendRequest to the given pubkey for the given value.
|
static SendRequest |
SendRequest.toCLTVPaymentChannel(NetworkParameters params,
BigInteger time,
ECKey from,
ECKey to,
Coin value) |
static SendRequest |
SendRequest.toCLTVPaymentChannel(NetworkParameters params,
Date releaseTime,
ECKey from,
ECKey to,
Coin value) |
static SendRequest |
SendRequest.toCLTVPaymentChannel(NetworkParameters params,
int releaseBlock,
ECKey from,
ECKey to,
Coin value) |
Constructor and Description |
---|
CoinSelection(Coin valueGathered,
Collection<TransactionOutput> gathered) |
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.
|
Copyright © 2016. All rights reserved.