Skip to main content

ZswapTransient

For the complete documentation index, see llms.txt

@midnight/ledger v8.0.3


@midnight/ledger / ZswapTransient

Class: ZswapTransient<P>

A shielded "transient"; an output that is immediately spent within the same transaction

Type Parameters​

P​

P extends Proofish

Properties​

commitment​

readonly commitment: string;

The commitment of the transient


contractAddress​

readonly contractAddress: undefined | string;

The contract address creating the transient, if applicable


inputProof​

readonly inputProof: P;

The input proof of this transient


nullifier​

readonly nullifier: string;

The nullifier of the transient


outputProof​

readonly outputProof: P;

The output proof of this transient

Methods​

serialize()​

serialize(): Uint8Array;

Returns​

Uint8Array


toString()​

toString(compact?): string;

Parameters​

compact?​

boolean

Returns​

string


deserialize()​

static deserialize<P>(markerP, raw): ZswapTransient<P>;

Type Parameters​

P​

P extends Proofish

Parameters​

markerP​

P["instance"]

raw​

Uint8Array

Returns​

ZswapTransient<P>


newFromContractOwnedOutput()​

static newFromContractOwnedOutput(
coin,
segment,
output): UnprovenTransient;

Creates a new contract-owned transient, from a given output and its coin.

The QualifiedShieldedCoinInfo should have an mt_index of 0

Parameters​

coin​

QualifiedShieldedCoinInfo

segment​

undefined | number

output​

UnprovenOutput

Returns​

UnprovenTransient