public class BlockIO
extends java.lang.Object
Constructor and Description |
---|
BlockIO(java.lang.String apiKey) |
Modifier and Type | Method and Description |
---|---|
AccountAddresses |
getAccountAddresses()
Requests a list of addresses in the account associated with this clients' API key
|
AccountBalance |
getAccountBalance()
Requests the balance of the account associated with this clients' API key
|
AddressBalances |
getAddressBalancesByAddress(java.lang.String[] addresses)
Requests balance(s) of given address(es) in the account associated with this clients' API key
Make sure that the addresses actually exist in the account or the whole call will fail |
AddressBalances |
getAddressBalancesByLabels(java.lang.String[] labels)
Requests balance(s) of given label(s) in the account associated with this clients' API key
Make sure that the labels actually exist in the account or the whole call will fail |
AddressByLabel |
getAddressByLabel(java.lang.String label)
Requests the address with the given label from the account associated with this clients' API key
|
NewAddress |
getNewAddress(java.lang.String label)
Requests the creation of a new address for the account associated with the clients' API key
|
Prices |
getPrices(java.lang.String baseCurrency)
Requests prices of the currency of the account associated with this clients' API key
|
TransactionsReceived |
getTransactionsReceived(java.lang.String beforeTX)
Lists up to 100 of the last transactions received by the account associated with this clients' API key
|
TransactionsReceived |
getTransactionsReceivedByAddress(java.lang.String[] addresses,
java.lang.String beforeTX)
Lists up to 100 of the last transactions received by the provided addresses of the account associated with this clients' API key
|
TransactionsReceived |
getTransactionsReceivedByLabel(java.lang.String[] labels,
java.lang.String beforeTX)
Lists up to 100 of the last transactions received by the provided labels of the account associated with this clients' API key
|
TransactionsReceived |
getTransactionsReceivedByUserID(java.lang.String[] userIDs,
java.lang.String beforeTX)
Lists up to 100 of the last transactions received by the provided user IDs of the account associated with this clients' API key
|
TransactionsSent |
getTransactionsSent(java.lang.String beforeTX)
Lists up to 100 of the last transactions sent by the account associated with this clients' API key
|
TransactionsSent |
getTransactionsSentByAddress(java.lang.String[] addresses,
java.lang.String beforeTX)
Lists up to 100 of the last transactions sent by the provided addresses of the account associated with this clients' API key
|
TransactionsSent |
getTransactionsSentByLabel(java.lang.String[] labels,
java.lang.String beforeTX)
Lists up to 100 of the last transactions sent by the provided labels of the account associated with this clients' API key
|
TransactionsSent |
getTransactionsSentByUserID(java.lang.String[] userIDs,
java.lang.String beforeTX)
Lists up to 100 of the last transactions sent by the provided user IDs of the account associated with this clients' API key
|
GreenAddresses |
isGreenAddress(java.lang.String[] addresses)
Checks the given address(es) for being Block.io Green Address(es)
|
GreenTransactions |
isGreenTransaction(java.lang.String[] txIDs)
Checks the given transaction(s) for being sent by a Block.io Green Address
|
Withdrawal |
withdraw(java.lang.String[] sources,
io.block.api.BlockIO.ParamType sourceType,
java.util.Map<java.lang.String,java.lang.Double> targetsAndAmounts,
io.block.api.BlockIO.ParamType targetType,
java.lang.String secretPin)
Withdraw from the account associated with this clients' API key.
|
Withdrawal |
withdrawToAddress(java.lang.String address,
double amount,
java.lang.String secretPin)
Convenience method for a simple withdrawal from the account associated with this clients' API key to the specified address
|
public AccountBalance getAccountBalance() throws BlockIOException
AccountBalance
object containing the balancesBlockIOException
public NewAddress getNewAddress(java.lang.String label) throws BlockIOException
label
- Optional label for the new address. null or "" for random labelNewAddress
object containing information about the new addressBlockIOException
public AccountAddresses getAccountAddresses() throws BlockIOException
AccountAddresses
object containing the addressesBlockIOException
public AddressBalances getAddressBalancesByAddress(java.lang.String[] addresses) throws BlockIOException
addresses
- A String array containing the addresses to request balances forAddressBalances
object containing the balancesBlockIOException
public AddressBalances getAddressBalancesByLabels(java.lang.String[] labels) throws BlockIOException
labels
- A String array containing the labels to request balances forAddressBalances
object containing the balancesBlockIOException
public AddressByLabel getAddressByLabel(java.lang.String label) throws BlockIOException
label
- The label for which to request the address forAddressByLabel
object containing the address and additional info about itBlockIOException
public Withdrawal withdrawToAddress(java.lang.String address, double amount, java.lang.String secretPin) throws BlockIOException
address
- Target addressamount
- Amount to withdrawsecretPin
- The secret PIN you set at block.io to authorize and sign the withdrawalWithdrawal
object containing information about the sent transaction.BlockIOException
public Withdrawal withdraw(java.lang.String[] sources, io.block.api.BlockIO.ParamType sourceType, java.util.Map<java.lang.String,java.lang.Double> targetsAndAmounts, io.block.api.BlockIO.ParamType targetType, java.lang.String secretPin) throws BlockIOException
sources
- Supply an array of sources for this withdrawal. If you set this to null, then block.io will select the sources automatically.
You must not mix source types!sourceType
- If you supplied a sources array, this is mandatory. Must be one of BlockIO.ParamType
.targetsAndAmounts
- A Map
with target as key (String
) and amount as value (Double
).
Each entry will be one target of the withdrawal. Limit is 100 per withdrawal.
You must not mix target types!targetType
- This is mandatory and defines what type of targets this withdrawal goes to. One of BlockIO.ParamType
.secretPin
- The secret PIN you set at block.io to authorize and sign the withdrawalWithdrawal
object containing information about the sent transaction.BlockIOException
public Prices getPrices(java.lang.String baseCurrency) throws BlockIOException
baseCurrency
- Optional base currency to return prices in. null or "" to get prices in all available base currenciesPrices
object containing price information in one or more base currency from one or more exchangeBlockIOException
public GreenAddresses isGreenAddress(java.lang.String[] addresses) throws BlockIOException
addresses
- A String array containing the addresses to request status forGreenAddresses
object containing the subset of the given addresses that are greenBlockIOException
public GreenTransactions isGreenTransaction(java.lang.String[] txIDs) throws BlockIOException
GreenTransactions
object containing the subset of the given transactions that are greenBlockIOException
public TransactionsReceived getTransactionsReceived(java.lang.String beforeTX) throws BlockIOException
beforeTX
- An optional transaction ID used as upper bound of the requested transactions. Use this to request more than 100 of the last transactionsTransactionsReceived
object containing the list of received transactionsBlockIOException
public TransactionsReceived getTransactionsReceivedByAddress(java.lang.String[] addresses, java.lang.String beforeTX) throws BlockIOException
addresses
- A String array containing the addresses to request transactions forbeforeTX
- An optional transaction ID used as upper bound of the requested transactions. Use this to request more than 100 of the last transactionsTransactionsReceived
object containing the list of received transactionsBlockIOException
public TransactionsReceived getTransactionsReceivedByLabel(java.lang.String[] labels, java.lang.String beforeTX) throws BlockIOException
labels
- A String array containing the labels to request transactions forbeforeTX
- An optional transaction ID used as upper bound of the requested transactions. Use this to request more than 100 of the last transactionsTransactionsReceived
object containing the list of received transactionsBlockIOException
public TransactionsReceived getTransactionsReceivedByUserID(java.lang.String[] userIDs, java.lang.String beforeTX) throws BlockIOException
userIDs
- A String array containing the user IDs to request transactions forbeforeTX
- An optional transaction ID used as upper bound of the requested transactions. Use this to request more than 100 of the last transactionsTransactionsReceived
object containing the list of received transactionsBlockIOException
public TransactionsSent getTransactionsSent(java.lang.String beforeTX) throws BlockIOException
beforeTX
- An optional transaction ID used as upper bound of the requested transactions. Use this to request more than 100 of the last transactionsTransactionsSent
object containing the list of sent transactionsBlockIOException
public TransactionsSent getTransactionsSentByAddress(java.lang.String[] addresses, java.lang.String beforeTX) throws BlockIOException
addresses
- A String array containing the addresses to request transactions forbeforeTX
- An optional transaction ID used as upper bound of the requested transactions. Use this to request more than 100 of the last transactionsTransactionsSent
object containing the list of sent transactionsBlockIOException
public TransactionsSent getTransactionsSentByLabel(java.lang.String[] labels, java.lang.String beforeTX) throws BlockIOException
labels
- A String array containing the labels to request transactions forbeforeTX
- An optional transaction ID used as upper bound of the requested transactions. Use this to request more than 100 of the last transactionsTransactionsSent
object containing the list of sent transactionsBlockIOException
public TransactionsSent getTransactionsSentByUserID(java.lang.String[] userIDs, java.lang.String beforeTX) throws BlockIOException
userIDs
- A String array containing the user IDs to request transactions forbeforeTX
- An optional transaction ID used as upper bound of the requested transactions. Use this to request more than 100 of the last transactionsTransactionsSent
object containing the list of sent transactionsBlockIOException