import { ChainId } from '../../types'; import { BlockscoutNativeTokenData, BlockscoutToken, BlockscoutTokenPagination, BlockscoutTokens, BlockscoutTokenType } from './blockscoutType'; import { HttpClient } from '../http'; /** * Blockscout class provides a client abstraction for the Immutable 3rd party indexer. */ export declare class Blockscout { readonly url: string; readonly nativeToken: BlockscoutNativeTokenData; readonly ttl: number; readonly chainId: ChainId; private cacheMap; private httpClient; private setCache; private getCache; /** * Blockscout constructor * @param httpClient Client used for http requests * @param chainId target chain * @param ttl cache TTL */ constructor(httpClient: HttpClient, chainId: ChainId, ttl?: number); /** * isChainSupported verifies if the chain is supported by Blockscout * @param chainId */ static isChainSupported: (chainId: ChainId) => boolean; /** * isBlockscoutError verifies if the error is a Blockscout client error * @param err error to evaluate */ static isBlockscoutError: (err: any) => boolean; /** * getTokensByWalletAddress fetches the list of tokens (by type) owned by the wallet address. * @param walletAddress wallet address * @param tokenType token type * @param nextPage parameters for the next page, to be provided alongside walletAddress and tokenType * @returns list of tokens given the wallet address and the token types */ getTokensByWalletAddress(params: { walletAddress: string; tokenType: BlockscoutTokenType; nextPage?: BlockscoutTokenPagination | null; }): Promise; /** * getNativeTokenByWalletAddress fetches the native token owned by the wallet address. * @param walletAddress wallet address * @returns list of tokens given the wallet address and the token types */ getNativeTokenByWalletAddress(params: { walletAddress: string; }): Promise; }