Skip to main content
Version: IOTA

Java API Reference

Account

consolidateOutputs(include_dust_allowance_outputs): Message[]

Consolidate account outputs.

ParameterTypeDescription
include_dust_allowance_outputsbooleanWether we include dust outputs or not

transfer(transfer): Message

Send messages.

ParameterTypeDescription
transferTransferA transfer object, can be made using Transfer.builder

retry(message_id): Message

Retry message.

ParameterTypeDescription
message_idMessageIdThe id of the message we want to retry

promote(message_id): Message

Promote message.

ParameterTypeDescription
message_idMessageIdThe id of the message we want to promote

reattach(message_id): Message

Reattach message.

ParameterTypeDescription
message_idMessageIdThe id of the message we want to reattach

generateAddress(): Address

Gets a new unused address and links it to this account.

generateAddresses(amount): Address[]

Gets amount new unused addresses and links them to this account.

ParameterTypeDescription
amountlongThe amount of addresses we generate

getUnusedAddress(): Address

Synchronizes the account addresses with the Tangle and returns the latest address in the account, which is an address without balance.

isLatestAddressUnused(): boolean

Syncs the latest address with the Tangle and determines whether it's unused or not. An unused address is an address without balance and associated message history. Note that such address might have been used in the past, because the message history might have been pruned by the node.

latestAddress(): Address

Returns the most recent address of the account.

balance(): AccountBalance

Gets the account balance information.

setAlias(alias): void

Updates the account alias.

ParameterTypeDescription
aliasStringThe new alias

setClientOptions(options): void

Updates the account's client options.

ParameterTypeDescription
optionsClientOptionsThe new options

listMessages(count, from, message_type): Message[]

Gets a list of transactions on this account. It's fetched from the storage. To ensure the database is updated with the latest transactions, sync should be called first.

// gets 10 received messages, skipping the first 5 most recent messages.
ClientOptions clientOptions = ClientOptionsBuilder::new()
.withNode("https://api.lb-0.h.chrysalis-devnet.iota.cafe")
.build();

AccountManager manager = AccountManager.builder()
.withStorage("./test-storage", null)
.finish();
manager.setStrongholdPassword("password");
manager.storeMnemonic(SignerType.STRONGHOLD, null);

Account account = manager
.createAccount(clientOptions)
.unwrap()
.initialise();
account.listMessages(10, 5, MessageType.RECEIVED));
ParameterTypeDescription
countlongNumber of (most recent) messages to fetch.
fromlongStarting point of the subset to fetch.
message_typeMessageTypeOptional message type filter., can be null

listSpentAddresses(): Address[]

Gets the spent addresses.

listUnspentAddresses(): Address[]

Gets the unspent addresses.

getMessage(message_id): Optional<Message>

Gets a message with the given id associated with this account.

ParameterTypeDescription
message_idMessageIdThe id of the message we want to get

getNodeInfo(node, jwt, username, password): NodeInfoWrapper

Gets the node info from /api/v1/info endpoint TODO: Add auth and url in one NodeInfoOptions struct.

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

alias(): String

The account alias.

bech32Hrp(): String

Returns the address bech32 human readable part.

id(): String

The account identifier.

createdAt(): Calendar

Time of account creation.

sync(): AccountSynchronizer

Returns the builder to setup the process to synchronize this account with the Tangle.

lastSyncedAt(): Optional<Calendar>

Time the account was last synced with the Tangle.

clientOptions(): ClientOptions

The current client options.

AccountBalance

Account balance information.

getTotal(): long

Account's total balance.

getAvailable(): long

For example, if a user with 50i total account balance has made a message spending 20i, the available balance should be (50i-30i) = 20i.

getIncoming(): long

Balances from message with incoming: true. Note that this may not be accurate since the node prunes the messags.

getOutgoing(): long

Balances from message with incoming: false. Note that this may not be accurate since the node prunes the messags.

AccountInitialiser

signerType(signer_type): AccountInitialiser

Sets the account type.

ParameterTypeDescription
signer_typeAccountSignerType

alias(alias): AccountInitialiser

Defines the account alias. If not defined, we'll generate one.

ParameterTypeDescription
aliasString

createdAt(created_at): AccountInitialiser

Time of account creation.

ParameterTypeDescription
created_atlong

