/** * Rate table primitives for Joule resource-credit metering. * * A `IRateTable` maps each `ResourceClass` to a `µJ-per-unit` price. * All arithmetic is `bigint`; no floating-point is introduced. * * @see joule-resource-credits spec, Requirement 1.1, 1.6 */ import { ResourceClass } from './resourceClass'; /** * Per-class pricing row inside a rate table. */ export interface IRateTableEntry { /** Denominator unit string, e.g. `'request'`, `'MB-day'`, `'MB-out'`. */ unit: string; /** Cost per one unit expressed in µJ (bigint). */ microJoulesPerUnit: bigint; /** Human-readable description of what this class covers. */ description: string; } /** * Versioned, signed rate table. * * Once recorded on-ledger, a rate table is immutable. * Historical pricing is preserved so that per-request events can * reference the version that was active at emit time (Req 1.3). */ export interface IRateTable { /** Monotonically increasing, starting at 1. */ version: number; /** Unix milliseconds at which this table becomes effective. */ effectiveAt: number; /** One entry per resource class. All four v1 classes must be present. */ entries: Record; /** Operator quorum key fingerprints that signed this table. */ signedBy: ReadonlyArray; } /** * Compute the µJ cost for `units` of resource class `cls` under `rate`. * * Formula: `microJoules = units * microJoulesPerUnit` (bigint, exact). * * @see joule-resource-credits spec, Requirement 1.6 */ export declare function priceMicroJoules(rate: IRateTable, cls: ResourceClass, units: bigint): bigint; /** * Default bootstrap rate table (version 1). * * Rates are intentionally conservative placeholders; the operator quorum * SHOULD submit a `RateTableUpdateAction` before opening to members. * * @see joule-resource-credits spec, Requirement 1.1 */ export declare const BOOTSTRAP_RATE_TABLE: Readonly; //# sourceMappingURL=rateTable.d.ts.map