Struct HeliusClient

Source
pub struct HeliusClient {
    pub rpc_client: RpcClient,
    pub http_client: Client,
    pub cluster: ClusterType,
    /* private fields */
}

Fields§

§rpc_client: RpcClient§http_client: Client§cluster: ClusterType

Implementations§

Source§

impl HeliusClient

Source

pub fn new(api_key: String, cluster_type: ClusterType) -> Self

Source

pub fn new_with_commitment( api_key: String, cluster_type: ClusterType, commitment_config: CommitmentConfig, ) -> Self

Source

pub fn new_with_timeout( api_key: String, cluster_type: ClusterType, timeout: Duration, ) -> Self

Source

pub fn new_with_timeout_and_commitment( api_key: String, cluster_type: ClusterType, timeout: Duration, commitment_config: CommitmentConfig, ) -> Self

Source

pub fn new_with_timeouts_and_commitment( api_key: String, cluster_type: ClusterType, timeout: Duration, commitment_config: CommitmentConfig, confirm_transaction_initial_timeout: Duration, ) -> Self

Source

pub fn new_mock(api_key: String, cluster_type: ClusterType) -> Self

Source

pub fn new_mock_with_mocks( api_key: String, cluster_type: ClusterType, mocks: Mocks, ) -> Self

Source§

impl HeliusClient

Source

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

Source

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.
Source

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.
Source

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.
Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source

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.

Source

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 the CommitmentLevel. Default is finalized.
Source

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.
Source

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 the CommitmentLevel. Default is finalized.
Source§

impl HeliusClient

Source

pub async fn create_webhook( &self, webhook_request: CreateWebhookRequest, ) -> ClientResult<Webhook>

Creates a webhook. POST request to https://api.helius.xyz/v0/webhooks.

Source

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.

Source

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.
Source

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.
Source

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§

Blanket Implementations§

Source§

impl<T> AbiExample for T

Source§

default fn example() -> T

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T