messages(messages): AccountInitialiser

Messages associated with the seed. The account can be initialised with locally stored messages.

ParameterTypeDescription
messagesMessage[]

addresses(addresses): AccountInitialiser

Address history associated with the seed. The account can be initialised with locally stored address history.

ParameterTypeDescription
addressesAddress[]

skipPersistence(): AccountInitialiser

Skips storing the account to the database.

allowCreateMultipleEmptyAccounts(): AccountInitialiser

Enables creating multiple accounts without history. The wallet disables it by default to simplify account discovery.

initialise(): Account

Initialises the account.

AccountManager

The account manager.

Used to manage multiple accounts.

Builder(): AccountManagerBuilder

Initialises the account manager builder.

getMigrationData(nodes, seed, permanode, security_level, initial_address_index, gap_limit): MigrationData

Gets the legacy migration data for the seed.

ParameterTypeDescription
nodesString[]List of legacy nodes to connect to
seedStringThe seed we want to get data for
permanodeStringThe legacy permanode URL
security_levelbyteThe seed security level
initial_address_indexlongThe starting index of the seed we searc
gap_limitlongThe maximum gap we cross without finding an address with balance

getMigrationAddress(ledger_prompt, account_id): MigrationAddress

Convert the first address from the first account to a migration tryte address

ParameterTypeDescription
ledger_promptboolean
account_idString

createMigrationBundle(seed, input_address_indexes, options): MigrationBundle

Creates the bundle for migration associated with the given input indexes, Performs bundle mining if the address is spent and mine is true, And signs the bundle. Returns the bundle hash. It logs the operations to $storage_path.join(log_file_name).

ParameterTypeDescription
seedString
input_address_indexeslong[]
optionsMigrationBundleOptions

sendMigrationBundle(nodes, bundle_hash, mwm): void

Sends the migration bundle to the given node. mwm 0 for default(14)

ParameterTypeDescription
nodesString[]
bundle_hashString
mwmshort

startBackgroundSync(polling_interval, automatic_output_consolidation): void

Initialises the background polling and MQTT monitoring.

ParameterTypeDescription
polling_intervalfloatSets the polling interval in seconds
automatic_output_consolidationbooleanIf we automatically consolidate outputs

stopBackgroundSync(): void

Stops the background polling and MQTT monitoring.

setStoragePassword(password): void

Sets the password for the stored accounts.

ParameterTypeDescription
passwordStringThe Storage password

setStrongholdPassword(password): void

Sets the stronghold password.

ParameterTypeDescription
passwordStringThe Stronghold snapshot password

changeStrongholdPassword(current_password, new_password): void

Changes the stronghold password.

ParameterTypeDescription
current_passwordStringThe current Stronghold password
new_passwordStringThe new Stronghold password

isLatestAddressUnused(): boolean

Determines whether all accounts has the latest address unused.

setClientOptions(options): void

Sets the client options for all accounts.

ParameterTypeDescription
optionsClientOptions

storeMnemonic(signer_type, mnemonic): void

Stores a mnemonic for the given signer type. If the mnemonic is not provided, we'll generate one.

ParameterTypeDescription
signer_typeAccountSignerType
mnemonicString

generateMnemonic(): String

Generates a new mnemonic.

verifyMnemonic(mnemonic): void

Checks is the mnemonic is valid. If a mnemonic was generated with generate_mnemonic(), the mnemonic here should match the generated.

ParameterTypeDescription
mnemonicString

createAccount(client_options): AccountInitialiser

Adds a new account.

ParameterTypeDescription
client_optionsClientOptions

removeAccount(account_id): void

Deletes an account.

ParameterTypeDescription
account_idString

syncAccounts(): AccountsSynchronizer

Syncs all accounts.

internalTransfer(from_account_id, to_account_id, amount): Message

Transfers an amount from an account to another.

ParameterTypeDescription
from_account_idString
to_account_idString
amountlong

backup(destination, stronghold_password): Path

Backups the storage to the given destination

ParameterTypeDescription
destinationString
stronghold_passwordString

importAccounts(source, stronghold_password): void

Import backed up accounts.

ParameterTypeDescription
sourceString
stronghold_passwordString

getAccount(account_id): Account

Gets the account associated with the given identifier.

ParameterTypeDescription
account_idString

