pub struct HeliusClient {
pub rpc_client: RpcClient,
pub http_client: Client,
pub cluster: ClusterType,
/* private fields */
}Fields§
§rpc_client: RpcClient§http_client: Client§cluster: ClusterTypeImplementations§
Source§impl HeliusClient
impl HeliusClient
pub fn new(api_key: String, cluster_type: ClusterType) -> Self
pub fn new_with_commitment( api_key: String, cluster_type: ClusterType, commitment_config: CommitmentConfig, ) -> Self
pub fn new_with_timeout( api_key: String, cluster_type: ClusterType, timeout: Duration, ) -> Self
pub fn new_with_timeout_and_commitment( api_key: String, cluster_type: ClusterType, timeout: Duration, commitment_config: CommitmentConfig, ) -> Self
pub fn new_with_timeouts_and_commitment( api_key: String, cluster_type: ClusterType, timeout: Duration, commitment_config: CommitmentConfig, confirm_transaction_initial_timeout: Duration, ) -> Self
pub fn new_mock(api_key: String, cluster_type: ClusterType) -> Self
pub fn new_mock_with_mocks( api_key: String, cluster_type: ClusterType, mocks: Mocks, ) -> Self
Source§impl HeliusClient
impl HeliusClient
Sourcepub async fn get_naming_service_names(
&self,
address: String,
) -> ClientResult<Vec<String>>
pub async fn get_naming_service_names( &self, address: String, ) -> ClientResult<Vec<String>>
Returns the Solana Naming Service name for a given address. GET request to https://api.helius.xyz/v0/addresses/{address}/names.
address- The address that you want names for.
Source§impl HeliusClient
impl HeliusClient
Sourcepub async fn get_token_balances(
&self,
address: String,
) -> ClientResult<TokenBalancesResponse>
pub async fn get_token_balances( &self, address: String, ) -> ClientResult<TokenBalancesResponse>
Returns the native balance and token balances for a given address. GET request to https://api.helius.xyz/v0/addresses/{address}/balances.
address- The address that you want token balances for.
Sourcepub async fn get_nfts(
&self,
address: String,
page_number: Option<usize>,
) -> ClientResult<NftResponse>
pub async fn get_nfts( &self, address: String, page_number: Option<usize>, ) -> ClientResult<NftResponse>
Returns the NFTs held for a given address. GET request to https://api.helius.xyz/v0/addresses/{address}/nfts.
address- The address that you want nfts for.
Sourcepub async fn get_nfts_metadata(
&self,
token_mints: Vec<String>,
) -> ClientResult<Vec<NftMetadata>>
pub async fn get_nfts_metadata( &self, token_mints: Vec<String>, ) -> ClientResult<Vec<NftMetadata>>
Returns NFT metadata for the given token mint addresses. POST request to https://api.helius.xyz/v1/nfts.
token_mints- The nft mint addresses that you want metadata for.
Sourcepub async fn get_nft_events_for_address(
&self,
config: RequestConfig,
) -> ClientResult<Vec<NftEvent>>
pub async fn get_nft_events_for_address( &self, config: RequestConfig, ) -> ClientResult<Vec<NftEvent>>
Returns all NFT related events associated with the given address. POST request to https://api.helius.xyz/v1/nft-events.
config- TheRequestConfig.
Sourcepub async fn get_nft_events(
&self,
config: RequestConfig,
) -> ClientResult<Vec<NftEvent>>
pub async fn get_nft_events( &self, config: RequestConfig, ) -> ClientResult<Vec<NftEvent>>
Returns all NFT related events associated with the given address. GET request to https://api.helius.xyz/v1/addresses/{address}/nft-events.
config- TheRequestConfig.
Sourcepub async fn get_active_nft_listings(
&self,
config: ActiveListingsRequestConfig,
) -> ClientResult<ActiveListingsResponse>
pub async fn get_active_nft_listings( &self, config: ActiveListingsRequestConfig, ) -> ClientResult<ActiveListingsResponse>
Query for active NFT listings. POST request to https://api.helius.xyz/v1/active-listings.
config- TheActiveListingsRequestConfig.
Sourcepub async fn get_mint_list(
&self,
config: MintListRequestConfig,
) -> ClientResult<MintListResponse>
pub async fn get_mint_list( &self, config: MintListRequestConfig, ) -> ClientResult<MintListResponse>
Returns a list of mint accounts for a given NFT collection. POST request to https://api.helius.xyz/v1/mintlist.
config- TheMintListRequestConfig.
Sourcepub async fn get_tokens_metadata(
&self,
token_mints: Vec<String>,
) -> ClientResult<Vec<TokenMetadata>>
pub async fn get_tokens_metadata( &self, token_mints: Vec<String>, ) -> ClientResult<Vec<TokenMetadata>>
Returns token metadata (whether NFT or Fungible) for the given token mint addresses. POST request to https://api.helius.xyz/v0/tokens/metadata.
token_mints- The token mint addresses that you want metadata for.
Source§impl HeliusClient
impl HeliusClient
Sourcepub async fn get_transactions_for_address(
&self,
config: GetRawTransactionsRequestConfig,
) -> ClientResult<Vec<RawTransaction>>
pub async fn get_transactions_for_address( &self, config: GetRawTransactionsRequestConfig, ) -> ClientResult<Vec<RawTransaction>>
Returns raw transaction history for a given address. GET request to https://api.helius.xyz/v0/addresses/{address}/raw-transactions.
config- TheRequestConfig.
Sourcepub async fn get_transactions_by_hash(
&self,
transaction_hashes: Vec<String>,
commitment: Option<CommitmentLevel>,
) -> ClientResult<Vec<RawTransaction>>
pub async fn get_transactions_by_hash( &self, transaction_hashes: Vec<String>, commitment: Option<CommitmentLevel>, ) -> ClientResult<Vec<RawTransaction>>
Returns raw transaction information for the given transaction hashes. POST request to https://api.helius.xyz/v0/raw-transactions.
transaction_hashes- The transaction hashes as Strings.commitment- an Option containing theCommitmentLevel. Default is finalized.
Sourcepub async fn get_enriched_transactions(
&self,
config: RequestConfig,
) -> ClientResult<Vec<EnrichedTransaction>>
pub async fn get_enriched_transactions( &self, config: RequestConfig, ) -> ClientResult<Vec<EnrichedTransaction>>
Returns enriched transaction history for a given address. GET request to https://api.helius.xyz/v0/addresses/{address}/transactions.
address- The address that you want transactions for.
Sourcepub async fn get_enriched_transactions_by_hash(
&self,
transaction_hashes: Vec<String>,
commitment: Option<CommitmentLevel>,
) -> ClientResult<Vec<EnrichedTransaction>>
pub async fn get_enriched_transactions_by_hash( &self, transaction_hashes: Vec<String>, commitment: Option<CommitmentLevel>, ) -> ClientResult<Vec<EnrichedTransaction>>
Returns enriched transaction information for the given transaction hashes. POST request to https://api.helius.xyz/v0/transactions.
transaction_hashes- The transaction hashes as Strings.commitment- an Option containing theCommitmentLevel. Default is finalized.
Source§impl HeliusClient
impl HeliusClient
Sourcepub async fn create_webhook(
&self,
webhook_request: CreateWebhookRequest,
) -> ClientResult<Webhook>
pub async fn create_webhook( &self, webhook_request: CreateWebhookRequest, ) -> ClientResult<Webhook>
Creates a webhook. POST request to https://api.helius.xyz/v0/webhooks.
webhook_request- TheCreateWebhookRequest.
Sourcepub async fn get_webhooks(&self) -> ClientResult<Vec<Webhook>>
pub async fn get_webhooks(&self) -> ClientResult<Vec<Webhook>>
Returns all webhooks for the API key used to create the HeliusClient. GET request to https://api.helius.xyz/v0/webhooks.
Sourcepub async fn get_webhook(&self, webhook_id: String) -> ClientResult<Webhook>
pub async fn get_webhook(&self, webhook_id: String) -> ClientResult<Webhook>
Returns a single webhook. GET request to https://api.helius.xyz/v0/webhooks/{webhook_id}.
webhook_id- The webhook that you want to fetch.
Sourcepub async fn edit_webhook(
&self,
webhook_id: String,
new_webhook: CreateWebhookRequest,
) -> ClientResult<Webhook>
pub async fn edit_webhook( &self, webhook_id: String, new_webhook: CreateWebhookRequest, ) -> ClientResult<Webhook>
Edits a webhook. PUT request to https://api.helius.xyz/v0/webhooks/{webhook_id}.
webhook_id- The webhook that you want to edit.
Sourcepub async fn delete_webhook(&self, webhook_id: String) -> ClientResult<()>
pub async fn delete_webhook(&self, webhook_id: String) -> ClientResult<()>
Deletes a webhook. DELETE request to https://api.helius.xyz/v0/webhooks/{webhook_id}.
webhook_id- The webhook that you want to delete.
Auto Trait Implementations§
impl !Freeze for HeliusClient
impl !RefUnwindSafe for HeliusClient
impl Send for HeliusClient
impl Sync for HeliusClient
impl Unpin for HeliusClient
impl !UnwindSafe for HeliusClient
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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