Skip to main content

NetworkParamsHelper

export interface NetworkParamsHelper {
  calcMaxConwayTxFee(refScriptsSize: bigint): bigint
  costModelParamsV1: number[]
  costModelParamsV2: number[]
  costModelParamsV3: number[]
  exFeeParams: [number, number]
  latestTipSlot: number
  latestTipTime: number
  lovelacePerUtxoByte: number
  maxCollateralInputs: number
  maxTxExecutionBudget: [number, number]
  maxTxFee: bigint
  maxTxSize: number
  minCollateralPct: number
  params: T
  refScriptsFeePerByte: number
  secondsPerSlot: number
  slotToTime(slot: IntLike): number
  stakeAddressDeposit: bigint
  timeToSlot(time: IntLike): number
  txFeeParams: [number, number]
}

Properties

calcMaxConwayTxFee

networkParamsHelper.calcMaxConwayTxFee satisfies (refScriptsSize: bigint) => bigint

costModelParamsV1

networkParamsHelper.costModelParamsV1 satisfies number[]

costModelParamsV2

networkParamsHelper.costModelParamsV2 satisfies number[]

costModelParamsV3

networkParamsHelper.costModelParamsV3 satisfies number[]

exFeeParams

networkParamsHelper.exFeeParams satisfies [number, number]

latestTipSlot

networkParamsHelper.latestTipSlot satisfies number

latestTipTime

networkParamsHelper.latestTipTime satisfies number

lovelacePerUtxoByte

networkParamsHelper.lovelacePerUtxoByte satisfies number

maxCollateralInputs

networkParamsHelper.maxCollateralInputs satisfies number

maxTxExecutionBudget

networkParamsHelper.maxTxExecutionBudget satisfies [number, number]

maxTxFee

Tx balancing picks additional inputs by starting from maxTxFee. This is done because the order of the inputs can have a huge impact on the tx fee, so the order must be known before balancing. If there aren't enough inputs to cover the maxTxFee and the min deposits of newly created UTxOs, the balancing will fail. TODO: make this private once we are in Conway era, because this should always take into account the cost of ref scripts

networkParamsHelper.maxTxFee satisfies bigint

maxTxSize

networkParamsHelper.maxTxSize satisfies number

minCollateralPct

networkParamsHelper.minCollateralPct satisfies number

params

networkParamsHelper.params satisfies T

refScriptsFeePerByte

networkParamsHelper.refScriptsFeePerByte satisfies number

secondsPerSlot

networkParamsHelper.secondsPerSlot satisfies number

slotToTime

networkParamsHelper.slotToTime satisfies (slot: IntLike) => number

stakeAddressDeposit

networkParamsHelper.stakeAddressDeposit satisfies bigint

timeToSlot

networkParamsHelper.timeToSlot satisfies (time: IntLike) => number

txFeeParams

networkParamsHelper.txFeeParams satisfies [number, number]