import type { Address, PublicClient } from "viem"; import type { SomniaMarketsAddresses } from "./config.js"; /** * On-chain state of the configured MarketCreator (part of {@link SystemInfo}). * Fields read via failure-tolerant calls: `null`/`0n` fallbacks mean the read * failed, not a live zero. * * @category system */ export interface MarketCreatorInfo { /** Markets this creator has minted (`marketCount()`; `0n` if the read failed). */ marketCount: bigint; /** Creator owner; `null` when the read failed. */ owner: Address | null; /** Gas limit its reactivity roll callbacks run with. */ reactivityGasLimit: bigint; /** Reactivity-callback fee ceiling (wei per gas). */ reactivityMaxFeePerGas: bigint; /** Reactivity-callback tip (wei per gas). */ reactivityPriorityFeePerGas: bigint; /** Origin operator id this creator's markets are attributed to. */ operatorId: number; /** Origin venue id within the operator (bytes32 hex). */ venueId: string; } /** * Live snapshot of the deployed CLOB-family contract state, as read by * {@link SomniaMarketsClient.getSystemInfo}. Every field is failure-tolerant: `null` means the * contract is unconfigured or the live read failed — never a thrown error. * * @category system */ export interface SystemInfo { /** BinaryMarketsModule.clobFactory() (authoritative) or the configured fallback. */ clobFactory: Address | null; /** * ClobFactory.binaryMarketImpl(), or null when the live read fails (there is * no configured market-impl fallback; `binaryPoolImpl` is a different contract). */ binaryMarketImpl: Address | null; /** True when the live ClobFactory differs from the configured one. */ factoryMismatch: boolean; /** * The BinarySettlement singleton the module is wired to (live * `BinaryMarketsModule.settlement()`, falling back to the configured * `addresses.binarySettlement`). Null pre-wire / on pre-v2 deploys. */ settlement: Address | null; /** True when the module's live settlement differs from the configured one. */ settlementMismatch: boolean; /** The configured MarketCreator's state; null when `addresses.marketCreator` is unset. */ marketCreator: MarketCreatorInfo | null; /** FakeOracle wiring; null when `addresses.fakeOracle` is unset. */ oracle: { /** FakeOracle owner (the resolve/void signer); null when the read failed. */ owner: Address | null; /** The module the oracle delivers to (its `RECEIVER`); null when the read failed. */ binaryModule: Address | null; } | null; /** * Collateral ERC-20 metadata (from `addresses.collateral`, falling back to the * legacy `testUsdc`); null when neither is configured. */ usdc: { /** Token symbol; null when the read failed. */ symbol: string | null; /** Token decimals; null when the read failed. */ decimals: number | null; } | null; } /** Live snapshot of the deployed CLOB family (for the /system dashboard). */ export declare function getSystemInfo(client: PublicClient, addresses: SomniaMarketsAddresses): Promise; /** Native (gas-token) balance of an address. */ export declare function getNativeBalance(address: Address, client: PublicClient): Promise; /** * Chain-direct summary of one transaction — sender, gas spent, fee paid, * status — for enriching an order/fill view with what the tx cost. One * `eth_getTransactionByHash` + one `eth_getTransactionReceipt`, in parallel. */ export interface TransactionSummary { /** Sender (the wallet that paid gas), lowercased. */ from: string; /** Target contract, lowercased; null on a deployment. */ to: string | null; nonce: number; status: "success" | "reverted"; gasUsed: bigint; /** The sender's gas limit for the tx. */ gasLimit: bigint; effectiveGasPrice: bigint; /** gasUsed × effectiveGasPrice — the fee paid, wei of the native token. */ feeWei: bigint; /** Native value sent with the tx (wei). */ value: bigint; /** Log records in the receipt — how much the tx did (batch orders emit many). */ logCount: number; } /** * {@link TransactionSummary} for `hash`, or null when the tx is unknown to the * node (never landed, or pruned). Rejected inputs (not a 32-byte hash) also * return null rather than throwing — callers treat this as best-effort * enrichment. */ export declare function getTransactionSummary(hash: string, client: PublicClient): Promise;