/**
 * UCD Mint Authorization Utilities
 *
 * Generates authorization signatures for UCD mint requests
 * that can be verified by the ucd-mint-validator LIT Action.
 * Also includes withdrawal authorization utilities.
 */
import { type Provider, type Signer } from "ethers";
/**
 * Owner Authorization Interface (matches lit-actions)
 */
export interface MintOwnerAuthorization {
    positionId: string;
    timestamp: number;
    chainId: number;
    amount: string;
    action: string;
    signature: string;
}
/**
 * Build the mint authorization message hash without signing.
 *
 * Use this when signing with a smart contract wallet (e.g. Safe) that
 * needs to wrap the hash in its own domain before signing.
 *
 * Returns the raw hash AND the timestamp so both can be passed to
 * generateMintAuthorization via the pre-computed signature overload.
 *
 * @param positionId - Position identifier
 * @param amount - Amount to mint in wei (bigint)
 * @param chainId - Chain ID for cross-chain replay protection
 * @returns { hash, timestamp } — pass these to Safe for signing
 */
export declare function buildMintAuthorizationHash(positionId: string, amount: bigint, chainId: number): {
    hash: string;
    timestamp: number;
};
/**
 * Generate mint authorization signature
 *
 * Creates a signature that matches the format expected by
 * AuthorizationModule.verifyMintAuthorization in lit-actions.
 *
 * Message structure:
 * solidityKeccak256(
 *   ["bytes32", "uint256", "uint256", "uint256", "bytes32"],
 *   [positionId, timestamp, chainId, amount, actionHash]
 * )
 *
 * Where:
 * - actionHash = keccak256("mint-ucd")
 * - Signer address is recovered from signature by LIT Action
 * - LIT Action validates recovered address === position owner
 *
 * @param positionId - Position identifier
 * @param amount - Amount to mint in wei (bigint)
 * @param chainId - Chain ID for cross-chain replay protection
 * @param signerOrPrecomputed - Either an ethers Signer (EOA) or { timestamp, signature } for smart contract wallets
 * @returns Authorization object with signature
 */
export declare function generateMintAuthorization(positionId: string, amount: bigint, chainId: number, signerOrPrecomputed: Signer | {
    timestamp: number;
    signature: string;
}): Promise<MintOwnerAuthorization>;
/**
 * Payment Authorization Interface (matches lit-actions)
 */
export interface PaymentOwnerAuthorization {
    positionId: string;
    timestamp: number;
    chainId: number;
    amount: string;
    action: string;
    signature: string;
}
/**
 * Extend Position Authorization Interface (matches lit-actions)
 */
export interface ExtendOwnerAuthorization {
    positionId: string;
    timestamp: number;
    chainId: number;
    selectedTerm: number;
    action: string;
    signature: string;
}
/**
 * Balance Confirmation Authorization Interface
 * For permissionless balance confirmation with quantum security
 */
export interface BalanceConfirmationAuthorization {
    positionId: string;
    timestamp: number;
    chainId: number;
    caller: string;
    action: string;
    signature: string;
}
/**
 * Generate payment authorization signature
 *
 * Creates a signature that matches the format expected by
 * process-payment-validator LIT Action.
 *
 * Message structure:
 * solidityKeccak256(
 *   ["bytes32", "uint256", "uint256", "uint256", "bytes32"],
 *   [positionId, timestamp, chainId, amount, actionHash]
 * )
 *
 * Where:
 * - actionHash = keccak256("make-payment")
 * - Signer address is recovered from signature by LIT Action
 * - LIT Action validates recovered address === position owner
 */
export declare function generatePaymentAuthorization(positionId: string, amount: bigint, chainId: number, signer: Signer): Promise<PaymentOwnerAuthorization>;
/**
 * Generate extend position authorization signature
 *
 * Creates a signature that matches the format expected by
 * extend-position-validator LIT Action.
 *
 * Message structure:
 * solidityKeccak256(
 *   ["bytes32", "uint256", "uint256", "uint256", "bytes32"],
 *   [positionId, timestamp, chainId, selectedTerm, actionHash]
 * )
 *
 * Where:
 * - actionHash = keccak256("extend-position")
 * - Signer address is recovered from signature by LIT Action
 * - LIT Action validates recovered address === position owner
 */
export declare function generateExtendAuthorization(positionId: string, selectedTerm: number, chainId: number, signer: Signer): Promise<ExtendOwnerAuthorization>;
/**
 * Optional Chipotle service fallback for `getPKPPublicKeyFromTokenId`.
 *
 * Chipotle PKPs have no on-chain `getPubkey(tokenId)` lookup, so when the
 * SDK's in-memory `pkp-data` cache is empty (page reload, new device, cleared
 * browser data) we recover the public key by re-running pkp-validator via the
 * lit-ops-server `/api/lit/pkp/derive-public-key` endpoint. Chipotle key
 * derivation is deterministic from `pkpId`, so this returns the same key.
 */
