Struct iota_sdk::client::core::ClientInner
source · pub struct ClientInner { /* private fields */ }
client
only.Implementations§
source§impl ClientInner
impl ClientInner
source§impl ClientInner
impl ClientInner
sourcepub async fn get_network_info(&self) -> Result<NetworkInfo>
pub async fn get_network_info(&self) -> Result<NetworkInfo>
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.
sourcepub async fn get_protocol_parameters(&self) -> Result<ProtocolParameters>
pub async fn get_protocol_parameters(&self) -> Result<ProtocolParameters>
Gets the protocol parameters of the node we’re connecting to.
sourcepub async fn get_protocol_version(&self) -> Result<u8>
pub async fn get_protocol_version(&self) -> Result<u8>
Gets the protocol version of the node we’re connecting to.
sourcepub async fn get_network_name(&self) -> Result<String>
pub async fn get_network_name(&self) -> Result<String>
Gets the network name of the node we’re connecting to.
sourcepub async fn get_network_id(&self) -> Result<u64>
pub async fn get_network_id(&self) -> Result<u64>
Gets the network id of the node we’re connecting to.
sourcepub async fn get_bech32_hrp(&self) -> Result<Hrp>
pub async fn get_bech32_hrp(&self) -> Result<Hrp>
Gets the bech32 HRP of the node we’re connecting to.
sourcepub async fn get_min_pow_score(&self) -> Result<u32>
pub async fn get_min_pow_score(&self) -> Result<u32>
Gets the minimum pow score of the node we’re connecting to.
sourcepub async fn get_below_max_depth(&self) -> Result<u8>
pub async fn get_below_max_depth(&self) -> Result<u8>
Gets the below maximum depth of the node we’re connecting to.
sourcepub async fn get_rent_structure(&self) -> Result<RentStructure>
pub async fn get_rent_structure(&self) -> Result<RentStructure>
Gets the rent structure of the node we’re connecting to.
sourcepub async fn get_token_supply(&self) -> Result<u64>
pub async fn get_token_supply(&self) -> Result<u64>
Gets the token supply of the node we’re connecting to.
sourcepub async fn get_tips_interval(&self) -> u64
pub async fn get_tips_interval(&self) -> u64
returns the tips interval
sourcepub async fn get_local_pow(&self) -> bool
pub async fn get_local_pow(&self) -> bool
returns if local pow should be used or not
sourcepub async fn get_fallback_to_local_pow(&self) -> bool
pub async fn get_fallback_to_local_pow(&self) -> bool
returns the fallback_to_local_pow
sourcepub async fn bech32_hrp_matches(&self, bech32_hrp: &Hrp) -> Result<()>
pub async fn bech32_hrp_matches(&self, bech32_hrp: &Hrp) -> Result<()>
Validates if a bech32 HRP matches the one from the connected network.
sourcepub async fn resize_request_pool(&self, new_size: usize)
pub async fn resize_request_pool(&self, new_size: usize)
Resize the client’s request pool
source§impl ClientInner
impl ClientInner
sourcepub async fn get_health(&self, url: &str) -> Result<bool>
pub async fn get_health(&self, url: &str) -> Result<bool>
Returns the health of the node. GET /health
sourcepub async fn get_routes(&self) -> Result<RoutesResponse>
pub async fn get_routes(&self) -> Result<RoutesResponse>
Returns the available API route groups of the node. GET /api/routes
sourcepub async fn get_info(&self) -> Result<NodeInfoWrapper>
pub async fn get_info(&self) -> Result<NodeInfoWrapper>
Returns general information about the node. GET /api/core/v2/info
sourcepub async fn get_tips(&self) -> Result<Vec<BlockId>>
pub async fn get_tips(&self) -> Result<Vec<BlockId>>
Returns tips that are ideal for attaching a block. GET /api/core/v2/tips
sourcepub async fn post_block(&self, block: &Block) -> Result<BlockId>
pub async fn post_block(&self, block: &Block) -> Result<BlockId>
Returns the BlockId of the submitted block. POST JSON to /api/core/v2/blocks
sourcepub async fn post_block_raw(&self, block: &Block) -> Result<BlockId>
pub async fn post_block_raw(&self, block: &Block) -> Result<BlockId>
Returns the BlockId of the submitted block. POST /api/core/v2/blocks
sourcepub async fn get_block(&self, block_id: &BlockId) -> Result<Block>
pub async fn get_block(&self, block_id: &BlockId) -> Result<Block>
Finds a block by its BlockId. This method returns the given block object. GET /api/core/v2/blocks/{BlockId}
sourcepub async fn get_block_raw(&self, block_id: &BlockId) -> Result<Vec<u8>>
pub async fn get_block_raw(&self, block_id: &BlockId) -> Result<Vec<u8>>
Finds a block by its BlockId. This method returns the given block raw data. GET /api/core/v2/blocks/{BlockId}
sourcepub async fn get_block_metadata(
&self,
block_id: &BlockId
) -> Result<BlockMetadataResponse>
pub async fn get_block_metadata( &self, block_id: &BlockId ) -> Result<BlockMetadataResponse>
Returns the metadata of a block. GET /api/core/v2/blocks/{BlockId}/metadata
sourcepub async fn get_output(
&self,
output_id: &OutputId
) -> Result<OutputWithMetadata>
pub async fn get_output( &self, output_id: &OutputId ) -> Result<OutputWithMetadata>
Finds an output, as JSON, by its OutputId (TransactionId + output_index). GET /api/core/v2/outputs/{outputId}
sourcepub async fn get_output_raw(&self, output_id: &OutputId) -> Result<Vec<u8>>
pub async fn get_output_raw(&self, output_id: &OutputId) -> Result<Vec<u8>>
Finds an output, as raw bytes, by its OutputId (TransactionId + output_index). GET /api/core/v2/outputs/{outputId}
sourcepub async fn get_output_metadata(
&self,
output_id: &OutputId
) -> Result<OutputMetadata>
pub async fn get_output_metadata( &self, output_id: &OutputId ) -> Result<OutputMetadata>
Get the metadata for a given OutputId
(TransactionId + output_index).
GET /api/core/v2/outputs/{outputId}/metadata
sourcepub async fn get_receipts(&self) -> Result<Vec<ReceiptResponse>>
pub async fn get_receipts(&self) -> Result<Vec<ReceiptResponse>>
Gets all stored receipts. GET /api/core/v2/receipts
sourcepub async fn get_receipts_migrated_at(
&self,
milestone_index: u32
) -> Result<Vec<ReceiptResponse>>
pub async fn get_receipts_migrated_at( &self, milestone_index: u32 ) -> Result<Vec<ReceiptResponse>>
Gets the receipts by the given milestone index. GET /api/core/v2/receipts/{migratedAt}
sourcepub async fn get_treasury(&self) -> Result<TreasuryResponse>
pub async fn get_treasury(&self) -> Result<TreasuryResponse>
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
sourcepub async fn get_included_block(
&self,
transaction_id: &TransactionId
) -> Result<Block>
pub async fn get_included_block( &self, transaction_id: &TransactionId ) -> Result<Block>
Returns the block, as object, that was included in the ledger for a given TransactionId. GET /api/core/v2/transactions/{transactionId}/included-block
sourcepub async fn get_included_block_raw(
&self,
transaction_id: &TransactionId
) -> Result<Vec<u8>>
pub async fn get_included_block_raw( &self, transaction_id: &TransactionId ) -> Result<Vec<u8>>
Returns the block, as raw bytes, that was included in the ledger for a given TransactionId. GET /api/core/v2/transactions/{transactionId}/included-block
sourcepub async fn get_included_block_metadata(
&self,
transaction_id: &TransactionId
) -> Result<BlockMetadataResponse>
pub async fn get_included_block_metadata( &self, transaction_id: &TransactionId ) -> Result<BlockMetadataResponse>
Returns the metadata of the block that was included in the ledger for a given TransactionId. GET /api/core/v2/transactions/{transactionId}/included-block/metadata
sourcepub async fn get_milestone_by_id(
&self,
milestone_id: &MilestoneId
) -> Result<MilestonePayload>
pub async fn get_milestone_by_id( &self, milestone_id: &MilestoneId ) -> Result<MilestonePayload>
Gets the milestone by the given milestone id. GET /api/core/v2/milestones/{milestoneId}
sourcepub async fn get_milestone_by_id_raw(
&self,
milestone_id: &MilestoneId
) -> Result<Vec<u8>>
pub async fn get_milestone_by_id_raw( &self, milestone_id: &MilestoneId ) -> Result<Vec<u8>>
Gets the milestone by the given milestone id. GET /api/core/v2/milestones/{milestoneId}
sourcepub async fn get_utxo_changes_by_id(
&self,
milestone_id: &MilestoneId
) -> Result<UtxoChangesResponse>
pub async fn get_utxo_changes_by_id( &self, milestone_id: &MilestoneId ) -> Result<UtxoChangesResponse>
Gets all UTXO changes of a milestone by its milestone id. GET /api/core/v2/milestones/{milestoneId}/utxo-changes
sourcepub async fn get_milestone_by_index(
&self,
index: u32
) -> Result<MilestonePayload>
pub async fn get_milestone_by_index( &self, index: u32 ) -> Result<MilestonePayload>
Gets the milestone by the given milestone index. GET /api/core/v2/milestones/{index}
sourcepub async fn get_milestone_by_index_raw(&self, index: u32) -> Result<Vec<u8>>
pub async fn get_milestone_by_index_raw(&self, index: u32) -> Result<Vec<u8>>
Gets the milestone by the given milestone index. GET /api/core/v2/milestones/{index}
sourcepub async fn get_utxo_changes_by_index(
&self,
index: u32
) -> Result<UtxoChangesResponse>
pub async fn get_utxo_changes_by_index( &self, index: u32 ) -> Result<UtxoChangesResponse>
Gets all UTXO changes of a milestone by its milestone index. GET /api/core/v2/milestones/by-index/{index}/utxo-changes
sourcepub async fn get_peers(&self) -> Result<Vec<PeerResponse>>
pub async fn get_peers(&self) -> Result<Vec<PeerResponse>>
GET /api/core/v2/peers
source§impl ClientInner
impl ClientInner
sourcepub async fn output_ids(
&self,
query_parameters: impl Into<Vec<QueryParameter>> + Send
) -> Result<OutputIdsResponse>
pub async fn output_ids( &self, query_parameters: impl Into<Vec<QueryParameter>> + Send ) -> Result<OutputIdsResponse>
Get basic, alias, nft and foundry outputs filtered by the given parameters. GET with query parameter returns all outputIDs that fit these filter criteria. Query parameters: “hasNativeTokens”, “minNativeTokenCount”, “maxNativeTokenCount”, “unlockableByAddress”, “createdBefore”, “createdAfter”, “cursor”, “pageSize”. Returns Err(Node(NotFound) if no results are found. api/indexer/v1/outputs
sourcepub async fn basic_output_ids(
&self,
query_parameters: impl Into<Vec<QueryParameter>> + Send
) -> Result<OutputIdsResponse>
pub async fn basic_output_ids( &self, query_parameters: impl Into<Vec<QueryParameter>> + Send ) -> Result<OutputIdsResponse>
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 Err(Node(NotFound) if no results are found. api/indexer/v1/outputs/basic
sourcepub async fn alias_output_ids(
&self,
query_parameters: impl Into<Vec<QueryParameter>> + Send
) -> Result<OutputIdsResponse>
pub async fn alias_output_ids( &self, query_parameters: impl Into<Vec<QueryParameter>> + Send ) -> Result<OutputIdsResponse>
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 Err(Node(NotFound) if no results are found. api/indexer/v1/outputs/alias
sourcepub async fn alias_output_id(&self, alias_id: AliasId) -> Result<OutputId>
pub async fn alias_output_id(&self, alias_id: AliasId) -> Result<OutputId>
Get alias output by its aliasID. api/indexer/v1/outputs/alias/:{AliasId}
sourcepub async fn foundry_output_ids(
&self,
query_parameters: impl Into<Vec<QueryParameter>> + Send
) -> Result<OutputIdsResponse>
pub async fn foundry_output_ids( &self, query_parameters: impl Into<Vec<QueryParameter>> + Send ) -> Result<OutputIdsResponse>
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 Err(Node(NotFound) if no results are found. api/indexer/v1/outputs/foundry
sourcepub async fn foundry_output_id(&self, foundry_id: FoundryId) -> Result<OutputId>
pub async fn foundry_output_id(&self, foundry_id: FoundryId) -> Result<OutputId>
Get foundry output by its foundryID. api/indexer/v1/outputs/foundry/:{FoundryID}
sourcepub async fn nft_output_ids(
&self,
query_parameters: impl Into<Vec<QueryParameter>> + Send
) -> Result<OutputIdsResponse>
pub async fn nft_output_ids( &self, query_parameters: impl Into<Vec<QueryParameter>> + Send ) -> Result<OutputIdsResponse>
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 Err(Node(NotFound) if no results are found. api/indexer/v1/outputs/nft
sourcepub async fn nft_output_id(&self, nft_id: NftId) -> Result<OutputId>
pub async fn nft_output_id(&self, nft_id: NftId) -> Result<OutputId>
Get NFT output by its nftID. api/indexer/v1/outputs/nft/:{NftId}
source§impl ClientInner
impl ClientInner
sourcepub async fn get_output_ids(
&self,
route: &str,
query_parameters: QueryParameters,
need_quorum: bool,
prefer_permanode: bool
) -> Result<OutputIdsResponse>
pub async fn get_output_ids( &self, route: &str, query_parameters: QueryParameters, need_quorum: bool, prefer_permanode: bool ) -> Result<OutputIdsResponse>
Get all output ids for a provided URL route and query parameters.
If a QueryParameter::Cursor(_)
is provided, only a single page will be queried.
source§impl ClientInner
impl ClientInner
sourcepub async fn mqtt_event_receiver(&self) -> WatchReceiver<MqttEvent>
Available on crate feature mqtt
only.
pub async fn mqtt_event_receiver(&self) -> WatchReceiver<MqttEvent>
mqtt
only.Returns the mqtt event receiver.
source§impl ClientInner
impl ClientInner
sourcepub async fn events(
&self,
event_type: Option<ParticipationEventType>
) -> Result<EventsResponse>
Available on crate feature participation
only.
pub async fn events( &self, event_type: Option<ParticipationEventType> ) -> Result<EventsResponse>
participation
only.RouteParticipationEvents is the route to list all events, returning their ID, the event name and status.
sourcepub async fn event(
&self,
event_id: &ParticipationEventId
) -> Result<ParticipationEventData>
Available on crate feature participation
only.
pub async fn event( &self, event_id: &ParticipationEventId ) -> Result<ParticipationEventData>
participation
only.RouteParticipationEvent is the route to access a single participation by its ID.
sourcepub async fn event_status(
&self,
event_id: &ParticipationEventId,
milestone_index: Option<u32>
) -> Result<ParticipationEventStatus>
Available on crate feature participation
only.
pub async fn event_status( &self, event_id: &ParticipationEventId, milestone_index: Option<u32> ) -> Result<ParticipationEventStatus>
participation
only.RouteParticipationEventStatus is the route to access the status of a single participation by its ID.
sourcepub async fn output_status(
&self,
output_id: &OutputId
) -> Result<OutputStatusResponse>
Available on crate feature participation
only.
pub async fn output_status( &self, output_id: &OutputId ) -> Result<OutputStatusResponse>
participation
only.RouteOutputStatus is the route to get the vote status for a given output ID.
sourcepub async fn address_staking_status(
&self,
bech32_address: impl ConvertTo<Bech32Address>
) -> Result<AddressStakingStatus>
Available on crate feature participation
only.
pub async fn address_staking_status( &self, bech32_address: impl ConvertTo<Bech32Address> ) -> Result<AddressStakingStatus>
participation
only.RouteAddressBech32Status is the route to get the staking rewards for the given bech32 address.
sourcepub async fn address_participation_output_ids(
&self,
bech32_address: impl ConvertTo<Bech32Address>
) -> Result<AddressOutputsResponse>
Available on crate feature participation
only.
pub async fn address_participation_output_ids( &self, bech32_address: impl ConvertTo<Bech32Address> ) -> Result<AddressOutputsResponse>
participation
only.RouteAddressBech32Outputs is the route to get the outputs for the given bech32 address.
source§impl ClientInner
impl ClientInner
source§impl ClientInner
impl ClientInner
source§impl ClientInner
impl ClientInner
sourcepub async fn hex_to_bech32(
&self,
hex: &str,
bech32_hrp: Option<impl ConvertTo<Hrp>>
) -> Result<Bech32Address>
pub async fn hex_to_bech32( &self, hex: &str, bech32_hrp: Option<impl ConvertTo<Hrp>> ) -> Result<Bech32Address>
Transforms a hex encoded address to a bech32 encoded address
sourcepub async fn alias_id_to_bech32(
&self,
alias_id: AliasId,
bech32_hrp: Option<impl ConvertTo<Hrp>>
) -> Result<Bech32Address>
pub async fn alias_id_to_bech32( &self, alias_id: AliasId, bech32_hrp: Option<impl ConvertTo<Hrp>> ) -> Result<Bech32Address>
Transforms an alias id to a bech32 encoded address
sourcepub async fn nft_id_to_bech32(
&self,
nft_id: NftId,
bech32_hrp: Option<impl ConvertTo<Hrp>>
) -> Result<Bech32Address>
pub async fn nft_id_to_bech32( &self, nft_id: NftId, bech32_hrp: Option<impl ConvertTo<Hrp>> ) -> Result<Bech32Address>
Transforms an nft id to a bech32 encoded address
sourcepub async fn hex_public_key_to_bech32_address(
&self,
hex: &str,
bech32_hrp: Option<impl ConvertTo<Hrp>>
) -> Result<Bech32Address>
pub async fn hex_public_key_to_bech32_address( &self, hex: &str, bech32_hrp: Option<impl ConvertTo<Hrp>> ) -> Result<Bech32Address>
Transforms a hex encoded public key to a bech32 encoded address
Auto Trait Implementations§
impl !Freeze for ClientInner
impl !RefUnwindSafe for ClientInner
impl Send for ClientInner
impl Sync for ClientInner
impl Unpin for ClientInner
impl !UnwindSafe for ClientInner
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more