Skip to main content

UnprovenOffer

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


@midnight/zswap v3.0.2 / UnprovenOffer

Class: UnprovenOffer

A Offer, prior to being proven

All "shielded" information in the offer can still be extracted at this stage!

Constructors​

new UnprovenOffer()​

new UnprovenOffer(): UnprovenOffer

Returns​

UnprovenOffer

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: UnprovenInput[];

The inputs this offer is composed of


outputs​

readonly outputs: UnprovenOutput[];

The outputs this offer is composed of


transient​

readonly transient: UnprovenTransient[];

The transients this offer is composed of

Methods​

merge()​

merge(other): UnprovenOffer

Combine this offer with another

Parameters​

β€’ other: UnprovenOffer

Returns​

UnprovenOffer


serialize()​

serialize(netid): Uint8Array

Parameters​

β€’ netid: NetworkId

Returns​

Uint8Array


toString()​

toString(compact?): string

Parameters​

β€’ compact?: boolean

Returns​

string


deserialize()​

static deserialize(raw, netid): UnprovenOffer

Parameters​

β€’ raw: Uint8Array

β€’ netid: NetworkId

Returns​

UnprovenOffer


fromInput()​

static fromInput(
input,
type_,
value): UnprovenOffer

Creates a singleton offer, from an UnprovenInput and its value vector

Parameters​

β€’ input: UnprovenInput

β€’ type_: string

β€’ value: bigint

Returns​

UnprovenOffer


fromOutput()​

static fromOutput(
output,
type_,
value): UnprovenOffer

Creates a singleton offer, from an UnprovenOutput and its value vector

Parameters​

β€’ output: UnprovenOutput

β€’ type_: string

β€’ value: bigint

Returns​

UnprovenOffer


fromTransient()​

static fromTransient(transient): UnprovenOffer

Creates a singleton offer, from an UnprovenTransient

Parameters​

β€’ transient: UnprovenTransient

Returns​

UnprovenOffer