Skip to main content

Offer

@midnight/zswap v3.0.2 β€’ Readme | API


@midnight/zswap v3.0.2 / Offer

Class: Offer

A full Zswap offer; the zswap part of a transaction

Consists of sets of Inputs, Outputs, and Transients, as well as a deltas vector of the transaction value

Constructors​

new Offer()​

private new Offer(): Offer

Returns​

Offer

Properties​

deltas​

readonly deltas: Map<string, bigint>;

The value of this offer for each token type; note that this may be negative

This is input coin values - output coin values, for value vectors


inputs​

readonly inputs: Input[];

The inputs this offer is composed of


outputs​

readonly outputs: Output[];

The outputs this offer is composed of


transient​

readonly transient: Transient[];

The transients this offer is composed of

Methods​

merge()​

merge(other): Offer

Combine this offer with another

Parameters​

β€’ other: Offer

Returns​

Offer


serialize()​

serialize(netid): Uint8Array

Parameters​

β€’ netid: NetworkId

Returns​

Uint8Array


toString()​

toString(compact?): string

Parameters​

β€’ compact?: boolean

Returns​

string


deserialize()​

static deserialize(raw, netid): Offer

Parameters​

β€’ raw: Uint8Array

β€’ netid: NetworkId

Returns​

Offer