Package | Description |
---|---|
org.bitcoinj.core |
The core package contains classes for network messages like
Block and
Transaction , peer connectivity via PeerGroup ,
block chain management and the Wallet class. |
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.testing |
Various utilities for writing unit tests: also useful for testing your own code and apps that build on top of
bitcoinj.
|
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. |
Modifier and Type | Field and Description |
---|---|
static Coin |
Coin.CENT
0.01 Bitcoins.
|
static Coin |
Coin.COIN
One Bitcoin.
|
static Coin |
Wallet.SendRequest.DEFAULT_FEE_PER_KB
If you want to modify the default fee for your entire app without having to change each SendRequest you make,
you can do it here.
|
Coin |
Wallet.SendRequest.fee
A transaction can have a fee attached, which is defined as the difference between the input values
and output values.
|
Coin |
Wallet.SendRequest.feePerKb
A transaction can have a fee attached, which is defined as the difference between the input values
and output values.
|
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 fee is lower than this value (in satoshis), a default reference client 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.divide(long divisor) |
Coin[] |
Coin.divideAndRemainder(long divisor) |
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.
|
Coin |
Wallet.getBalance(Wallet.BalanceType balanceType)
Returns the balance of this wallet as calculated by the provided balanceType.
|
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 |
TransactionOutput.getMinNonDustValue()
Returns the minimum value for this output to be considered "not dust", i.e.
|
Coin |
TransactionOutput.getMinNonDustValue(Coin feePerKbRequired)
Gets the minimum value for a txout of this size to be considered non-dust by a reference client
(and thus relayed).
|
Coin |
TransactionOutput.getValue()
Returns the value of this output.
|
Coin |
TransactionInput.getValue() |
Coin |
StoredTransactionOutput.getValue()
The value which this Transaction output holds
|
Coin |
Transaction.getValue(TransactionBag wallet)
Returns the difference of
Transaction.getValueSentFromMe(TransactionBag) and Transaction.getValueSentToMe(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 |
Wallet.getWatchedBalance()
Returns the available balance, including any unspent balance at watched addresses
|
Coin |
Wallet.getWatchedBalance(CoinSelector selector)
Returns the balance that would be considered spendable by the given coin selector, including
any unspent balance at watched addresses.
|
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.shiftLeft(int n) |
Coin |
Coin.shiftRight(int n) |
Coin |
Coin.subtract(Coin value) |
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 |
---|---|
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 |
---|---|
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.
|
org.bitcoinj.core.Wallet.FeeCalculation |
Wallet.calculateFee(Wallet.SendRequest req,
Coin value,
List<TransactionInput> originalInputs,
boolean needAtLeastReferenceFee,
LinkedList<TransactionOutput> candidates) |
int |
Coin.compareTo(Coin other) |
Block |
Block.createNextBlock(Address to,
Coin value) |
Block |
Block.createNextBlockWithCoinbase(byte[] pubKey,
Coin coinbaseValue) |
Transaction |
Wallet.createSend(Address address,
Coin value)
Statelessly creates a transaction that sends the given value to address.
|
long |
Coin.divide(Coin divisor) |
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.
|
Coin |
TransactionOutput.getMinNonDustValue(Coin feePerKbRequired)
Gets the minimum value for a txout of this size to be considered non-dust by a reference client
(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.
|
void |
WalletEventListener.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) |
void |
WalletEventListener.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.onCoinsSent(Wallet wallet,
Transaction tx,
Coin prevBalance,
Coin newBalance) |
protected void |
Wallet.queueOnCoinsReceived(Transaction tx,
Coin balance,
Coin newBalance) |
protected void |
Wallet.queueOnCoinsSent(Transaction tx,
Coin prevBalance,
Coin newBalance) |
Wallet.SendResult |
Wallet.sendCoins(TransactionBroadcaster broadcaster,
Address to,
Coin value)
Sends coins to the given address, via the given
PeerGroup . |
void |
TransactionOutput.setValue(Coin value)
Sets the value of this output.
|
Coin |
Coin.subtract(Coin value) |
static Wallet.SendRequest |
Wallet.SendRequest.to(Address destination,
Coin value)
Creates a new SendRequest to the given address for the given value.
|
static Wallet.SendRequest |
Wallet.SendRequest.to(NetworkParameters params,
ECKey destination,
Coin value)
Creates a new SendRequest to the given pubkey for the given value.
|
Constructor and Description |
---|
InsufficientMoneyException(Coin missing) |
InsufficientMoneyException(Coin missing,
String message) |
StoredTransactionOutput(Sha256Hash hash,
long index,
Coin value,
int height,
boolean isCoinbase,
byte[] scriptBytes)
Creates a stored transaction output
|
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).
|
Modifier and Type | Method and Description |
---|---|
void |
NativeWalletEventListener.onCoinsReceived(Wallet wallet,
Transaction tx,
Coin prevBalance,
Coin newBalance) |
void |
NativeWalletEventListener.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 | Field and Description |
---|---|
Coin |
PaymentChannelClientState.IncrementedPayment.amount |
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 |
PaymentChannelServerState.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 |
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 |
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.
|
Modifier and Type | Method and Description |
---|---|
ListenableFuture<PaymentIncrementAck> |
PaymentChannelClientConnection.incrementPayment(Coin size)
Increments the total value which we pay the server.
|
ListenableFuture<PaymentIncrementAck> |
PaymentChannelClient.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> |
PaymentChannelClientConnection.incrementPayment(Coin size,
com.google.protobuf.ByteString info)
Increments the total value which we pay the server.
|
ListenableFuture<PaymentIncrementAck> |
PaymentChannelClient.incrementPayment(Coin size,
com.google.protobuf.ByteString info)
Increments the total value which we pay the server.
|
ListenableFuture<PaymentIncrementAck> |
IPaymentChannelClient.incrementPayment(Coin size,
com.google.protobuf.ByteString info)
Increments the total value which we pay the server.
|
PaymentChannelClientState.IncrementedPayment |
PaymentChannelClientState.incrementPaymentBy(Coin size)
Updates the outputs on the payment contract transaction and re-signs it.
|
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
|
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
|
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,
long timeWindow,
IPaymentChannelClient.ClientConnection conn)
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)
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 serverMultisigKey,
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.
|
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 |
---|---|
static Transaction |
FakeTxBuilder.createFakeTx(NetworkParameters params,
Coin value,
Address to)
Create a fake TX of sufficient realism to exercise the unit tests.
|
static Transaction[] |
FakeTxBuilder.createFakeTx(NetworkParameters params,
Coin value,
Address to,
Address from)
Transaction[0] is a feeder transaction, supplying BTC to Transaction[1]
|
static Transaction |
FakeTxBuilder.createFakeTx(NetworkParameters params,
Coin value,
ECKey to)
Create a fake TX of sufficient realism to exercise the unit tests.
|
static Transaction |
FakeTxBuilder.createFakeTxWithChangeAddress(NetworkParameters params,
Coin value,
Address to,
Address changeOutput)
Create a fake TX of sufficient realism to exercise the unit tests.
|
protected Transaction |
TestWithWallet.sendMoneyToWallet(Coin value,
AbstractBlockChain.NewBlockType type) |
protected Transaction |
TestWithWallet.sendMoneyToWallet(Wallet wallet,
Coin value,
Address toAddress,
AbstractBlockChain.NewBlockType type) |
protected Transaction |
TestWithWallet.sendMoneyToWallet(Wallet wallet,
Coin value,
ECKey toPubKey,
AbstractBlockChain.NewBlockType type) |
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) |
static String |
BitcoinURI.convertToBitcoinURI(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) |
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) |
Constructor and Description |
---|
ExchangeRate(Coin coin,
Fiat fiat) |
Modifier and Type | Field and Description |
---|---|
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 |
---|---|
CoinSelection |
KeyTimeCoinSelector.select(Coin target,
List<TransactionOutput> candidates) |
CoinSelection |
FilteringCoinSelector.select(Coin target,
List<TransactionOutput> candidates) |
CoinSelection |
DefaultCoinSelector.select(Coin biTarget,
List<TransactionOutput> candidates) |
CoinSelection |
CoinSelector.select(Coin target,
List<TransactionOutput> candidates)
Creates a CoinSelection that tries to meet the target amount of value.
|
Constructor and Description |
---|
CoinSelection(Coin valueGathered,
Collection<TransactionOutput> gathered) |
Copyright © 2014. All rights reserved.