import { TransactionReceipt, ethers, ContractRunner, InterfaceAbi, Signer } from 'ethers'; type Address = string; type Bytes32 = string; declare enum PooledEscrowStatus { None = 0, Open = 1, Released = 2, Refundable = 3, Closed = 4 } interface PooledEscrowRecord { token: Address; creator: Address; beneficiary: Address; authorizer: Address; expiresAt: bigint; status: PooledEscrowStatus; beneficiaryNonce: bigint; totalDeposited: bigint; totalReleased: bigint; totalRefunded: bigint; metadataHash: Bytes32; } interface CreatePooledEscrowArgs { escrowId: Bytes32; token: Address; beneficiary?: Address; authorizer?: Address; expiresAt?: bigint | number; metadataHash?: Bytes32; } interface BeneficiaryAssignment { escrowId: Bytes32; beneficiary: Address; nonce: bigint | number; deadline: bigint | number; } interface PreparedContractCall { to: Address; data: string; value: bigint; } interface ApprovalCallOptions { /** Add `approve(spender, 0)` before the exact approval for strict ERC-20s. */ resetAllowance?: boolean; } interface DeployPooledEscrowOptions { factory?: Address; implOwner?: Address; initFn?: string; version?: number; } interface DeployPooledEscrowResult { address: Address; receipt: TransactionReceipt; helper: PooledTokenEscrowHelper; } interface PooledTokenEscrowHelperOptions { abi?: InterfaceAbi; } declare const BENEFICIARY_ASSIGNMENT_TYPES: { BeneficiaryAssignment: { name: string; type: string; }[]; }; /** Developer-friendly wrapper for the generic PooledTokenEscrow contract. */ declare class PooledTokenEscrowHelper { readonly address: Address; readonly contract: ethers.Contract; private readonly options?; constructor(address: Address, runner: ContractRunner | null, options?: PooledTokenEscrowHelperOptions); static attach(address: Address, runner: ContractRunner | null, options?: PooledTokenEscrowHelperOptions): PooledTokenEscrowHelper; connect(runner: ContractRunner): PooledTokenEscrowHelper; static deploy(admin: Address, signer: Signer, options?: DeployPooledEscrowOptions): Promise; createEscrow(args: CreatePooledEscrowArgs): Promise; deposit(escrowId: Bytes32, contributionId: Bytes32, amount: bigint | number): Promise; assignBeneficiary(assignment: BeneficiaryAssignment, authorization: string): Promise; claim(escrowId: Bytes32): Promise; withdrawOpenContribution(escrowId: Bytes32): Promise; cancelEscrow(escrowId: Bytes32): Promise; enableRefunds(escrowId: Bytes32): Promise; refund(escrowId: Bytes32): Promise; getEscrow(escrowId: Bytes32): Promise; contributionOf(escrowId: Bytes32, contributor: Address): Promise; refundedOf(escrowId: Bytes32, contributor: Address): Promise; refundableOf(escrowId: Bytes32, contributor: Address): Promise; withdrawableOf(escrowId: Bytes32, contributor: Address): Promise; contributionAmount(escrowId: Bytes32, contributionId: Bytes32): Promise; lockedBalanceOf(token: Address): Promise; buildCreateEscrowCall(args: CreatePooledEscrowArgs): PreparedContractCall; buildDepositCall(escrowId: Bytes32, contributionId: Bytes32, amount: bigint | number): PreparedContractCall; /** * Build calls for smart-account batching. The allowance is exact by default. * Set `resetAllowance` for ERC-20s that require zeroing an existing allowance. */ buildApproveAndDepositCalls(token: Address, escrowId: Bytes32, contributionId: Bytes32, amount: bigint | number, options?: ApprovalCallOptions): PreparedContractCall[]; buildAssignBeneficiaryCall(assignment: BeneficiaryAssignment, authorization: string): PreparedContractCall; buildClaimCall(escrowId: Bytes32): PreparedContractCall; buildWithdrawOpenContributionCall(escrowId: Bytes32): PreparedContractCall; buildRefundCall(escrowId: Bytes32): PreparedContractCall; buildCancelCall(escrowId: Bytes32): PreparedContractCall; static beneficiaryAssignmentTypedData(chainId: bigint | number, verifyingContract: Address, assignment: BeneficiaryAssignment): { domain: { name: string; version: string; chainId: bigint; verifyingContract: string; }; types: { BeneficiaryAssignment: { name: string; type: string; }[]; }; value: { escrowId: string; beneficiary: string; nonce: bigint; deadline: bigint; }; }; static beneficiaryAssignmentDigest(chainId: bigint | number, verifyingContract: Address, assignment: BeneficiaryAssignment): string; signBeneficiaryAssignment(signer: Signer, assignment: BeneficiaryAssignment): Promise; private buildCall; } export { type ApprovalCallOptions as A, BENEFICIARY_ASSIGNMENT_TYPES as B, type CreatePooledEscrowArgs as C, type DeployPooledEscrowOptions as D, type PooledEscrowRecord as P, type BeneficiaryAssignment as a, type DeployPooledEscrowResult as b, PooledEscrowStatus as c, PooledTokenEscrowHelper as d, type PooledTokenEscrowHelperOptions as e, type PreparedContractCall as f };