| Modifier and Type | Field and Description |
|---|---|
protected List<Connection> |
nodes |
| Modifier | Constructor and Description |
|---|---|
protected |
IotaAPICore(ApiOptions options) |
| Modifier and Type | Method and Description |
|---|---|
AddNeighborsResponse |
addNeighbors(String... uris)
Temporarily add a list of neighbors to your node.
|
boolean |
addNode(Connection n) |
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.
|
GetAttachToTangleResponse |
attachToTangleLocalPow(String trunkTransaction,
String branchTransaction,
Integer minWeightMagnitude,
IotaPoW pow,
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.
|
IotaCustomResponse |
callIxi(String module,
String... args) |
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 with checksum
|
FindTransactionResponse |
findTransactionsByApprovees(String... approvees)
Find the transactions by approvees
|
FindTransactionResponse |
findTransactionsByBundles(String... bundles)
Find the transactions by bundles
|
FindTransactionResponse |
findTransactionsByDigests(String... digests)
Deprecated.
|
FindTransactionResponse |
findTransactionsByTags(String... tags)
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.
|
GetBalancesResponse |
getBalances(Integer threshold,
String[] addresses,
String[] tips)
Calculates the confirmed balance, as viewed by the specified tips.
|
ICurl |
getCurl()
Gives a clone of the custom curl defined in
ApiOptions |
String |
getHost()
Deprecated.
|
GetInclusionStateResponse |
getInclusionStates(String[] transactions,
String[] tips)
Get the inclusion states of a set of transactions.
|
IotaPoW |
getLocalPoW() |
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.
|
List<Connection> |
getNodes() |
String |
getPort()
Deprecated.
|
String |
getProtocol()
Deprecated.
|
Connection |
getRandomNode() |
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.
|
boolean |
hasNodes() |
InterruptAttachingToTangleResponse |
interruptAttachingToTangle()
Interrupts and completely aborts the attachToTangle process.
|
RemoveNeighborsResponse |
removeNeighbors(String... uris)
Temporarily removes a list of neighbors from your node.
|
boolean |
removeNode(Connection n) |
void |
setCurl(ICurl localPoW) |
void |
setLocalPoW(IotaPoW localPoW) |
StoreTransactionsResponse |
storeTransactions(String... trytes)
Stores transactions in the local storage.
|
String |
toString() |
WereAddressesSpentFromResponse |
wereAddressesSpentFrom(String... addresses)
Check if a list of addresses was ever spent from, in the current epoch, or in previous epochs.
|
protected final List<Connection> nodes
protected IotaAPICore(ApiOptions options)
public boolean hasNodes()
public Connection getRandomNode()
public List<Connection> getNodes()
public boolean addNode(Connection n)
public boolean removeNode(Connection n)
public ICurl getCurl()
ApiOptionspublic void setCurl(ICurl localPoW)
public IotaPoW getLocalPoW()
public void setLocalPoW(IotaPoW localPoW)
public GetNodeInfoResponse getNodeInfo() throws ArgumentException
GetNodeInfoResponseArgumentException - The request was considered wrong in any way by the nodepublic GetNeighborsResponse getNeighbors() throws ArgumentException
GetNeighborsResponseArgumentException - The request was considered wrong in any way by the nodepublic AddNeighborsResponse addNeighbors(String... uris) throws ArgumentException
uris - list of neighbors to addAddNeighborsResponseArgumentException - The request was considered wrong in any way by the nodeArgumentException - When an URI is invalidpublic RemoveNeighborsResponse removeNeighbors(String... uris) throws ArgumentException
uris - The URIs of the neighbors we want to remove.RemoveNeighborsResponseArgumentException - The request was considered wrong in any way by the nodeArgumentException - When an URI is invalidpublic GetTipsResponse getTips() throws ArgumentException
GetTipsResponseArgumentException - The request was considered wrong in any way by the nodepublic 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 addresses, must contain checksumstags - Array of tagsapprovees - Array of transaction hashesbundles - Array of bundle hashesFindTransactionResponseArgumentException - The request was considered wrong in any way by the nodeArgumentException - If any of the parameters are not empty but have invalid valuespublic IotaCustomResponse callIxi(String module, String... args) throws ArgumentException
ArgumentExceptionpublic FindTransactionResponse findTransactionsByAddresses(String... addresses) throws ArgumentException
addresses - An array of addresses, must contain checksumsFindTransactionResponseArgumentException - The request was considered wrong in any way by the nodeArgumentException - If one of the addresses is invalidpublic FindTransactionResponse findTransactionsByBundles(String... bundles) throws ArgumentException
bundles - An array of bundles.FindTransactionResponseArgumentException - The request was considered wrong in any way by the nodeArgumentException - If one of the bundle hashes is invalidpublic FindTransactionResponse findTransactionsByApprovees(String... approvees) throws ArgumentException
approvees - An array of approvees.FindTransactionResponseArgumentException - The request was considered wrong in any way by the nodeArgumentException - If one of the approvee hashes is invalid@Deprecated public FindTransactionResponse findTransactionsByDigests(String... digests) throws ArgumentException
findTransactionsByTags(java.lang.String...) insteaddigests - A List of digests. Must be hashed tags (digest)ArgumentException - The request was considered wrong in any way by the nodeArgumentException - When one of the digests is invalidpublic FindTransactionResponse findTransactionsByTags(String... tags) throws ArgumentException
tags - A List of tags.FindTransactionResponseArgumentException - The request was considered wrong in any way by the nodeArgumentException - When one of the tags is invalidpublic 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.GetInclusionStateResponseArgumentException - The request was considered wrong in any way by the nodeArgumentException - when a transaction hash is invalidArgumentException - when a tip is invalidpublic GetTrytesResponse getTrytes(String... hashes) throws ArgumentException
Transaction.Transaction(String) for conversion to an object.hashes - The transaction hashes you want to get trytes from.GetTrytesResponseArgumentException - The request was considered wrong in any way by the nodeArgumentException - when a transaction hash is invalidpublic 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.GetTransactionsToApproveResponseArgumentException - The request was considered wrong in any way by the nodeArgumentException - The depth is invalidpublic GetTransactionsToApproveResponse getTransactionsToApprove(Integer depth) throws ArgumentException
depth - Number of bundles to go back to determine the transactions for approval.GetTransactionsToApproveResponseArgumentException - The request was considered wrong in any way by the nodepublic GetBalancesResponse getBalances(Integer threshold, String[] addresses, 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. Must contain the checksum.tips - The optional tips to find the balance through.GetBalancesResponseArgumentException - The request was considered wrong in any way by the nodeArgumentException - The threshold is invalidArgumentException - The tips or addresses are invalidpublic 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. Must contain the checksum.tips - The tips to find the balance through. Can be nullGetBalancesResponseArgumentException - 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. Must contain the checksum.GetBalancesResponseArgumentException - The request was considered wrong in any way by the nodepublic WereAddressesSpentFromResponse wereAddressesSpentFrom(String... addresses) throws ArgumentException
addresses - List of addresses to check if they were ever spent from. Must contain the checksum.WereAddressesSpentFromResponseArgumentException - when an address is invalidpublic CheckConsistencyResponse checkConsistency(String... tails) throws ArgumentException
tails - The tails describing the subtangle.CheckConsistencyResponseArgumentException - when a tail hash is invalidpublic 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:trunkTransactionbranchTransactionnoncetrunkTransaction - 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.GetAttachToTangleResponseArgumentException - when a trunk or branch hash is invalidArgumentException - when the provided transaction trytes are invalidpublic GetAttachToTangleResponse attachToTangleLocalPow(String trunkTransaction, String branchTransaction, Integer minWeightMagnitude, IotaPoW pow, String... trytes)
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:trunkTransactionbranchTransactionnoncetrunkTransaction - 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.pow - Method of proof of worktrytes - The list of trytes to prepare for network attachment, by doing proof of work.GetAttachToTangleResponseArgumentException - when a trunk or branch hash is invalidArgumentException - when the provided transaction trytes are invalidpublic InterruptAttachingToTangleResponse interruptAttachingToTangle() throws ArgumentException
InterruptAttachingToTangleResponseArgumentException - If node connection failspublic BroadcastTransactionsResponse broadcastTransactions(String... trytes) throws ArgumentException
trytes - The list of transaction trytes to broadcastBroadcastTransactionsResponseArgumentException - when the provided transaction trytes are invalidpublic StoreTransactionsResponse storeTransactions(String... trytes) throws ArgumentException
trytes - Transaction data to be stored.StoreTransactionsResponseArgumentException - when the provided transaction trytes are invalid@Deprecated public String getProtocol()
@Deprecated public String getHost()
@Deprecated public String getPort()
Copyright © 2019. All rights reserved.