Helios API/ API Reference/ Classes/

NetworkParams

Wrapper for the raw JSON containing all the current network parameters.

NetworkParams is needed to be able to calculate script budgets and perform transaction building checks.

The raw JSON can be downloaded from the following CDN locations:

These JSONs are updated every 15 minutes.

Index

Constructors

constructor

new NetworkParams(raw, liveSlotGetter?)

Parameters

NameType
rawany
liveSlotGetter?null | LiveSlotGetter

Accessors

liveSlot

get liveSlot(): null | bigint

Returns

null | bigint

maxTxFee

get 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.

Returns

bigint

raw

get raw(): any

Returns

any

stakeAddressDeposit

get stakeAddressDeposit(): bigint

Returns

bigint

Methods

slotToTime

slotToTime(slot): bigint

Calculates the time (in milliseconds in 01/01/1970) associated with a given slot number.

Parameters

NameType
slotbigint

Returns

bigint

timeToSlot

timeToSlot(time): bigint

Calculates the slot number associated with a given time. Time is specified as milliseconds since 01/01/1970.

Parameters

NameTypeDescription
timebigintMilliseconds since 1970

Returns

bigint