Class: SigningWriter<L>
Defined in: packages/overcast-core/src/protocol/signing-writer.ts:24
Composes a transaction-building OvercastWriter with an
OvercastChainSigner: each operation builds the layer's transaction (tx)
via writer, then signs + submits it via signer, yielding the signer's
receipt. The result is itself an OvercastWriter<receipt>, so callers no
longer juggle the build-then-submit two-step.
Extended by
Type Parameters
| Type Parameter | Description |
|---|---|
L extends OvercastLayer | the OvercastLayer describing this settlement layer. |
Implements
OvercastWriter<L["receipt"]>
Constructors
Constructor
new SigningWriter<L>(signer, writer): SigningWriter<L>;
Defined in: packages/overcast-core/src/protocol/signing-writer.ts:27
Parameters
| Parameter | Type |
|---|---|
signer | OvercastChainSigner<L> |
writer | OvercastWriter<L["tx"]> |
Returns
SigningWriter<L>
Properties
signer
readonly signer: OvercastChainSigner<L>;
Defined in: packages/overcast-core/src/protocol/signing-writer.ts:28
writer
readonly writer: OvercastWriter<L["tx"]>;
Defined in: packages/overcast-core/src/protocol/signing-writer.ts:29
Methods
acceptOffer()
acceptOffer(settlementOffer, collateralOffer): Promise<L["receipt"]>;
Defined in: packages/overcast-core/src/protocol/signing-writer.ts:68
matches settlement and collateral offer
Parameters
| Parameter | Type | Description |
|---|---|---|
settlementOffer | SettlementOffer | - |
collateralOffer | CollateralOffer | - |
Returns
Promise<L["receipt"]>
Implementation of
addAuthorizedKey()
addAuthorizedKey(key): Promise<L["receipt"]>;
Defined in: packages/overcast-core/src/protocol/signing-writer.ts:107
authorizes key to sign SignedOperations on the calling wallet's
behalf. Registers a signing-key record owned by the wallet; thereafter an
operator may submit that wallet's delegable calls (createCollateralOffer,
createSettlementOffer, exerciseOption) by presenting an operation signed
with key. The wallet must sign this transaction itself — you can only
authorize keys for yourself.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | the public key to authorize as a signer for this wallet. |
Returns
Promise<L["receipt"]>
Implementation of
OvercastWriter.addAuthorizedKey
closeCollateralOffer()
closeCollateralOffer(collateralOffer, operation?): Promise<L["receipt"]>;
Defined in: packages/overcast-core/src/protocol/signing-writer.ts:50
closes an open collateral offer, refunding its escrowed collateral to the maker's deposit vault
Parameters
| Parameter | Type | Description |
|---|---|---|
collateralOffer | CollateralOffer | the offer to close (must match the on-chain, content-addressed offer exactly). |
operation? | SignedOperation | delegated authorization by the offer's maker; the operation must have been signed over this offer's id. |
Returns
Promise<L["receipt"]>
Implementation of
OvercastWriter.closeCollateralOffer
closeSettlementOffer()
closeSettlementOffer(settlementOffer, operation?): Promise<L["receipt"]>;
Defined in: packages/overcast-core/src/protocol/signing-writer.ts:59
closes an open settlement offer, refunding its escrowed premium to the taker's deposit vault
Parameters
| Parameter | Type | Description |
|---|---|---|
settlementOffer | SettlementOffer | the offer to close (must match the on-chain, content-addressed offer exactly). |
operation? | SignedOperation | delegated authorization by the offer's taker; the operation must have been signed over this offer's id. |
Returns
Promise<L["receipt"]>
Implementation of
OvercastWriter.closeSettlementOffer
createCollateralOffer()
createCollateralOffer(collateralOffer, operation?): Promise<L["receipt"]>;
Defined in: packages/overcast-core/src/protocol/signing-writer.ts:32
creates a new collateral offer
Parameters
| Parameter | Type | Description |
|---|---|---|
collateralOffer | CollateralOffer | - |
operation? | SignedOperation | delegated authorization by the offer's maker; the operation must have been signed over this exact offer. |
Returns
Promise<L["receipt"]>
Implementation of
OvercastWriter.createCollateralOffer
createSettlementOffer()
createSettlementOffer(settlementOffer, operation?): Promise<L["receipt"]>;
Defined in: packages/overcast-core/src/protocol/signing-writer.ts:41
creates a new settlement offer
Parameters
| Parameter | Type | Description |
|---|---|---|
settlementOffer | SettlementOffer | - |
operation? | SignedOperation | delegated authorization by the offer's taker; the operation must have been signed over this exact offer. |
Returns
Promise<L["receipt"]>
Implementation of
OvercastWriter.createSettlementOffer
deposit()
deposit(deposit): Promise<L["receipt"]>;
Defined in: packages/overcast-core/src/protocol/signing-writer.ts:99
deposits funds into the depositor's protocol escrow vault
Parameters
| Parameter | Type | Description |
|---|---|---|
deposit | DepositParams | - |
Returns
Promise<L["receipt"]>
Implementation of
exerciseOption()
exerciseOption(
option,
amount,
metadata?,
operation?): Promise<L["receipt"]>;
Defined in: packages/overcast-core/src/protocol/signing-writer.ts:77
exercies an option with the given amount
Parameters
| Parameter | Type | Description |
|---|---|---|
option | MarketOption | - |
amount | bigint | - |
metadata? | Metadata | opaque settlement-layer metadata, forwarded to the layer verbatim (no interpretation). Defaults to empty; a physical layer needs none. Build it yourself or via OvercastSettlementLayer.buildMetadata. |
operation? | SignedOperation | delegated authorization by the option's taker; the operation must have been signed over the exercise payload (option offer ids, amount and metadata exactly as passed here). |
Returns
Promise<L["receipt"]>
Implementation of
redeemOption()
redeemOption(
option,
amount,
metadata?,
operation?): Promise<L["receipt"]>;
Defined in: packages/overcast-core/src/protocol/signing-writer.ts:88
redeems an option with the given amount
Parameters
| Parameter | Type | Description |
|---|---|---|
option | MarketOption | - |
amount | bigint | - |
metadata? | Metadata | opaque settlement-layer metadata, forwarded to the layer verbatim (see exerciseOption). |
operation? | SignedOperation | delegated authorization by the option's maker; the operation must have been signed over the redeem payload (option offer ids, amount and metadata exactly as passed here). |
Returns
Promise<L["receipt"]>
Implementation of
removeAuthorizedKey()
removeAuthorizedKey(key): Promise<L["receipt"]>;
Defined in: packages/overcast-core/src/protocol/signing-writer.ts:111
revokes a key previously authorized via addAuthorizedKey, closing
its signing-key record (the rent is refunded to the wallet). Operations
signed with key are rejected afterwards. The wallet must sign this
transaction itself.
Parameters
| Parameter | Type | Description |
|---|---|---|
key | string | the public key to deauthorize. |
Returns
Promise<L["receipt"]>
Implementation of
OvercastWriter.removeAuthorizedKey
withdraw()
withdraw(withdraw): Promise<L["receipt"]>;
Defined in: packages/overcast-core/src/protocol/signing-writer.ts:103
withdraws funds from the withdrawer's protocol escrow vault
Parameters
| Parameter | Type | Description |
|---|---|---|
withdraw | WithdrawParams | - |
Returns
Promise<L["receipt"]>