Skip to main content

UnprovenInput

@midnight/zswap v4.0.0-rc


@midnight/zswap / UnprovenInput

Class: UnprovenInput

A Input, before being proven

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

Properties

contractAddress

readonly contractAddress: undefined | string;

The contract address receiving the input, if the sender is a contract


nullifier

readonly nullifier: string;

The nullifier of the input

Methods

serialize()

serialize(netid): Uint8Array<ArrayBufferLike>

Parameters

netid

NetworkId

Returns

Uint8Array<ArrayBufferLike>


toString()

toString(compact?): string

Parameters

compact?

boolean

Returns

string


deserialize()

static deserialize(raw, netid): UnprovenInput

Parameters

raw

Uint8Array<ArrayBufferLike>

netid

NetworkId

Returns

UnprovenInput


newContractOwned()

static newContractOwned(
coin,
segment,
contract,
state): UnprovenInput

Creates a new input, spending a specific coin from a smart contract, against a state which contains this coin.

Note that inputs created in this way also need to be authorized by the contract

Parameters

coin

QualifiedCoinInfo

segment

number

contract

string

state

ZswapChainState

Returns

UnprovenInput