import { Container, ContainerInfo } from "dockerode"; import { ContractAbi, TransactionReceipt } from "web3"; import type { Web3Account } from "web3-eth-accounts"; import { LogLevelDesc } from "@hyperledger-cacti/cactus-common"; export interface IGethTestLedgerOptions { readonly containerImageName?: string; readonly containerImageVersion?: string; readonly logLevel?: LogLevelDesc; readonly emitContainerLogs?: boolean; readonly envVars?: string[]; readonly useRunningLedger?: boolean; readonly networkName?: string; } /** * Default values used by GethTestLedger constructor. */ export declare const GETH_TEST_LEDGER_DEFAULT_OPTIONS: Readonly<{ containerImageName: "ghcr.io/hyperledger/cacti-geth-all-in-one"; containerImageVersion: "2023-07-27-2a8c48ed6"; logLevel: LogLevelDesc; emitContainerLogs: false; envVars: never[]; useRunningLedger: false; networkName: "cactus-ethereum-test-network"; }>; export declare const WHALE_ACCOUNT_PRIVATE_KEY = "86bbf98cf5e5b1c43d2c8701764897357e0fa24982c0137efabf6dc3a6e7b69e"; export declare const WHALE_ACCOUNT_ADDRESS = "0x6a2ec8c50ba1a9ce47c52d1cb5b7136ee9d0ccc0"; export declare class GethTestLedger { readonly options: IGethTestLedgerOptions; static readonly CLASS_NAME = "GethTestLedger"; private readonly log; private readonly logLevel; private readonly containerImageName; private readonly containerImageVersion; private readonly envVars; private readonly emitContainerLogs; readonly useRunningLedger: boolean; private _container; private _containerId; private _web3; private readonly networkName; get fullContainerImageName(): string; get className(): string; get container(): Container; private get web3(); constructor(options: IGethTestLedgerOptions); /** * Get container status. * * @returns status string */ getContainerStatus(): Promise; /** * Start a test Geth ledger. * * @param omitPull Don't pull docker image from upstream if true. * @returns Promise */ start(omitPull?: boolean, cmd?: string[]): Promise; /** * Stop a test Geth ledger. * * @returns Stop operation results. */ stop(): Promise; /** * Destroy a test Geth ledger. * * @returns Destroy operation results. */ destroy(): Promise; /** * Creates a new ETH account from scratch on the ledger and then sends it a * little seed money to get things started. * * Uses `web3.eth.accounts.create` * * @param [seedMoney=10e18 (1ETH)] The amount of money to seed the new test account with. */ createEthTestAccount(seedMoney?: number): Promise; /** * Creates a new personal ethereum account with specified initial money and password. * * Uses `web3.eth.personal.newAccount` * * @param seedMoney Initial money to transfer to this account * @param password Personal account password * @returns New account address */ newEthPersonalAccount(seedMoney?: number, password?: string): Promise; /** * Seed `targetAccount` with money from coin base account. * * @param targetAccount Ethereum account to send money to. * @param value Amount of money. * @returns Transfer `TransactionReceipt` */ transferAssetFromCoinbase(targetAccount: string, value: number): Promise; /** * Deploy contract from coin base account to the ledger. * * @param abi - JSON interface of the contract. * @param bytecode - Compiled code of the contract. * @param args - Contract arguments. * @returns Contract deployment `TransactionReceipt` */ deployContract(abi: ContractAbi, bytecode: string, args?: any[]): Promise; getRpcApiHttpHost(asLocalhost?: boolean): Promise; getRpcApiWebSocketHost(asLocalhost?: boolean): Promise; getContainerIpAddress(network?: string): Promise; protected getContainerInfo(): Promise; getContainerImageName(): string; private getHostPort; getHostPortHttp(): Promise; getHostPortWs(): Promise; getNetworkName(): string; }