Skip to main content

Interface: ClientToServerEvents

Defined in: packages/overcast-core/src/rfq/events.ts:335

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<...>.

Properties​

acceptQuote​

acceptQuote: (payload, ack) => void;

Defined in: packages/overcast-core/src/rfq/events.ts:345

Parameters​

ParameterTypeDescription
payload{ offer: | Bytes32 | { expiry: number; operation: { curve: SignatureCurve; digest: Bytes32; expiry: number; salt: Bytes32; signature: Hex; signingKey: Bytes32; }; salt: Bytes32; }; quoteId: string; }-
payload.offer| Bytes32 | { expiry: number; operation: { curve: SignatureCurve; digest: Bytes32; expiry: number; salt: Bytes32; signature: Hex; signingKey: Bytes32; }; salt: Bytes32; }The user responds either with a signed offer operation to accept the quote, or an on-chain offer id.
payload.quoteIdstring-
ack(res) => void-

Returns​

void


cancelQuote​

cancelQuote: (payload, ack) => void;

Defined in: packages/overcast-core/src/rfq/events.ts:350

Parameters​

ParameterTypeDescription
payload{ operation?: { curve: SignatureCurve; digest: Bytes32; expiry: number; salt: Bytes32; signature: Hex; signingKey: Bytes32; }; quoteId: string; }-
payload.operation?{ curve: SignatureCurve; digest: Bytes32; expiry: number; salt: Bytes32; signature: Hex; signingKey: Bytes32; }-
payload.operation.curveSignatureCurveThe curve that was used to sign the digest
payload.operation.digestBytes32The digest that has been signed
payload.operation.expirynumberUnix seconds after which the operation is no longer valid.
payload.operation.saltBytes32Random per-operation salt (nonce) for replay protection.
payload.operation.signatureHexed25519 signature over the operation digest — 64 raw bytes in hex.
payload.operation.signingKeyBytes32The public key that produced signature.
payload.quoteIdstring-
ack(res) => void-

Returns​

void


cancelRfq​

cancelRfq: (payload, ack) => void;

Defined in: packages/overcast-core/src/rfq/events.ts:349

Parameters​

ParameterType
payload{ rfqId: string; }
payload.rfqIdstring
ack(res) => void

Returns​

void


createRfq​

createRfq: (payload, ack) => void;

Defined in: packages/overcast-core/src/rfq/events.ts:337

Parameters​

ParameterTypeDescription
payload{ creator: Bytes32; domain: number; options?: { [key: string]: unknown; responder?: Bytes32[]; }; request: | { details: { borrowAllowed?: boolean; collateralAmount?: string; collateralAsset?: Bytes32; domain?: number; endTimestamp?: number; premiumAmount?: string; premiumAsset?: Bytes32; settlementAmount?: string; settlementAsset?: Bytes32; settlementLayer?: Bytes32; startTimestamp?: number; }; expiry?: number; type: "terms"; } | { offerId: Bytes32; type: "chainRef"; }; side: "TAKER" | "MAKER"; }-
payload.creatorBytes32-
payload.domainnumberThe deployment this RFQ is for. Stamped by the RfqClient from the domain it registered under, so it cannot disagree with register.
payload.options?{ [key: string]: unknown; responder?: Bytes32[]; }RFQ options; there might be an unknown option in the future.
payload.options.responder?Bytes32[]Optional list that are allowed to respond. If not provided, everyone can respond
payload.request| { details: { borrowAllowed?: boolean; collateralAmount?: string; collateralAsset?: Bytes32; domain?: number; endTimestamp?: number; premiumAmount?: string; premiumAsset?: Bytes32; settlementAmount?: string; settlementAsset?: Bytes32; settlementLayer?: Bytes32; startTimestamp?: number; }; expiry?: number; type: "terms"; } | { offerId: Bytes32; type: "chainRef"; }Either an off-chain request (partial details the creator asks for, plus an optional expiry), or an already on-chain quoteId.
payload.side"TAKER" | "MAKER"RFQ is designed in a way that it is side un-aware. Both makers or takers of options can create RFQs.
ack(res) => void-

Returns​

void


register​

register: (payload, ack) => void;

Defined in: packages/overcast-core/src/rfq/events.ts:336

Parameters​

ParameterType
payload{ address: Address; domain: number; role: "TAKER" | "MAKER"; }
payload.addressAddress
payload.domainnumber
payload.role"TAKER" | "MAKER"
ack(res) => void

Returns​

void


skipRfq​

skipRfq: (payload, ack) => void;

Defined in: packages/overcast-core/src/rfq/events.ts:354

Parameters​

ParameterTypeDescription
payload{ reason?: string; rfqId: string; }-
payload.reason?stringOptional human-readable reason, relayed to the RFQ's creator.
payload.rfqIdstringThe RFQ being skipped.
ack(res) => void-

Returns​

void


submitQuote​

submitQuote: (payload, ack) => void;

Defined in: packages/overcast-core/src/rfq/events.ts:341

Parameters​

ParameterTypeDescription
payload{ creator: Bytes32; details: { borrowAllowed: boolean; collateralAmount: string; collateralAsset: Bytes32; domain: number; endTimestamp: number; premiumAmount: string; premiumAsset: Bytes32; settlementAmount: string; settlementAsset: Bytes32; settlementLayer: Bytes32; startTimestamp: number; }; expiry: number; operation: { curve: SignatureCurve; digest: Bytes32; expiry: number; salt: Bytes32; signature: Hex; signingKey: Bytes32; }; rfqId: string; salt: Bytes32; side: "TAKER" | "MAKER"; }-
payload.creatorBytes32-
payload.details{ borrowAllowed: boolean; collateralAmount: string; collateralAsset: Bytes32; domain: number; endTimestamp: number; premiumAmount: string; premiumAsset: Bytes32; settlementAmount: string; settlementAsset: Bytes32; settlementLayer: Bytes32; startTimestamp: number; }Answer has to be with full details.
payload.details.borrowAllowedboolean-
payload.details.collateralAmountstring-
payload.details.collateralAssetBytes32-
payload.details.domainnumber-
payload.details.endTimestampnumber-
payload.details.premiumAmountstring-
payload.details.premiumAssetBytes32-
payload.details.settlementAmountstring-
payload.details.settlementAssetBytes32-
payload.details.settlementLayerBytes32-
payload.details.startTimestampnumber-
payload.expirynumberExpiry when this quote becomes invalid.
payload.operation{ curve: SignatureCurve; digest: Bytes32; expiry: number; salt: Bytes32; signature: Hex; signingKey: Bytes32; }The signed offer operation authorizing this quote.
payload.operation.curveSignatureCurveThe curve that was used to sign the digest
payload.operation.digestBytes32The digest that has been signed
payload.operation.expirynumberUnix seconds after which the operation is no longer valid.
payload.operation.saltBytes32Random per-operation salt (nonce) for replay protection.
payload.operation.signatureHexed25519 signature over the operation digest — 64 raw bytes in hex.
payload.operation.signingKeyBytes32The public key that produced signature.
payload.rfqIdstringThe RFQ that this quote responds to.
payload.saltBytes32The salt to use for the offer object.
payload.side"TAKER" | "MAKER"The side is the opposite of the RFQ's side.
ack(res) => void-

Returns​

void