export interface ChipotleServiceFallback {
    serviceEndpoint: string;
    /** Returns `Authorization`-style headers for the lit-ops-server request. */
    getAuthHeader?: () => Promise<Record<string, string>>;
    borrowerAddress?: string;
    timeoutMs?: number;
    debug?: boolean;
}
/**
 * Get PKP public key from PKP token ID.
 *
 * For legacy PKPs minted as NFTs on Chronicle Yellowstone: looks up
 * via `getPubkey(tokenId)` on the supplied PKP NFT contract.
 *
 * For Chipotle PKPs (ABI-encoded ETH address): there is no on-chain lookup, so
 * if `chipotleFallback.serviceEndpoint` is configured, the public key is
 * derived by calling lit-ops-server. If the fallback is not configured, this
 * throws with a clear diagnostic.
 *
 * @param pkpTokenId - PKP token ID (bytes32 hex string)
 * @param provider - Ethereum provider connected to the PKP NFT chain (legacy PKPs only)
 * @param pkpNftContractAddress - PKP NFT contract address on that chain (legacy PKPs only)
 * @param chipotleFallback - Service-mode fallback used when pkpTokenId is a Chipotle id
 * @returns PKP public key as hex string with '0x' prefix
 */
export declare function getPKPPublicKeyFromTokenId(pkpTokenId: string, provider?: Provider, pkpNftContractAddress?: string, chipotleFallback?: ChipotleServiceFallback): Promise<string>;
/**
 * Withdraw Owner Authorization Interface (matches lit-actions)
 */
export interface WithdrawOwnerAuthorization {
    positionId: string;
    timestamp: number;
    chainId: number;
    amount: string;
    action: string;
    signature: string;
}
/**
 * Build the withdraw authorization message hash without signing.
 *
 * Use this when signing with a smart contract wallet (e.g. Safe) that
 * needs to wrap the hash in its own domain before signing.
 *
 * @param positionId - Position identifier
 * @param amount - Amount to withdraw in satoshis (bigint)
 * @param chainId - Chain ID for cross-chain replay protection
 * @param destinationAddress - Bitcoin destination address
 * @returns { hash, timestamp } — pass these to Safe for signing
 */
export declare function buildWithdrawAuthorizationHash(positionId: string, amount: bigint, chainId: number, destinationAddress: string): {
    hash: string;
    timestamp: number;
};
/**
 * Generate withdrawal authorization signature
 *
 * Creates a signature that matches the format expected by
 * AuthorizationModule.verifyWithdrawAuthorization in lit-actions.
 *
 * Message structure:
 * solidityKeccak256(
 *   ["bytes32", "uint256", "uint256", "uint256", "string", "bytes32"],
 *   [positionId, timestamp, chainId, amount, destinationAddress, actionHash]
 * )
 *
 * Where:
 * - actionHash = keccak256("withdraw-btc")
 * - Signer address is recovered from signature by LIT Action
 * - LIT Action validates recovered address === position owner
 *
 * @param positionId - Position identifier
 * @param amount - Amount to withdraw in satoshis (bigint)
 * @param chainId - Chain ID for cross-chain replay protection
 * @param signerOrPrecomputed - Either an ethers Signer (EOA) or { timestamp, signature } for smart contract wallets
 * @param destinationAddress - Bitcoin address for withdrawal
 * @returns Authorization object with signature
 */
export declare function generateWithdrawAuthorization(positionId: string, amount: bigint, // satoshis
chainId: number, signerOrPrecomputed: Signer | {
    timestamp: number;
    signature: string;
}, destinationAddress: string): Promise<WithdrawOwnerAuthorization>;
/**
 * Generate balance confirmation authorization signature
 *
 * Creates a signature for permissionless balance confirmation with quantum security.
 * Unlike mint/payment (owner-signed), this is signed by the caller (anyone).
 *
 * Message structure:
 * solidityKeccak256(
 *   ["bytes32", "uint256", "uint256", "address", "bytes32"],
 *   [positionId, timestamp, chainId, caller, actionHash]
 * )
 *
 * Where:
 * - actionHash = keccak256("confirm-balance")
 * - Signer is the caller (anyone can call permissionlessly)
 * - Quantum timestamp validates timing security
 *
 * @param positionId - Position identifier
 * @param chainId - Chain ID for cross-chain replay protection
 * @param signer - Ethereum signer to sign with (the caller)
 * @returns Authorization object with signature
 */
export declare function generateBalanceConfirmationAuthorization(positionId: string, chainId: number, signer: Signer): Promise<BalanceConfirmationAuthorization>;
