@overcast-xyz/core
Enumerations
| Enumeration | Description |
|---|---|
| ACTIONS | Action discriminant bound into every signed operation message, so a payload can never be verified under another action's discriminant. Mirrors OperationPayload::action in operation.rs — append-only: never reuse or renumber a value. |
| SignatureCurve | - |
Classes
| Class | Description |
|---|---|
| AssetRegistry | An in-memory lookup from (domain, asset address) to its curated Asset metadata. |
| CloseOfferOperation | The signed body of an off-chain operation. Each subclass binds an action discriminant (actionByte) to a payload byte layout (payloadBytes), and digest folds both — with the shared metadata — into the canonical 32-byte message the signer commits to. |
| ConfigError | Every way one host's config was unreadable, in one throw. |
| CreateOfferOperation | The signed body of an off-chain operation. Each subclass binds an action discriminant (actionByte) to a payload byte layout (payloadBytes), and digest folds both — with the shared metadata — into the canonical 32-byte message the signer commits to. |
| DirectEd25519Signer | The default RawSigner: an in-process key over @noble/ed25519, a pure-JS implementation that runs identically in Node, browsers and other runtimes (no dependency on Node's built-in crypto). Built from a 32-byte seed (the leading half of an ed25519 secret key); createProtocolSigner derives that seed from the config's privateKey. |
| DirectSecp256k1Signer | - |
| ExerciseOperation | A taker delegating exercise_option. Unlike the offer operations this is not a content-addressed struct: the taker commits to the two offer ids, the exercise amount, and the opaque settlement metadata. |
| HexError | Thrown when a string is not well-formed hex of the expected width. A distinct class so callers validating untrusted input (a CLI prompt, a wire payload) can tell a malformed value from a genuine failure. |
| HttpOvercastView | An OvercastView backed by the Overcast backend's REST API. |
| MemoryStore | In-memory reference implementation of the storage ports. Backs both the trusted write side (OvercastStore) and the public read side (OvercastView); a real deployment swaps this for a database-backed store implementing the same interfaces. |
| MissingSignerError | Thrown when a write is attempted on an app that was built without an OvercastChainSigner — i.e. a read-only app, whose OvercastConfig carries no key material to sign with. |
| MultiOvercastApp | One handle over several chains at once: hand it the factories and it builds each chain's OvercastApp, then hands any one of them back at its original type. |
| Operation | The signed body of an off-chain operation. Each subclass binds an action discriminant (actionByte) to a payload byte layout (payloadBytes), and digest folds both — with the shared metadata — into the canonical 32-byte message the signer commits to. |
| OvercastApp | The full Overcast SDK surface for a settlement layer, organised by where each operation lands so the effect of a call is clear from how you reach it: |
| OvercastAssets | An AssetRegistry pinned to one domain and one address boundary — the shape a single-chain consumer actually wants. |
| OvercastChainClient | Concrete OvercastChain: a SigningWriter (signer + transaction writer, build → sign → submit) with the layer's OvercastReader folded in, so on-chain reads and signed writes live behind a single object. Built by OvercastApp from the pieces a ProtocolFactory resolves. |
| OvercastChainSigner | Owns the signing key + connection for a settlement layer and turns a built transaction into a confirmed on-chain result. Signs transactions — for signing arbitrary protocol payloads (off-chain authorization) see OvercastProtocolSigner. |
| OvercastCurator | Everything needed to turn raw protocol records into curated (display, wire) shapes and back: the per-domain address boundaries (OvercastUtilsRegistry) and the per-domain asset metadata (AssetRegistry). |
| OvercastHttpError | Thrown when a backend read fails — either the server answered with a non-2xx status (the status and, where present, the backend's own error message are surfaced) or the request never reached it (network / timeout, status undefined). The originating axios error is kept as Error.cause. |
| OvercastIndexer | Drives the store off the chain through three modes. Each is a step that supervise runs in a loop: |
| OvercastProtocolSigner | Signs protocol payloads — not chain transactions. Where an OvercastChainSigner turns a built transaction into an on-chain result, a protocol signer produces a detached signature over an Operation's digest, used for the protocol's off-chain authorization (e.g. authorizing an offer). |
| OvercastUtilsRegistry | Every settlement layer's OvercastUtils, keyed by the protocol domain separator — OptionDetails.domain, the same domain an indexed event and every projection row carries. |
| ProtocolFactory | The single chain-specific entry point: builds every per-layer piece the SDK composes into an OvercastApp — the on-chain OvercastReader, the transaction-building OvercastWriter, the OvercastChainSigner and the OvercastIndexerClient. A settlement layer implements this one factory (e.g. a Solana factory) and is good to go; the rest of the SDK stays chain-agnostic. |
| RedeemOperation | A maker delegating redeem_option. Mirrors ExerciseOperation: the maker commits to the two offer ids, the redeemed amount, and the opaque settlement metadata. Its payload layout is identical to the exercise payload — the action discriminant keeps their signed messages disjoint. |
| RfqClient | The realtime RFQ channel: a typed socket.io client that registers with the backend, emits request/response (ack-style) calls, and surfaces server broadcasts through the on* callbacks. Owned by OvercastApp as its rfq field; the on-chain write/read sides live on the app itself. |
| RfqError | Error thrown when a request/response (ack-style) call fails — either the server returned { ok: false } with a stable RfqErrorCode, or no ack arrived before the timeout elapsed. |
| SettlementLayerRegistry | The set of settlement layers a chain implements, keyed by type. Built by the chain's ProtocolFactory (which layers exist is a per-chain fact) and surfaced to consumers as app.settlement. |
| SigningWriter | Composes a transaction-building OvercastWriter with an OvercastChainSigner: each operation builds the layer's transaction(s) via writer, then signs + submits them via signer, yielding the signer's receipts. The result is itself an OvercastWriter<receipt>, so callers no longer juggle the build-then-submit two-step. |
| WithdrawOperation | Payload byte layout: asset (32B) |
Interfaces
| Interface | Description |
|---|---|
| AppOptions | - |
| AssetFilter | Filter for OvercastView.listAssets. |
| AssetQuery | - |
| AuthorizedKeyFilter | Filter for OvercastView.listAuthorizedKeys. All clauses are AND-ed. |
| AuthorizedKeyQuery | - |
| ClientToServerEvents | Client→server events, keyed by event name. socket.io models request/response as a trailing ack callback argument; each here resolves to an RfqAck. Use as the second type parameter on a client Socket<...> and the first on the server Server<...>. |
| ConfigFieldEntry | One field of a ConfigSchema, as configFields yields it. |
| ConfigSource | Where a host's values come from, and what it calls them when one is wrong. |
| CuratedOffer | Offer over CuratedOptionDetails. |
| LogFn | One level's log method. |
| Logger | The logging surface this package depends on. Declared here rather than re-exported from LogTape so the published API stays decoupled from the backend's own versioning. |
| LoggingOptions | - |
| MultiAppOptions | - |
| OfferClosure | How an offer's indexed events left it — the facts the raw Offer does not carry, the same way OptionTotals lives outside the raw MarketOption. An offer is consumed or refunded on-chain, never both. |
| OfferFilter | Filter for the offer listings. All clauses are AND-ed. |
| OfferQuery | - |
| OperationParams | - |
| OptionFilter | Filter for OvercastView.listOptions. All clauses are AND-ed. |
| OptionQuery | - |
| OvercastChain | The protocol's on-chain surface: authoritative reads (OvercastReader) and signed writes (OvercastWriter, yielding one TxStep<L["receipt"]> per transaction the operation took — see SigningWriter), merged into one object. Everything here touches the settlement layer directly — it costs gas, needs the signer, and is chain-specific — as opposed to the cheap, curated backend reads exposed on app.api (an OvercastView). |
| OvercastEventHistory | - |
| OvercastIndexerClient | - |
| OvercastLayer | Describes a single settlement layer by bundling the three types that vary between implementations, so the rest of the SDK threads one generic (L) instead of repeating <T, R, C> everywhere. Each consumer derives what it needs via indexed access (L["tx"], L["receipt"], L["config"]). |
| OvercastReader | - |
| OvercastSettlementLayer | The logic for one settlement layer on a given chain (L): the config (Bytes32) an offer commits to, and — for layers that have one — a convenience helper for the exercise/redeem metadata. |
| OvercastStore | The permissioned write surface. Wired only into trusted processes: - the OvercastIndexer, which streams on-chain events via insertEvents; - the RFQ service, which persists validated off-chain RFQs / quotes. |
| OvercastUtils | A settlement layer's address boundary: the complete set of conversions between the chain's own address encoding and the canonical Bytes32 slots that core works in. |
| OvercastView | The non-permissioned read surface, returning curated (display, JSON-safe) shapes. This is the interface shared across backend and frontend: a database implementation runs the query in-process, while a thin HTTP implementation in the frontend serializes the same query objects to the backend. Keep every argument and result JSON-serializable so both implementations stay honest. |
| OvercastWriter | The Overcast protocol's write operations, parameterised by the layer L they run against and by what each call yields (the read counterpart is OvercastReader). |
| Page | A single page of results plus the cursor to fetch the next one. |
| Pagination | Cursor / offset pagination. Prefer the opaque cursor (keyset pagination): it is stable while new rows are inserted and stays fast on large tables. offset is offered only as a convenience for simple, shallow UI paging. |
| RawSigner | - |
| ReadConfigOptions | Options for readConfig. |
| RfqAck | Generic ack returned from the request/response (ack-style) handlers. Kept as a generic interface (rather than a zod schema) so callers can parameterize the data shape per event; see ClientToServerEvents. |
| RfqClientOptions | - |
| RfqFilter | Filter for OvercastView.listRfqs. All clauses are AND-ed. |
| RfqQuery | - |
| ServerToClientEvents | Server→client broadcasts, keyed by event name. Use as the first type parameter on a client Socket<...> and the second on the server Server<...>, so .on(...) / .emit(...) are checked on both ends. |
| SettlementParams | The inputs a settlement-consulting write (exerciseOption / redeemOption) takes beyond the option and amount. Grouped into one object because the last of them is chain-specific: settlement is typed as the layer's OvercastLayer.settlementContext, so a context shape the chain doesn't model fails to compile rather than being smuggled in as a list of addresses. |
| SignedOperation | - |
| SortOrder | - |
| StoredQuote | A persisted quote, mirroring the curated newQuote broadcast payload. |
| StoredRfq | A persisted RFQ, mirroring the curated newRfq broadcast payload. |
| UserDepositFilter | Filter for OvercastView.listUserDeposits. All clauses are AND-ed. |
| UserDepositQuery | - |
Type Aliases
| Type Alias | Description |
|---|---|
| AcceptQuoteInput | Input to RfqClient.acceptQuote. Either sign a fresh offer for the acceptor's side over the quote's details, or accept against an existing on-chain offer by chainOfferId — the two are mutually exclusive. |
| AcceptQuotePayload | - |
| ActionName | An ACTIONS variant by name ("CreateOffer", …, "Withdraw"). |
| Address | An address in one settlement layer's own string encoding — a base58 pubkey on Solana, a checksummed 0x… address on an EVM chain. |
| Asset | Curated metadata describing a tradeable asset (see assetSchema). |
| AssetKey | An asset's identity as one string: "<domain>:<address>", the key an AssetRegistry files a domain-scoped asset under. |
| AuthorizedKey | An Ed25519 signing key an account has delegated to, projected by the indexer from that (owner, key) pair's AuthorizedKeySet / AuthorizedKeyRemoved events. A revoked key is retained with active: false rather than dropped, so the record doubles as the pair's authorization history — hence both timestamps are optional and independent (removedAt is set on a key that was authorized and later revoked, and re-authorizing it flips active back without clearing it). Already JSON-safe (no assets, no native amounts), so it needs no curated counterpart. |
| AuthorizedKeyRemoved | - |
| AuthorizedKeySet | - |
| Bytes32 | A 32-byte value as a 0x-prefixed, lower-case hex string: the protocol's canonical, cross-chain representation of everything it identifies — assets, accounts, settlement layers, salts, digests, and the content-addresses of offers and options. |
| CancelRfqPayload | - |
| ChainName | A unique name of a chain used to identify it across the OvercastApp's stack — the key a MultiOvercastApp files each chain's app under, and the value on every OvercastConfig. |
| Checkpoint | A position in the chain's log. Totally ordered by (ledgerState, txIdx). |
| CheckpointKind | Which indexer cursor a checkpoint belongs to: backfill plus one per tail, named after the Commitment it writes. - backfill — the historical sweep's descending paging cursor ("lowest point swept so far"), advanced page by page towards the start checkpoint. - live / finalized — a tail's ascending frontier ("newest head fully swept"), advanced after each sweep. live is reorg-able, finalized canonical. |
| Commitment | The confidence level of a chain head or an indexed event. live comes from the low-latency live tail and is still reorg-able; finalized is settled and canonical. The finalization sweep upgrades a row from live to finalized; a live write never downgrades one. |
| ConfigField | One string-configurable field of a layer config, as configField returns it: a parser producing V, and ConfigMeta registered alongside. |
| ConfigMeta | How one field of a layer config is named and documented in the places a string is all a host has: a --flag, an environment variable, a .env file, a secret manager. |
| ConfigSchema | A config schema: one z.object whose every field is a ConfigField. |
| ConfigShape | The string-configurable slice of a layer config C, as the shape a ConfigSchema is built from. |
| CreateRfqPayload | CreateRfqPayloadWire with rich bigint option details. domain is excluded: the RfqClient stamps the domain it is registered under. |
| CreateRfqPayloadWire | - |
| CuratedMarketOption | MarketOption over CuratedOptionDetails, enriched with the indexer-aggregated OptionTotals and OptionCreation as decimal strings (wire form). The raw MarketOption carries neither totals nor creation facts — they are derived from the option's on-chain events and only surfaced here, on the display-facing shape. |
| CuratedOptionDetails | See curatedOptionDetailsSchema. |
| Deposited | - |
| DepositParams | Parameters for a deposit into a user's protocol escrow vault. |
| Equivalent | true when A and B are mutually assignable (structurally equivalent). Preferred over invariant equality for comparing a z.infer object against a composed type like Omit<…> & Record<…>: those are the same shape but not token-identical, so a strict equality check reports a false mismatch. The tuple wrappers stop the conditionals distributing over unions. |
| EventPage | One bounded page of a OvercastIndexerClient.getEvents scan. |
| Expect | Compile-time assertion that its argument is exactly true (pair it with Equivalent). Instantiate it in a throwaway type _ = Expect<Equivalent<X, Y>> to fail the build when X and Y drift apart — used to pin hand-written wire DTOs to their canonical types. Works via the constraint: a false argument violates T extends true and is a compile error, even when _ is unused. |
| FactoryByName | The factory in T filed under N. This is what the literal name buys: a runtime key turned back into one specific factory type, so a lookup yields EvmFactory — not ProtocolFactory<EvmLayer>, and not a union — with everything chain-specific on it still reachable. |
| FactoryLayer | The OvercastLayer a factory type builds for — FactoryLayer<EvmFactory> is EvmLayer. Recovered by inference rather than declared, so a chain package needs no extra type-level bookkeeping to join a multi-app. |
| FactoryNames | The union of ChainNames a factory tuple covers, as literals — "evm" or "solana" for the pair in MultiOvercastApp's example. |
| FeePaid | - |
| Hex | Raw bytes of any length as a 0x-prefixed, lower-case hex string. The widest of the hex types: Bytes32 narrows it, and the only value in the protocol that needs the wider form is a 64-byte signature. |
| Indexed | - |
| IndexedEvents | - |
| InputConfig | - |
| KnownSettlementLayer | - |
| LogFields | Structured fields attached to a log line. |
| LogLevel | satisfies above is the guard that lets levels pass through untranslated: if LogTape ever renames a level, this stops compiling instead of failing at configure time. |
| MarketOption | - |
| MarketOptionCreated | - |
| Metadata | Opaque, layer-defined bytes forwarded to a settlement layer uninterpreted. |
| MultiApp | Any one of a multi-app's apps, as the union of their exact types (OvercastApp<EvmLayer> or OvercastApp<SolanaLayer>) rather than one app over the union layer — so it needs no cast to produce and stays honest about which app is which. |
| MultiApps | Every app a multi-app holds, keyed by its factory's ChainName. |
| MultiFactories | Every factory in T, keyed by its ChainName. |
| NewRfqPayload | - |
| Offer | - |
| OfferCancelled | - |
| OfferCreated | - |
| OfferStatus | An offer's lifecycle (see offerStatus): - open — still matchable: not consumed, not withdrawn, not past expiry. - expired — nothing closed it, but its own deadline has passed, so the program will no longer match it. Evaluated against the reader's clock. - matched — consumed by an option (named by matchedOptionId). - cancelled — withdrawn by its creator, escrow refunded. |
| OfferStatusFilter | Selects offers by lifecycle: one concrete OfferStatus, or closed as shorthand for "anything but open" (expired, matched or cancelled) — so an order-book view and its history are one scalar apart. |
| OperationConsumed | - |
| OperationReplayProtectionKeyCleared | - |
| OptionBorrowed | - |
| OptionCreation | Creation-time facts about a MarketOption that the on-chain option account doesn't hold: the indexer reads them off the option's MarketOptionCreated event. Like OptionTotals they live separately from the canonical, content-addressed option (they play no part in its id) and are only surfaced on the curated, display-facing option. |
| OptionDetails | - |
| OptionDetailsWire | - |
| OptionExercised | - |
| OptionRedeemed | - |
| OptionRepaid | - |
| OptionSide | - |
| OptionState | Where a MarketOption sits in its lifecycle — derived from its window and its OptionTotals by optionState, and surfaced on the curated option. The four states are exhaustive and mutually exclusive; each one names what the protocol will let a party do next: - pending — the exercise window hasn't opened yet (now < startTimestamp); neither party can act. - exercisable — inside the window with exercise claims left, so the taker can still exercise. - redeemable — exercise is closed (expired, or every exercise claim burnt) and collateral-return claims remain, so the maker can redeem. - finished — every collateral-return claim is burnt: both escrows are drained and nothing further can happen. |
| OptionTotals | Running burn totals for a MarketOption, aggregated by the indexer from the option's OptionExercised / OptionRedeemed events. These are not part of the canonical, content-addressed option (they don't exist on the on-chain account — the chain derives them from the claim mint supplies), so they live separately and are only surfaced on the curated, display-facing option. |
| OvercastConfig | Connection, identity and backend configuration for one chain. |
| OvercastConfigOverrides | The chain-agnostic slice of an OvercastConfig — what a caller states once and merges over a factory's own config (AppOptions.config, MultiAppOptions.config). |
| OvercastStorage | Convenience alias for an implementation that backs both ports — the typical single concrete store (memory, Postgres, …). Consumers should still depend on the narrowest port they need (OvercastStore or OvercastView). |
| Permissions | - |
| ProtocolConfig | - |
| ProtocolConfigUpdated | - |
| ProtocolFactories | A tuple of factories, one per chain — what a MultiOvercastApp is built from and stays parameterised by. |
| ProtocolInitialized | - |
| ProtocolPaused | - |
| ProtocolState | The protocol's single global on-chain record: the mutable ProtocolConfig governance can change, plus the domain fixed at genesis. Read with OvercastReader.getProtocolState. |
| QuoteAcceptedPayload | - |
| QuoteNewPayload | - |
| QuoteStatus | Lifecycle of a quote submitted against an RFQ. |
| RegisterPayload | - |
| RfqErrorCode | - |
| RfqErrorInfo | - |
| RfqStatus | Lifecycle of an RFQ. Carried now so the model is ready for reconciliation. |
| SettlementConfig | The config shape layer K decodes to — the value OvercastLayer.settlements maps that key to, and what resolve(K).read(id) returns. |
| SettlementConfigMap | A chain's settlement layers as a map from each layer's type key to the shape read() decodes that layer's on-chain config account into. Every chain must cover the KnownSettlementLayer subset (so physical / oracle are always present and always keys of keyof settlements), and may add its own extra keys. The mapped values are the per-layer config types, which is what lets SettlementLayerRegistry.resolve return a precisely-typed layer. |
| SettlementKey | The union of settlement-layer type keys a chain implements — the keys of its OvercastLayer.settlements map (always including the KnownSettlementLayer subset). Keys the SettlementLayerRegistry and every SettlementSelection. |
| SettlementLayers | The structural view of SettlementLayerRegistry — same members, minus the private fields. |
| SettlementSelection | How a caller picks a settlement layer for an offer: a bare type key (→ the layer's default config) or a { type, config } pair naming a custom config. Keyed by SettlementKey, so selecting a layer the chain doesn't implement fails to compile. |
| SignedOperationWire | - |
| StoredRfqRequest | - |
| SubmitQuotePayload | SubmitQuotePayloadWire with rich bigint option details. |
| SubmitQuotePayloadWire | - |
| TxDetails | Chain-specific parsed detail of an already-submitted transaction, as returned by an indexer lookup (OvercastIndexerClient.getTransactionInfo). Opaque at the core level; each chain narrows it (e.g. Solana's ParsedTransactionWithMeta). |
| TxHash | A submitted transaction's unique on-chain identifier (signature / hash). |
| TxInfo | The outcome of submitting a transaction to a settlement layer. Returned by ["submit"] and, by extension, by every SigningWriter method — as one TxStep per transaction the operation took, since an operation is not always a single transaction. |
| UnsignedTransaction | An optional description of the transaction |
| UserDeposit | A user's live escrow vault balance for one asset, aggregated by the indexer from that account/asset pair's Deposited / Withdrawn events. |
| UserDepositWire | A UserDeposit in wire form: the canonical slots kept as they are, with the native amount as a decimal string so the shape survives JSON.stringify. |
| UUID | A backend-minted handle for an off-chain record — an RFQ or a quote. This is usually just a uuid TODO: make this type safe uuid |
| Withdrawn | - |
| WithdrawParams | Parameters for a withdrawal from a user's protocol escrow vault. |
| WithId | A stored value paired with its content-address: the sha256 of the value's canonical byte layout (see getId). Cross-chain by construction — the same offer has the same id everywhere — and an address on no chain at all; each layer merely uses the bytes its own way, as a PDA seed on Solana or a mapping key on an EVM chain. |
Variables
| Variable | Description |
|---|---|
| acceptQuotePayloadSchema | Accept a quote — either by signing a fresh offer operation (operation + salt + expiry) or by referencing an already on-chain offer id. Carries no bigint, so the one schema is both the wire and the client-facing shape. |
| AMOUNT_ENCODED_LEN | Byte width of a token amount in the serialization: a 256-bit (u256) word. |
| assetSchema | Curated metadata describing a tradeable asset, keyed by the pair (domain, address) — the protocol domain the asset lives on plus its on-chain address in that layer's own encoding (Address). This is display data, so the address is spelled the way a human reads it, not as the canonical Bytes32 slot core hashes. Resolving one from the other is OvercastUtils.formatAddress's job, which is why every curation entry point takes the layer's utils. |
| BYTES32_LEN | Byte width of a Bytes32: an asset, an account, a salt, a digest. |
| bytes32Schema | A canonical 32-byte slot. Validated here — a wire payload is untrusted. |
| cancelRfqPayloadSchema | - |
| COMMON_CONFIG_SCHEMA | The OvercastConfig fields that mean the same thing on every chain, so every layer schema can spread its shape in rather than restating them. |
| CONFIG_FIELD | The brand configField stamps a parser with, so that a schema field declared any other way does not typecheck. |
| configMeta | Every ConfigMeta in the process, keyed by the schema it belongs to. |
| createRfqPayloadWireSchema | CreateRfqPayload with its option details in wire form. |
| curatedOptionDetailsSchema | OptionDetails with its asset fields resolved to Asset and its native amounts as decimal strings (wire form). Defined as a zod schema so it can validate broadcast DTOs; the type is inferred from it. |
| DEFAULT_BACKEND | - |
| DEFAULT_EXPIRY_DURATION | - |
| DEFAULT_TRANSPORT | - |
| domainSchema | The deployment a socket payload belongs to. Its own field rather than read off an option's terms: an RFQ's details are partial (a chainRef RFQ has none), so the terms cannot be relied on to name it. |
| hexSchema | Raw bytes of any length, e.g. a 64-byte signature. |
| hexUtils | The address boundary of the protocol's own encoding: here an address simply is its canonical Bytes32 slot, spelled in hex. |
| jsonSink | One JSON object per line, keyed the way hosted log aggregators expect: severity as a string (GCP Cloud Logging and Datadog both read it; pino's numeric level: 30 is what made these logs unreadable in the cloud) and message as the rendered text. |
| LOG_LEVELS | Level names, ordered least → most severe. These are LogTape's own names, so they pass straight through to it with no translation step. Note warning, not warn — the method is still Logger.warn. |
| logger | Default root logger for ad-hoc use. |
| METER_NAME | Instrumentation scope name grouping every instrument this package emits. |
| newRfqPayloadSchema | - |
| OPERATION_PREFIX | Domain-separation prefix distinguishing operation messages from the content-addressed struct ids (offer_id, option_id) derived in utils.ts. Must match OPERATION_PREFIX in the on-chain operation.rs. |
| OPERATION_VERSION | - |
| optionDetailsWireSchema | OptionDetails with its native bigint amounts as decimal strings — the JSON-safe wire form. |
| optionSideSchema | - |
| quoteAcceptedPayloadSchema | - |
| quoteNewPayloadSchema | - |
| registerPayloadSchema | - |
| rfqErrorCodeSchema | Stable error codes surfaced on *:error events. |
| rfqErrorSchema | The { code, message } error carried on acks and the error event. |
| rfqOptionsSchema | RFQ options bag. responder is an optional allowlist of ids permitted to respond; unknown keys pass through so future options don't need a schema bump. |
| SIGNATURE_LEN | Byte width of an ed25519 signature — the one value wider than a slot. |
| signedOperationSchema | A SignedOperation: the ed25519 signature over an operation's digest, the key that produced it, and the operation params (expiry + replay salt) it commits to. Sent wherever a payload authorizes a delegated, off-chain-signed action. Carries no bigint, so this one schema is both the wire and the client-facing shape. |
| SLOT_ENCODED_LEN | Byte width of every identified value in this layout: assets, accounts, ids. |
| submitQuotePayloadWireSchema | SubmitQuotePayload with its option details in wire form. |
| ZERO_BYTES32 | The all-zero slot: the protocol's None for an optional address. |
Functions
| Function | Description |
|---|---|
| amountFromWire | Parse a decimal-string wire amount back to a native bigint. |
| amountLE | A token amount as a 256-bit little-endian word. |
| amountToWire | Serialize a native amount to its decimal-string wire form. |
| assetKey | The AssetKey for a domain-scoped asset. |
| buildOffer | Build the correctly-shaped Offer for a side. Both carry the same terms and salt, and an expiry defaulted via defaultExpiry. |
| buildPermissionsBitmap | - |
| bytes32ToBytes | Decode a Bytes32 to its raw 32 bytes, throwing on any other width. |
| bytesToHex | Encode raw bytes as a lower-case Hex string. |
| completeOptionDetails | Complete an RFQ's (partial, curated) option terms with a market maker's quoted premium to produce the canonical, signable OptionDetails a quote is submitted over. Asset fields are resolved back to their addresses and the decimal-string amounts to native bigints. |
| concat | Concatenate byte chunks into a single Uint8Array. |
| configChoices | The values field accepts, when it accepts a closed set of them — so a host that generates flags can offer `--transport polling |
| configField | Declare one field of a config schema: how its string is parsed, and how the hosts reading it name and describe it. |
| configFieldMeta | One named field's metadata, for a host that has to read a single field on its own rather than the whole schema — the CLI asking whether a wallet identity was supplied before it decides which client to build. |
| configFields | A schema's fields in declaration order, each with its registered metadata. |
| configureLogging | Routes this package's log records to a destination. Until this is called (or LogTape is configured directly by the host) records are discarded. |
| createLogger | Creates a namespaced logger. Pass a colon-separated name to scope a subsystem, e.g. createLogger("indexer:backfill"). |
| createProtocolSigner | Resolve the OvercastProtocolSigner for a config: the explicit OvercastConfig.protocolSigner override if supplied, otherwise one wrapping a DirectEd25519Signer built from the config's privateKey. Returns undefined for a read-only config (no override and no key) — nothing to sign protocol payloads with. |
| curateMarketOption | Curate a MarketOption, folding in the indexer-aggregated OptionTotals (sourced from the option's exercise / redeem events) and its OptionCreation facts (from the MarketOptionCreated event) since the raw option carries neither, plus the lifecycle OptionState the totals imply. now (unix seconds) is accepted so a caller curating a whole page evaluates every option against one clock reading. |
| curateOffer | Curate an Offer, folding in the lifecycle its OfferClosure and expiry imply. closure defaults to "nothing closed it" for callers curating an offer they just built (an RFQ payload, a signing preview) and have no event history for; now (unix seconds) is accepted so a caller curating a whole page evaluates every offer against one clock reading. |
| curateOptionDetails | Resolve every asset field of OptionDetails against the registry, on the domain the details themselves name. An asset with no curated metadata defaults to a bare Asset carrying just the address (see AssetRegistry.getOrDefault) rather than throwing — the terms are canonical either way, and curation only annotates them. |
| defaultExpiry | Returns a default expiry timestamp in seconds, calculates the current time in seconds and adds the default expiry duration to it |
| defaultOperationParams | - |
| envSource | Values from environment variables under one prefix, e.g. OVERCAST_ for a CLI's single global namespace or BASE_ for one chain of a multi-chain backend. Pass "" for unprefixed names. |
| flagKey | The key a flag parser hands this field's value back under — --core-address becomes coreAddress, and a field with no flag falls back to its env suffix. |
| flagsThenEnv | Values from parsed CLI flags first, then the environment under prefix — the precedence a command line has: what was typed beats what was exported. |
| formatAssetAmount | Format a native amount as a display string, e.g. 1.5 SOL. |
| formatUnits | Convert a native integer bigint to a whole-token (display) decimal string, exactly — e.g. formatUnits(1_500_000_000n, 9) → "1.5". Trailing fractional zeros are trimmed. |
| getId | Content-addressed id for one of the local Overcast types, matching the on-chain HashId derivation. Discriminates the input by shape: an option references both of the offers it consumed, an offer does not. |
| getLogLevel | Returns the currently active log level, or null if logging is silenced. |
| getMeter | Resolves a Meter from the registered MeterProvider. |
| hexToBytes | Decode a hex string to its raw bytes. Re-validates rather than trusting the brand — a Hex can always have been minted by a cast — because these bytes feed signed preimages, where a silent truncation produces a digest no chain will match. |
| i64LE | i64, little-endian (8 bytes). |
| isBytes32 | Whether value is well-formed hex of exactly 32 bytes (a Bytes32). |
| isHex | Whether value is well-formed hex: 0x followed by an even number of hex digits, and — when byteLength is given — exactly that many bytes. |
| marketOptionBytes | MarketOption byte layout (374 bytes): tag(0x01) · details(245) · taker(32) · maker(32) · settlement_offer(32) · collateral_offer(32). |
| offerBytes | Offer byte layout (351 bytes): tag(0x00) · side(1) · salt(32) · creator(32) · option_details(245) · expiry(i64) · counterparty(32). |
| offerStatus | Derive an offer's OfferStatus from the events that closed it and its own deadline. now is unix seconds — the same unit as Offer.expiry — and defaults to the local clock. |
| omitUndefined | Drop the keys whose value is undefined. |
| optionState | Derive an option's OptionState from its window and its running OptionTotals. now is unix seconds — the same unit as OptionDetails.startTimestamp / endTimestamp — and defaults to the local clock. |
| parseBytes32 | Validate an untrusted string as a Bytes32 — 32 bytes exactly — or throw. Use this at every boundary that hands core an asset, account, salt or content-address: a truncated value would otherwise hash to an id no chain agrees with, and fail somewhere far from its origin. |
| parseHex | Validate an untrusted string as Hex and normalize it to lower case, or throw a HexError. The entry point for anything crossing a boundary the type system doesn't cover: a wire payload, a CLI argument, an environment variable. |
| parsePermissions | - |
| parseUnits | Convert a whole-token (display) decimal string to an exact native integer bigint. e.g. parseUnits("1.5", 9) → 1_500_000_000n. Throws if the value is malformed or specifies more fractional digits than decimals supports (which would silently truncate). |
| permissionNames | - |
| randomSalt | A fresh 32-byte salt for an offer or an operation: raw entropy, in a slot. |
| rawBytesToBytes32 | Encode exactly 32 raw bytes as a Bytes32, throwing on any other length. The width is checked rather than assumed: this is the seam a layer's OvercastUtils.toBytes32 returns through, and a short slot would shift every following field of a serialized struct. |
| readConfig | Read schema's fields out of source into the overrides a layer factory is built with. |
| serializeAmounts | Convert the native bigint amounts of an OptionDetails (possibly partial — RFQ requests omit some terms) to their decimal-string wire form, leaving every other field untouched. |
| setLogLevel | Sets the active log level, re-applying the current destination. Takes effect immediately for every logger, including ones already created. Pass null to silence logging. |
| Sleep | - |
| slot | A Bytes32 as its raw 32 bytes — the only address/id primitive this layout needs, because assets, accounts, salts and content-addresses are all the same 32-byte slot on every chain. |
| toDisplayAmount | Convert a native integer amount to a whole-token (display) decimal string, exactly — e.g. 1_500_000_000n SOL (9 decimals) → "1.5". |
| toNativeAmount | Convert a whole-token (display) amount — given as a decimal string to avoid float loss — to an exact native integer amount, using the asset's decimals. e.g. "1.5" SOL (9 decimals) → 1_500_000_000n. |
| u32LE | u32, little-endian (4 bytes). |
| u64LE | u64, little-endian (8 bytes). Native bigint so values stay exact. |
| uncurateMarketOption | Strip a CuratedMarketOption back to the raw, canonical MarketOption. The curated-only enrichments (totals, creation facts, derived state) are dropped rather than carried along — they are not part of the option's identity, and getId must see exactly the canonical shape. |
| uncurateOffer | Strip a CuratedOffer back to the raw, canonical Offer — the shape getId and the signers must see. The curated-only lifecycle (status, matchedOptionId) is dropped: it is derived, not part of the offer's identity. |
| uncurateOptionDetails | Strip a CuratedOptionDetails back to the raw OptionDetails (asset fields → their addresses). Used by clients that receive a curated broadcast but need the canonical, signable details. |