public interface Wallet
| Modifier and Type | Interface and Description |
|---|---|
static interface |
Wallet.Address |
| Modifier and Type | Field and Description |
|---|---|
static BigDecimal |
ALL_FUNDS |
static String |
LABEL_CHANGE |
| Modifier and Type | Method and Description |
|---|---|
Wallet.Address |
addAddress(String key,
List<String> labels)
Add a watch only address to this wallet
|
Wallet.Address |
addPrivateKey(String privKey,
List<String> labels)
Add an address deriven from a private key to this wallet
|
Wallet.Address |
findAddress(String rawAddr)
Find the address for a given raw address
|
Wallet.Address |
getAddress(String label)
Get the default address for a given label
|
List<Wallet.Address> |
getAddresses()
Get all addresses.
|
List<Wallet.Address> |
getAddresses(String label)
Get addresses for a given label.
|
BigDecimal |
getBalance(String label)
Get the balance for a given label
|
BigDecimal |
getBalance(Wallet.Address addr)
Get the balance for a given address
|
Wallet.Address |
getChangeAddress(String label)
Get a random change address for a given label.
|
List<Wallet.Address> |
getChangeAddresses(String label)
Get change addresses for a given label
|
List<String> |
getLabels()
List available label
|
Tx |
getTransaction(String txId)
Get the transaction for the given Id
|
void |
importAddresses(Config config)
Import addressses from configuration.
|
List<UTXO> |
listLockUnspent(List<Wallet.Address> addrs)
List locked UTXOs associated with a list of addresses
The lock state of an UTXO is delegated to the underlying
wallet implementation and may not survive wallet restart.
|
List<UTXO> |
listUnspent(List<Wallet.Address> addrs)
List UTXOs associated with a list of addresses
|
List<UTXO> |
listUnspent(String label)
Get all unspent transaction outputs associated with the given label
|
boolean |
lockUnspent(UTXO utxo,
boolean unlock)
Lock an unspent transaction output.
|
Wallet.Address |
newAddress(String label)
Generate new address.
|
Wallet.Address |
newChangeAddress(String label)
Generate new change address.
|
List<UTXO> |
selectUnspent(List<Wallet.Address> addrs,
BigDecimal amount)
Select a list of unspent transaction outputs that satisfy the requested amount
|
List<UTXO> |
selectUnspent(String label,
BigDecimal amount)
Select a list of unspent transaction outputs that satisfy the requested amount
|
String |
sendFromLabel(String label,
String toAddr,
BigDecimal amount)
Sends funds that are associated with a given label to an address
|
String |
sendToAddress(String toAddr,
BigDecimal amount)
Sends funds from the default account to an address
|
String |
sendTx(Tx tx)
Send a raw transaction to the network
|
static final String LABEL_CHANGE
static final BigDecimal ALL_FUNDS
void importAddresses(Config config)
Wallet.Address addPrivateKey(String privKey, List<String> labels)
Wallet.Address addAddress(String key, List<String> labels)
Wallet.Address newAddress(String label)
Wallet.Address newChangeAddress(String label)
List<Wallet.Address> getAddresses()
Wallet.Address getAddress(String label)
Wallet.Address findAddress(String rawAddr)
List<Wallet.Address> getAddresses(String label)
Wallet.Address getChangeAddress(String label)
List<Wallet.Address> getChangeAddresses(String label)
BigDecimal getBalance(String label)
BigDecimal getBalance(Wallet.Address addr)
String sendToAddress(String toAddr, BigDecimal amount)
String sendFromLabel(String label, String toAddr, BigDecimal amount)
List<UTXO> selectUnspent(String label, BigDecimal amount)
List<UTXO> selectUnspent(List<Wallet.Address> addrs, BigDecimal amount)
List<UTXO> listUnspent(String label)
List<UTXO> listUnspent(List<Wallet.Address> addrs)
List<UTXO> listLockUnspent(List<Wallet.Address> addrs)
boolean lockUnspent(UTXO utxo, boolean unlock)
Copyright © 2018. All rights reserved.