Skip to main content

UnprovenTransaction

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


@midnight/zswap v3.0.2 / UnprovenTransaction

Class: UnprovenTransaction

Transaction, prior to being proven

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

Constructors​

new UnprovenTransaction(guaranteed, fallible)​

new UnprovenTransaction(guaranteed, fallible?): UnprovenTransaction

Creates the transaction from guaranteed/fallible UnprovenOffers

Parameters​

β€’ guaranteed: UnprovenOffer

β€’ fallible?: UnprovenOffer

Returns​

UnprovenTransaction

Properties​

fallibleCoins​

readonly fallibleCoins: undefined | UnprovenOffer;

The fallible Zswap offer


guaranteedCoins​

readonly guaranteedCoins: undefined | UnprovenOffer;

The guaranteed Zswap offer


mint​

readonly mint: undefined | UnprovenAuthorizedMint;

The mint this transaction represents, if applicable

Methods​

eraseProofs()​

eraseProofs(): ProofErasedTransaction

Erases the proofs contained in this transaction

Returns​

ProofErasedTransaction


identifiers()​

identifiers(): string[]

Returns the set of identifiers contained within this transaction. Any of these may be used to watch for a specific transaction.

Returns​

string[]


merge()​

merge(other): UnprovenTransaction

Merges this transaction with another

Parameters​

β€’ other: UnprovenTransaction

Returns​

UnprovenTransaction

Throws​

If both transactions have contract interactions, or they spend the same coins


serialize()​

serialize(netid): Uint8Array

Parameters​

β€’ netid: NetworkId

Returns​

Uint8Array


toString()​

toString(compact?): string

Parameters​

β€’ compact?: boolean

Returns​

string


deserialize()​

static deserialize(raw, netid): UnprovenTransaction

Parameters​

β€’ raw: Uint8Array

β€’ netid: NetworkId

Returns​

UnprovenTransaction


fromMint()​

static fromMint(mint): UnprovenTransaction

Creates a minting claim transaction, the funds claimed must have been legitimately minted previously.

Parameters​

β€’ mint: UnprovenAuthorizedMint

Returns​

UnprovenTransaction