Skip to main content

@overcast-xyz/evm-client

Classes​

ClassDescription
EvmChainlinkLayerEVM's oracle settlement layer, priced off Chainlink Data Feeds: the config binds an asset pair to one feed per leg plus a staleness bound and a resolution style, and that whole binding determines the layer's address.
EvmChainSignerEVM implementation of OvercastChainSigner: takes the { to, data, value } an EvmWriter builds and turns it into a mined, status-checked receipt.
EvmFactoryThe EVM ProtocolFactory: a single EvmConfig is all the SDK needs to build every per-layer piece — the EvmProvider the clients run on, the calldata-encoding EvmWriter, the EvmReader, the EvmIndexerClient and (when there is key material) the EvmChainSigner. Hand it to OvercastApp.create and the rest of the SDK stays chain-agnostic. Protocol-payload signing is chain-agnostic and lives in core — see createProtocolSigner.
EvmIndexerClientEVM implementation of OvercastIndexerClient.
EvmPhysicalLayerEVM's physical settlement layer: settlement happens in the option's own assets, so the layer carries no metadata and commits to the ExerciseMode.Full layer by default.
EvmProviderEverything an EvmConfig says about how to reach the chain, resolved once and shared: the Chain the clients are bound to, the Transport they speak over, the read-only PublicClient the reader / writer / indexer all run on, and — only when the config carries something to sign with — the Account and WalletClient the EvmChainSigner submits through.
EvmReaderEVM implementation of OvercastReader: the read-only side of the protocol. It needs only a viem PublicClient (no account), so it serves read-only clients too.
EvmUtilsEVM's OvercastUtils: the whole boundary between 0x… addresses and the canonical 32-byte slots core works in.
EvmWriterEVM implementation of OvercastWriter: the write side of the protocol, yielding built-but-unsubmitted EvmLayer.txs that the caller signs and sends (or hands to SigningWriter, which does both).

Interfaces​

InterfaceDescription
EvmConfig-
EvmLayer-

Type Aliases​

Type AliasDescription
EvmEscrowKeyOne entry in core's escrow ledgers, see EvmReader.escrowBalances.
EvmFinalityHow a deployment's chain settles, i.e. what Commitment: "finalized" resolves to for everything that reads a canonical head — today the indexer's canonical tier and its backfill ceiling.
EvmTxDetailsThe raw material one transaction's events were decoded from, as the IndexedEvents.tx the store archives.
OracleSettlementConfigDecoded EvmChainlinkLayer config, mirroring the contract's ChainlinkSettlementConfig: the two assets, the feed each is priced off, and the settlement policy. Every field is a constructor argument, so all of it lands in the layer's address — the address alone says exactly which assets settle against which feeds under which policy.
PhysicalSettlementConfigDecoded EvmPhysicalLayer config. Physical settlement is fully described by its exercise mode — everything else about the trade lives on the option itself — and that one byte is the layer contract's only constructor argument, so it alone determines the address.

Variables​

VariableDescription
anvil-
DEFAULT_CHAIN_IDanvil's chain id — the default deployment target when none is supplied.
DEFAULT_CHAINLINK_FEEDSCHAINLINK_FEEDS as the per-chain lookup tables, built once.
DEFAULT_CHAINLINK_PARAMETERSThe policy fields EvmChainlinkLayer.defaultConfig fills in.
DEFAULT_FINALITYDefault EvmConfig.finality.
DEFAULT_LOG_BLOCK_RANGEDefault EvmConfig.logBlockRange.
DEFAULT_RECEIPT_POLL_INTERVALDefault EvmConfig.receiptPollInterval, in milliseconds.
DEFAULT_RPC_URLLocal anvil node — the default RPC endpoint when none is supplied.
DEFAULT_TX_CONFIRMATIONSDefault EvmConfig.txConfirmations: mined, and nothing beyond it. See the field for why this is not EvmConfig.finality.
EVM_CONFIG_SCHEMAHow an EVM deployment is configured from strings — a --flag, an environment variable, a secret manager — for any host that has to read one: the CLI's global flags, a backend's per-chain environment.
evmUtilsShared, stateless EvmUtils — address conversion needs no config.

Functions​

FunctionDescription
chainlinkFeedMapA feed table from [asset, feed] address pairs — the shape EvmChainlinkLayer looks assets up in.
chainlinkFeedsForThe default feeds for chainId, or an empty table when none are known.
evmAddressA 20-byte EVM address.
evmConfigBuild a complete EvmConfig from a partial one.
evmFinalitySee EvmFinality: the block tag by name, or a confirmation depth.
evmHex0x-prefixed hex of exactly bytes bytes.
fromMarketOptionThe core domain's MarketOption as the contract struct — what every write against a live option submits, since core stores only the id and rebuilds the option from the terms handed in.
fromOfferThe core domain's Offer as the contract struct — what EvmWriter submits to createOffer.
fromOptionDetailsThe core domain's OptionDetails as the contract struct.
fromSideThe core domain's OptionSide as the contract's numeric enum.
fromSignedOperationCore's SignedOperation as the authorization envelope every *Signed entry point takes.
resolveEvmAccountThe account a config signs as, or undefined for a read-only one.
resolveEvmChainThe viem Chain for a config: the explicit EvmConfig.chain if supplied, otherwise a minimal definition synthesized from chainId + rpcUrl.
toEvmSideA decoded uint8 narrowed to the contract's OptionSide.
toMarketOptionThe contract's MarketOption as the core domain shape.
toOfferThe contract's Offer as the core domain shape.
toOptionDetailsThe contract's OptionDetails as the core domain shape.
toPrivateKeyHexKey material from an OvercastConfig as the 32-byte hex secp256k1 key viem wants. Accepts a 0x-prefixed hex string or a raw byte array.
toProtocolConfigThe contract's ProtocolConfig as the core domain shape — what the ProtocolInitialized and ProtocolConfigUpdated logs carry.
toSideThe contract's numeric OptionSide as the core domain union.
toSlotWiden anything up to 32 bytes into a canonical slot — the padding primitive EvmUtils.toBytes32 is built on.