getAccounts(): Account[]

Gets all accounts from storage.

reattach(account_id, message_id): Message

Reattaches an unconfirmed transaction.

ParameterTypeDescription
account_idString
message_idMessageId

promote(account_id, message_id): Message

Promotes an unconfirmed transaction.

ParameterTypeDescription
account_idString
message_idMessageId

retry(account_id, message_id): Message

Retries an unconfirmed transaction.

ParameterTypeDescription
account_idString
message_idMessageId

AccountManagerBuilder

Account manager builder.

AccountManagerBuilder(): AccountManagerBuilder

Initialises a new instance of the account manager builder with the default storage adapter.

withStorage(storage_path, password): AccountManagerBuilder

Sets the storage config to be used.

ParameterTypeDescription
storage_pathStringThe path where the database file will be saved
passwordStringThe storage password

withPollingInterval(polling_interval): AccountManagerBuilder

Sets the polling interval.

ParameterTypeDescription
polling_intervalfloatthe polling interval in seconds

withSkipPolling(): AccountManagerBuilder

Skip polling

withOutputConsolidationThreshold(threshold): AccountManagerBuilder

Sets the number of outputs an address must have to trigger the automatic consolidation process.

ParameterTypeDescription
thresholdlongThe number of outputs an address must have to trigger the automatic consolidation process

withAutomaticOutputConsolidationDisabled(): AccountManagerBuilder

Disables the automatic output consolidation process.

withSyncSpentOutputs(): AccountManagerBuilder

Enables fetching spent output history on sync.

withEventPersistence(): AccountManagerBuilder

Enables event persistence.

withMultipleEmptyAccounts(): AccountManagerBuilder

Enables creating multiple accounts without history. The wallet disables it by default to simplify account discovery.

finish(): AccountManager

Builds the manager.

AccountSignerType

STRONGHOLD

LEDGER_NANO

LEDGER_NANO_SIMULATOR

AccountSynchronizer

Account sync helper.

gapLimit(limit): AccountSynchronizer

Number of address indexes that are generated.

ParameterTypeDescription
limitlongThe maximum gap we cross without finding an address with balance

skipPersistence(): AccountSynchronizer

Skip saving new messages and addresses on the account object. The found data is returned on the execute call but won't be persisted on the database.

skipChangeAddresses(): AccountSynchronizer

Skip syncing existing change addresses.

addressIndex(address_index): AccountSynchronizer

Initial address index to start syncing.

ParameterTypeDescription
address_indexlongThe starting index

execute(): SyncedAccount

Syncs account with the tangle. The account syncing process ensures that the latest metadata (balance, transactions) associated with an account is fetched from the tangle and is stored locally.

AccountsSynchronizer

The accounts synchronizer.

gapLimit(limit): AccountsSynchronizer

Number of address indexes that are generated.

ParameterTypeDescription
limitlongThe maximum gap we cross without finding an address with balance

addressIndex(address_index): AccountsSynchronizer

Initial address index to start syncing.

ParameterTypeDescription
address_indexlongThe starting index

skipAccountDiscovery(): AccountsSynchronizer

Skips the account discovery process.

skipChangeAddresses(): AccountsSynchronizer

Skip syncing existing change addresses.

accountDiscoveryThreshold(account_discovery_threshold): AccountsSynchronizer

Sets the minimum number of accounts to check on the discovery process.

ParameterTypeDescription
account_discovery_thresholdlongThe minimum accounts number

execute(): SyncedAccount[]

Syncs the accounts with the Tangle.

Actor

iotaInitialize(cb, actor_id, storage_path): void

ParameterTypeDescription
cbActorCallback
actor_idString
storage_pathString

iotaDestroy(actor_id): void

ParameterTypeDescription
actor_idString

iotaSendMessage(message): void

ParameterTypeDescription
messageString

iotaListen(actor_id, id, event): void

ParameterTypeDescription
actor_idString
idString
eventEventType

iotaInitLogger(file_name): void

ParameterTypeDescription
file_nameString

ActorCallback

onEvent(event): void

ParameterTypeDescription
eventString

Address

An address.

builder(): AddressBuilder

Gets a new instance of the address builder.

balance(): long

Address total balance

readable(): String

the Bech32 human readable part.

address(): AddressWrapper

The address.

