import { type AztecAddress, type DebugLogger, EthAddress, Fr, type PXE, type SiblingPath } from '@aztec/aztec.js';
import { TokenPortalAbi } from '@aztec/l1-artifacts';
import { type Account, type Chain, type GetContractReturnType, type Hex, type HttpTransport, type PublicClient, type WalletClient } from 'viem';
/** L1 to L2 message info to claim it on L2. */
export type L2Claim = {
    /** Secret for claiming. */
    claimSecret: Fr;
    /** Hash of the secret for claiming. */
    claimSecretHash: Fr;
    /** Hash of the message. */
    messageHash: Hex;
    /** Leaf index in the L1 to L2 message tree. */
    messageLeafIndex: bigint;
};
/** L1 to L2 message info that corresponds to an amount to claim. */
export type L2AmountClaim = L2Claim & {
    claimAmount: Fr;
};
/** L1 to L2 message info that corresponds to an amount to claim with associated recipient. */
export type L2AmountClaimWithRecipient = L2AmountClaim & {
    /** Address that will receive the newly minted notes. */ recipient: AztecAddress;
};
/** Generates a pair secret and secret hash */
export declare function generateClaimSecret(logger?: DebugLogger): [Fr, Fr];
/** Helper for managing an ERC20 on L1. */
export declare class L1TokenManager {
    /** Address of the ERC20 contract. */
    readonly address: EthAddress;
    private publicClient;
    private walletClient;
    private logger;
    private contract;
    constructor(
    /** Address of the ERC20 contract. */
    address: EthAddress, publicClient: PublicClient<HttpTransport, Chain>, walletClient: WalletClient<HttpTransport, Chain, Account>, logger: DebugLogger);
    /**
     * Returns the balance of the given address.
     * @param address - Address to get the balance of.
     */
    getL1TokenBalance(address: Hex): Promise<bigint>;
    /**
     * Mints tokens for the given address. Returns once the tx has been mined.
     * @param amount - Amount to mint.
     * @param address - Address to mint the tokens for.
     * @param addressName - Optional name of the address for logging.
     */
    mint(amount: bigint, address: Hex, addressName?: string): Promise<void>;
    /**
     * Approves tokens for the given address. Returns once the tx has been mined.
     * @param amount - Amount to approve.
     * @param address - Address to approve the tokens for.
     * @param addressName - Optional name of the address for logging.
     */
    approve(amount: bigint, address: Hex, addressName?: string): Promise<void>;
}
/** Helper for interacting with the FeeJuicePortal on L1. */
export declare class L1FeeJuicePortalManager {
    private readonly publicClient;
    private readonly walletClient;
    private readonly logger;
    private readonly tokenManager;
    private readonly contract;
    constructor(portalAddress: EthAddress, tokenAddress: EthAddress, publicClient: PublicClient<HttpTransport, Chain>, walletClient: WalletClient<HttpTransport, Chain, Account>, logger: DebugLogger);
    /** Returns the associated token manager for the L1 ERC20. */
    getTokenManager(): L1TokenManager;
    /**
     * Bridges fee juice from L1 to L2 publicly. Handles L1 ERC20 approvals. Returns once the tx has been mined.
     * @param to - Address to send the tokens to on L2.
     * @param amount - Amount of tokens to send.
     * @param mint - Whether to mint the tokens before sending (only during testing).
     */
    bridgeTokensPublic(to: AztecAddress, amount: bigint, mint?: boolean): Promise<L2AmountClaim>;
    /**
     * Creates a new instance
     * @param pxe - PXE client used for retrieving the L1 contract addresses.
     * @param publicClient - L1 public client.
     * @param walletClient - L1 wallet client.
     * @param logger - Logger.
     */
    static new(pxe: PXE, publicClient: PublicClient<HttpTransport, Chain>, walletClient: WalletClient<HttpTransport, Chain, Account>, logger: DebugLogger): Promise<L1FeeJuicePortalManager>;
}
/** Helper for interacting with a test TokenPortal on L1 for sending tokens to L2. */
export declare class L1ToL2TokenPortalManager {
    protected publicClient: PublicClient<HttpTransport, Chain>;
    protected walletClient: WalletClient<HttpTransport, Chain, Account>;
    protected logger: DebugLogger;
    protected readonly portal: GetContractReturnType<typeof TokenPortalAbi, WalletClient<HttpTransport, Chain, Account>>;
    protected readonly tokenManager: L1TokenManager;
    constructor(portalAddress: EthAddress, tokenAddress: EthAddress, publicClient: PublicClient<HttpTransport, Chain>, walletClient: WalletClient<HttpTransport, Chain, Account>, logger: DebugLogger);
    /** Returns the token manager for the underlying L1 token. */
    getTokenManager(): L1TokenManager;
    /**
     * Bridges tokens from L1 to L2. Handles token approvals. Returns once the tx has been mined.
     * @param to - Address to send the tokens to on L2.
     * @param amount - Amount of tokens to send.
     * @param mint - Whether to mint the tokens before sending (only during testing).
     */
    bridgeTokensPublic(to: AztecAddress, amount: bigint, mint?: boolean): Promise<L2AmountClaim>;
    /**
     * Bridges tokens from L1 to L2 privately. Handles token approvals. Returns once the tx has been mined.
     * @param to - Address to send the tokens to on L2.
     * @param amount - Amount of tokens to send.
     * @param mint - Whether to mint the tokens before sending (only during testing).
     */
    bridgeTokensPrivate(to: AztecAddress, amount: bigint, mint?: boolean): Promise<L2AmountClaimWithRecipient>;
    private bridgeSetup;
}
/** Helper for interacting with a test TokenPortal on L1 for both withdrawing from and bridging to L2. */
export declare class L1TokenPortalManager extends L1ToL2TokenPortalManager {
    private readonly outbox;
    constructor(portalAddress: EthAddress, tokenAddress: EthAddress, outboxAddress: EthAddress, publicClient: PublicClient<HttpTransport, Chain>, walletClient: WalletClient<HttpTransport, Chain, Account>, logger: DebugLogger);
    /**
     * Withdraws funds from the portal by consuming an L2 to L1 message. Returns once the tx is mined on L1.
     * @param amount - Amount to withdraw.
     * @param recipient - Who will receive the funds.
     * @param blockNumber - L2 block number of the message.
     * @param messageIndex - Index of the message.
     * @param siblingPath - Sibling path of the message.
     */
    withdrawFunds(amount: bigint, recipient: EthAddress, blockNumber: bigint, messageIndex: bigint, siblingPath: SiblingPath<number>): Promise<void>;
    /**
     * Computes the L2 to L1 message leaf for the given parameters.
     * @param amount - Amount to bridge.
     * @param recipient - Recipient on L1.
     * @param l2Bridge - Address of the L2 bridge.
     * @param callerOnL1 - Caller address on L1.
     */
    getL2ToL1MessageLeaf(amount: bigint, recipient: EthAddress, l2Bridge: AztecAddress, callerOnL1?: EthAddress): Fr;
}
//# sourceMappingURL=portal_manager.d.ts.map