Skip to main content

@midnight/zswap v0.3.11Readme | API


@midnight/zswap v0.3.11 / UnprovenOutput

Class: UnprovenOutput

An Output before being proven

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

Constructors

new UnprovenOutput()

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(): Uint8Array

Returns

Uint8Array


toString()

toString(compact?): string

Parameters

compact?: boolean

Returns

string


deserialize()

static deserialize(raw): UnprovenOutput

Parameters

raw: Uint8Array

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