Skip to main content

UnprovenOffer

@midnight/zswap v4.0.0-rc


@midnight/zswap / 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<ArrayBufferLike>

Parameters

netid

NetworkId

Returns

Uint8Array<ArrayBufferLike>


toString()

toString(compact?): string

Parameters

compact?

boolean

Returns

string


deserialize()

static deserialize(raw, netid): UnprovenOffer

Parameters

raw

Uint8Array<ArrayBufferLike>

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