Skip to main content
Version: IOTA

API Reference

Address

tryFromBech32(addr): Address

Tries to create an Address from a Bech32 encoded string.

ParameterTypeDescription
addrString

toBech32(hrp): String

ParameterTypeDescription
hrpString

verify(msg, signature): void

ParameterTypeDescription
msgbyte[]
signatureSignatureUnlock

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_infoAPI

GET_PEERS

get_peersAPI

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.

ParameterTypeDescription
disconnectboolean

timeout(timeout): BrokerOptions

timeout of the mqtt broker.

ParameterTypeDescription
timeoutfloatThe timeout in seconds

useWs(use_ws): BrokerOptions

Defines if websockets should be used (true) or TCP (false)

ParameterTypeDescription
use_wsbooleanIf we use web sockets or not

port(port): BrokerOptions

Defines the port to be used for the MQTT connection

ParameterTypeDescription
portintThe port we use to conenct

maxReconnectionAttempts(max_reconnection_attempts): BrokerOptions

Defines the maximum reconnection attempts before it returns an error

ParameterTypeDescription
max_reconnection_attemptslongThe 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

ParameterTypeDescription
nodeStringthe 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.

ParameterTypeDescription
output_idStringThe 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.

ParameterTypeDescription
addressStringThe address we want to get the balance for

getAddressesBalances(addresses): BalanceAddressResponse[]

since we are only checking and already know the addresses.

ParameterTypeDescription
addressesString[]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.

ParameterTypeDescription
output_idsString[]The optional output ids to check for
addressesString[]The optional list of addresses to check for

getMilestone(index): MilestoneResponse

GET /api/v1/milestones/{index} endpoint Get the milestone by the given index.

ParameterTypeDescription
indexlongthe milestone index

getMilestoneUtxoChanges(index): MilestoneUtxoChangesResponse

GET /api/v1/milestones/{index}/utxo-changes endpoint Gets the utxo changes by the given milestone index.

ParameterTypeDescription
indexlongthe 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.

ParameterTypeDescription
indexlongthe 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.

ParameterTypeDescription
transaction_idTransactionIdthe transaction id

postMessage(msg): MessageId

POST /api/v1/messages endpoint

ParameterTypeDescription
msgMessageThe 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.

ParameterTypeDescription
message_idMessageIdThe id of the Message to reattach

reattachUnchecked(message_id): MessageWrap

Reattach a message without checking if it should be reattached

ParameterTypeDescription
message_idMessageIdThe 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.

ParameterTypeDescription
message_idMessageIdThe id of the Message to promote

promoteUnchecked(message_id): MessageWrap

Promote a message without checking if it should be promoted

ParameterTypeDescription
message_idMessageIdThe 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.

ParameterTypeDescription
seedStringthe 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.

ParameterTypeDescription
seedStringssed 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.

ParameterTypeDescription
message_idMessageIdThe id of the Message to include
intervallongThe interval in seconds to try
max_attemptslongThe 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.

ParameterTypeDescription
mnemonicStringThe mmnemonic to turn into a seed

findInputs(addresses, amount): UtxoInput[]

Function to find inputs from addresses for a provided amount (useful for offline signing)

ParameterTypeDescription
addressesString[]The addresses to obtain balance from
amountlongthe amount we need to find

bech32ToHex(bech32): String

Returns a parsed hex String from bech32.

ParameterTypeDescription
bech32StringThe address Bech32 string

hexToBech32(hex, bech32_hrp): String

Transforms a hex encoded address to a bech32 encoded address

ParameterTypeDescription
hexStringThe address Bech32 string
bech32_hrpStringThe Bech32 hrp string

hexPublicKeyToBech32Address(hex, bech32_hrp): String

Transforms a hex encoded public key to a bech32 encoded address

ParameterTypeDescription
hexStringhex encoded public key
bech32_hrpStringThe Bech32 hrp string

isAddressValid(address): boolean

Checks if a str is a valid bech32 encoded address.

ParameterTypeDescription
addressStringThe addresss string to check

parseBech32Address(address): Address

Returns a valid Address parsed from a String.

ParameterTypeDescription
addressStringThe 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

ParameterTypeDescription
seedStringThe seed you used previously
account_indexlongThe account index used, is 0 when you didnt use it
address_indexlongThe address index you want to migrate
pub_addrbooleanIf 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

