pub struct SolscanAPI { /* private fields */ }
Expand description

SolscanAPI is a struct that contains a String for the SolscanURL and a Client which is the instance.

Properties:

A doc comment. A doc comment. A doc comment.

  • base_url: The base URL for the Solscan API.
  • client: This is the HTTP client that will be used to make requests to the Solscan API.

Implementations

Implementation of the struct called SolscanAPI.

It creates a new instance of the SolscanAPI struct.

Returns:

A new instance of the SolscanAPI struct.

This function creates a new instance of the SolscanAPI struct, which is used to make custom requests to the Solscan API (mostly useful for mockups)

Arguments:

  • solscan_url: The URL of the Solscan API.

Returns:

A new instance of the SolscanAPI struct.

It checks the status of the endpoint.

Arguments:

  • endpoint: The endpoint to ping. If none is provided, the base url will be used.

Returns:

A Result<StatusCode, Error>

It gets the last block

Arguments:

  • limit: The number of blocks to return.

Returns:

A Result<Vec, SolscanError>

It gets the transactions for a block.

Arguments:

  • block: The block number to get transactions for.
  • offset: The offset of the first transaction to return.
  • limit: The number of transactions to return.

Returns:

A Result<Vec, SolscanError>

It gets the block information for a given block number.

Arguments:

  • block: The block number you want to query

Returns:

A Result<BlockResult, SolscanError>

It gets the last transactions from the blockchain.

Arguments:

  • limit: The number of transactions to return.

Returns:

A Result<Vec, SolscanError>

It fetches a transaction from the blockchain.

Arguments:

  • signature: The transaction hash

Returns:

A Result<Transaction, SolscanError>

It fetches the tokens associated with an account.

Arguments:

  • account: The address of the account you want to get the tokens for.

Returns:

A Result<Vec, SolscanError>

It gets the transactions for a given account.

Arguments:

  • account: The address of the account you want to get the transactions for.
  • before_hash: The hash of the transaction you want to start from.
  • limit: The number of transactions to return.

Returns:

A Result<Vec, SolscanError>

It returns a list of accounts that have staked to the given account.

Arguments:

  • account: The account address to query

Returns:

A Result<Vec, SolscanError>

It fetches the account spl transfer data from the solscan api.

Arguments:

  • account: The account address to query
  • form_time: The start time of the query.
  • to_time: The time to end the search at.
  • offset: The offset of the first result to return.
  • limit: The number of results to return.

Returns:

A Result<SplTransfer, SolscanError>

It gets the SOL transfers for a given account.

Arguments:

  • account: The account address to query
  • form_time: The start time of the query.
  • to_time: The timestamp of the last block you want to include in the results.
  • offset: The offset of the first result to return.
  • limit: The number of results to return.

Returns:

A Result<SolTransferList, SolscanError>

It fetches the account information of the given account.

Arguments:

  • account: The account address to query

Returns:

A Result<AccountInfo, SolscanError>

It returns a list of token holders for a given token address.

Arguments:

  • account: The address of the token contract
  • offset: The offset of the first result to return.
  • limit: The number of results to return.

Returns:

A Result<TokenHolders, SolscanError>

It fetches the token meta data for a given token address.

Arguments:

  • account: The address of the token contract

Returns:

A Result<TokenMeta, SolscanError>

It fetches the token market item for the given account.

Arguments:

  • account: The address of the token contract

Returns:

A Result<TokenMarketItem, SolscanError>

It gets the chain info from the Solana blockchain.

Returns:

A Result<ChainInfo, SolscanError>

Trait Implementations

Creating a default implementation for the SolscanAPI struct.

It creates a new instance of the SolscanAPI struct.

Returns:

A new instance of the SolscanAPI struct.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

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

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

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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