pub struct Client { /* private fields */ }
Expand description

An instance of the client using HORNET or Bee URI

Implementations

Function to consolidate all funds and native tokens 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

Get the inputs of a transaction for the given transaction id.

A generic send function for easily sending transaction or tagged data blocks.

Return a list of addresses from a secret manager regardless of their validity.

Find all blocks by provided block IDs.

Retries (promotes or reattaches) a block for provided block id. Block should only be retried only if they are valid and haven’t been confirmed for a while.

Retries (promotes or reattaches) a block for provided block id until it’s included (referenced by a milestone). Default interval is 5 seconds and max attempts is 40. Returns the included block at first position and additional reattached blocks

Function to find inputs from addresses for a provided amount (useful for offline signing), ignoring outputs with additional unlock conditions

Find all outputs based on the requests criteria. This method will try to query multiple nodes if the request amount exceeds individual node limit.

Reattaches blocks for provided block id. Blocks can be reattached only if they are valid and haven’t been confirmed for a while.

Reattach a block without checking if it should be reattached

Promotes a block. The method should validate if a promotion is necessary through get_block. If not, the method should error out and should not allow unnecessary promotions.

Promote a block without checking if it should be promoted

Returns the local time checked with the timestamp of the latest milestone, if the difference is larger than 5 minutes an error is returned to prevent locking outputs by accident for a wrong time.

Create the builder to instantiate the IOTA Client.

Gets the miner to use based on the Pow setting

Gets the network related information such as network_id and min_pow_score and if it’s the default one, sync it first and set the NetworkInfo.

Gets the protocol parameters of the node we’re connecting to.

Gets the protocol version of the node we’re connecting to.

Gets the network name of the node we’re connecting to.

Gets the network id of the node we’re connecting to.

Gets the bech32 HRP of the node we’re connecting to.

Gets the minimum pow score of the node we’re connecting to.

Gets the below maximum depth of the node we’re connecting to.

Gets the rent structure of the node we’re connecting to.

Gets the token supply of the node we’re connecting to.

returns the tips interval

returns if local pow should be used or not

returns the fallback_to_local_pow

Returns the health of the node. GET /health

Returns the available API route groups of the node. GET /api/routes

Returns general information about the node. GET /api/core/v2/info

GET /api/core/v2/info endpoint

Returns tips that are ideal for attaching a block. GET /api/core/v2/tips

Returns the BlockId of the submitted block. POST JSON to /api/core/v2/blocks

Returns the BlockId of the submitted block. POST /api/core/v2/blocks

Finds a block by its BlockId. This method returns the given block object. GET /api/core/v2/blocks/{BlockId}

Finds a block by its BlockId. This method returns the given block raw data. GET /api/core/v2/blocks/{BlockId}

Returns the metadata of a block. GET /api/core/v2/blocks/{BlockId}/metadata

Finds an output, as JSON, by its OutputId (TransactionId + output_index). GET /api/core/v2/outputs/{outputId}

Finds an output, as raw bytes, by its OutputId (TransactionId + output_index). GET /api/core/v2/outputs/{outputId}

Get the metadata for a given OutputId (TransactionId + output_index). GET /api/core/v2/outputs/{outputId}/metadata

Gets all stored receipts. GET /api/core/v2/receipts

Gets the receipts by the given milestone index. GET /api/core/v2/receipts/{migratedAt}

Gets the current treasury output. The treasury output contains all tokens from the legacy network that have not yet been migrated. GET /api/core/v2/treasury

Returns the block, as object, that was included in the ledger for a given TransactionId. GET /api/core/v2/transactions/{transactionId}/included-block

Returns the block, as raw bytes, that was included in the ledger for a given TransactionId. GET /api/core/v2/transactions/{transactionId}/included-block

Gets the milestone by the given milestone id. GET /api/core/v2/milestones/{milestoneId}

Gets the milestone by the given milestone id. GET /api/core/v2/milestones/{milestoneId}

Gets all UTXO changes of a milestone by its milestone id. GET /api/core/v2/milestones/{milestoneId}/utxo-changes

Gets the milestone by the given milestone index. GET /api/core/v2/milestones/{index}

Gets the milestone by the given milestone index. GET /api/core/v2/milestones/{index}

Gets all UTXO changes of a milestone by its milestone index. GET /api/core/v2/milestones/by-index/{index}/utxo-changes

GET /api/core/v2/peers

Request outputs by their output id in parallel

Request outputs by their output id in parallel, ignores failed requests Useful to get data about spent outputs, that might not be pruned yet

Get basic outputs filtered by the given parameters. GET with query parameter returns all outputIDs that fit these filter criteria. Query parameters: “address”, “hasStorageDepositReturn”, “storageDepositReturnAddress”, “hasExpiration”, “expiresBefore”, “expiresAfter”, “hasTimelock”, “timelockedBefore”, “timelockedAfter”, “sender”, “tag”, “createdBefore” and “createdAfter”. Returns an empty Vec if no results are found. api/indexer/v1/outputs/basic

Get alias outputs filtered by the given parameters. GET with query parameter returns all outputIDs that fit these filter criteria. Query parameters: “stateController”, “governor”, “issuer”, “sender”, “createdBefore”, “createdAfter” Returns an empty list if no results are found. api/indexer/v1/outputs/alias

Get alias output by its aliasID. api/indexer/v1/outputs/alias/:{AliasId}

Get foundry outputs filtered by the given parameters. GET with query parameter returns all outputIDs that fit these filter criteria. Query parameters: “address”, “createdBefore”, “createdAfter” Returns an empty list if no results are found. api/indexer/v1/outputs/foundry

Get foundry output by its foundryID. api/indexer/v1/outputs/foundry/:{FoundryID}

Get NFT outputs filtered by the given parameters. Query parameters: “address”, “hasStorageDepositReturn”, “storageDepositReturnAddress”, “hasExpiration”, “expiresBefore”, “expiresAfter”, “hasTimelock”, “timelockedBefore”, “timelockedAfter”, “issuer”, “sender”, “tag”, “createdBefore”, “createdAfter” Returns an empty list if no results are found. api/indexer/v1/outputs/nft

Get NFT output by its nftID. api/indexer/v1/outputs/nft/:{NftId}

Get all output ids for a provided URL route and query parameters.

Get a node candidate from the healthy node pool.

returns the unhealthy nodes.

Transforms bech32 to hex

Transforms a hex encoded address to a bech32 encoded address

Transforms a hex encoded public key to a bech32 encoded address

Returns a valid Address parsed from a String.

Checks if a String is a valid bech32 encoded address.

Generates a new mnemonic.

Returns a seed for a mnemonic.

Returns a hex encoded seed for a mnemonic.

UTF-8 encodes the tag of a given TaggedDataPayload.

UTF-8 encodes the data of a given TaggedDataPayload.

UTF-8 encodes both the tag and data of a given TaggedDataPayload.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Gracefully shutdown the Client

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more