Table of Contents

Class ThirdwebInsight

Namespace
Thirdweb.Indexer
Assembly
Thirdweb.dll
public class ThirdwebInsight
Inheritance
ThirdwebInsight
Inherited Members

Methods

Create(ThirdwebClient)

Create a new instance of the ThirdwebInsight class.

public static Task<ThirdwebInsight> Create(ThirdwebClient client)

Parameters

client ThirdwebClient

The ThirdwebClient instance.

Returns

Task<ThirdwebInsight>

A new instance of ThirdwebInsight.

GetEvents(BigInteger[], string, string, BigInteger?, BigInteger?, BigInteger?, BigInteger?, SortBy, SortOrder, int, int, bool)

Get events, optionally filtered by contract address, event signature, and more.

public Task<InsightEvents> GetEvents(BigInteger[] chainIds, string contractAddress = null, string eventSignature = null, BigInteger? fromBlock = null, BigInteger? toBlock = null, BigInteger? fromTimestamp = null, BigInteger? toTimestamp = null, SortBy sortBy = SortBy.BlockNumber, SortOrder sortOrder = SortOrder.Desc, int limit = 20, int page = 0, bool decode = true)

Parameters

chainIds BigInteger[]

The chain IDs to get the events from.

contractAddress string

The contract address to get the events from. (Optional)

eventSignature string

The event signature to get the events from. (Optional)

fromBlock BigInteger?

The starting block number to get the events from. (Optional, if provided, said block is included in query)

toBlock BigInteger?

The ending block number to get the events from. (Optional, if provided, said block is included in query)

fromTimestamp BigInteger?

The starting block timestamp to get the events from. (Optional, if provided, said block is included in query)

toTimestamp BigInteger?

The ending block timestamp to get the events from. (Optional, if provided, said block is included in query)

sortBy SortBy

The field to sort the events by. (Default: BlockNumber)

sortOrder SortOrder

The order to sort the events by. (Default: Desc)

limit int

The number of events to return. (Default: 20)

page int

The page number to return. (Default: 0)

decode bool

Whether to decode the events. (Default: true)

Returns

Task<InsightEvents>

The events and metadata as an instance of InsightEvents.

Exceptions

ArgumentException

Thrown when an event signature is provided without a contract address.

ArgumentException

Thrown when no chain IDs are provided.

GetTokenPrice(string, BigInteger, long?)

public Task<Token_Price> GetTokenPrice(string addressOrSymbol, BigInteger chainId, long? timestamp = null)

Parameters

addressOrSymbol string
chainId BigInteger
timestamp long?

Returns

Task<Token_Price>

GetTokenPrices(string[], BigInteger[], long?)

public Task<Token_Price[]> GetTokenPrices(string[] addressOrSymbols, BigInteger[] chainIds, long? timestamp = null)

Parameters

addressOrSymbols string[]
chainIds BigInteger[]
timestamp long?

Returns

Task<Token_Price[]>

GetTokens(string, BigInteger[], bool)

Get the token balances of an address.

public Task<(Token_ERC20[] erc20Tokens, Token_ERC721[] erc721Tokens, Token_ERC1155[] erc1155Tokens)> GetTokens(string ownerAddress, BigInteger[] chainIds, bool withMetadata = true)

Parameters

ownerAddress string

The address to get the token balances of.

chainIds BigInteger[]

The chain IDs to get the token balances from.

withMetadata bool

Whether to include NFT metadata in the response. (Default: true)

Returns

Task<(Token_ERC20[] erc20Tokens, Token_ERC721[] erc721Tokens, Token_ERC1155[] erc1155Tokens)>

A tuple containing the ERC20, ERC721, and ERC1155 tokens.

Exceptions

ArgumentNullException

Thrown when the owner address is null or empty.

ArgumentException

Thrown when no chain IDs are provided.

GetTokens_ERC1155(string, BigInteger[], int, int, bool)

Get the ERC1155 tokens of an address.

