import { Identity } from '@dfinity/agent';
import { Principal } from '@dfinity/principal';
export { identityFromPem } from './identity.js';
/**
 * Represents the structure of the token metadata stored in prometheus-tokens.json.
 */
export interface TokenInfo {
    canister_id: string;
    symbol: string;
    decimals: number;
}
/**
 * Defines the configuration for the PrometheusServerClient.
 */
export interface ServerClientConfig {
    /**
     * The server's own identity, typically loaded from a secure PEM file.
     */
    identity: Identity;
    /**
     * The Principal that will receive the funds from charges.
     */
    payoutPrincipal: Principal;
    /** The host URL for the Internet Computer. Defaults to `https://icp-api.io`. */
    host?: string;
    /**
     * Explicitly set whether to fetch the root key for local development.
     */
    fetchRootKey?: boolean;
    /**
     * The path to the token metadata file generated by the config script.
     */
    tokenConfigPath: string;
}
/**
 * Defines the arguments for the `charge` method.
 */
export interface ChargeOptions {
    /** The Principal of the user to be charged. This should be securely extracted from a validated JWT. */
    userToCharge: string | Principal;
    /** The amount to charge, specified in whole tokens (e.g., 0.01). */
    amount: number;
}
/**
 * Represents the outcome of a charge operation.
 */
export type ChargeResult = {
    ok: true;
    blockIndex: bigint;
} | {
    ok: false;
    error: string;
};
/**
 * The main client for interacting with the Prometheus Protocol from a secure server
 * environment (e.g., Node.js). It handles direct, authenticated calls to ICRC-2 ledgers.
 */
export declare class PrometheusServerClient {
    private agent;
    private payoutPrincipal;
    private tokenConfigPath;
    private tokenInfoCache;
    /**
     * Creates an instance of the PrometheusServerClient.
     * @param config The configuration for the client.
     */
    constructor(config: ServerClientConfig);
    /**
     * A private helper to lazily load token info from the local config file.
     */
    private getSupportedTokens;
    /**
     * Charges a user by executing an `icrc2_transfer_from` call.
     * This method automatically uses the first payment token configured in the
     * prometheus-tokens.json file and handles the conversion from a token amount
     * to the correct number of e8s based on the token's decimals.
     *
     * @param options An object containing the details of the charge.
     * @returns A promise that resolves to a result object indicating the outcome of the charge.
     */
    charge(options: ChargeOptions): Promise<ChargeResult>;
}
