/** * Transaction Execution — CLI wrapper over @poa-box/core/execute. * * The full pipeline (gas estimation as revert prediction, dry-run calldata, * EIP-7702 sponsored routing with EOA fallback, receipt-log parsing, error * classification/decoding) lives in @poa-box/core/execute/ethers and is * environment-free. This wrapper restores the CLI's implicit env behavior: * * - sponsorship auto-resolves from env (POP_PRIVATE_KEY/POP_ORG_ID/POP_HAT_ID * + PIMLICO_API_KEY|POP_BUNDLER_URL) when options.sponsored is not given * - bundler routing comes from POP_BUNDLER_URL / PIMLICO_API_KEY * - POP_LEGACY_DRYRUN_TXHASH=1 keeps the legacy dry-run txHash field * * executeTx keeps its pre-extraction signature for every command and for * @poa-box/agent's `@poa-box/cli/lib/tx` deep import. */ import { ethers } from 'ethers'; import { classifyError, detectUserOpFailure, parseEventLogs } from '@poa-box/core/execute/ethers'; import type { TxResult, ErrorCode, ClassifiedError } from '@poa-box/core/execute/ethers'; import type { TxIntent } from '@poa-box/core/tx/intent'; import { resolveSponsoredConfig } from './sponsorship-config'; import type { SponsoredConfig } from './sponsorship-config'; export { resolveSponsoredConfig }; export type { SponsoredConfig }; export { classifyError, detectUserOpFailure, parseEventLogs }; export type { TxResult, ErrorCode, ClassifiedError }; export interface TxOptions { dryRun?: boolean; gasLimit?: number; value?: ethers.BigNumber; sponsored?: SponsoredConfig; } /** * Execute a contract method. * In dry-run mode: estimates gas and encodes calldata without sending. * When sponsored config is available (explicit or from env) and the EOA is * delegated, routes through the PaymasterHub for gas sponsorship, falling back * to a direct EOA tx. Returns parsed event logs so callers can extract entity IDs. */ export declare function executeTx(contract: ethers.Contract, method: string, args: any[], options?: TxOptions): Promise; /** * Execute a @poa-box/core TxIntent with the same CLI env bindings as executeTx. * New code should prefer building intents (tx/ in @poa-box/core) and * executing them here. */ export declare function executeIntent(signer: ethers.Signer, intent: TxIntent, options?: TxOptions): Promise;