/** * @pwngh/economy-lab * * Copyright (c) Preston Neal * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */ import type { Digest, Ports, Processor, Rates, Signer, Store } from '../../src/ports.js'; import type { Ctx, FeePolicy, WorkerCtx } from '../../src/contract.js'; import type { Config, Secrets } from '../../src/config.js'; import { fixedClock, sequentialIds, silentLogger, silentMeter } from '../../src/runtime.js'; export { fixedClock, sequentialIds, silentMeter }; /** The silent logger under the name the suite has always used. */ export declare const testLogger: typeof silentLogger; /** Seeded SHA-256 (see `withSeed`), via `crypto.subtle` so the hash matches on Node, Bun, and Deno. */ export declare function seededDigest(seed?: number): Digest; /** Not real crypto: sign is a seeded hash, verify re-signs and compares — enough to exercise the path. */ export declare function seededSigner(seed?: number): Signer; /** * The production {@link configuredRates} pinned to round values so splits land on whole cents: * `buy` $0.01, `par` (the backing peg) and `payout` both $0.005 — a 50% platform spread. */ export declare function fixedRates(): Rates; /** Approves every payout with the predictable reference `prov_`. */ export declare function fakeProcessor(): Processor; /** A flat-percentage split (see `splitLegs`); stateless, so legs depend only on inputs. */ export declare function defaultPricing(): FeePolicy; /** Throwaway secrets are fine here; test/config.test.ts covers loadSecrets' missing-secret check. */ export declare function testSecrets(): Secrets; export declare function testConfig(): Config; /** * The Ctx a handler reads, wired from the deterministic doubles above; a test calls the handler * directly instead of routing through `submit`. */ export declare function makeCtx(overrides?: Partial): Ctx; /** The background worker's context (no pricing), the WorkerCtx counterpart to {@link makeCtx}. */ export declare function makeWorkerCtx(overrides?: Partial): WorkerCtx; /** A finished test Ports bag over the given store; any field overridable. */ export declare function makePorts(store: Store, overrides?: Partial): Ports; /** Predicate for assert.throws/rejects: the thrown Error carries exactly this stable code. */ export declare function hasCode(code: string): (error: unknown) => boolean;