Modifier and Type | Class and Description |
---|---|
static class |
IotaAPICore.Builder<T extends IotaAPICore.Builder<T>> |
Modifier | Constructor and Description |
---|---|
protected |
IotaAPICore(IotaAPICore.Builder<?> builder)
Build the API core.
|
Modifier and Type | Method and Description |
---|---|
AddNeighborsResponse |
addNeighbors(String... uris)
Temporarily add a list of neighbors to your node.
|
GetAttachToTangleResponse |
attachToTangle(String trunkTransaction,
String branchTransaction,
Integer minWeightMagnitude,
String... trytes)
Prepares the specified transactions (trytes) for attachment to the Tangle by doing Proof of Work.
|
BroadcastTransactionsResponse |
broadcastTransactions(String... trytes)
Broadcast a list of transactions to all neighbors.
|
CheckConsistencyResponse |
checkConsistency(String... tails)
Checks the consistency of the subtangle formed by the provided tails.
|
FindTransactionResponse |
findTransactions(String[] addresses,
String[] tags,
String[] approvees,
String[] bundles)
Find the transactions which match the specified input and return.
|
FindTransactionResponse |
findTransactionsByAddresses(String... addresses)
Find the transactions by addresses
|
FindTransactionResponse |
findTransactionsByApprovees(String... approvees)
Find the transactions by approvees
|
FindTransactionResponse |
findTransactionsByBundles(String... bundles)
Find the transactions by bundles
|
FindTransactionResponse |
findTransactionsByDigests(String... digests)
Find the transactions by tags
|
GetBalancesResponse |
getBalances(Integer threshold,
List<String> addresses)
Calculates the confirmed balance, as viewed by the latest solid milestone.
|
GetBalancesResponse |
getBalances(Integer threshold,
List<String> addresses,
List<String> tips)
Calculates the confirmed balance, as viewed by the specified tips.
|
String |
getHost()
Gets the host.
|
GetInclusionStateResponse |
getInclusionStates(String[] transactions,
String[] tips)
Get the inclusion states of a set of transactions.
|
GetNeighborsResponse |
getNeighbors()
Returns the set of neighbors you are connected with, as well as their activity statistics (or counters).
|
GetNodeInfoResponse |
getNodeInfo()
Returns information about this node.
|
String |
getPort()
Gets the port.
|
String |
getProtocol()
Gets the protocol.
|
GetTipsResponse |
getTips()
Returns all tips currently known by this node.
|
GetTransactionsToApproveResponse |
getTransactionsToApprove(Integer depth)
Tip selection which returns trunkTransaction and branchTransaction.
|
GetTransactionsToApproveResponse |
getTransactionsToApprove(Integer depth,
String reference)
Tip selection which returns trunkTransaction and branchTransaction.
|
GetTrytesResponse |
getTrytes(String... hashes)
Returns the raw transaction data (trytes) of a specific transaction.
|
InterruptAttachingToTangleResponse |
interruptAttachingToTangle()
Interrupts and completely aborts the attachToTangle process.
|
RemoveNeighborsResponse |
removeNeighbors(String... uris)
Temporarily removes a list of neighbors from your node.
|
StoreTransactionsResponse |
storeTransactions(String... trytes)
Stores transactions in the local storage.
|
WereAddressesSpentFromResponse |
wereAddressesSpentFrom(String... addresses)
Check if a list of addresses was ever spent from, in the current epoch, or in previous epochs.
|
protected static <tt> retrofit2.Response<tt> |
wrapCheckedException(retrofit2.Call<tt> call) |
protected IotaAPICore(IotaAPICore.Builder<?> builder)
builder
- The builder.protected static <tt> retrofit2.Response<tt> wrapCheckedException(retrofit2.Call<tt> call) throws ArgumentException
ArgumentException
public GetNodeInfoResponse getNodeInfo() throws ArgumentException
GetNodeInfoResponse
ArgumentException
public GetNeighborsResponse getNeighbors() throws ArgumentException
GetNeighborsResponse
ArgumentException
public AddNeighborsResponse addNeighbors(String... uris) throws ArgumentException
uris
- list of neighbors to addAddNeighborsResponse
ArgumentException
public RemoveNeighborsResponse removeNeighbors(String... uris) throws ArgumentException
uris
- The URIs of the neighbors we want to remove.RemoveNeighborsResponse
ArgumentException
public GetTipsResponse getTips() throws ArgumentException
GetTipsResponse
ArgumentException
public FindTransactionResponse findTransactions(String[] addresses, String[] tags, String[] approvees, String[] bundles) throws ArgumentException
Find the transactions which match the specified input and return. All input values are lists, for which a list of return values (transaction hashes), in the same order, is returned for all individual elements. The input fields can either be bundles, addresses, tags or approvees.
Using multiple of these input fields returns the intersection of the values. Can error if the node found more transactions than the max transactions send amountaddresses
- Array of hashes from addressestags
- Array of tagsapprovees
- Array of transaction hashesbundles
- Array of bundle hashesFindTransactionResponse
ArgumentException
public FindTransactionResponse findTransactionsByAddresses(String... addresses) throws ArgumentException
addresses
- An array of addresses.FindTransactionResponse
ArgumentException
public FindTransactionResponse findTransactionsByBundles(String... bundles) throws ArgumentException
bundles
- An array of bundles.FindTransactionResponse
ArgumentException
public FindTransactionResponse findTransactionsByApprovees(String... approvees) throws ArgumentException
approvees
- An array of approveess.FindTransactionResponse
ArgumentException
public FindTransactionResponse findTransactionsByDigests(String... digests) throws ArgumentException
digests
- A List of tags.FindTransactionResponse
ArgumentException
public GetInclusionStateResponse getInclusionStates(String[] transactions, String[] tips) throws ArgumentException
Get the inclusion states of a set of transactions. This is for determining if a transaction was accepted and confirmed by the network or not. You can search for multiple tips (and thus, milestones) to get past inclusion states of transactions.
This API call returns a list of boolean values in the same order as the submitted transactions. Boolean values will be true for confirmed transactions, otherwise false.
transactions
- Array of transactions you want to get the inclusion state for.tips
- Array of tips (including milestones) you want to search for the inclusion state.GetInclusionStateResponse
ArgumentException
- when a transaction hash is invalidArgumentException
- when a tip is invalidArgumentException
public GetTrytesResponse getTrytes(String... hashes) throws ArgumentException
Transaction.Transaction(String)
for conversion to an object.hashes
- The transaction hashes you want to get trytes from.GetTrytesResponse
ArgumentException
- when a transaction hash is invalidArgumentException
public GetTransactionsToApproveResponse getTransactionsToApprove(Integer depth, String reference) throws ArgumentException
depth
- Number of bundles to go back to determine the transactions for approval.reference
- Hash of transaction to start random-walk from.
This used to make sure the tips returned reference a given transaction in their past.
Can be null.GetTransactionsToApproveResponse
ArgumentException
public GetTransactionsToApproveResponse getTransactionsToApprove(Integer depth) throws ArgumentException
depth
- Number of bundles to go back to determine the transactions for approval.GetTransactionsToApproveResponse
ArgumentException
public GetBalancesResponse getBalances(Integer threshold, List<String> addresses, List<String> tips) throws ArgumentException
Calculates the confirmed balance, as viewed by the specified tips. If you do not specify the referencing tips, the returned balance is based on the latest confirmed milestone. In addition to the balances, it also returns the referencing tips (or milestone), as well as the index with which the confirmed balance was determined. The balances are returned as a list in the same order as the addresses were provided as input.
threshold
- The confirmation threshold between 0 and 100(inclusive).
Should be set to 100 for getting balance by counting only confirmed transactions.addresses
- The addresses where we will find the balance for.tips
- The tips to find the balance through. Can be nullGetBalancesResponse
ArgumentException
- The the request was considered wrong in any way by the nodepublic GetBalancesResponse getBalances(Integer threshold, List<String> addresses) throws ArgumentException
Calculates the confirmed balance, as viewed by the latest solid milestone. In addition to the balances, it also returns the referencing milestone, and the index with which the confirmed balance was determined. The balances are returned as a list in the same order as the addresses were provided as input.
threshold
- The confirmation threshold, should be set to 100.addresses
- The list of addresses you want to get the confirmed balance from.GetBalancesResponse
ArgumentException
public WereAddressesSpentFromResponse wereAddressesSpentFrom(String... addresses) throws ArgumentException
addresses
- List of addresses to check if they were ever spent from.WereAddressesSpentFromResponse
ArgumentException
- when an address is invalidArgumentException
public CheckConsistencyResponse checkConsistency(String... tails) throws ArgumentException
tails
- The tails describing the subtangle.CheckConsistencyResponse
ArgumentException
- when a tail hash is invalidArgumentException
public GetAttachToTangleResponse attachToTangle(String trunkTransaction, String branchTransaction, Integer minWeightMagnitude, String... trytes) throws ArgumentException
Prepares the specified transactions (trytes) for attachment to the Tangle by doing Proof of Work. You need to supply branchTransaction as well as trunkTransaction. These are the tips which you're going to validate and reference with this transaction. These are obtainable by the getTransactionsToApprove API call.
The returned value is a different set of tryte values which you can input into broadcastTransactions and storeTransactions.
The last 243 trytes of the return value consist of the following:trunkTransaction
branchTransaction
nonce
trunkTransaction
- A reference to an external transaction (tip) used as trunk.
The transaction with index 0 will have this tip in its trunk.
All other transactions reference the previous transaction in the bundle (Their index-1).branchTransaction
- A reference to an external transaction (tip) used as branch.
Each Transaction in the bundle will have this tip as their branch, except the last.
The last one will have the branch in its trunk.minWeightMagnitude
- The amount of work we should do to confirm this transaction.
Each 0-trit on the end of the transaction represents 1 magnitude.
A 9-tryte represents 3 magnitudes, since a 9 is represented by 3 0-trits.
Transactions with a different minWeightMagnitude are compatible.trytes
- The list of trytes to prepare for network attachment, by doing proof of work.GetAttachToTangleResponse
ArgumentException
- when a trunk or branch hash is invalidArgumentException
- when the provided transaction trytes are invalidArgumentException
public InterruptAttachingToTangleResponse interruptAttachingToTangle() throws ArgumentException
InterruptAttachingToTangleResponse
ArgumentException
public BroadcastTransactionsResponse broadcastTransactions(String... trytes) throws ArgumentException
trytes
- The list of transaction trytes to broadcastBroadcastTransactionsResponse
ArgumentException
- when the provided transaction trytes are invalidArgumentException
public StoreTransactionsResponse storeTransactions(String... trytes) throws ArgumentException
trytes
- Transaction data to be stored.StoreTransactionsResponse
ArgumentException
public String getProtocol()
public String getHost()
public String getPort()
Copyright © 2018. All rights reserved.