AddressBuilder

address(address): AddressBuilder

Defines the address.

ParameterTypeDescription
addressAddressWrapper

keyIndex(key_index): AddressBuilder

Sets the address key index.

ParameterTypeDescription
key_indexlong

outputs(outputs): AddressBuilder

Sets the address outputs.

ParameterTypeDescription
outputsAddressOutput[]

internal(internal): AddressBuilder

Sets the internal flag.

ParameterTypeDescription
internalboolean

build(): Address

Builds the address.

AddressConsolidationNeededEvent

The address consolidation needed data.

accountId(): String

The associated account identifier.

address(): AddressWrapper

The associated address.

AddressConsolidationNeededListener

onAddressConsolidationNeeded(event): void

ParameterTypeDescription
eventAddressConsolidationNeededEvent

AddressData

Address data for TransferProgressType.GeneratingRemainderDepositAddress and LedgerAddressGeneration.

address(): String

The address.

AddressOutput

An Address output.

transactionId(): TransactionId

Transaction ID of the output

setTransactionId(transaction_id): void

ParameterTypeDescription
transaction_idTransactionId

messageId(): MessageId

Message ID of the output

setMessageId(message_id): void

ParameterTypeDescription
message_idMessageId

index(): int

Output index.

setIndex(index): void

ParameterTypeDescription
indexint

amount(): long

Output amount.

setAmount(amount): void

ParameterTypeDescription
amountlong

isSpent(): boolean

Spend status of the output,

setSpent(is_spent): void

ParameterTypeDescription
is_spentboolean

address(): AddressWrapper

Associated address.

setAddress(address): void

ParameterTypeDescription
addressAddressWrapper

kind(): OutputKind

Output kind.

setKind(kind): void

ParameterTypeDescription
kindOutputKind

AddressWrapper

from(address, bech32_hrp): AddressWrapper

Create an Address based on its address and Bech segments

ParameterTypeDescription
addressStringThe Address segment
bech32_hrpStringthe bech segment

parse(address): AddressWrapper

parse a fully functional address string into an AddressWrapper

ParameterTypeDescription
addressStringThe address we will parse

toBech32(): String

Get the bech segment of the address

Api

GET_TIPS

get_tips API

POST_MESSAGE

post_message API

GET_OUTPUT

get_output API

GET_BALANCE

get_balance API

BalanceChange

The balance change event payload.

isSpent(): boolean

Checks if spent was more than 0

spent(): long

The change amount if it was a spent event.

received(): long

The change amount if it was a receive event.

BalanceChangeListener

onBalanceChange(event): void

ParameterTypeDescription
eventBalanceEvent

BalanceEvent

The balance change event data.

indexationId(): String

Event unique identifier.

accountId(): String

The associated account identifier.

messageId(): Optional<MessageId>

The message id associated with the balance change. Note that this might be empty without AccountManagerBuilder#withSyncSpentOutputs

address(): AddressWrapper

The associated address.

remainder(): Optional<Boolean>

Whether the event is associated with a remainder output or not. Note that this might be empty if we couldn't get the message object from the node.

balanceChange(): BalanceChange

The balance change data.

BroadcastTransactionListener

onBroadcastTransaction(event): void

ParameterTypeDescription
eventTransactionEvent

BroadcastingBundle

Broadcasting the given bundle hash.

getBundleHash(): String

The bundle hash.

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

ClientOptions

The client options type.

ClientOptionsBuilder

The options builder for a client connected to multiple nodes.

ClientOptionsBuilder(): ClientOptionsBuilder

Initialises a new instance of the builder.

withPrimaryNode(node): ClientOptionsBuilder

Sets the primary node.

ParameterTypeDescription
nodeStringThe node URL

withPrimaryNodeAuth(node, jwt, username, password): ClientOptionsBuilder

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): ClientOptionsBuilder

Sets the primary PoW node.

ParameterTypeDescription
nodeString

withPrimaryPowNodeAuth(node, jwt, username, password): ClientOptionsBuilder

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

withNode(node): ClientOptionsBuilder

Adds a node to the node list.

ParameterTypeDescription
nodeStringThe node URL

withNodes(nodes): ClientOptionsBuilder

ClientOptions connected to a list of nodes.

ParameterTypeDescription
nodesString[]The list of node URLs

