Skip to content

resolveMaxEpoch

resolveMaxEpoch(provider, leadEpochs?): Promise<number>

Defined in: ootle/src/builder.ts:54

Reads the chain tip and returns the max_epoch a transaction built now should carry: currentEpoch + leadEpochs.

const builder = TransactionBuilder.new(provider.network(), await resolveMaxEpoch(provider));

Provider

number = DEFAULT_TRANSACTION_VALIDITY_EPOCHS

Promise<number>

if leadEpochs is not a positive integer, or exceeds MAX_TRANSACTION_VALIDITY_EPOCHS (which the network would reject with AbortReason::ValidityWindowTooLong).