Skip to main content

@midnight/ledger v3.0.2Readme | API


@midnight/ledger 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