@midnight/ledger v2.0.8 • Readme | API
@midnight/ledger v2.0.8 / UnprovenTransaction
Class: UnprovenTransaction
Transaction, prior to being proven
All "shielded" information in the transaction can still be extracted at this stage!
Constructors
new UnprovenTransaction(guaranteed, fallible, calls)
new UnprovenTransaction(
guaranteed,
fallible?,
calls?): UnprovenTransaction
Creates the transaction from guaranteed/fallible UnprovenOffers, and a ContractCallsPrototype.
Parameters
• guaranteed: UnprovenOffer
• fallible?: UnprovenOffer
• calls?: ContractCallsPrototype
Returns
Properties
contractCalls
readonly contractCalls: (ContractCall | ContractDeploy)[];
The contract interactions contained in this transaction
fallibleCoins
readonly fallibleCoins: undefined | UnprovenOffer;
The fallible Zswap offer
guaranteedCoins
readonly guaranteedCoins: UnprovenOffer;
The guaranteed Zswap offer
Methods
eraseProofs()
eraseProofs(): ProofErasedTransaction
Erases the proofs contained in this transaction
Returns
identifiers()
identifiers(): string[]
Returns the set of identifiers contained within this transaction. Any of these may be used to watch for a specific transaction.
Returns
string
[]
imbalances()
imbalances(guaranteed, fees?): Map<string, bigint>
For given fees, and a given section (guaranteed/fallible), what the surplus or deficit of this transaction in any token type is.
Parameters
• guaranteed: boolean
• fees?: bigint
Returns
Map
<string
, bigint
>
merge()
merge(other): UnprovenTransaction
Merges this transaction with another
Parameters
• other: UnprovenTransaction
Returns
Throws
If both transactions have contract interactions, or they spend the same coins
serialize()
serialize(): Uint8Array
Returns
Uint8Array
toString()
toString(compact?): string
Parameters
• compact?: boolean
Returns
string
deserialize()
static deserialize(raw): UnprovenTransaction
Parameters
• raw: Uint8Array