withNodePoolUrls(node_pool_urls): ClientOptionsBuilder

Get node list from the node_pool_urls

ParameterTypeDescription
node_pool_urlsString[]node_pool_urls list of node URLs for the node pool

withNetwork(network): ClientOptionsBuilder

ClientOptions connected to the default Network pool.

import org.iota.wallet.ClientOptionsBuilder;
ClientOptions clientOptions = new ClientOptionsBuilder().with_network("testnet2").build();
ParameterTypeDescription
networkStringThe network we connect to

withNodeSyncInterval(node_sync_interval): ClientOptionsBuilder

Set the node sync interval

ParameterTypeDescription
node_sync_intervalfloatThe interval in seconds

withNodeSyncDisabled(): ClientOptionsBuilder

Disables the node syncing process. Every node will be considered healthy and ready to use.

withMqttBrokerOptions(options): ClientOptionsBuilder

Sets the MQTT broker options.

ParameterTypeDescription
optionsBrokerOptionsthe MQTT options

withMqttDisabled(): ClientOptionsBuilder

Disables MQTT

withLocalPow(local): ClientOptionsBuilder

Sets whether the PoW should be done locally or remotely.

ParameterTypeDescription
localbooleanEnables or disables local PoW

withRequestTimeout(timeout): ClientOptionsBuilder

Sets the request timeout.

ParameterTypeDescription
timeoutfloatThe request timeout in seconds

withApiTimeout(api, timeout): ClientOptionsBuilder

Sets the request timeout for a specific API usage.

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

build(): ClientOptions

Builds the options.

ErrorListener

onError(error): void

ParameterTypeDescription
errorString

Essence

asRegular(): RegularEssence

EventId

The event identifier type.

EventManager

subscribeErrors(cb): EventId

Listen to errors.

ParameterTypeDescription
cbErrorListener

subscribeNewTransaction(cb): EventId

Listen to new messages.

ParameterTypeDescription
cbNewTransactionListener

subscribeConfirmationStateChange(cb): EventId

Listen to transaction confirmation state change.

ParameterTypeDescription
cbTransactionConfirmationChangeListener

subscribeReattachment(cb): EventId

Listen to transaction reattachment change.

ParameterTypeDescription
cbReattachTransactionListener

subscribeBroadcast(cb): EventId

Listen to transaction broadcast.

ParameterTypeDescription
cbBroadcastTransactionListener

subscribeTransferProgress(cb): EventId

Listen to a transfer event.

ParameterTypeDescription
cbTransferProgressListener

subscribeMigrationProgress(cb): EventId

Listen to a migration event.

ParameterTypeDescription
cbMigrationProgressListener

subscribeBalanceChange(cb): EventId

Listen to balance changes.

ParameterTypeDescription
cbBalanceChangeListener

subscribeStrongholdStatusChange(cb): EventId

Listen to stronghold status change events.

ParameterTypeDescription
cbStrongholdStatusListener

subscribeAddressConsolidationNeeded(cb): EventId

Listen to address consolidation needed events.

ParameterTypeDescription
cbAddressConsolidationNeededListener

removeErrorListener(event): void

Removes the error listener associated with the given identifier.

ParameterTypeDescription
eventEventIdThe ID of the listener we want to remove

removeNewTransactionListener(event): void

Removes the new transaction listener associated with the given identifier.

ParameterTypeDescription
eventEventIdThe ID of the listener we want to remove

removeConfirmationStateChangeListener(event): void

Removes the new confirmation state change listener associated with the given identifier.

ParameterTypeDescription
eventEventIdThe ID of the listener we want to remove

removeReattachmentListener(event): void

Removes the reattachment listener associated with the given identifier.

ParameterTypeDescription
eventEventIdThe ID of the listener we want to remove

removeBroadcastListener(event): void

Removes the broadcast listener associated with the given identifier.

ParameterTypeDescription
eventEventIdThe ID of the listener we want to remove

removeTransferProgressListener(event): void

Remove a transfer event listener.

ParameterTypeDescription
eventEventIdThe ID of the listener we want to remove

removeMigrationProgressListener(event): void

ParameterTypeDescription
eventEventIdThe ID of the listener we want to remove Remove a migration event listener.

removeBalanceChangeListener(event): void

Removes the balance change listener associated with the given identifier.