ParameterTypeDescription
seedStringThe seed you used previously
account_indexlongThe account index used, is 0 when you didnt use it
address_indexlongThe address index you want to migrate
pub_addrbooleanIf it's a public or internal address
to_addressStringThe 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.

ParameterTypeDescription
nodeStringThe node URL

withNodes(nodes): ClientBuilder

Adds a list of IOTA nodes by their URLs.

ParameterTypeDescription
nodesString[]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

ParameterTypeDescription
nodeStringThe node URL
jwtStringThe JWT, can be null
usernameStringThe username, can be null
passwordStringThe 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

ParameterTypeDescription
nodeStringThe node URL
jwtStringThe JWT, can be null
usernameStringThe username, can be null
passwordStringThe 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

ParameterTypeDescription
nodeStringThe node URL
jwtStringThe JWT, can be null
usernameStringThe username, can be null
passwordStringThe 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

ParameterTypeDescription
nodeStringThe node URL
jwtStringThe JWT, can be null
usernameStringThe username, can be null
passwordStringThe password, can be null. Only checked if username is not null

withNodePoolUrls(node_pool_urls): ClientBuilder

Get node list from the node_pool_urls

ParameterTypeDescription
node_pool_urlsString[]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();
ParameterTypeDescription
networkStringThe network we connect to

withNodeSyncInterval(node_sync_interval): ClientBuilder

Set the node sync interval

ParameterTypeDescription
node_sync_intervalfloatThe 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

ParameterTypeDescription
quorumbooleantrue if we use a quorum

withQuorumSize(quorum_size): ClientBuilder

Set amount of nodes which should be used for quorum

ParameterTypeDescription
quorum_sizelongThe amount of nodes

withQuorumThreshold(threshold): ClientBuilder

Set quorum threshold

ParameterTypeDescription
thresholdlongThe percentage of nodes that need to agree (0-100)

withMqttBrokerOptions(options): ClientBuilder

Sets the MQTT broker options.

ParameterTypeDescription
optionsBrokerOptionsthe MQTT options

withLocalPow(local): ClientBuilder

Sets whether the PoW should be done locally or remotely.

ParameterTypeDescription
localbooleanEnables or disables local PoW

withTipsInterval(tips): ClientBuilder

Sets after how many seconds new tips will be requested during PoW

ParameterTypeDescription
tipslongdelay in seconds

withRequestTimeout(timeout): ClientBuilder

Sets the default request timeout in seconds.

ParameterTypeDescription
timeoutfloatThe request timeout in seconds

withApiTimeout(api, timeout): ClientBuilder

Sets the request timeout in seconds for a specific API usage.

ParameterTypeDescription
apiApiThe API we set the timeout for
timeoutfloatThe request timeout in seconds

finish(): Client

Build the Client instance.

ClientException

ClientException(): ClientException

ClientException(errorMessage): ClientException

ParameterTypeDescription
errorMessageString

ClientMessageBuilder

withSeed(seed): ClientMessageBuilder

Sets the seed.

ParameterTypeDescription
seedStringThe seed to use

withAccountIndex(account_index): ClientMessageBuilder

Sets the account index.

ParameterTypeDescription
account_indexlongThe index to set

withInitialAddressIndex(initial_address_index): ClientMessageBuilder

Sets the index of the address to start looking for balance.

ParameterTypeDescription
initial_address_indexlongThe initial index to start address search from

withInput(input): ClientMessageBuilder

Set a custom input(transaction output)

ParameterTypeDescription
inputUtxoInputThe custom input

withInputRange(low, high): ClientMessageBuilder

Set a custom range in which to search for addresses for custom inputs. Default: 0..100

ParameterTypeDescription
lowlongLow end of input range (0)
highlongUpper end of input range (100)

withOutput(address, amount): ClientMessageBuilder

Insert the output address and amount to spent. The amount cannot be zero.

ParameterTypeDescription
addressStringThe address we send to
amountlongThe amount to send (> 0)

withDustAllowanceOutput(address, amount): ClientMessageBuilder

Set a dust allowance transfer to the builder, address needs to be Bech32 encoded

ParameterTypeDescription
addressStringThe Bech32 encoded address we send to
amountlongThe amount to send (> 0)

withOutputHex(address, amount): ClientMessageBuilder

