import type { WalletChain } from '../v2/wallet-binding/types.js';
import type { SignedPassport } from '../types/passport.js';
import type { ACPCheckoutSession, ACPLineItem, ACPMoney, ACPAddress, CommerceConfig, CommerceDelegation, CommercePreflightCheck, CommercePreflightResult, CommerceActionReceipt, HumanApprovalRequest, IdempotencyStore } from '../types/commerce.js';
declare const COMMERCE_SCOPES: readonly ["commerce:checkout", "commerce:browse", "commerce:purchase", "commerce:cancel"];
type CommerceScope = typeof COMMERCE_SCOPES[number];
export declare function hasCommerceScope(delegation: CommerceDelegation, required: CommerceScope): boolean;
export declare function checkPassportGate(signedPassport: SignedPassport): CommercePreflightCheck;
export declare function checkScopeGate(delegation: CommerceDelegation): CommercePreflightCheck;
export declare function checkSpendGate(delegation: CommerceDelegation, estimatedTotal: ACPMoney): CommercePreflightCheck;
export declare function checkHumanApprovalThreshold(delegation: CommerceDelegation, estimatedTotal: ACPMoney): string | null;
export declare function checkMerchantGate(delegation: CommerceDelegation, merchantName: string): CommercePreflightCheck | null;
export declare function checkWalletGate(signedPassport: SignedPassport, walletRef: {
    chain: WalletChain;
    address: string;
}): CommercePreflightCheck;
export declare function commercePreflight(_opts: {
    signedPassport: SignedPassport;
    delegation: CommerceDelegation;
    merchantName: string;
    estimatedTotal: ACPMoney;
    config?: CommerceConfig;
    walletRef?: {
        chain: WalletChain;
        address: string;
    };
    idempotencyKey?: string;
    idempotencyStore?: IdempotencyStore;
    idempotencyWindowSeconds?: number;
}): CommercePreflightResult;
export declare function createCheckout(_opts: {
    signedPassport: SignedPassport;
    delegation: CommerceDelegation;
    config: CommerceConfig;
    items: {
        skuId: string;
        quantity: number;
    }[];
    customer?: {
        name?: string;
        email?: string;
    };
    fulfillmentAddress?: ACPAddress;
    privateKey: string;
}): Promise<{
    session: ACPCheckoutSession;
    receipt: CommerceActionReceipt;
}>;
export declare function updateCheckout(_opts: {
    signedPassport: SignedPassport;
    delegation: CommerceDelegation;
    config: CommerceConfig;
    sessionId: string;
    updates: {
        items?: {
            id: string;
            quantity: number;
        }[];
        fulfillmentAddress?: ACPAddress;
        fulfillmentOptionId?: string;
    };
    privateKey: string;
}): Promise<{
    session: ACPCheckoutSession;
    receipt: CommerceActionReceipt;
}>;
export declare function completeCheckout(_opts: {
    signedPassport: SignedPassport;
    delegation: CommerceDelegation;
    config: CommerceConfig;
    sessionId: string;
    paymentToken: string;
    paymentMethod?: string;
    privateKey: string;
}): Promise<{
    session: ACPCheckoutSession;
    receipt: CommerceActionReceipt;
    spendUpdated: CommerceDelegation;
}>;
export declare function cancelCheckout(_opts: {
    signedPassport: SignedPassport;
    delegation: CommerceDelegation;
    config: CommerceConfig;
    sessionId: string;
    privateKey: string;
}): Promise<{
    session: ACPCheckoutSession;
    receipt: CommerceActionReceipt;
}>;
export declare function requestHumanApproval(opts: {
    agentId: string;
    delegationId: string;
    merchantName: string;
    items: ACPLineItem[];
    totalAmount: ACPMoney;
    reason: string;
    expiresInMinutes?: number;
}): HumanApprovalRequest;
export declare function signCommerceReceipt(opts: {
    agentId: string;
    delegationId: string;
    actionType: CommerceActionReceipt['action']['type'];
    target: string;
    method: string;
    session: ACPCheckoutSession;
    merchantName: string;
    delegationChain: string[];
    beneficiary: string;
    privateKey: string;
}): CommerceActionReceipt;
export declare function extractDelegationChain(sp: SignedPassport): string[];
export declare function createCommerceDelegation(opts: {
    agentId: string;
    delegationId: string;
    spendLimit: number;
    currency?: string;
    approvedMerchants?: string[];
    requireHumanApproval?: boolean;
    humanApprovalThreshold?: number;
    additionalScopes?: string[];
}): CommerceDelegation;
export declare function getSpendSummary(delegation: CommerceDelegation): {
    limit: number;
    spent: number;
    remaining: number;
    currency: string;
    utilizationPercent: number;
    nearLimit: boolean;
};
export declare function verifyCommerceReceipt(receipt: CommerceActionReceipt, publicKey: string): {
    valid: boolean;
    errors: string[];
};
export {};
//# sourceMappingURL=commerce.d.ts.map