import { Contract, providers, Signer } from 'ethers'; import type { JsonFragment } from '@ethersproject/abi'; import type { CurrencyTypes } from '@requestnetwork/types'; /** * Contract information specific to a network */ export declare type ArtifactNetworkInfo = { /** Contract's address */ address: string; /** Block number at which the contract was created */ creationBlockNumber: number; }; /** Deployment information and ABI per network */ export declare type ArtifactDeploymentInfo = { abi: JsonFragment[]; deployment: Partial>; }; /** Deployment information and ABI per version and network */ export declare type ArtifactInfo = Record>; export declare type DeploymentInformation = { address: string; creationBlockNumber: number; }; /** * Provides information on a deployed smart-contract, * and utilities to connect to it **/ export declare class ContractArtifact { private info; private lastVersion; constructor(info: ArtifactInfo, lastVersion: string); /** * Returns an ethers contract instance for the given `networkName` */ connect(networkName: CurrencyTypes.EvmChainName, signerOrProvider: Signer | providers.Provider, version?: string): TContract; getInterface(): TContract['interface']; /** * Retrieve the abi from the artifact of the used version * @returns the abi of the artifact as a json object */ getContractAbi(version?: string): JsonFragment[]; /** * Retrieve the address from the artifact of the used version * deployed into the specified network * @param networkName the name of the network where the contract is deployed * @returns the address of the deployed contract */ getAddress(networkName: CurrencyTypes.VMChainName, version?: string): string; /** * Retrieve all addresses for all versions * @param networkName the name of the network where the contract is deployed * @returns the addresses of the deployed contract and the associated version. */ getAllAddresses(networkName: CurrencyTypes.VMChainName): { version: string; address: string | undefined; }[]; /** * Retrieve all addresses for all versions for all networks * @returns the addresses of the deployed contract and the associated network and version. */ getAllAddressesFromAllNetworks(): { version: string; address: string; networkName: CurrencyTypes.VMChainName; }[]; /** * Retrieve the block creation number from the artifact of the used version * deployed into the specified network * @param networkName the name of the network where the contract is deployed * @returns the number of the block where the contract was deployed */ getCreationBlockNumber(networkName: CurrencyTypes.VMChainName, version?: string): number; /** * Retrieve the deployment information from the artifact of the used version * deployed into the specified network. Will trow an error if the version of network is incorrect. * @param networkName the name of the network where the contract is deployed * @returns The address and the number of the creation block */ getDeploymentInformation(networkName: CurrencyTypes.VMChainName, version?: string): DeploymentInformation; /** * Retrieve the deployment information from the artifact of the used version * deployed into the specified network * @param networkName the name of the network where the contract is deployed * @returns The address and the number of the creation block, or null if not found */ getOptionalDeploymentInformation(networkName: CurrencyTypes.VMChainName, version?: string): DeploymentInformation | null; } //# sourceMappingURL=ContractArtifact.d.ts.map