Skip to main content

@midnight/zswap v3.0.2Readme | API


@midnight/zswap v3.0.2 / UnprovenOutput

Class: UnprovenOutput

An Output before being proven

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

Constructors

new UnprovenOutput()

private new UnprovenOutput(): UnprovenOutput

Returns

UnprovenOutput

Properties

commitment

readonly commitment: string;

The commitment of the output


contractAddress

readonly contractAddress: undefined | string;

The contract address receiving the output, if the recipient is a contract

Methods

serialize()

serialize(netid): Uint8Array

Parameters

netid: NetworkId

Returns

Uint8Array


toString()

toString(compact?): string

Parameters

compact?: boolean

Returns

string


deserialize()

static deserialize(raw, netid): UnprovenOutput

Parameters

raw: Uint8Array

netid: NetworkId

Returns

UnprovenOutput


new()

static new(
coin,
target_cpk,
target_epk?): UnprovenOutput

Creates a new output, targeted to a user's coin public key.

Optionally the output contains a ciphertext encrypted to the user's encryption public key, which may be omitted only if the CoinInfo is transferred to the recipient another way

Parameters

coin: CoinInfo

target_cpk: string

target_epk?: string

Returns

UnprovenOutput


newContractOwned()

static newContractOwned(coin, contract): UnprovenOutput

Creates a new output, targeted to a smart contract

A contract must also explicitly receive a coin created in this way for the output to be valid

Parameters

coin: CoinInfo

contract: string

Returns

UnprovenOutput