Java API Reference
Account
consolidateOutputs(include_dust_allowance_outputs): Message[]
Consolidate account outputs.
Parameter | Type | Description |
---|---|---|
include_dust_allowance_outputs | boolean | Wether we include dust outputs or not |
transfer(transfer): Message
Send messages.
Parameter | Type | Description |
---|---|---|
transfer | Transfer | A transfer object, can be made using Transfer.builder |
retry(message_id): Message
Retry message.
Parameter | Type | Description |
---|---|---|
message_id | MessageId | The id of the message we want to retry |
promote(message_id): Message
Promote message.
Parameter | Type | Description |
---|---|---|
message_id | MessageId | The id of the message we want to promote |
reattach(message_id): Message
Reattach message.
Parameter | Type | Description |
---|---|---|
message_id | MessageId | The 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.
Parameter | Type | Description |
---|---|---|
amount | long | The 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.
Parameter | Type | Description |
---|---|---|
alias | String | The new alias |
setClientOptions(options): void
Updates the account's client options.
Parameter | Type | Description |
---|---|---|
options | ClientOptions | The 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));
Parameter | Type | Description |
---|---|---|
count | long | Number of (most recent) messages to fetch. |
from | long | Starting point of the subset to fetch. |
message_type | MessageType | Optional 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.
Parameter | Type | Description |
---|---|---|
message_id | MessageId | The 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.
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 |
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.
Parameter | Type | Description |
---|---|---|
signer_type | AccountSignerType |
alias(alias): AccountInitialiser
Defines the account alias. If not defined, we'll generate one.
Parameter | Type | Description |
---|---|---|
alias | String |
createdAt(created_at): AccountInitialiser
Time of account creation.
Parameter | Type | Description |
---|---|---|
created_at | long |
messages(messages): AccountInitialiser
Messages associated with the seed. The account can be initialised with locally stored messages.
Parameter | Type | Description |
---|---|---|
messages | Message[] |
addresses(addresses): AccountInitialiser
Address history associated with the seed. The account can be initialised with locally stored address history.
Parameter | Type | Description |
---|---|---|
addresses | Address[] |
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.
Parameter | Type | Description |
---|---|---|
nodes | String[] | List of legacy nodes to connect to |
seed | String | The seed we want to get data for |
permanode | String | The legacy permanode URL |
security_level | byte | The seed security level |
initial_address_index | long | The starting index of the seed we searc |
gap_limit | long | The 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
Parameter | Type | Description |
---|---|---|
ledger_prompt | boolean | |
account_id | String |
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)
.
Parameter | Type | Description |
---|---|---|
seed | String | |
input_address_indexes | long[] | |
options | MigrationBundleOptions |
sendMigrationBundle(nodes, bundle_hash, mwm): void
Sends the migration bundle to the given node. mwm 0 for default(14)
Parameter | Type | Description |
---|---|---|
nodes | String[] | |
bundle_hash | String | |
mwm | short |
startBackgroundSync(polling_interval, automatic_output_consolidation): void
Initialises the background polling and MQTT monitoring.
Parameter | Type | Description |
---|---|---|
polling_interval | float | Sets the polling interval in seconds |
automatic_output_consolidation | boolean | If we automatically consolidate outputs |
stopBackgroundSync(): void
Stops the background polling and MQTT monitoring.
setStoragePassword(password): void
Sets the password for the stored accounts.
Parameter | Type | Description |
---|---|---|
password | String | The Storage password |
setStrongholdPassword(password): void
Sets the stronghold password.
Parameter | Type | Description |
---|---|---|
password | String | The Stronghold snapshot password |
changeStrongholdPassword(current_password, new_password): void
Changes the stronghold password.
Parameter | Type | Description |
---|---|---|
current_password | String | The current Stronghold password |
new_password | String | The new Stronghold password |
isLatestAddressUnused(): boolean
Determines whether all accounts has the latest address unused.
setClientOptions(options): void
Sets the client options for all accounts.
Parameter | Type | Description |
---|---|---|
options | ClientOptions |
storeMnemonic(signer_type, mnemonic): void
Stores a mnemonic for the given signer type. If the mnemonic is not provided, we'll generate one.
Parameter | Type | Description |
---|---|---|
signer_type | AccountSignerType | |
mnemonic | String |
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.
Parameter | Type | Description |
---|---|---|
mnemonic | String |
createAccount(client_options): AccountInitialiser
Adds a new account.
Parameter | Type | Description |
---|---|---|
client_options | ClientOptions |
removeAccount(account_id): void
Deletes an account.
Parameter | Type | Description |
---|---|---|
account_id | String |
syncAccounts(): AccountsSynchronizer
Syncs all accounts.
internalTransfer(from_account_id, to_account_id, amount): Message
Transfers an amount from an account to another.
Parameter | Type | Description |
---|---|---|
from_account_id | String | |
to_account_id | String | |
amount | long |
backup(destination, stronghold_password): Path
Backups the storage to the given destination
Parameter | Type | Description |
---|---|---|
destination | String | |
stronghold_password | String |
importAccounts(source, stronghold_password): void
Import backed up accounts.
Parameter | Type | Description |
---|---|---|
source | String | |
stronghold_password | String |
getAccount(account_id): Account
Gets the account associated with the given identifier.
Parameter | Type | Description |
---|---|---|
account_id | String |
getAccounts(): Account[]
Gets all accounts from storage.
reattach(account_id, message_id): Message
Reattaches an unconfirmed transaction.
Parameter | Type | Description |
---|---|---|
account_id | String | |
message_id | MessageId |
promote(account_id, message_id): Message
Promotes an unconfirmed transaction.
Parameter | Type | Description |
---|---|---|
account_id | String | |
message_id | MessageId |
retry(account_id, message_id): Message
Retries an unconfirmed transaction.
Parameter | Type | Description |
---|---|---|
account_id | String | |
message_id | MessageId |
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.
Parameter | Type | Description |
---|---|---|
storage_path | String | The path where the database file will be saved |
password | String | The storage password |
withPollingInterval(polling_interval): AccountManagerBuilder
Sets the polling interval.
Parameter | Type | Description |
---|---|---|
polling_interval | float | the 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.
Parameter | Type | Description |
---|---|---|
threshold | long | The 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.
Parameter | Type | Description |
---|---|---|
limit | long | The 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.
Parameter | Type | Description |
---|---|---|
address_index | long | The 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.
Parameter | Type | Description |
---|---|---|
limit | long | The maximum gap we cross without finding an address with balance |
addressIndex(address_index): AccountsSynchronizer
Initial address index to start syncing.
Parameter | Type | Description |
---|---|---|
address_index | long | The 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.
Parameter | Type | Description |
---|---|---|
account_discovery_threshold | long | The minimum accounts number |
execute(): SyncedAccount[]
Syncs the accounts with the Tangle.
Actor
iotaInitialize(cb, actor_id, storage_path): void
Parameter | Type | Description |
---|---|---|
cb | ActorCallback | |
actor_id | String | |
storage_path | String |
iotaDestroy(actor_id): void
Parameter | Type | Description |
---|---|---|
actor_id | String |
iotaSendMessage(message): void
Parameter | Type | Description |
---|---|---|
message | String |
iotaListen(actor_id, id, event): void
Parameter | Type | Description |
---|---|---|
actor_id | String | |
id | String | |
event | EventType |
iotaInitLogger(file_name): void
Parameter | Type | Description |
---|---|---|
file_name | String |
ActorCallback
onEvent(event): void
Parameter | Type | Description |
---|---|---|
event | String |
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.
Parameter | Type | Description |
---|---|---|
address | AddressWrapper |
keyIndex(key_index): AddressBuilder
Sets the address key index.
Parameter | Type | Description |
---|---|---|
key_index | long |
outputs(outputs): AddressBuilder
Sets the address outputs.
Parameter | Type | Description |
---|---|---|
outputs | AddressOutput[] |
internal(internal): AddressBuilder
Sets the internal
flag.
Parameter | Type | Description |
---|---|---|
internal | boolean |
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
Parameter | Type | Description |
---|---|---|
event | AddressConsolidationNeededEvent |
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
Parameter | Type | Description |
---|---|---|
transaction_id | TransactionId |
messageId(): MessageId
Message ID of the output
setMessageId(message_id): void
Parameter | Type | Description |
---|---|---|
message_id | MessageId |
index(): int
Output index.
setIndex(index): void
Parameter | Type | Description |
---|---|---|
index | int |
amount(): long
Output amount.
setAmount(amount): void
Parameter | Type | Description |
---|---|---|
amount | long |
isSpent(): boolean
Spend status of the output,
setSpent(is_spent): void
Parameter | Type | Description |
---|---|---|
is_spent | boolean |
address(): AddressWrapper
Associated address.
setAddress(address): void
Parameter | Type | Description |
---|---|---|
address | AddressWrapper |
kind(): OutputKind
Output kind.
setKind(kind): void
Parameter | Type | Description |
---|---|---|
kind | OutputKind |
AddressWrapper
from(address, bech32_hrp): AddressWrapper
Create an Address based on its address and Bech segments
Parameter | Type | Description |
---|---|---|
address | String | The Address segment |
bech32_hrp | String | the bech segment |
parse(address): AddressWrapper
parse a fully functional address string into an AddressWrapper
Parameter | Type | Description |
---|---|---|
address | String | The 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
Parameter | Type | Description |
---|---|---|
event | BalanceEvent |
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
Parameter | Type | Description |
---|---|---|
event | TransactionEvent |
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.
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 |
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.
Parameter | Type | Description |
---|---|---|
node | String | The 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
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): ClientOptionsBuilder
Sets the primary PoW node.
Parameter | Type | Description |
---|---|---|
node | String |
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
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 |
withNode(node): ClientOptionsBuilder
Adds a node to the node list.
Parameter | Type | Description |
---|---|---|
node | String | The node URL |
withNodes(nodes): ClientOptionsBuilder
ClientOptions connected to a list of nodes.
Parameter | Type | Description |
---|---|---|
nodes | String[] | The list of node URLs |
withNodePoolUrls(node_pool_urls): ClientOptionsBuilder
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 |
withNetwork(network): ClientOptionsBuilder
ClientOptions connected to the default Network pool.
import org.iota.wallet.ClientOptionsBuilder;
ClientOptions clientOptions = new ClientOptionsBuilder().with_network("testnet2").build();
Parameter | Type | Description |
---|---|---|
network | String | The network we connect to |
withNodeSyncInterval(node_sync_interval): ClientOptionsBuilder
Set the node sync interval
Parameter | Type | Description |
---|---|---|
node_sync_interval | float | The 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.
Parameter | Type | Description |
---|---|---|
options | BrokerOptions | the MQTT options |
withMqttDisabled(): ClientOptionsBuilder
Disables MQTT
withLocalPow(local): ClientOptionsBuilder
Sets whether the PoW should be done locally or remotely.
Parameter | Type | Description |
---|---|---|
local | boolean | Enables or disables local PoW |
withRequestTimeout(timeout): ClientOptionsBuilder
Sets the request timeout.
Parameter | Type | Description |
---|---|---|
timeout | float | The request timeout in seconds |
withApiTimeout(api, timeout): ClientOptionsBuilder
Sets the request timeout for a specific API usage.
Parameter | Type | Description |
---|---|---|
api | Api | The API we set the timeout for |
timeout | float | The request timeout in seconds |
build(): ClientOptions
Builds the options.
ErrorListener
onError(error): void
Parameter | Type | Description |
---|---|---|
error | String |
Essence
asRegular(): RegularEssence
EventId
The event identifier type.
EventManager
subscribeErrors(cb): EventId
Listen to errors.
Parameter | Type | Description |
---|---|---|
cb | ErrorListener |
subscribeNewTransaction(cb): EventId
Listen to new messages.
Parameter | Type | Description |
---|---|---|
cb | NewTransactionListener |
subscribeConfirmationStateChange(cb): EventId
Listen to transaction confirmation state change.
Parameter | Type | Description |
---|---|---|
cb | TransactionConfirmationChangeListener |
subscribeReattachment(cb): EventId
Listen to transaction reattachment change.
Parameter | Type | Description |
---|---|---|
cb | ReattachTransactionListener |
subscribeBroadcast(cb): EventId
Listen to transaction broadcast.
Parameter | Type | Description |
---|---|---|
cb | BroadcastTransactionListener |
subscribeTransferProgress(cb): EventId
Listen to a transfer event.
Parameter | Type | Description |
---|---|---|
cb | TransferProgressListener |
subscribeMigrationProgress(cb): EventId
Listen to a migration event.
Parameter | Type | Description |
---|---|---|
cb | MigrationProgressListener |
subscribeBalanceChange(cb): EventId
Listen to balance changes.
Parameter | Type | Description |
---|---|---|
cb | BalanceChangeListener |
subscribeStrongholdStatusChange(cb): EventId
Listen to stronghold status change events.
Parameter | Type | Description |
---|---|---|
cb | StrongholdStatusListener |
subscribeAddressConsolidationNeeded(cb): EventId
Listen to address consolidation needed
events.
Parameter | Type | Description |
---|---|---|
cb | AddressConsolidationNeededListener |
removeErrorListener(event): void
Removes the error listener associated with the given identifier.
Parameter | Type | Description |
---|---|---|
event | EventId | The ID of the listener we want to remove |
removeNewTransactionListener(event): void
Removes the new transaction listener associated with the given identifier.
Parameter | Type | Description |
---|---|---|
event | EventId | The ID of the listener we want to remove |
removeConfirmationStateChangeListener(event): void
Removes the new confirmation state change listener associated with the given identifier.
Parameter | Type | Description |
---|---|---|
event | EventId | The ID of the listener we want to remove |
removeReattachmentListener(event): void
Removes the reattachment listener associated with the given identifier.
Parameter | Type | Description |
---|---|---|
event | EventId | The ID of the listener we want to remove |
removeBroadcastListener(event): void
Removes the broadcast listener associated with the given identifier.
Parameter | Type | Description |
---|---|---|
event | EventId | The ID of the listener we want to remove |
removeTransferProgressListener(event): void
Remove a transfer event listener.
Parameter | Type | Description |
---|---|---|
event | EventId | The ID of the listener we want to remove |
removeMigrationProgressListener(event): void
Parameter | Type | Description |
---|---|---|
event | EventId | The 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.
Parameter | Type | Description |
---|---|---|
event | EventId | The ID of the listener we want to remove |
removeStrongholdStatusChangeListener(event): void
Removes the stronghold status change listener associated with the given identifier.
Parameter | Type | Description |
---|---|---|
event | EventId | The ID of the listener we want to remove |
removeAddressConsolidationNeededListener(event): void
Removes the balance change listener associated with the given identifier.
Parameter | Type | Description |
---|---|---|
event | EventId | The 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
.
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 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
Parameter | Type | Description |
---|---|---|
str_rep | String |
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
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
Parameter | Type | Description |
---|---|---|
node | boolean |
mine(): boolean
setTimeouts(secs): void
Sets the timeout in seconds, negative to set default
Parameter | Type | Description |
---|---|---|
secs | long |
timeouts(): long
Returns the set timeout, defaults to 10 minutes
setOffset(offset): void
Parameter | Type | Description |
---|---|---|
offset | Long |
offset(): OptionalLong
setLogFileName(log_file_name): void
Parameter | Type | Description |
---|---|---|
log_file_name | String |
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
Parameter | Type | Description |
---|---|---|
event | MigrationProgressEvent |
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
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
.
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.
verifyLink(): void
NewTransactionListener
onNewTransaction(event): void
Parameter | Type | Description |
---|---|---|
event | TransactionEvent |
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
Parameter | Type | Description |
---|---|---|
sig | Signature | The signature to verify |
msg | byte[] | 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
Parameter | Type | Description |
---|---|---|
bs | byte[] |
ReattachTransactionListener
onReattachTransaction(event): void
Parameter | Type | Description |
---|---|---|
event | TransactionReattachmentEvent |
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
.
Parameter | Type | Description |
---|---|---|
index | int | The 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
Parameter | Type | Description |
---|---|---|
a0 | String |
decode(s): byte[]
Parameter | Type | Description |
---|---|---|
s | String |
RustLogging
init(): void
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 | AddressWrapper | The address to set |
amount | long | The 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
.
Parameter | Type | Description |
---|---|---|
address | AddressWrapper | The address to set |
amount | long | The amount to set |
remainder | boolean | if 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
Parameter | Type | Description |
---|---|---|
public_key | byte[] | The public ket used for this signature block |
signature | byte[] | 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
Parameter | Type | Description |
---|---|---|
event | StrongholdStatusEvent |
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
Parameter | Type | Description |
---|---|---|
event | TransactionConfirmationChangeEvent |
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
Parameter | Type | Description |
---|---|---|
str_rep | String |
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
Parameter | Type | Description |
---|---|---|
address | AddressWrapper | The addres we want to send to |
amount | long | The amount we want to send |
output_kind | OutputKind | The 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.
Parameter | Type | Description |
---|---|---|
address | AddressWrapper | The addres we want to send to |
amount | long | The amount we want to send |
output_kind | OutputKind | The kind of output we wish to use |
newFromOutputs(outputs): TransferBuilder
Creates a transfer with multiple outputs.
Parameter | Type | Description |
---|---|---|
outputs | TransferOutput[] | List of outputs |
withRemainderValueStrategy(strategy): TransferBuilder
Sets the remainder value strategy for the transfer.
Parameter | Type | Description |
---|---|---|
strategy | RemainderValueStrategy | The 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.
Parameter | Type | Description |
---|---|---|
address | AddressWrapper | The address we send the remainder t o |
withIndexation(indexation): TransferBuilder
(Optional) message indexation.
Parameter | Type | Description |
---|---|---|
indexation | IndexationPayload | Build 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
Parameter | Type | Description |
---|---|---|
address | AddressWrapper | The addres we want to send to |
amount | long | The amount we want to send |
output_kind | OutputKind | The 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
Parameter | Type | Description |
---|---|---|
event | WalletTransferProgress |
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
Parameter | Type | Description |
---|---|---|
id | MilestoneId | The 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
Parameter | Type | Description |
---|---|---|
amount | long |
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
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.
Value
Value(value, unit): Value
Parameter | Type | Description |
---|---|---|
value | long | |
unit | ValueUnit |
withDenomination(): String
withoutDenomination(): long
value(): long
ValueUnit
I
Ki
Mi
Gi
Ti
Pi
WalletException
WalletException(): WalletException
WalletException(errorMessage): WalletException
Parameter | Type | Description |
---|---|---|
errorMessage | String |
WalletTransferProgress
accountId(): String
The associated account identifier.
event(): TransferProgress
Get the event linked to this progress