ParameterTypeDescription
eventEventIdThe ID of the listener we want to remove

removeStrongholdStatusChangeListener(event): void

Removes the stronghold status change listener associated with the given identifier.

ParameterTypeDescription
eventEventIdThe ID of the listener we want to remove

removeAddressConsolidationNeededListener(event): void

Removes the balance change listener associated with the given identifier.

ParameterTypeDescription
eventEventIdThe ID of the listener we want to remove

EventType

ERROR_THROWN

BALANCE_CHANGE

NEW_TRANSACTION

CONFIRMATION_STATE_CHANGE

REATTACHMENT

BROADCAST

STRONGHOLD_STATUS_CHANGE

TRANSFER_PROGRESS

MIGRATION_PROGRESS

FetchingMigrationData

Fetching migration data on the given address range.

getInitialAddressIndex(): long

The initial address index on the fetch range.

getFinalAddressIndex(): long

The final address index on the fetch range.

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 indexMilestoneSignature

index(): byte[]

Returns the index of an IndexationPayload.

data(): byte[]

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

InputData

Address can be used as input to spend balance

address(): String

Input address

securityLvl(): short

Security level

balance(): long

Balance of the address

index(): long

Index of the address

spent(): boolean

Spent status

spentBundlehashes(): String[]

Spent bundlehashes

InputKind

UTXO

TREASURY

Message

id(): MessageId

version(): long

parents(): MessageId[]

payloadLength(): long

payload(): Optional<MessagePayload>

timestamp(): Date

nonce(): long

confirmed(): Optional<Boolean>

broadcasted(): boolean

MessageId

MessageId(): MessageId

fromString(str_rep): MessageId

ParameterTypeDescription
str_repString

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

MessageType

RECEIVED

SENT

FAILED

UNCONFIRMED

VALUE

CONFIRMED

MigratedFundsEntry

tailTransactionHash(): String

Returns the tail transaction hash of a MigratedFundsEntry.

output(): SignatureLockedSingleOutput

Returns the output of a MigratedFundsEntry.

MigrationAddress

Migration address

trytes(): String

address tryte encoded

bech32(): String

address bech32 encoded

MigrationBundle

Migration bundle.

crackability(): double

The bundle crackability if it was mined.

getBundleHash(): String

The bundle hash.

MigrationBundleOptions

Finds account data for the migration from legacy network.

MigrationBundleOptions(): MigrationBundleOptions

setMine(node): void

ParameterTypeDescription
nodeboolean

mine(): boolean

setTimeouts(secs): void

Sets the timeout in seconds, negative to set default

ParameterTypeDescription
secslong

timeouts(): long

Returns the set timeout, defaults to 10 minutes

setOffset(offset): void

ParameterTypeDescription
offsetLong

offset(): OptionalLong

setLogFileName(log_file_name): void

ParameterTypeDescription
log_file_nameString

logFileName(): Optional<String>

MigrationData

Migration data.

balance(): long

Total seed balance.

lastCheckedAddressIndex(): long

The index of the last checked address. Useful if you want to call the finder again.

inputs(): InputData[]

Migration inputs.

spentAddresses(): boolean

If any of the inputs are spent

MigrationProgressEvent

Type container for handling the different Migration events.

getType(): MigrationProgressType

asFetchingMigrationData(): FetchingMigrationData

asMiningBundle(): MiningBundle

asSigningBundle(): SigningBundle

asBroadcastingBundle(): BroadcastingBundle

asTransactionConfirmed(): TransactionConfirmed

MigrationProgressListener

onMigrationProgress(event): void

ParameterTypeDescription
eventMigrationProgressEvent

MigrationProgressType

Migration event type.

FETCHING_MIGRATION_DATA

Fetching migration data on the given address range.

MINING_BUNDLE

Mining the bundle with the given spent address.

SIGNING_BUNDLE

Signing the bundle.

BROADCASTING_BUNDLE

Broadcasting the given bundle hash.

TRANSACTION_CONFIRMED

Transaction confirmation event.

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.

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.

MilestoneSignature

getSignature(): byte[]

Gets the signature of the milestone

MiningBundle

Mining the bundle with the given spent address.

getAddress(): String

The spent address.

NativeAPI

The NativeAPI class, which houses all entrypoints to the shared library.

