Skip to main content

UnprovenOutput

@midnight-ntwrk/ledger v3.0.2 β€’ Readme | API


@midnight-ntwrk/ledger 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