Set a transfer to the builder, address needs to be hex encoded

ParameterTypeDescription
addressStringThe hex encoded address we send to
amountlongThe amount to send (> 0)

withIndexVec(index): ClientMessageBuilder

Set indexation to the builder

ParameterTypeDescription
indexbyte[]The index to use

withIndexString(index): ClientMessageBuilder

Set indexation to the builder

ParameterTypeDescription
indexStringThe index to use

withData(data): ClientMessageBuilder

Set data to the builder

ParameterTypeDescription
databyte[]The data to use

withDataString(data): ClientMessageBuilder

Set data to the builder

ParameterTypeDescription
dataStringThe 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

ParameterTypeDescription
prepared_transaction_dataPreparedTransactionDataThe completely prepared transaction
seedStringThe seed used to prepare the transaction
inputs_range_lowlongLower input used for getting adresses (default: 0)
inputs_range_highlongUpper input used for getting adresses (default: 100)

finish(payload): Message

Consume the builder and return the message made with the specific payload

ParameterTypeDescription
payloadMessagePayloadA prepared and signed MessagePayload

finishTransaction(payload): Message

Consume the builder and return the message made with the specific payload

ParameterTypeDescription
payloadTransactionPayloadA prepared and signed TransactionPayload

finishMilestone(payload): Message

Consume the builder and return the message made with the specific payload

ParameterTypeDescription
payloadMilestonePayloadA prepared and signed MilestonePayload

finishIndex(payload): Message

Consume the builder and return the message made with the specific payload

ParameterTypeDescription
payloadIndexationPayloadA prepared and signed IndexationPayload

finishReceipt(payload): Message

Consume the builder and return the message made with the specific payload

ParameterTypeDescription
payloadReceiptPayloadA prepared and signed ReceiptPayload

finishTreasury(payload): Message

Consume the builder and return the message made with the specific payload

ParameterTypeDescription
payloadTreasuryPayloadA 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.

ParameterTypeDescription
addressStringThe 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.

ParameterTypeDescription
addressStringThe address to get the balance for
optionsOutputsOptionsThe options for finding outputs

GetAddressesBuilder

from(seed): GetAddressesBuilder

Construct a new addressbuilder with a seed. Invalid seeds throw an error

ParameterTypeDescription
seedString

fromOld(seed): GetAddressesBuilder

DEBUG DO NOT USE

ParameterTypeDescription
seedString

withAccountIndex(account_index): GetAddressesBuilder

Set the account index

ParameterTypeDescription
account_indexlong

withRange(start, end): GetAddressesBuilder

Set range to the builder

ParameterTypeDescription
startlong
endlong

withBech32Hrp(bech32_hrp): GetAddressesBuilder

Set bech32 human readable part (hrp)

ParameterTypeDescription
bech32_hrpString

withClient(client): GetAddressesBuilder

Set client to the builder

ParameterTypeDescription
clientClient

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.

ParameterTypeDescription
account_indexlongThe account index to use (Default: 0)

withInitialAddressIndex(initial_address_index): GetBalanceBuilderApi

Sets the index of the address to start looking for balance.

ParameterTypeDescription
initial_address_indexlongThe 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.

ParameterTypeDescription
gap_limitlongThe 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

ParameterTypeDescription
indexStringthe index string

indexVec(index): MessageId[]

GET /api/v1/messages?index={Index} endpoint Consume the builder and search for messages matching the index

ParameterTypeDescription
indexbyte[]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.

ParameterTypeDescription
message_idMessageIdThe 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.

ParameterTypeDescription
message_idMessageIdThe 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.

ParameterTypeDescription
message_idMessageIdThe 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.

ParameterTypeDescription
message_idMessageIdThe 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.

ParameterTypeDescription
indexbyte[]The index
databyte[]The data linked ot this index

fromStrings(index, data): IndexationPayload

Creates a new IndexationPayload from strings

ParameterTypeDescription
indexStringThe index
dataStringThe 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.

ParameterTypeDescription
network_idlongThe network id

parents(parents): MessageBuilder

Adds parents to a MessageBuilder.

ParameterTypeDescription
parentsMessageId[]A list of parents to set

payload(payload): MessageBuilder

Adds a payload to a MessageBuilder.

ParameterTypeDescription
payloadMessagePayloadthe MessagePayload to set

