API Reference
Address
tryFromBech32(addr): Address
Tries to create an Address
from a Bech32 encoded string.
Parameter | Type | Description |
---|---|---|
addr | String |
toBech32(hrp): String
Parameter | Type | Description |
---|---|---|
hrp | String |
verify(msg, signature): void
Parameter | Type | Description |
---|---|---|
msg | byte[] | |
signature | SignatureUnlock |
AddressDto
kind(): short
The kind of address
address(): String
The address itself
AddressIndexRecorder
Structure for sorting of UnlockBlocks
accountIndex(): long
Index of the account
input(): Input
The input used
output(): OutputResponse
The output information
addressIndex(): long
index of this address on the seed
chain(): Chain
The chain derived from seed
internal(): boolean
Whether this is an internal address
bech32Address(): String
The address
AddressPublicWrapper
isPublic(): boolean
If this is a public address
address(): Address
The address itself
AddressStringPublicWrapper
isPublic(): boolean
If this is a public address
address(): String
The address itself
Api
GET_HEALTH
get_health
API
GET_INFO
get_info
API
GET_PEERS
get_peers
API
GET_TIPS
get_tips
API
POST_MESSAGE
post_message
API
POST_MESSAGE_WITH_REMOTE_POW
post_message
API with remote pow
GET_OUTPUT
get_output
API
GET_MILESTONE
get_milestone
API
GET_MESSAGE
get_message
API
GET_BALANCE
get_balance
API
BalanceAddressResponse
Response of an address balance request
addressType(): short
The type of address
address(): String
The address
balance(): long
The balance of this address
dustAllowed(): boolean
Wether or not this address allows dust
BrokerOptions
The MQTT broker options.
BrokerOptions(): BrokerOptions
automaticDisconnect(disconnect): BrokerOptions
Whether the MQTT broker should be automatically disconnected when all topics are unsubscribed or not.
Parameter | Type | Description |
---|---|---|
disconnect | boolean |
timeout(timeout): BrokerOptions
timeout of the mqtt broker.
Parameter | Type | Description |
---|---|---|
timeout | float | The timeout in seconds |
useWs(use_ws): BrokerOptions
Defines if websockets should be used (true) or TCP (false)
Parameter | Type | Description |
---|---|---|
use_ws | boolean | If we use web sockets or not |
port(port): BrokerOptions
Defines the port to be used for the MQTT connection
Parameter | Type | Description |
---|---|---|
port | int | The port we use to conenct |
maxReconnectionAttempts(max_reconnection_attempts): BrokerOptions
Defines the maximum reconnection attempts before it returns an error
Parameter | Type | Description |
---|---|---|
max_reconnection_attempts | long | The maximum attempts |
Chain
slip10 chain
Client
The iota.rs client instance
Builder(): ClientBuilder
Creates a new instance of the CLient builder
getHealth(): boolean
GET /health endpoint
getNodeHealth(node): boolean
GET /health endpoint for the passed node
Parameter | Type | Description |
---|---|---|
node | String | the node url which you want to query speicifically for, in the case of multiple nodes in a pool |
getNode(): Node
getNetworkId(): long
Gets the network id of the node we're connecting to.
getPowProvider(): ClientMiner
Gets the miner to use based on the PoW setting
getNetworkInfo(): NetworkInfo
Gets the network related information such as network_id and min_pow_score and if it's the default one, sync it first.
getInfo(): NodeInfoWrapper
GET /api/v1/info endpoint
getPeers(): PeerDto[]
GET /api/v1/peers endpoint
getTips(): String[]
GET /api/v1/tips endpoint
getOutput(output_id): OutputResponse
GET /api/v1/outputs/{outputId} endpoint Find an output by its transaction_id and corresponding output_index.
Parameter | Type | Description |
---|---|---|
output_id | String | The id of the output |
getAddress(): GetAddressBuilder
GET /api/v1/addresses/{address} endpoint Creates a new instance of the AddressBuilder
getAddressBalance(address): BalanceAddressResponse
Return the balance in iota for the given address; No seed needed to do this since we are only checking and already know the address.
Parameter | Type | Description |
---|---|---|
address | String | The address we want to get the balance for |
getAddressesBalances(addresses): BalanceAddressResponse[]
since we are only checking and already know the addresses.
Parameter | Type | Description |
---|---|---|
addresses | String[] | The addresses we want to get the balance for |
findOutputs(output_ids, addresses): OutputResponse[]
Find all outputs based on the requests criteria. This method will try to query multiple nodes if the request amount exceeds individual node limit.
Parameter | Type | Description |
---|---|---|
output_ids | String[] | The optional output ids to check for |
addresses | String[] | The optional list of addresses to check for |
getMilestone(index): MilestoneResponse
GET /api/v1/milestones/{index} endpoint Get the milestone by the given index.
Parameter | Type | Description |
---|---|---|
index | long | the milestone index |
getMilestoneUtxoChanges(index): MilestoneUtxoChangesResponse
GET /api/v1/milestones/{index}/utxo-changes endpoint Gets the utxo changes by the given milestone index.
Parameter | Type | Description |
---|---|---|
index | long | the milestone index |
getReceipts(): ReceiptDto[]
GET /api/v1/receipts endpoint Get all receipts.
getReceiptsMigratedAt(index): ReceiptDto[]
GET /api/v1/receipts/{migratedAt} endpoint Get the receipts by the given milestone index.
Parameter | Type | Description |
---|---|---|
index | long | the milestone index |
getTreasury(): TreasuryResponse
GET /api/v1/treasury endpoint Get the treasury output.
getIncludedMessage(transaction_id): Message
GET /api/v1/transactions/{transactionId}/included-message Returns the included message of the transaction.
Parameter | Type | Description |
---|---|---|
transaction_id | TransactionId | the transaction id |
postMessage(msg): MessageId
POST /api/v1/messages endpoint
Parameter | Type | Description |
---|---|---|
msg | Message | The message to post. Use Client.message() to create one. |
reattach(message_id): MessageWrap
Reattaches messages for provided message id. Messages can be reattached only if they are valid and haven't been confirmed for a while.
Parameter | Type | Description |
---|---|---|
message_id | MessageId | The id of the Message to reattach |
reattachUnchecked(message_id): MessageWrap
Reattach a message without checking if it should be reattached
Parameter | Type | Description |
---|---|---|
message_id | MessageId | The id of the Message to reattach |
promote(message_id): MessageWrap
Promotes a message. The method should validate if a promotion is necessary through get_message. If not, the method should error out and should not allow unnecessary promotions.
Parameter | Type | Description |
---|---|---|
message_id | MessageId | The id of the Message to promote |
promoteUnchecked(message_id): MessageWrap
Promote a message without checking if it should be promoted
Parameter | Type | Description |
---|---|---|
message_id | MessageId | The id of the Message to promote |
getBalance(seed): GetBalanceBuilderApi
Return the balance for a provided seed Addresses with balance must be consecutive, so this method will return once it encounters a zero balance address.
Parameter | Type | Description |
---|---|---|
seed | String | the seed which contains the addressses you want to check balance for |
message(): ClientMessageBuilder
A generic send function for easily sending transaction or indexation messages.
getMessage(): GetMessageBuilder
GET /api/v1/messages/{messageId} endpoint
getAddresses(seed): GetAddressesBuilder
Return a list of addresses from the seed regardless of their validity.
Parameter | Type | Description |
---|---|---|
seed | String | ssed that will create the addresses |
retryUntilIncluded(message_id, interval, max_attempts): MessageWrap[]
Retries (promotes or reattaches) a message for provided message id until it's included (referenced by a milestone). Default interval is 5 seconds and max attempts is 40. Returns reattached messages. Set to -1 for defaults.
Parameter | Type | Description |
---|---|---|
message_id | MessageId | The id of the Message to include |
interval | long | The interval in seconds to try |
max_attempts | long | The maximum attempts for retrying |
subscriber(): MqttManager
Returns a handle to the MQTT topics manager.
generateMnemonic(): String
Generates a new mnemonic.
mnemonicToHexSeed(mnemonic): String
Returns a hex encoded seed for a mnemonic.
Parameter | Type | Description |
---|---|---|
mnemonic | String | The mmnemonic to turn into a seed |
findInputs(addresses, amount): UtxoInput[]
Function to find inputs from addresses for a provided amount (useful for offline signing)
Parameter | Type | Description |
---|---|---|
addresses | String[] | The addresses to obtain balance from |
amount | long | the amount we need to find |
bech32ToHex(bech32): String
Returns a parsed hex String from bech32.
Parameter | Type | Description |
---|---|---|
bech32 | String | The address Bech32 string |
hexToBech32(hex, bech32_hrp): String
Transforms a hex encoded address to a bech32 encoded address
Parameter | Type | Description |
---|---|---|
hex | String | The address Bech32 string |
bech32_hrp | String | The Bech32 hrp string |
hexPublicKeyToBech32Address(hex, bech32_hrp): String
Transforms a hex encoded public key to a bech32 encoded address
Parameter | Type | Description |
---|---|---|
hex | String | hex encoded public key |
bech32_hrp | String | The Bech32 hrp string |
isAddressValid(address): boolean
Checks if a str is a valid bech32 encoded address.
Parameter | Type | Description |
---|---|---|
address | String | The addresss string to check |
parseBech32Address(address): Address
Returns a valid Address parsed from a String.
Parameter | Type | Description |
---|---|---|
address | String | The addresss string to parse |
shouldMigrate(seed, account_index, address_index, pub_addr): boolean
Temporarily method to check if your seed is made using the incorrect generation of the old JAVA seed input
Parameter | Type | Description |
---|---|---|
seed | String | The seed you used previously |
account_index | long | The account index used, is 0 when you didnt use it |
address_index | long | The address index you want to migrate |
pub_addr | boolean | If it's a public or internal address |
migrate(seed, account_index, address_index, pub_addr, to_address): Message
Temporarily method in order to migrate wrongly generated seeds from JAVA to Rust Migrates the balance of the address towards the provided to_address And returns the message or an error
Parameter | Type | Description |
---|---|---|
seed | String | The seed you used previously |
account_index | long | The account index used, is 0 when you didnt use it |
address_index | long | The address index you want to migrate |
pub_addr | boolean | If it's a public or internal address |
to_address | String | The address we send the balance to |
ClientBuilder
The options builder for a client connected to multiple nodes.
ClientBuilder(): ClientBuilder
Create a new instance of the Client
withNode(node): ClientBuilder
Adds an IOTA node by its URL.
Parameter | Type | Description |
---|---|---|
node | String | The node URL |
withNodes(nodes): ClientBuilder
Adds a list of IOTA nodes by their URLs.
Parameter | Type | Description |
---|---|---|
nodes | String[] | The list of node URLs |
withNodeAuth(node, jwt, username, password): ClientBuilder
Adds an IOTA node by its URL with optional jwt and or basic authentication
Parameter | Type | Description |
---|---|---|
node | String | The node URL |
jwt | String | The JWT, can be null |
username | String | The username, can be null |
password | String | The password, can be null . Only checked if username is not null |
withPrimaryNode(node, jwt, username, password): ClientBuilder
Adds an IOTA node by its URL to be used as primary node, with optional jwt and or basic authentication
Parameter | Type | Description |
---|---|---|
node | String | The node URL |
jwt | String | The JWT, can be null |
username | String | The username, can be null |
password | String | The password, can be null . Only checked if username is not null |
withPrimaryPowNode(node, jwt, username, password): ClientBuilder
Adds an IOTA node by its URL to be used as primary PoW node (for remote PoW), with optional jwt and or basic authentication
Parameter | Type | Description |
---|---|---|
node | String | The node URL |
jwt | String | The JWT, can be null |
username | String | The username, can be null |
password | String | The password, can be null . Only checked if username is not null |
withPermanode(node, jwt, username, password): ClientBuilder
Adds an IOTA permanode by its URL, with optional jwt and or basic authentication
Parameter | Type | Description |
---|---|---|
node | String | The node URL |
jwt | String | The JWT, can be null |
username | String | The username, can be null |
password | String | The password, can be null . Only checked if username is not null |
withNodePoolUrls(node_pool_urls): ClientBuilder
Get node list from the node_pool_urls
Parameter | Type | Description |
---|---|---|
node_pool_urls | String[] | node_pool_urls list of node URLs for the node pool |
withOfflineMode(): ClientBuilder
Allows creating the client without nodes for offline address generation or signing
withNetwork(network): ClientBuilder
Client connected to the default Network pool unless specified.
import org.iota.client.ClientBuilder;
Client clientOptions = new ClientBuilder().with_network("devnet").build();
Parameter | Type | Description |
---|---|---|
network | String | The network we connect to |
withNodeSyncInterval(node_sync_interval): ClientBuilder
Set the node sync interval
Parameter | Type | Description |
---|---|---|
node_sync_interval | float | The interval in seconds |
withNodeSyncDisabled(): ClientBuilder
Disables the node syncing process. Every node will be considered healthy and ready to use.
withQuorum(quorum): ClientBuilder
Set if quorum should be used or not
Parameter | Type | Description |
---|---|---|
quorum | boolean | true if we use a quorum |
withQuorumSize(quorum_size): ClientBuilder
Set amount of nodes which should be used for quorum
Parameter | Type | Description |
---|---|---|
quorum_size | long | The amount of nodes |
withQuorumThreshold(threshold): ClientBuilder
Set quorum threshold
Parameter | Type | Description |
---|---|---|
threshold | long | The percentage of nodes that need to agree (0-100) |
withMqttBrokerOptions(options): ClientBuilder
Sets the MQTT broker options.
Parameter | Type | Description |
---|---|---|
options | BrokerOptions | the MQTT options |
withLocalPow(local): ClientBuilder
Sets whether the PoW should be done locally or remotely.
Parameter | Type | Description |
---|---|---|
local | boolean | Enables or disables local PoW |
withTipsInterval(tips): ClientBuilder
Sets after how many seconds new tips will be requested during PoW
Parameter | Type | Description |
---|---|---|
tips | long | delay in seconds |
withRequestTimeout(timeout): ClientBuilder
Sets the default request timeout in seconds.
Parameter | Type | Description |
---|---|---|
timeout | float | The request timeout in seconds |
withApiTimeout(api, timeout): ClientBuilder
Sets the request timeout in seconds for a specific API usage.
Parameter | Type | Description |
---|---|---|
api | Api | The API we set the timeout for |
timeout | float | The request timeout in seconds |
finish(): Client
Build the Client instance.
ClientException
ClientException(): ClientException
ClientException(errorMessage): ClientException
Parameter | Type | Description |
---|---|---|
errorMessage | String |
ClientMessageBuilder
withSeed(seed): ClientMessageBuilder
Sets the seed.
Parameter | Type | Description |
---|---|---|
seed | String | The seed to use |
withAccountIndex(account_index): ClientMessageBuilder
Sets the account index.
Parameter | Type | Description |
---|---|---|
account_index | long | The index to set |
withInitialAddressIndex(initial_address_index): ClientMessageBuilder
Sets the index of the address to start looking for balance.
Parameter | Type | Description |
---|---|---|
initial_address_index | long | The initial index to start address search from |
withInput(input): ClientMessageBuilder
Set a custom input(transaction output)
Parameter | Type | Description |
---|---|---|
input | UtxoInput | The custom input |
withInputRange(low, high): ClientMessageBuilder
Set a custom range in which to search for addresses for custom inputs. Default: 0..100
Parameter | Type | Description |
---|---|---|
low | long | Low end of input range (0) |
high | long | Upper end of input range (100) |
withOutput(address, amount): ClientMessageBuilder
Insert the output address and amount to spent. The amount cannot be zero.
Parameter | Type | Description |
---|---|---|
address | String | The address we send to |
amount | long | The amount to send (> 0) |
withDustAllowanceOutput(address, amount): ClientMessageBuilder
Set a dust allowance transfer to the builder, address needs to be Bech32 encoded
Parameter | Type | Description |
---|---|---|
address | String | The Bech32 encoded address we send to |
amount | long | The amount to send (> 0) |
withOutputHex(address, amount): ClientMessageBuilder
Set a transfer to the builder, address needs to be hex encoded
Parameter | Type | Description |
---|---|---|
address | String | The hex encoded address we send to |
amount | long | The amount to send (> 0) |
withIndexVec(index): ClientMessageBuilder
Set indexation to the builder
Parameter | Type | Description |
---|---|---|
index | byte[] | The index to use |
withIndexString(index): ClientMessageBuilder
Set indexation to the builder
Parameter | Type | Description |
---|---|---|
index | String | The index to use |
withData(data): ClientMessageBuilder
Set data to the builder
Parameter | Type | Description |
---|---|---|
data | byte[] | The data to use |
withDataString(data): ClientMessageBuilder
Set data to the builder
Parameter | Type | Description |
---|---|---|
data | String | The data to use |
prepareTransaction(): PreparedTransactionData
Prepare a transaction. Used as parameter for signTransaction
signTransaction(prepared_transaction_data, seed, inputs_range_low, inputs_range_high): MessagePayload
Sign the transaction. inputsRangeLow and high to 0 for not using an input range
Parameter | Type | Description |
---|---|---|
prepared_transaction_data | PreparedTransactionData | The completely prepared transaction |
seed | String | The seed used to prepare the transaction |
inputs_range_low | long | Lower input used for getting adresses (default: 0) |
inputs_range_high | long | Upper input used for getting adresses (default: 100) |
finish(payload): Message
Consume the builder and return the message made with the specific payload
Parameter | Type | Description |
---|---|---|
payload | MessagePayload | A prepared and signed MessagePayload |
finishTransaction(payload): Message
Consume the builder and return the message made with the specific payload
Parameter | Type | Description |
---|---|---|
payload | TransactionPayload | A prepared and signed TransactionPayload |
finishMilestone(payload): Message
Consume the builder and return the message made with the specific payload
Parameter | Type | Description |
---|---|---|
payload | MilestonePayload | A prepared and signed MilestonePayload |
finishIndex(payload): Message
Consume the builder and return the message made with the specific payload
Parameter | Type | Description |
---|---|---|
payload | IndexationPayload | A prepared and signed IndexationPayload |
finishReceipt(payload): Message
Consume the builder and return the message made with the specific payload
Parameter | Type | Description |
---|---|---|
payload | ReceiptPayload | A prepared and signed ReceiptPayload |
finishTreasury(payload): Message
Consume the builder and return the message made with the specific payload
Parameter | Type | Description |
---|---|---|
payload | TreasuryPayload | A prepared and signed TreasuryPayload |
finish(): Message
Consume the builder and return the message
ClientMiner
Client miner, used as
Essence
asRegular(): RegularEssence
GetAddressBuilder
Builder of GET /api/v1/address/{address} endpoint
balance(address): BalanceAddressResponse
Consume the builder and get the balance of a given Bech32 encoded address. If count equals maxResults, then there might be more outputs available but those were skipped for performance reasons. User should sweep the address to reduce the amount of outputs.
Parameter | Type | Description |
---|---|---|
address | String | The address to get the balance for |
outputs(address, options): UtxoInput[]
Consume the builder and get all outputs that use a given address. If count equals maxResults, then there might be more outputs available but those were skipped for performance reasons. User should sweep the address to reduce the amount of outputs.
Parameter | Type | Description |
---|---|---|
address | String | The address to get the balance for |
options | OutputsOptions | The options for finding outputs |
GetAddressesBuilder
from(seed): GetAddressesBuilder
Construct a new addressbuilder with a seed. Invalid seeds throw an error
Parameter | Type | Description |
---|---|---|
seed | String |
fromOld(seed): GetAddressesBuilder
DEBUG DO NOT USE
Parameter | Type | Description |
---|---|---|
seed | String |
withAccountIndex(account_index): GetAddressesBuilder
Set the account index
Parameter | Type | Description |
---|---|---|
account_index | long |
withRange(start, end): GetAddressesBuilder
Set range to the builder
Parameter | Type | Description |
---|---|---|
start | long | |
end | long |
withBech32Hrp(bech32_hrp): GetAddressesBuilder
Set bech32 human readable part (hrp)
Parameter | Type | Description |
---|---|---|
bech32_hrp | String |
withClient(client): GetAddressesBuilder
Set client to the builder
Parameter | Type | Description |
---|---|---|
client | Client |
finish(): String[]
Consume the builder and get a vector of public addresses bech32 encoded
getAll(): AddressStringPublicWrapper[]
getAllRaw(): AddressPublicWrapper[]
Consume the builder and get the vector of public and internal addresses
GetBalanceBuilderApi
withAccountIndex(account_index): GetBalanceBuilderApi
Sets the account index.
Parameter | Type | Description |
---|---|---|
account_index | long | The account index to use (Default: 0) |
withInitialAddressIndex(initial_address_index): GetBalanceBuilderApi
Sets the index of the address to start looking for balance.
Parameter | Type | Description |
---|---|---|
initial_address_index | long | The starting index to use for searching addresses (Default: 0) |
withGapLimit(gap_limit): GetBalanceBuilderApi
Sets the gap limit to specify how many addresses will be checked each round. If gap_limit amount of addresses in a row have no balance the function will return.
Parameter | Type | Description |
---|---|---|
gap_limit | long | The gap limit (Default: 20) |
finish(): long
Consume the builder and get the API result
GetMessageBuilder
indexString(index): MessageId[]
GET /api/v1/messages?index={Index} endpoint Consume the builder and search for messages matching the index
Parameter | Type | Description |
---|---|---|
index | String | the index string |
indexVec(index): MessageId[]
GET /api/v1/messages?index={Index} endpoint Consume the builder and search for messages matching the index
Parameter | Type | Description |
---|---|---|
index | byte[] | the index in bytes |
data(message_id): Message
GET /api/v1/messages/{messageID} endpoint Consume the builder and find a message by its identifer. This method returns the given message object.
Parameter | Type | Description |
---|---|---|
message_id | MessageId | The id of the message to find |
metadata(message_id): MessageMetadata
GET /api/v1/messages/{messageID}/metadata endpoint Consume the builder and find a message by its identifer. This method returns the given message metadata.
Parameter | Type | Description |
---|---|---|
message_id | MessageId | The id of the message to find |
raw(message_id): String
GET /api/v1/messages/{messageID}/raw endpoint Consume the builder and find a message by its identifer. This method returns the given message raw data.
Parameter | Type | Description |
---|---|---|
message_id | MessageId | The id of the message to find |
children(message_id): MessageId[]
GET /api/v1/messages/{messageID}/children endpoint Consume the builder and returns the list of message IDs that reference a message by its identifier.
Parameter | Type | Description |
---|---|---|
message_id | MessageId | The id of the message to find |
GossipDto
heartbeat(): HeartbeatDto
The hearthbeat information
metrics(): MetricsDto
The metrics information
HeartbeatDto
solidMilestoneIndex(): long
The solid milestone index
prunedMilestoneIndex(): long
The pruend milestone index
latestMilestoneIndex(): long
The latest milestone index
connectedNeighbors(): short
The amount of connected neighbors
syncedNeighbors(): short
The amount of synced neighbors
IndexPublicDto
index(): long
isPublic(): boolean
IndexationPayload
fromBytes(index, data): IndexationPayload
Creates a new IndexationPayload
.
Parameter | Type | Description |
---|---|---|
index | byte[] | The index |
data | byte[] | The data linked ot this index |
fromStrings(index, data): IndexationPayload
Creates a new IndexationPayload
from strings
Parameter | Type | Description |
---|---|---|
index | String | The index |
data | String | The data linked ot this index |
index(): byte[]
Returns the index of an IndexationPayload
.
indexString(): String
Returns the index of an IndexationPayload
.
data(): byte[]
Returns the data of an IndexationPayload
.
dataString(): String
Returns the data of an IndexationPayload
.
InfoResponse
Response of GET /api/v1/info. Returns general information about the node.
name(): String
The name of the node
version(): String
The node software version
networkId(): String
The network id the node is connected to
bech32Hrp(): String
The bech32 HRP which is accepted by this node
messagesPerSecond(): double
The messages per second this node is receiving
referencedMessagesPerSecond(): double
The referenced messages per second this node is receiving
referencedRate(): double
The reference rate
latestMilestoneTimestamp(): long
The timestamp of the latest received milestone
minPowScore(): double
The minimum required PoW for a message to be accepted
latestMilestoneIndex(): long
The index of the latest seen milestone
confirmedMilestoneIndex(): long
The index of the latest confirmed milestone
pruningIndex(): long
The milestone index this node is pruning from
features(): String[]
List of features running on this node
Input
kind(): InputKind
asUtxo(): UtxoInput
asTreasury(): TreasuryInput
InputKind
UTXO
TREASURY
LedgerInclusionStateDto
CONFLICTING
INCLUDED
NO_TRANSACTION
Message
Represent the object that nodes gossip around the network.
builder(): MessageBuilder
Creates a new MessageBuilder
to construct an instance of a Message
.
networkId(): long
Returns the network id of a Message
.
id(): MessageId
Computes the identifier of the message.
nonce(): long
Returns the nonce of a Message
.
parents(): MessageId[]
Returns the parents of a Message
.
payload(): Optional<MessagePayload>
Returns the optional payload of a Message
.
MessageBuilder
A builder to build a Message
.
MessageBuilder(): MessageBuilder
Creates a new MessageBuilder
.
networkId(network_id): MessageBuilder
Adds a network id to a MessageBuilder
.
Parameter | Type | Description |
---|---|---|
network_id | long | The network id |
parents(parents): MessageBuilder
Adds parents to a MessageBuilder
.
Parameter | Type | Description |
---|---|---|
parents | MessageId[] | A list of parents to set |
payload(payload): MessageBuilder
Adds a payload to a MessageBuilder
.
Parameter | Type | Description |
---|---|---|
payload | MessagePayload | the MessagePayload to set |
nonceProvider(provider, target_score): MessageBuilder
Sets a provider for the nonce. Can currently only be obtained from Client.getPowProvider
Parameter | Type | Description |
---|---|---|
provider | ClientMiner | Sets the nonce provider |
target_score | double | Target score for the nonce, Recommended: 4000 |
finish(): Message
Finish the MessageBuilder
MessageId
MessageId(): MessageId
fromString(str_rep): MessageId
Create a MessageId from string
Parameter | Type | Description |
---|---|---|
str_rep | String |
MessageMetadata
Response of GET /api/v1/messages/{message_id}/metadata. Returns the metadata of a message.
messageId(): String
The message id of this message
parentMessageIds(): String[]
The ids of the parents of this message
isSolid(): boolean
IF this message is solid
referencedByMilestoneIndex(): long
The optional milestone index if this message is referenced
milestoneIndex(): long
The optional milestone index this was included in
ledgerInclusionState(): Optional<LedgerInclusionStateDto>
The ledger state
conflictReason(): int
The optional reason of conflict
shouldPromote(): Optional<Boolean>
Optional; if the message needs to be promoted
shouldReattach(): Optional<Boolean>
Optional; if the message needs to be reattached
MessagePayload
Message payload wrapper
deserialize(serialised_data): MessagePayload
Turns a serialized message payload string back into its class
Parameter | Type | Description |
---|---|---|
serialised_data | String |
payloadType(): MessagePayloadType
Get the type of message this contains (used to select the correct getter)
asIndexation(): IndexationPayload
asMilestone(): MilestonePayload
asTransaction(): TransactionPayload
asReceipt(): ReceiptPayload
asTreasury(): TreasuryPayload
serialize(): String
Serializes the message payload into a json string
MessagePayloadType
TRANSACTION
MILESTONE
INDEXATION
RECEIPT
TREASURY_TRANSACTION
MessageWrap
message_id(): MessageId
The ID of this message
message(): Message
The message
MetricsDto
newMessages(): long
The amount of new messages received
receivedMessages(): long
The amount of received messages
knownMessages(): long
The amount of received known messages
receivedMessageRequests(): long
The amount of received requested messages
receivedMilestoneRequests(): long
The amount of received requested milestones
receivedHeartbeats(): long
The amount of received heartbeats
sentMessages(): long
The amount of sent messages
sentMessageRequests(): long
The amount of sent messages requests
sentMilestoneRequests(): long
The amount of sent milestone requests
sentHeartbeats(): long
The amount of sent heartbeats
droppedPackets(): long
The amount of dropped packets
MigratedFundsEntry
from(hash, output): MigratedFundsEntry
Creates a new MigratedFundsEntry
.
Parameter | Type | Description |
---|---|---|
hash | String | The hash from the transaction used to receive the funds |
output | SignatureLockedSingleOutput | the output related to this transaction |
tailTransactionHash(): String
Returns the tail transaction hash of a MigratedFundsEntry
.
output(): SignatureLockedSingleOutput
Returns the output of a MigratedFundsEntry
.
MigratedFundsEntryDto
tailTransactionHash(): String
The tail transaction hash
address(): AddressDto
The address this was deposited to
deposit(): long
The amount that was deposited
MilestoneId
fromString(str_rep): MilestoneId
Parameter | Type | Description |
---|---|---|
str_rep | String |
MilestonePayload
A payload which defines the inclusion set of other messages in the Tangle.
essence(): MilestonePayloadEssence
Returns the essence of a MilestonePayload
.
signatures(): MilestoneSignature[]
Returns the signatures of a MilestonePayload
.
validate(applicable_public_keys, min_threshold): void
Semantically validate a MilestonePayload
.
Parameter | Type | Description |
---|---|---|
applicable_public_keys | String[] | The public keys to use to validate |
min_threshold | long | THe minimum threshold for this to succeed (0...100) |
id(): String
Computes the identifier of a MilestonePayload
.
MilestonePayloadEssence
index(): long
Returns the index of a MilestonePayloadEssence
.
timestamp(): long
Returns the timestamp of a MilestonePayloadEssence
.
parents(): MessageId[]
Returns the parents of a MilestonePayloadEssence
.
merkleProof(): byte[]
Returns the merkle proof of a MilestonePayloadEssence
.
nextPowScore(): long
Returns the next proof of work score of a MilestonePayloadEssence
.
nextPowScoreMilestone(): long
Returns the next proof of work index of a MilestonePayloadEssence
.
publicKeys(): PublicKey[]
Returns the public keys of a MilestonePayloadEssence
.
receipt(): Optional<ReceiptPayload>
Returns the optional receipt of a MilestonePayloadEssence
.
hash(): byte[]
Hashes the MilestonePayloadEssence to be signed.
MilestoneResponse
index(): long
Milestone index.
messageId(): MessageId
Milestone message id
timestamp(): long
Milestone timestamp.
MilestoneSignature
getSignature(): byte[]
Gets the signature of the milestone
MilestoneUtxoChangesResponse
index(): long
Milestone index.
createdOutputs(): String[]
Milestone message id
consumedOutputs(): String[]
Milestone timestamp.
MqttEvent
CONNECTED
Client was connected.
DISCONNECTED
Client was disconnected.
MqttListener
onEvent(event): void
Parameter | Type | Description |
---|---|---|
event | TopicEvent |
MqttManager
withTopic(topic): MqttTopicManager
Add a new topic to the list.
Parameter | Type | Description |
---|---|---|
topic | Topic |
withTopics(topics): MqttTopicManager
Add a collection of topics to the list.
Parameter | Type | Description |
---|---|---|
topics | Topic[] |
unsubscribe(): void
Unsubscribes from all subscriptions.
disconnect(): void
Disconnects the broker. This will clear the stored topic handlers and close the MQTT connection.
MqttTopicManager
withTopic(topic): MqttTopicManager
Add a new topic to the list.
Parameter | Type | Description |
---|---|---|
topic | Topic |
withTopics(topics): MqttTopicManager
Add a collection of topics to the list.
Parameter | Type | Description |
---|---|---|
topics | Topic[] |
unsubscribe(): void
Unsubscribe from the given topics. If no topics were provided, the function will unsubscribe from every subscribed topic.
NativeAPI
The NativeAPI class, which houses all entrypoints to the shared library.
verifyLink(): void
NetworkInfo
Struct containing network and PoW related information
network(): Optional<String>
networkId(): long
bech32Hrp(): String
minPowScore(): double
localPow(): boolean
fallbackToLocalPow(): boolean
tipsInterval(): long
Node
Node struct
url(): String
node url
jwt(): Optional<String>
node jwt
NodeInfoWrapper
Wrapper for node information
url(): String
Get the URL from which this info is derived
nodeInfo(): InfoResponse
Get the information
Output
kind(): OutputKind
asSignatureLockedSingleOutput(): SignatureLockedSingleOutput
asSignatureLockedDustAllowanceOutput(): SignatureLockedDustAllowanceOutput
asTreasuryOutput(): TreasuryOutput
OutputDto
Wrapper for different output types
kind(): OutputKind
asSignatureLockedSingleOutputDto(): SignatureLockedSingleOutputDto
asSignatureLockedDustAllowanceOutputDto(): SignatureLockedDustAllowanceOutputDto
asTreasuryOutput(): TreasuryOutputDto
OutputKind
SIGNATURE_LOCKED_SINGLE
SIGNATURE_LOCKED_DUST_ALLOWANCE
TREASURY
OutputResponse
Response of GET /api/v1/outputs/{output_id}. Returns all information about a specific output.
messageId(): String
The message id this output is related to
transactionId(): String
The transaction id this output is related to
outputIndex(): int
The output index
isSpent(): boolean
true
if this output was spent. Otherwise false
output(): OutputDto
Get the output object which can be turned into its specific output type
OutputsOptions
OutputsOptions(): OutputsOptions
Creates a new instance of output options with default values
includeSpent(include_spent): void
Whether the query should include spent outputs or not.
Parameter | Type | Description |
---|---|---|
include_spent | boolean |
outputType(output_type): void
The output type filter.
Parameter | Type | Description |
---|---|---|
output_type | OutputKind |
PeerDto
Describes a peer.
id(): String
The id of the peer
multiAddresses(): String[]
multi addresses
alias(): Optional<String>
The alias of the peer
relation(): Relation
The type of peer
connected(): boolean
true
if this peer is connected
gossip(): Optional<GossipDto>
The gossip information of this peer
PreparedTransactionData
Helper struct for offline signing
deserialize(serialised_data): PreparedTransactionData
Turns a serialized preparedTransactionData string back into its class
Parameter | Type | Description |
---|---|---|
serialised_data | String | The serialised transaction data |
essence(): Essence
Transaction essence
addressIndexRecorders(): AddressIndexRecorder[]
Required address information for signing
serialize(): String
Serializes the prepared data into a json string
PublicKey
verify(sig, bytes): boolean
Verify the signature and bytes against this public key
Parameter | Type | Description |
---|---|---|
sig | Signature | The signature to verify |
bytes | byte[] | The bytes to verify |
toBytes(): byte[]
Turns ths public key into bytes
tryFromBytes(bytes): PublicKey
Attempt to create a public key from the provided bytes
Parameter | Type | Description |
---|---|---|
bytes | byte[] | The bytes to create the key from |
ReceiptDto
receipt(): ReceiptPayloadDto
Get the receipt payload
milestoneIndex(): long
Get the milestone index this receipt is related to
ReceiptPayload
from(migrated_at, last, funds, transaction): ReceiptPayload
Creates a new ReceiptPayload
.
Parameter | Type | Description |
---|---|---|
migrated_at | long | |
last | boolean | |
funds | MigratedFundsEntry[] | |
transaction | MessagePayload |
migratedAt(): long
Returns the milestone index at which the funds of a ReceiptPayload
were migrated at in the legacy network.
last(): boolean
Returns whether a ReceiptPayload
is the final one for a given migrated at index.
funds(): MigratedFundsEntry[]
The funds which were migrated with a ReceiptPayload
.
transaction(): TreasuryPayload
The TreasuryTransaction
used to fund the funds of a ReceiptPayload
.
amount(): long
Returns the sum of all MigratedFundsEntry
items within a ReceiptPayload
.
ReceiptPayloadDto
kind(): long
The type of receipt
migratedAt(): long
The milestone index at which the funds of a ReceiptPayload
were migrated
funds(): MigratedFundsEntryDto[]
The funds which are migrated
last(): boolean
Whether a ReceiptPayload
is the final one for a given migrated at index.
ReferenceUnlock
from(index): ReferenceUnlock
Creates a new ReferenceUnlock
.
Parameter | Type | Description |
---|---|---|
index | int | The unlock block index we use for signature |
index(): int
Return the index of a ReferenceUnlock
.
RegularEssence
inputs(): Input[]
Gets the transaction inputs.
outputs(): Output[]
Gets the transaction outputs.
payload(): Optional<MessagePayload>
Relation
KNOWN
UNKNOWN
AUTOPEERED
RustHex
encode(a0): String
Parameter | Type | Description |
---|---|---|
a0 | String |
encode(a0): String
Parameter | Type | Description |
---|---|---|
a0 | byte[] |
decode(s): byte[]
Parameter | Type | Description |
---|---|---|
s | String |
decode(s): byte[]
Parameter | Type | Description |
---|---|---|
s | byte[] |
RustLogging
init(): void
SecretKey
generate(): SecretKey
Generate a new secret key
fromBytes(bytes): SecretKey
Create a new secret key from the bytes
Parameter | Type | Description |
---|---|---|
bytes | byte[] | The bytes to create the key from |
publicKey(): PublicKey
Derive a public key from the secret key
toBytes(): byte[]
Turn this Secret key into bytes
sign(bytes): Signature
Sign the bytes using this key
Parameter | Type | Description |
---|---|---|
bytes | byte[] | the Bytes to sign |
Signature
toBytes(): byte[]
Turn the signature into bytes
fromBytes(bs): Signature
Turns bytes into a signature
Parameter | Type | Description |
---|---|---|
bs | byte[] |
SignatureLockedDustAllowanceOutput
Output type for deposits that enables an address to receive dust outputs. It can be consumed as an input like a regular SigLockedSingleOutput.
from(address, amount): SignatureLockedDustAllowanceOutput
Creates a new SignatureLockedDustAllowanceOutput
.
Parameter | Type | Description |
---|---|---|
address | Address | The address to set |
amount | long | The amount to set |
amount(): long
Returns the amount of a SignatureLockedDustAllowanceOutput
.
address(): Address
Returns the address of a SignatureLockedDustAllowanceOutput
.
SignatureLockedDustAllowanceOutputDto
Output type for deposits that enables an address to receive dust outputs. It can be consumed as an input like a regular SigLockedSingleOutput.
amount(): long
Returns the amount of a SignatureLockedDustAllowanceOutputDto
.
address(): AddressDto
Returns the address of a SignatureLockedDustAllowanceOutputDto
.
SignatureLockedSingleOutput
Describes a deposit to a single address which is unlocked via a signature.
from(address, amount): SignatureLockedSingleOutput
Creates a new SignatureLockedSingleOutput
.
Parameter | Type | Description |
---|---|---|
address | Address | The address to set |
amount | long | The amount to set |
amount(): long
Returns the amount of a SignatureLockedSingleOutput
.
address(): Address
Returns the address of a SignatureLockedSingleOutput
.
SignatureLockedSingleOutputDto
Describes a deposit to a single address which is unlocked via a signature.
amount(): long
Returns the amount of a SignatureLockedSingleOutputDto
.
address(): AddressDto
Returns the address of a SignatureLockedSingleOutputDto
.
SignatureUnlock
SignatureUnlock(public_key, signature): SignatureUnlock
Create a new Signature inlock block
Parameter | Type | Description |
---|---|---|
public_key | byte[] | The public ket used for this signature block |
signature | byte[] | The signature created for this unlock block |
Topic
from(topic): Topic
Creates a new topic and checks if it's valid.
Parameter | Type | Description |
---|---|---|
topic | String |
TopicEvent
topic(): String
the MQTT topic.
payload(): String
The MQTT event payload.
TransactionId
fromString(str_rep): TransactionId
Create a TransactionId from string
Parameter | Type | Description |
---|---|---|
str_rep | String |
TransactionPayload
builder(): TransactionPayloadBuilder
Return a new TransactionPayloadBuilder
to build a TransactionPayload
.
essence(): Essence
Return the essence of a TransactionPayload
.
id(): TransactionId
Computes the identifier of a TransactionPayload
.
unlockBlocks(): UnlockBlock[]
Return unlock blocks of a TransactionPayload
.
TransactionPayloadBuilder
TransactionPayloadBuilder(): TransactionPayloadBuilder
Creates a new TransactionPayloadBuilder
.
withEssence(essence): TransactionPayloadBuilder
Adds an essence to a TransactionPayloadBuilder
.
Parameter | Type | Description |
---|---|---|
essence | Essence |
withUnlockBlocks(unlock_blocks): TransactionPayloadBuilder
Adds unlock blocks to a TransactionPayloadBuilder
.
Parameter | Type | Description |
---|---|---|
unlock_blocks | UnlockBlocks |
finish(): TransactionPayload
Finishes a TransactionPayloadBuilder
into a TransactionPayload
.
TreasuryInput
TreasuryInput
is an input which references a milestone which generated a TreasuryOutput
.
TreasuryInput(id): TreasuryInput
Create a new TreasuryInput
Parameter | Type | Description |
---|---|---|
id | MilestoneId | The MilestoneId which Generated a TreasuryOutput |
milestoneId(): MilestoneId
Returns the milestones id of a TreasuryInput
.
TreasuryOutput
Trasury output.
from(amount): TreasuryOutput
Creates a new TreasuryOutput with the amount supplied
Parameter | Type | Description |
---|---|---|
amount | long | The amount to set |
amount(): long
Returns the amount of a TreasuryOutput
.
TreasuryOutputDto
kind(): short
The type of Treasury DTO
amount(): long
The amount in the treasury
TreasuryPayload
TreasuryPayload(input, output): TreasuryPayload
Parameter | Type | Description |
---|---|---|
input | TreasuryInput | |
output | TreasuryOutput |
output(): TreasuryOutput
input(): TreasuryInput
TreasuryResponse
Response of GET /api/v1/treasury. Returns all information about the treasury.
amount(): long
The amount in the treasury
milestoneId(): String
The milestone ID this reponse relates to
UnlockBlock
kind(): UnlockBlockKind
asReference(): ReferenceUnlock
asSignature(): SignatureUnlock
UnlockBlockKind
ED25519
REFERENCE
UnlockBlocks
from(unlock_blocks): UnlockBlocks
Parameter | Type | Description |
---|---|---|
unlock_blocks | UnlockBlock[] |
get(index): Optional<UnlockBlock>
Gets a clone of an UnlockBlock
from UnlockBlocks
.
Returns the referenced unlock block if the requested unlock block was a reference.
Parameter | Type | Description |
---|---|---|
index | long |
Util
consolidateFunds(client, seed, account_index, address_range_low, address_range_high): String
Function to consolidate all funds from a range of addresses to the address with the lowest index in that range Returns the address to which the funds got consolidated, if any were available
Parameter | Type | Description |
---|---|---|
client | Client | |
seed | String | |
account_index | long | |
address_range_low | long | |
address_range_high | long |
searchAddress(seed, bech32_hrp, account_index, range_low, range_high, address): IndexPublicDto
Function to find the index and public or internal type of an Bech32 encoded address
Parameter | Type | Description |
---|---|---|
seed | String | |
bech32_hrp | String | |
account_index | long | |
range_low | long | |
range_high | long | |
address | Address |
UtxoInput
Represents an input referencing an output.
from(id, index): UtxoInput
Create a new UtxoInput
Parameter | Type | Description |
---|---|---|
id | TransactionId | The ouput Id |
index | int | The output Index |
transactionId(): TransactionId
Returns the TransactionId
of the Output.
index(): int
Returns the index of the Output.