Skip to main content

GoldRushClient

Struct GoldRushClient 

Source
pub struct GoldRushClient { /* private fields */ }
Expand description

The main GoldRush client for interacting with the API.

Implementations§

Source§

impl GoldRushClient

Source

pub fn new<S: Into<String>>( api_key: S, config: ClientConfig, ) -> Result<Self, Error>

Create a new GoldRush client with the provided API key and configuration.

§Arguments
  • api_key - Your GoldRush API key
  • config - Client configuration options
§Example
use goldrush_sdk::{GoldRushClient, ClientConfig};

let client = GoldRushClient::new("your-api-key", ClientConfig::default())?;
Source

pub fn with_key<S: Into<String>>(api_key: S) -> Result<Self, Error>

Create a new GoldRush client with default configuration.

§Arguments
  • api_key - Your GoldRush API key
§Example
use goldrush_sdk::GoldRushClient;

let client = GoldRushClient::with_key("your-api-key")?;
Source

pub fn metrics(&self) -> Option<&Arc<MetricsCollector>>

Get access to the metrics collector (if enabled).

Source§

impl GoldRushClient

Source

pub async fn get_token_balances_for_wallet_address( &self, chain_name: &str, address: &str, options: Option<BalancesOptions>, ) -> Result<BalancesResponse, Error>

Get token balances for a wallet address.

§Arguments
  • chain_name - The blockchain name (e.g., “eth-mainnet”, “matic-mainnet”)
  • address - The wallet address to query
  • options - Optional query parameters
§Example
use goldrush_sdk::{GoldRushClient, BalancesOptions};

let options = BalancesOptions::new()
    .quote_currency("USD")
    .no_spam(true);
     
let balances = client
    .get_token_balances_for_wallet_address(
        "eth-mainnet",
        "0xfc43f5f9dd45258b3aff31bdbe6561d97e8b71de",
        Some(options)
    )
    .await?;
Source

pub async fn get_historical_portfolio_for_wallet_address( &self, chain_name: &str, address: &str, options: Option<BalancesOptions>, ) -> Result<BalancesResponse, Error>

Get historical portfolio balances for an address.

§Arguments
  • chain_name - The blockchain name
  • address - The wallet address to query
  • options - Optional query parameters
§Example
use goldrush_sdk::GoldRushClient;

let portfolio = client
    .get_historical_portfolio_for_wallet_address(
        "eth-mainnet",
        "0xfc43f5f9dd45258b3aff31bdbe6561d97e8b71de",
        None
    )
    .await?;
Source§

impl GoldRushClient

Source

pub async fn get_all_transactions_for_address( &self, chain_name: &str, address: &str, options: Option<TxOptions>, ) -> Result<TransactionsResponse, Error>

Get all transactions for an address.

§Arguments
  • chain_name - The blockchain name (e.g., “eth-mainnet”, “matic-mainnet”)
  • address - The wallet address to query
  • options - Optional query parameters
§Example
use goldrush_sdk::{GoldRushClient, TxOptions};

let options = TxOptions::new()
    .page_size(10)
    .quote_currency("USD");
     
let transactions = client
    .get_all_transactions_for_address(
        "eth-mainnet",
        "0xfc43f5f9dd45258b3aff31bdbe6561d97e8b71de",
        Some(options)
    )
    .await?;
Source

pub async fn get_transaction( &self, chain_name: &str, tx_hash: &str, ) -> Result<TransactionResponse, Error>

Get a specific transaction by hash.

§Arguments
  • chain_name - The blockchain name
  • tx_hash - The transaction hash
§Example
use goldrush_sdk::GoldRushClient;

let transaction = client
    .get_transaction(
        "eth-mainnet",
        "0x1234567890abcdef..."
    )
    .await?;
Source

pub async fn get_transactions_between_addresses( &self, chain_name: &str, from_address: &str, to_address: &str, options: Option<TxOptions>, ) -> Result<TransactionsResponse, Error>

Get transactions between two addresses.

§Arguments
  • chain_name - The blockchain name
  • from_address - The sender address
  • to_address - The recipient address
  • options - Optional query parameters
§Example
use goldrush_sdk::GoldRushClient;

let transactions = client
    .get_transactions_between_addresses(
        "eth-mainnet",
        "0xfrom...",
        "0xto...",
        None
    )
    .await?;
Source§

impl GoldRushClient

Source

pub async fn get_nfts_for_address( &self, chain_name: &str, address: &str, options: Option<NftOptions>, ) -> Result<NftsResponse, Error>

Get NFTs owned by an address.

§Arguments
  • chain_name - The blockchain name (e.g., “eth-mainnet”, “matic-mainnet”)
  • address - The wallet address to query
  • options - Optional query parameters
§Example
use goldrush_sdk::{GoldRushClient, NftOptions};

let options = NftOptions::new()
    .page_size(10)
    .with_metadata(true)
    .no_spam(true);
     
let nfts = client
    .get_nfts_for_address(
        "eth-mainnet",
        "0xfc43f5f9dd45258b3aff31bdbe6561d97e8b71de",
        Some(options)
    )
    .await?;
Source

pub async fn get_nft_metadata( &self, chain_name: &str, contract_address: &str, token_id: &str, ) -> Result<NftMetadataResponse, Error>

Get metadata for a specific NFT.

§Arguments
  • chain_name - The blockchain name
  • contract_address - The NFT collection contract address
  • token_id - The specific token ID
§Example
use goldrush_sdk::GoldRushClient;

let metadata = client
    .get_nft_metadata(
        "eth-mainnet",
        "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
        "1"
    )
    .await?;
Source

pub async fn get_nfts_for_collection( &self, chain_name: &str, contract_address: &str, options: Option<NftOptions>, ) -> Result<NftsResponse, Error>

Get all NFTs from a specific collection.

§Arguments
  • chain_name - The blockchain name
  • contract_address - The NFT collection contract address
  • options - Optional query parameters
§Example
use goldrush_sdk::GoldRushClient;

let collection_nfts = client
    .get_nfts_for_collection(
        "eth-mainnet",
        "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
        None
    )
    .await?;
Source

pub async fn get_nft_owners_for_collection( &self, chain_name: &str, contract_address: &str, options: Option<NftOptions>, ) -> Result<NftsResponse, Error>

Get NFT owners for a specific collection.

§Arguments
  • chain_name - The blockchain name
  • contract_address - The NFT collection contract address
  • options - Optional query parameters
§Example
use goldrush_sdk::GoldRushClient;

let owners = client
    .get_nft_owners_for_collection(
        "eth-mainnet",
        "0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d",
        None
    )
    .await?;

Auto Trait Implementations§

Blanket Implementations§

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<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, 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