import { BigNumber, BigNumberish, Contract, ContractReceipt, ContractTransaction } from 'ethers';
import { BaseActionObject, State, StateMachine } from 'xstate';
import { ApprovalPermit } from './utils';
export declare type ApprovalContract = Contract | {
    allowance: (owner: string, spender: string) => Promise<BigNumber>;
    approve: (spender: string, amount: BigNumberish) => Promise<ContractTransaction>;
} | null;
export declare type VestingContract = Contract | {
    approveProtocol: () => Promise<ContractTransaction>;
} | null;
export declare type PermitApprovalInput = {
    /** Chain ID to do approval on */
    permitApprovalChain: number;
    /** @example https://github.com/graphprotocol/contracts/blob/dev/contracts/token/GraphToken.sol#L37 */
    l1TokenDomainSalt: string;
};
export interface ApprovalFlowMachineCtx {
    ethereumAccount: string | null;
    approvalContract: ApprovalContract;
    spender: string | null;
    approvalConfirmations?: number;
    vestingContract: VestingContract;
    vestingContractAddress: string | null;
    allowedAmount: BigNumber;
    allowedPermitAmount: BigNumber;
    approvalAmount: BigNumber | null;
    approvalTxResponse?: ContractTransaction;
    approvalTxReceipt?: ContractReceipt;
    approvalPermit?: ApprovalPermit;
    permitApprovalInput?: PermitApprovalInput;
}
export declare type ApprovalFlowMachineEvent = {
    type: 'SET_SPENDER';
    payload: string;
} | {
    type: 'RETRIEVE_ALLOWANCE';
} | {
    type: 'UPDATE_ALLOWANCE';
    payload: BigNumber;
} | {
    type: 'UPDATE_ALLOWANCE_PERMIT';
    payload: BigNumber;
};
export declare type ApprovalFlowMachineServices = {
    handleRetrieveAllowance: {
        data: BigNumber;
    };
    handleUpdateAllowance: {
        payload: BigNumber;
        data: ContractTransaction;
    };
    handleUpdatePermitAllowance: {
        payload: BigNumber;
        data: ApprovalPermit;
    };
    handleWaitForUpdateAllowanceToComplete: {
        data: ContractReceipt;
    };
};
export declare type ApprovalFlowStateMachine = StateMachine<ApprovalFlowMachineCtx, any, ApprovalFlowMachineEvent, {
    value: any;
    context: ApprovalFlowMachineCtx;
}, BaseActionObject, ApprovalFlowMachineServices, any>;
export declare type ApprovalFlowState = State<ApprovalFlowMachineCtx, ApprovalFlowMachineEvent>;
export default function buildApprovalFlowMachine(ethereumAccount: string | null, approvalContract: ApprovalContract, spender: string | null, vestingContract?: VestingContract, vestingContractAddress?: string | null, approvalConfirmations?: number, permitApprovalInput?: PermitApprovalInput): ApprovalFlowStateMachine;
