Interface: OvercastSettlementLayer<L, C>
Defined in: packages/overcast-core/src/protocol/settlement-layer.ts:37
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.
A layer defines this once per chain (e.g. a Solana physical layer) and is
registered by its type key in the chain's
SettlementLayerRegistry. The registry is a caller-side helper: it
produces the config a caller pins into details.settlementLayer before
signing. The writer never consults it — it commits whatever the offer already
carries, verbatim.
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
L extends OvercastLayer | - | the OvercastLayer describing this settlement layer. |
C | unknown | the shape read decodes this layer's config account into. |
Properties
type
readonly type: SettlementKey<L>;
Defined in: packages/overcast-core/src/protocol/settlement-layer.ts:39
This layer's type key — matches the on-chain discriminator and the registry key.
Methods
buildMetadata()?
optional buildMetadata(option): Promise<Metadata>;
Defined in: packages/overcast-core/src/protocol/settlement-layer.ts:96
Optional helper producing this layer's conventional exercise/redeem metadata. Purely a convenience: the writer forwards whatever bytes the caller passes verbatim, so a caller with an intent the SDK has no model for can ignore this and supply its own bytes.
Parameters
| Parameter | Type |
|---|---|
option | MarketOption |
Returns
Promise<Metadata>
configId()
configId(config): Promise<Bytes32>;
Defined in: packages/overcast-core/src/protocol/settlement-layer.ts:69
The id config lives at: the value a caller pins into
details.settlementLayer before signing. Nothing need be deployed there
yet — the id is derived from the configuration (a hash of its contents, a
CREATE2 address, a PDA), which is what lets an offer commit to a layer
before it exists.
Asynchronous because deriving it is not a purely local computation on every chain: a layer whose id is a hash of its own contents derives it offline, while one whose id depends on code the SDK does not hold has to ask the chain that owns that code.
Parameters
| Parameter | Type |
|---|---|
config | C |
Returns
Promise<Bytes32>
createConfig()?
optional createConfig(config): Promise<L["tx"]>;
Defined in: packages/overcast-core/src/protocol/settlement-layer.ts:88
Build a transaction that deploys a config for this layer, described by the
same shape read decodes one into and defaultConfig derives —
so a config read off one cluster can be replayed onto another verbatim, and
the layer an offer's default id commits to can be placed by handing back what
defaultConfig returned. Optional: layers whose configs are all pre-deployed
need not offer it.
Parameters
| Parameter | Type |
|---|---|
config | C |
Returns
Promise<L["tx"]>
defaultConfig()
defaultConfig(details): Promise<C>;
Defined in: packages/overcast-core/src/protocol/settlement-layer.ts:55
The config this layer settles details under when a caller selects the layer
without naming a specific one — the layer's own defaults (exercise mode,
price feeds, staleness bounds) applied to the option's terms.
Returns the config itself rather than its id, because a caller needs both
and only the layer can produce it: configId turns it into the id
pinned into details.settlementLayer, and createConfig turns the
same value into the transaction that deploys it, which is what a caller does
when the id turns out to hold nothing yet.
Asynchronous for the same reason configId is — on some chains a default is not a purely local computation.
Parameters
| Parameter | Type |
|---|---|
details | Partial<OptionDetails> |
Returns
Promise<C>
read()
read(id): Promise<C>;
Defined in: packages/overcast-core/src/protocol/settlement-layer.ts:78
Read the on-chain config account this layer owns at id and decode it into
this layer's typed config C. Because SettlementLayerRegistry.resolve
is generic over the layer key, a caller who selects a concrete layer
(resolve("oracle")) gets a precisely-typed result here with no casts.
Throws if the account doesn't exist or isn't a config this layer owns.
Parameters
| Parameter | Type |
|---|---|
id | Bytes32 |
Returns
Promise<C>