[−][src]Struct iota_client::client::Client
An instance of the client using IRI URI
Implementations
impl Client
[src]
pub fn get() -> &'static Client
[src]
Get the instance of IOTA Client. It will init the instance if it's not created yet.
pub fn add_node(uri: &str) -> Result<()>
[src]
Add a node to the node pool. (TODO: it's not though)
pub async fn add_neighbors(uris: Vec<String>) -> Result<AddNeighborsResponse>
[src]
Add a list of neighbors to your node. It should be noted that this is only temporary, and the added neighbors will be removed from your set of neighbors after you relaunch IRI.
Parameters
uris
- Slices of neighbor URIs(&str
) to add
pub fn attach_to_tangle() -> AttachToTangleBuilder
[src]
Does proof of work for the given transaction trytes.
The branch_transaction
and trunk_transaction
parameters are returned
from the get_transactions_to_approve
method.
Parameters
trunk_transaction
- trunk transaction hashbranch_transaction
- branch transaction hashmin_weight_magnitude
- Difficulty of PoWtrytes
- Slice of transaction trytes. When sending transactions in a bundle, make sure that the trytes of the last transaction in the bundle are in index 0 of the array.
pub async fn broadcast_bundle<'_>(hash: &'_ Hash) -> Result<Vec<Transaction>>
[src]
Re-broadcasts all transactions in a bundle given the tail transaction hash. It might be useful when transactions did not properly propagate, particularly in the case of large bundles.
Parameters
hash
- Tail transaction hash (current_index == 0)
pub async fn broadcast_transactions<'_>(trytes: &'_ [Transaction]) -> Result<()>
[src]
Sends transaction trytes to a node.
The input trytes for this call are provided by attach_to_tangle
.
Response only contains errors and exceptions, it would be None
if the call success.
Parameters
trytes
- Transaction trytes
pub async fn check_consistency<'_>(
tails: &'_ [Hash]
) -> Result<ConsistencyResponse>
[src]
tails: &'_ [Hash]
) -> Result<ConsistencyResponse>
Checks the consistency of transactions. A consistent transaction is one where the following statements are true:
- The node isn't missing the transaction's branch or trunk transactions
- The transaction's bundle is valid
- The transaction's branch and trunk transactions are valid
Parameters
tails
- Transaction hashes to check
pub fn find_transactions() -> FindTransactionsBuilder
[src]
Finds transactions that contain the given values in their transaction fields. The parameters define the transaction fields to search for, including bundles, addresses, tags, and approvees. Using multiple transaction fields, returns transactions hashes at the intersection of those values.
Parameters
pub fn get_balances() -> GetBalancesBuilder
[src]
Gets the confirmed balance of an address. If the tips parameter is missing, the returned balance is correct as of the latest confirmed milestone. This endpoint returns data only if the node is synchronized.
Parameters
pub async fn get_bundle<'_>(hash: &'_ Hash) -> Result<Vec<Transaction>>
[src]
Fetches and validates the bundle given a tail transaction hash, by calling traverse_bundle
and traversing through trunk transaction.
Parameters
- [
hash
] - Tail transaction hash (current_index == 0)
pub fn get_inclusion_states() -> GetInclusionStatesBuilder
[src]
Gets the inclusion states of a set of transactions. This endpoint determines if a transaction is confirmed by the network (referenced by a valid milestone). You can search for multiple tips (and thus, milestones) to get past inclusion states of transactions. This endpoint returns data only if the node is synchronized.
Parameters
transactions
- List of transaction hashes for which you want to get the inclusion statetips
- (Optional) List of tip transaction hashes (including milestones) you want to search for
pub fn get_inputs(seed: &IotaSeed<Kerl>) -> GetInputsBuilder
[src]
Creates and returns an Inputs object by generating addresses and fetching their latest balance.
Parameters
pub async fn get_latest_inclusion<'_>(
transactions: &'_ [Hash]
) -> Result<Vec<bool>>
[src]
transactions: &'_ [Hash]
) -> Result<Vec<bool>>
Fetches inclusion states of the given transactions by calling GetInclusionStates using the latest solid subtangle milestone from GetNodeInfo.
Parameters
- [
transactions
] - List of transaction hashes for which you want to get the inclusion state
pub async fn get_latest_solid_subtangle_milestone() -> Result<Hash>
[src]
Gets latest solid subtangle milestone.
pub async fn get_missing_transactions() -> Result<GetTipsResponse>
[src]
Gets all transaction hashes that a node is currently requesting from its neighbors.
pub async fn get_neighbors() -> Result<GetNeighborsResponse>
[src]
Gets a node's neighbors and their activity.
pub fn get_new_address(seed: &IotaSeed<Kerl>) -> GetNewAddressBuilder
[src]
Generates and returns a new address by calling find_transactions
until the first unused address is detected.
This stops working after a snapshot.
Parameters
pub async fn get_node_api_configuration(
) -> Result<GetNodeAPIConfigurationResponse>
[src]
) -> Result<GetNodeAPIConfigurationResponse>
Gets a node's API configuration settings.
pub async fn get_node_info() -> Result<GetNodeInfoResponse>
[src]
Gets information about a node.
pub async fn get_tips() -> Result<GetTipsResponse>
[src]
Gets tip transaction hashes from a node.
pub fn get_transactions_to_approve() -> GetTransactionsToApproveBuilder
[src]
Gets two consistent tip transaction hashes to use as branch/trunk transactions. This endpoint returns data only if the node is synchronized.
Parameters
pub async fn get_trytes<'_>(hashes: &'_ [Hash]) -> Result<GetTrytesResponse>
[src]
pub async fn interrupt_attaching_to_tangle() -> Result<()>
[src]
Aborts the process that's started by the attach_to_tangle
method.
pub async fn is_address_used<'_>(address: &'_ Address) -> Result<bool>
[src]
Checks whether an address is used via FindTransactions and WereAddressesSpentFrom.
Parameters
address
- IOTA address
pub async fn is_promotable<'_>(tail: &'_ Hash) -> Result<bool>
[src]
checks if a transaction is promotable by calling the checkConsistency IRI API command and verifying that attachmentTimestamp is above a lower bound. Lower bound is calculated based on the number of milestones issued since transaction attachment.
Parameters
tail
- Tail Transaction Hash
pub fn prepare_transfers(seed: &IotaSeed<Kerl>) -> PrepareTransfersBuilder
[src]
Prepares the transaction trytes by generating a bundle, filling in transfers and inputs, adding remainder and signing all input transactions.
Parameters
pub async fn remove_neighbors(
uris: Vec<String>
) -> Result<RemoveNeighborsResponse>
[src]
uris: Vec<String>
) -> Result<RemoveNeighborsResponse>
Removes a list of neighbors to your node. This is only temporary, and if you have your neighbors added via the command line, they will be retained after you restart your node.
Parameters
uris
- Slice of neighbor URIs(&str
) to remove
pub async fn replay_bundle<'_>(hash: &'_ Hash) -> Result<SendTrytesBuilder>
[src]
Reattaches a transfer to tangle by selecting tips & performing the Proof-of-Work again. Reattachments are useful in case original transactions are pending and can be done securely as many times as needed.
Parameters
hash
- Tail transaction hash. Tail transaction is the transaction in the bundle with current_index == 0depth
- Number of milestones to go back to start the tip selection algorithm. Default is 3.min_weight_magnitude
- Difficulty of PoW
pub fn send_transfers(seed: &IotaSeed<Kerl>) -> SendTransfersBuilder
[src]
Calls PrepareTransfers and then sends off the bundle via SendTrytes.
seed
- An iota seed.transfers
- Transfer addresses to send data/value to.inputs
- (Optional, but recommended) Input addresses used for signing. Useget_inputs
to get the valid inputs yourself.remainder
- (Optional) Custom remainder address.security
- (Optional) Security level. Default is 2.depth
- Number of milestones to go back to start the tip selection algorithm. Default is 3.min_weight_magnitude
- Difficulty of PoWreference
- (Optional) Transaction hash from which to start the weighted random walk.
pub fn send_trytes() -> SendTrytesBuilder
[src]
Perform Attaches to tanlge, stores and broadcasts a vector of transaction trytes.
Parameters
trytes
- Vector of trytes to attach, store & broadcastdepth
- Number of milestones to go back to start the tip selection algorithm. Default is 3.min_weight_magnitude
- Difficulty of PoWreference
- (Optional) Transaction hash from which to start the weighted random walk.
pub async fn store_and_broadcast<'_>(trytes: &'_ [Transaction]) -> Result<()>
[src]
Store and broadcast transactions to the node.
The trytes to be used for this call are returned by attach_to_tangle
.
Response only contains errors and exceptions, it would be None
if the call success.
Parameters
- [
trytes
] - Transaction trytes
pub async fn store_transactions<'_>(trytes: &'_ [Transaction]) -> Result<()>
[src]
Store transactions into the local storage.
The trytes to be used for this call are returned by attach_to_tangle
.
Response only contains errors and exceptions, it would be None
if the call success.
Parameters
trytes
- Transaction trytes
pub async fn traverse_bundle<'_>(hash: &'_ Hash) -> Result<Vec<Transaction>>
[src]
Fetches the bundle of a given the tail transaction hash, by traversing through trunk transaction.
It does not validate the bundle. Use get_bundle
instead to get validated bundle.
Parameters
- [
hash
] - Tail transaction hash (current_index == 0)
pub async fn were_addresses_spent_from<'_>(
addresses: &'_ [Address]
) -> Result<WereAddressesSpentFromResponse>
[src]
addresses: &'_ [Address]
) -> Result<WereAddressesSpentFromResponse>
Checks if an address was ever withdrawn from, either in the current epoch or in any previous epochs. If an address has a pending transaction, it's also considered 'spent'.
Parameters
address
- addresses to check (do not include the checksum)
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,