Skip to main content

@midnight/zswap v0.3.11Readme | API


@midnight/zswap v0.3.11 / 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()

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(): Uint8Array

Returns

Uint8Array


toString()

toString(compact?): string

Parameters

compact?: boolean

Returns

string


deserialize()

static deserialize(raw): Offer

Parameters

raw: Uint8Array

Returns

Offer