@midnight/ledger v2.0.8 • Readme | API
@midnight/ledger v2.0.8 / ProofErasedTransaction
Class: ProofErasedTransaction
Transaction, with all proof information erased
Primarily for use in testing, or handling data known to be correct from external information
Constructors
new ProofErasedTransaction()
new ProofErasedTransaction(): ProofErasedTransaction
Returns
Properties
contractCalls
readonly contractCalls: (ContractCall | ContractDeploy)[];
The contract interactions contained in this transaction
fallibleCoins
readonly fallibleCoins: undefined | ProofErasedOffer;
The fallible Zswap offer
guaranteedCoins
readonly guaranteedCoins: ProofErasedOffer;
The guaranteed Zswap offer
Methods
fees()
fees(): bigint
The cost of this transaction, in the atomic unit of the base token
Returns
bigint
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): ProofErasedTransaction
Merges this transaction with another
Parameters
• other: ProofErasedTransaction
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
wellFormed()
wellFormed(enforce_balancing): void
Tests well-formedness criteria, optionally including transaction balancing
For obvious reasons, doesn't check proofs
Parameters
• enforce_balancing: boolean
Returns
void
Throws
If the transaction is not well-formed for any reason
deserialize()
static deserialize(raw): ProofErasedTransaction
Parameters
• raw: Uint8Array