public Task<Token_ERC1155[]> GetTokens_ERC1155(string ownerAddress, BigInteger[] chainIds, int limit = 50, int page = 0, bool withMetadata = true)

Parameters

ownerAddress string

The address to get the ERC1155 tokens of.

chainIds BigInteger[]

The chain IDs to get the ERC1155 tokens from.

limit int

The number of tokens to return. (Default: 50)

page int

The page number to return. (Default: 0)

withMetadata bool

Whether to include NFT metadata in the response. (Default: true)

Returns

Task<Token_ERC1155[]>

An array of ERC1155 tokens.

Exceptions

ArgumentNullException

Thrown when the owner address is null or empty.

ArgumentException

Thrown when no chain IDs are provided.

GetTokens_ERC20(string, BigInteger[], int, int)

Get the ERC20 tokens of an address.

public Task<Token_ERC20[]> GetTokens_ERC20(string ownerAddress, BigInteger[] chainIds, int limit = 50, int page = 0)

Parameters

ownerAddress string

The address to get the ERC20 tokens of.

chainIds BigInteger[]

The chain IDs to get the ERC20 tokens from.

limit int

The number of tokens to return. (Default: 50)

page int

The page number to return. (Default: 0)

Returns

Task<Token_ERC20[]>

An array of ERC20 tokens.

Exceptions

ArgumentNullException

Thrown when the owner address is null or empty.

ArgumentException

Thrown when no chain IDs are provided.

GetTokens_ERC721(string, BigInteger[], int, int, bool)

Get the ERC721 tokens of an address.

public Task<Token_ERC721[]> GetTokens_ERC721(string ownerAddress, BigInteger[] chainIds, int limit = 50, int page = 0, bool withMetadata = true)

Parameters

ownerAddress string

The address to get the ERC721 tokens of.

chainIds BigInteger[]

The chain IDs to get the ERC721 tokens from.

limit int

The number of tokens to return. (Default: 50)

page int

The page number to return. (Default: 0)

withMetadata bool

Whether to include NFT metadata in the response. (Default: true)

Returns

Task<Token_ERC721[]>

An array of ERC721 tokens.

Exceptions

ArgumentNullException

Thrown when the owner address is null or empty.

ArgumentException

Thrown when no chain IDs are provided.

GetTransactions(BigInteger[], string, string, BigInteger?, BigInteger?, BigInteger?, BigInteger?, SortBy, SortOrder, int, int, bool)

Get transactions, optionally filtered by contract address, signature, and more.

public Task<InsightTransactions> GetTransactions(BigInteger[] chainIds, string contractAddress = null, string signature = null, BigInteger? fromBlock = null, BigInteger? toBlock = null, BigInteger? fromTimestamp = null, BigInteger? toTimestamp = null, SortBy sortBy = SortBy.BlockNumber, SortOrder sortOrder = SortOrder.Desc, int limit = 20, int page = 0, bool decode = true)

Parameters

chainIds BigInteger[]

The chain IDs to get the transactions from.

contractAddress string

The contract address to get the transactions from. (Optional)

signature string

The signature to filter transactions by. (Optional)

fromBlock BigInteger?

The starting block number to get the transactions from. (Optional, if provided, said block is included in query)

toBlock BigInteger?

The ending block number to get the transactions from. (Optional, if provided, said block is included in query)

fromTimestamp BigInteger?

The starting block timestamp to get the transactions from. (Optional, if provided, said block is included in query)

toTimestamp BigInteger?

The ending block timestamp to get the transactions from. (Optional, if provided, said block is included in query)

sortBy SortBy

The field to sort the transactions by. (Default: BlockNumber)

sortOrder SortOrder

The order to sort the transactions by. (Default: Desc)

limit int

The number of transactions to return. (Default: 20)

page int

The page number to return. (Default: 0)

decode bool

Whether to decode the transactions. (Default: true)

Returns

Task<InsightTransactions>

The transactions and metadata as an instance of InsightTransactions.

Exceptions

ArgumentException

Thrown when a signature is provided without a contract address.

ArgumentException

Thrown when no chain IDs are provided.