NewTransactionListener

onNewTransaction(event): void

ParameterTypeDescription
eventTransactionEvent

NodeInfoWrapper

url(): String

Get the URL from which this info is derived

nodeInfo(): InfoResponse

Get the information

OutputKind

NONE

SIGNATURE_LOCKED_SINGLE

SIGNATURE_LOCKED_DUST_ALLOWANCE

TREASURY

PreparedTransactionData

Prepared transaction event data.

inputs(): TransactionIO[]

Transaction inputs.

outputs(): TransactionIO[]

Transaction outputs.

data(): Optional<String>

The indexation data.

PublicKey

verify(sig, msg): boolean

Verify the signature and bytes against this public key

ParameterTypeDescription
sigSignatureThe signature to verify
msgbyte[]The bytes to verify

toBytes(): byte[]

Turns ths public key into bytes

tryFromBytes(bs): PublicKey

Attempt to create a public key from the provided bytes

ParameterTypeDescription
bsbyte[]

ReattachTransactionListener

onReattachTransaction(event): void

ParameterTypeDescription
eventTransactionReattachmentEvent

ReceiptPayload

migratedAt(): long

The milestone index at which the funds of a ReceiptPayload were migrated

last(): boolean

Whether a ReceiptPayload is the final one for a given migrated at index.

funds(): MigratedFundsEntry[]

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(): TransactionInput[]

Gets the transaction inputs.

outputs(): TransactionOutput[]

Gets the transaction outputs.

payload(): Optional<IndexationPayload>

internal(): boolean

Whether the transaction is between the mnemonic accounts or not.

incoming(): boolean

Whether the transaction is incoming or outgoing.

value(): long

The transactions's value.

remainderValue(): long

The transactions's remainder value sum.

RemainderValueStrategy

REUSE_ADDRESS

CHANGE_ADDRESS

RustHex

encode(a0): String

ParameterTypeDescription
a0String

decode(s): byte[]

ParameterTypeDescription
sString

RustLogging

init(): void

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
addressAddressWrapperThe address to set
amountlongThe amount to set

amount(): long

Returns the amount of a SignatureLockedDustAllowanceOutput.

address(): AddressWrapper

Returns the address of a SignatureLockedDustAllowanceOutput.

SignatureLockedSingleOutput

Describes a deposit to a single address which is unlocked via a signature.

from(address, amount, remainder): SignatureLockedSingleOutput

Creates a new SignatureLockedSingleOutput.

ParameterTypeDescription
addressAddressWrapperThe address to set
amountlongThe amount to set
remainderbooleanif this output allows remainder

amount(): long

Returns the amount of a SignatureLockedSingleOutput.

address(): AddressWrapper

Returns the address of a SignatureLockedSingleOutput.

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

SigningBundle

Signing the bundle.

getAddresses(): String[]

The addresses associated with the bundle.

StrongholdStatusEvent

snapshotPath(): Path

status(): StrongholdStatusType

unlockedDuration(): Duration

StrongholdStatusListener

onStrongholdStatusChange(event): void

ParameterTypeDescription
eventStrongholdStatusEvent

StrongholdStatusType

UNLOCKED

LOCKED

SyncedAccount

deposit_address(): Address

Get a deposit address guaranteed to be valid after having synced

TransactionConfirmationChangeEvent

A transaction confirmation state change event data.

indexationId(): String

Event unique identifier.

accountId(): String

The associated account identifier.

message(): Message

The event message.

confirmed(): boolean

The confirmed state of the transaction.

TransactionConfirmationChangeListener

onConfirmationStateChange(event): void

ParameterTypeDescription
eventTransactionConfirmationChangeEvent

TransactionConfirmed

Transaction confirmation event.

getBundleHash(): String

The bundle hash.

TransactionEvent

A transaction-related event data.

indexationId(): String

Event unique identifier.

accountId(): String

The associated account identifier.

message(): Message

The event message.

TransactionIO

Input or output data for PreparedTransactionData

address(): String

Address

amount(): long

Amount

remainder(): Optional<Boolean>

Remainder

TransactionId

fromString(str_rep): TransactionId

ParameterTypeDescription
str_repString

TransactionInput

kind(): InputKind

asUtxo(): UtxoInput

asTreasury(): TreasuryInput

