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:
- Preview: https://d1t0d7c2nekuk0.cloudfront.net/preview.json
- Preprod: https://d1t0d7c2nekuk0.cloudfront.net/preprod.json
- Mainnet: https://d1t0d7c2nekuk0.cloudfront.net/mainnet.json
These JSONs are updated every 15 minutes.
Index
Constructors
constructor
• new NetworkParams(raw
, liveSlotGetter?
)
Parameters
Name | Type |
---|---|
raw | any |
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
Name | Type |
---|---|
slot | bigint |
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
Name | Type | Description |
---|---|---|
time | bigint | Milliseconds since 1970 |
Returns
bigint