nonceProvider(provider, target_score): MessageBuilder

Sets a provider for the nonce. Can currently only be obtained from Client.getPowProvider

ParameterTypeDescription
providerClientMinerSets the nonce provider
target_scoredoubleTarget score for the nonce, Recommended: 4000

finish(): Message

Finish the MessageBuilder

MessageId

MessageId(): MessageId

fromString(str_rep): MessageId

Create a MessageId from string

ParameterTypeDescription
str_repString

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

ParameterTypeDescription
serialised_dataString

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.

ParameterTypeDescription
hashStringThe hash from the transaction used to receive the funds
outputSignatureLockedSingleOutputthe 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

ParameterTypeDescription
str_repString

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.

ParameterTypeDescription
applicable_public_keysString[]The public keys to use to validate
min_thresholdlongTHe 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

ParameterTypeDescription
eventTopicEvent

MqttManager

withTopic(topic): MqttTopicManager

Add a new topic to the list.

ParameterTypeDescription
topicTopic

withTopics(topics): MqttTopicManager

Add a collection of topics to the list.

ParameterTypeDescription
topicsTopic[]

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.

ParameterTypeDescription
topicTopic

withTopics(topics): MqttTopicManager

Add a collection of topics to the list.

ParameterTypeDescription
topicsTopic[]

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.

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.

ParameterTypeDescription
include_spentboolean

outputType(output_type): void

The output type filter.

ParameterTypeDescription
output_typeOutputKind

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

ParameterTypeDescription
serialised_dataStringThe 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

ParameterTypeDescription
sigSignatureThe signature to verify
bytesbyte[]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

ParameterTypeDescription
bytesbyte[]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.

ParameterTypeDescription
migrated_atlong
lastboolean
fundsMigratedFundsEntry[]
transactionMessagePayload

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.

ParameterTypeDescription
indexintThe 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

ParameterTypeDescription
a0String

encode(a0): String

ParameterTypeDescription
a0byte[]

decode(s): byte[]

ParameterTypeDescription
sString

decode(s): byte[]

ParameterTypeDescription
sbyte[]

RustLogging

init(): void

SecretKey

generate(): SecretKey

Generate a new secret key

fromBytes(bytes): SecretKey

Create a new secret key from the bytes

ParameterTypeDescription
bytesbyte[]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

ParameterTypeDescription
bytesbyte[]the Bytes to sign

Signature

toBytes(): byte[]

Turn the signature into bytes

fromBytes(bs): Signature

Turns bytes into a signature

ParameterTypeDescription
bsbyte[]

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.

ParameterTypeDescription
addressAddressThe address to set
amountlongThe 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.

ParameterTypeDescription
addressAddressThe address to set
amountlongThe 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

ParameterTypeDescription
public_keybyte[]The public ket used for this signature block
signaturebyte[]The signature created for this unlock block

Topic

from(topic): Topic

Creates a new topic and checks if it's valid.

ParameterTypeDescription
topicString

TopicEvent

topic(): String

the MQTT topic.

payload(): String

The MQTT event payload.

TransactionId

fromString(str_rep): TransactionId

Create a TransactionId from string

ParameterTypeDescription
str_repString

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.

ParameterTypeDescription
essenceEssence

withUnlockBlocks(unlock_blocks): TransactionPayloadBuilder

Adds unlock blocks to a TransactionPayloadBuilder.

ParameterTypeDescription
unlock_blocksUnlockBlocks

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

ParameterTypeDescription
idMilestoneIdThe 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

ParameterTypeDescription
amountlongThe 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

ParameterTypeDescription
inputTreasuryInput
outputTreasuryOutput

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

ParameterTypeDescription
unlock_blocksUnlockBlock[]

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.

ParameterTypeDescription
indexlong

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

ParameterTypeDescription
clientClient
seedString
account_indexlong
address_range_lowlong
address_range_highlong

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

ParameterTypeDescription
seedString
bech32_hrpString
account_indexlong
range_lowlong
range_highlong
addressAddress

UtxoInput

Represents an input referencing an output.

from(id, index): UtxoInput

Create a new UtxoInput

ParameterTypeDescription
idTransactionIdThe ouput Id
indexintThe output Index

transactionId(): TransactionId

Returns the TransactionId of the Output.

index(): int

Returns the index of the Output.