TransactionOutput

kind(): OutputKind

asSignatureLockedSingleOutput(): SignatureLockedSingleOutput

asSignatureLockedDustAllowanceOutput(): SignatureLockedDustAllowanceOutput

asTreasuryOutput(): TreasuryOutput

TransactionPayload

essence(): Essence

Return the essence of a TransactionPayload.

unlockBlocks(): UnlockBlock[]

Return unlock blocks of a TransactionPayload.

TransactionReattachmentEvent

Transaction reattachment event data.

indexationId(): String

Event unique identifier.

accountId(): String

The associated account identifier.

message(): Message

The event message.

reattachedMessageId(): MessageId

The id of the message that was reattached.

Transfer

builder(address, amount, output_kind): TransferBuilder

Creates a new Builder for making a Transfer object

ParameterTypeDescription
addressAddressWrapperThe addres we want to send to
amountlongThe amount we want to send
output_kindOutputKindThe kind of output we wish to use, can be OutputKind.NONE

TransferBuilder

TransferBuilder(address, amount, output_kind): TransferBuilder

Initialises a new transfer to the given address.

ParameterTypeDescription
addressAddressWrapperThe addres we want to send to
amountlongThe amount we want to send
output_kindOutputKindThe kind of output we wish to use

newFromOutputs(outputs): TransferBuilder

Creates a transfer with multiple outputs.

ParameterTypeDescription
outputsTransferOutput[]List of outputs

withRemainderValueStrategy(strategy): TransferBuilder

Sets the remainder value strategy for the transfer.

ParameterTypeDescription
strategyRemainderValueStrategyThe type of strategy we use to handle the remainder

withRemainderToAccountWithAddress(address): TransferBuilder

Move the remainder value to an address that must belong to the source account.

ParameterTypeDescription
addressAddressWrapperThe address we send the remainder t o

withIndexation(indexation): TransferBuilder

(Optional) message indexation.

ParameterTypeDescription
indexationIndexationPayloadBuild a transfer with this specific payload

withSkipSync(): TransferBuilder

Skip account syncing before transferring.

finish(): Transfer

Builds the transfer.

TransferOutput

Transfer output.

TransferOutput(address, amount, output_kind): TransferOutput

Transfer output

ParameterTypeDescription
addressAddressWrapperThe addres we want to send to
amountlongThe amount we want to send
output_kindOutputKindThe kind of output we wish to use. Default used is SIGNATURE_LOCKED_SINGLE

getAmount(): long

The output value.

getAddress(): AddressWrapper

The output address.

getOutputKind(): OutputKind

The output type

TransferProgress

Type container for handling the different TransferProgress events.

getType(): TransferProgressType

asPreparedTransaction(): PreparedTransactionData

asGeneratingRemainderDepositAddress(): AddressData

TransferProgressListener

onTransferProgress(event): void

ParameterTypeDescription
eventWalletTransferProgress

TransferProgressType

Transfer event data.

SYNCING_ACCOUNT

Syncing account.

SELECTING_INPUTS

Performing input selection.

GENERATING_REMAINDER_DEPOST_ADDRESS

Generating remainder value deposit address.

PREPARED_TRANSACTION

Prepared transaction.

SIGNING_TRANSACTION

Signing the transaction.

PERFORMING_POW

Performing PoW.

BROADCASTING

Broadcasting.

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

from(amount): TreasuryOutput

Creates a new TreasuryOutput with the amount supplied

ParameterTypeDescription
amountlong

amount(): long

Returns the amount of a TreasuryOutput.

TreasuryPayload

output(): TreasuryOutput

input(): TreasuryInput

UnlockBlock

kind(): UnlockBlockKind

asReference(): ReferenceUnlock

asSignature(): SignatureUnlock

UnlockBlockKind

ED25519

REFERENCE

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.

Value

Value(value, unit): Value

ParameterTypeDescription
valuelong
unitValueUnit

withDenomination(): String

withoutDenomination(): long

value(): long

ValueUnit

I

Ki

Mi

Gi

Ti

Pi

WalletException

WalletException(): WalletException

WalletException(errorMessage): WalletException

ParameterTypeDescription
errorMessageString

WalletTransferProgress

accountId(): String

The associated account identifier.

event(): TransferProgress

Get the event linked to this progress