import { type ContractTransaction, type BigNumber, type Overrides } from 'ethers'; import { type SignerOrProvider, Network } from '@colony/core'; import { type TokenLockingClient } from '@colony/tokens'; import { type IColonyNetwork } from '../contracts/index.js'; import { ClientType } from '../constants.js'; import { type AnyColonyClient } from '../clients/Core/exports.js'; type NetworkEstimate = IColonyNetwork['estimateGas']; interface ExtendedEstimate extends NetworkEstimate { deployToken(name: string, symbol: string, decimals?: number): Promise; } export interface ColonyNetworkClient extends IColonyNetwork { clientType: ClientType.NetworkClient; network: Network; reputationOracleEndpoint: string; estimateGas: ExtendedEstimate; disableVersionCheck: boolean; /** * Get a ColonyClient instance for the currently deployed version of that Colony by providing the address or the integer colony number * * @param addressOrId - The colony address (string) or the auto-incremented Colony id (integer) * * @returns The corresponding initialized ColonyClient instance */ getColonyClient(addressOrId: string | number): Promise; /** * Get the initialized MetaColony client * * @returns a ColonyClient instance of the MetaColony (id: 1) */ getMetaColonyClient(): Promise; /** * Deploy an ERC20 token contract, compatible with Colony * * @remarks * For valid values see the spec here: https://eips.ethereum.org/EIPS/eip-20 * * @param name - The token name. Can be any string. Be creative * @param symbol - The symbol of the token (e.g. CLNY) * @param decimals - The number of token decimals * * @returns ethers compatible ContractTransaction */ deployToken(name: string, symbol: string, decimals?: number, overrides?: Overrides): Promise; /** * Gets the TokenLockingClient * * @returns an initialized version of the TokenLockingClient */ getTokenLockingClient(): Promise; /** * Like {@link lookupRegisteredENSDomain}, but also working on the Goerli testnet * * @remarks * On Goerli, all ens domains have the `.test` suffix. The contracts return `.eth` anyways. * We patch the original function to fix this problem. On any other network it will return the * original function * * @param address - Address we want to look up * * @returns an ENS name in the form of `[username].user.joincolony.eth` or `[colonyName].colony.joincolony.eth` */ lookupRegisteredENSDomainWithNetworkPatches(address: string): Promise; } export interface NetworkClientOptions { networkAddress?: string; reputationOracleEndpoint?: string; disableVersionCheck?: boolean; } /** * The main entry point for accessing the deployed colonyNetwork contracts * * Specify a network and an ethers compatible singer or provider to get back an * initialized and extended (ethers) contract client for the colonyNetwork. From * here you can access different colonies, extensions, ENS and other features of Colony. * * Example * ```ts * import { getColonyNetworkClient, Network } = from '@colony/colony-js'; * import { providers } from 'ethers'; * * // For local connections (run an Ethereum node on port 8545); * const provider = new providers.JsonRpcProvider(); * * // Just for reading data - to sign transactions we need to pass in a signer. * const networkClient = await getColonyNetworkClient(Network.Xdai, provider); * ``` * * @param network - One of the available options. See {@link Network}. * @param signerOrProvider - An [ethers](https://github.com/ethers-io/ethers.js/) * compatible signer or provider instance * @param options - Here you can supply options for accessing certain contracts * (mostly used in local/dev environments) */ declare const getColonyNetworkClient: (network: Network, signerOrProvider: SignerOrProvider, options?: NetworkClientOptions) => ColonyNetworkClient; export default getColonyNetworkClient;