Class ThirdwebInsight
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
ThirdwebClientThe 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
stringThe contract address to get the events from. (Optional)
eventSignature
stringThe 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
SortByThe field to sort the events by. (Default: BlockNumber)
sortOrder
SortOrderThe order to sort the events by. (Default: Desc)
limit
intThe number of events to return. (Default: 20)
page
intThe page number to return. (Default: 0)
decode
boolWhether 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.
GetTokens(string, BigInteger[])
Get the token balances of an address.
public Task<(Token_ERC20[] erc20Tokens, Token_ERC721[] erc721Tokens, Token_ERC1155[] erc1155Tokens)> GetTokens(string ownerAddress, BigInteger[] chainIds)
Parameters
ownerAddress
stringThe address to get the token balances of.
chainIds
BigInteger[]The chain IDs to get the token balances from.
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[])
Get the ERC1155 tokens of an address.
public Task<Token_ERC1155[]> GetTokens_ERC1155(string ownerAddress, BigInteger[] chainIds)
Parameters
ownerAddress
stringThe address to get the ERC1155 tokens of.
chainIds
BigInteger[]The chain IDs to get the ERC1155 tokens from.
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[])
Get the ERC20 tokens of an address.
public Task<Token_ERC20[]> GetTokens_ERC20(string ownerAddress, BigInteger[] chainIds)
Parameters
ownerAddress
stringThe address to get the ERC20 tokens of.
chainIds
BigInteger[]The chain IDs to get the ERC20 tokens from.
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[])
Get the ERC721 tokens of an address.
public Task<Token_ERC721[]> GetTokens_ERC721(string ownerAddress, BigInteger[] chainIds)
Parameters
ownerAddress
stringThe address to get the ERC721 tokens of.
chainIds
BigInteger[]The chain IDs to get the ERC721 tokens from.
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
stringThe contract address to get the transactions from. (Optional)
signature
stringThe 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
SortByThe field to sort the transactions by. (Default: BlockNumber)
sortOrder
SortOrderThe order to sort the transactions by. (Default: Desc)
limit
intThe number of transactions to return. (Default: 20)
page
intThe page number to return. (Default: 0)
decode
boolWhether 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.