Main scanner class that provides access to all Conflux Core API modules. Extends the base API class with specific module implementations.

CoreScanner

Hierarchy (View Summary)

Constructors

  • Creates an instance of CoreScanner with all available modules.

    Parameters

    • config: ApiConfig = ...

      Configuration object for the scanner

      API configuration options. Contains settings for connecting to the Conflux Core Scanner API.

      • target: ConfluxTarget

        Target network environment

      • OptionalapiKey?: string

        API key for authentication

      • Optionalhost?: string

        Custom API host URL

    Returns CoreScanner

Properties

baseUrl: string

Base URL for the API endpoints

apiKey?: string

Optional API key for authenticated requests

logger: Logger<never> = ...

Logger instance for the scanner

account: AccountModule

Module for account-related operations

contract: ContractModule

Module for smart contract operations

Module for NFT-related operations

statistics: StatisticsModule

Module for statistics and metrics

Module for utility functions

Methods

  • Protected

    Makes an API request with the given parameters. Handles parameter sanitization, API key inclusion, and error handling.

    Type Parameters

    • T

      Type of the expected response data

    Parameters

    • endpoint: string

      API endpoint to call

    • params: Record<string, undefined | null | string | number | boolean> = {}

      Query parameters

    Returns Promise<ApiResponse<T>>

    Promise resolving to the API response

    When the API request fails or returns an error status