Skip to main content

NetworkParamsHelper

export interface NetworkParamsHelper<T extends NetworkParams = NetworkParams> {
  calcMaxConwayTxFee(refScriptsSize: bigint): bigint
  costModelParamsV1: number[]
  costModelParamsV2: number[]
  costModelParamsV3: number[]
  defaultCollateralUTXO: undefined | TxInput<SpendingCredential>
  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

calcMaxConwayTxFee(refScriptsSize: bigint): bigint

costModelParamsV1

costModelParamsV1: number[]

costModelParamsV2

costModelParamsV2: number[]

costModelParamsV3

costModelParamsV3: number[]

defaultCollateralUTXO

defaultCollateralUTXO: undefined | TxInput<SpendingCredential>

exFeeParams

exFeeParams: [number, number]

latestTipSlot

latestTipSlot: number

latestTipTime

latestTipTime: number

lovelacePerUtxoByte

lovelacePerUtxoByte: number

maxCollateralInputs

maxCollateralInputs: number

maxTxExecutionBudget

maxTxExecutionBudget: [number, number]

maxTxFee

maxTxFee: bigint
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

maxTxSize

maxTxSize: number

minCollateralPct

minCollateralPct: number

params

params: T

refScriptsFeePerByte

refScriptsFeePerByte: number

secondsPerSlot

secondsPerSlot: number

slotToTime

slotToTime(slot: IntLike): number

stakeAddressDeposit

stakeAddressDeposit: bigint

timeToSlot

timeToSlot(time: IntLike): number

txFeeParams

txFeeParams: [number, number]