UNPKG

@celo/explorer

Version:
25 lines 1.09 kB
/** * Block-explorer (Blockscout / Etherscan-compatible) helpers for querying a * verified contract's ABI when Sourcify does not have it. * * Celo core contracts are canonically verified on Celoscan / Blockscout, so this * is a more reliable ABI source than Sourcify for celo addresses (and works while * Sourcify's v1 API is being sunset). */ import { AbiItem, Address, Connection } from '@celo/connect'; import { ContractMapping } from './base'; /** * Build a ContractMapping (selector -> ABI item) from a raw ABI, mirroring the * Sourcify Metadata path so downstream decoding behaves identically. */ export declare function abiToContractMapping(name: string, address: Address, abi: AbiItem[]): ContractMapping; /** * Fetch a verified contract's ABI from the chain's Blockscout instance. * Returns null when the chain is unsupported, the request fails, or the * contract is not verified. */ export declare function fetchAbiFromExplorer(connection: Connection, address: string): Promise<{ name: string; abi: AbiItem[]; } | null>; //# sourceMappingURL=explorer.d.ts.map