# Class: Rent
Configuration of network rent.
# Table of contents
# Constructors
# Accessors
# Methods
# Constructors
# constructor
• new Rent(lamportsPerByteYear
, exemptionThreshold
, burnPercent
)
# Parameters
Name | Type | Description |
---|---|---|
lamportsPerByteYear | bigint | Rental rate in lamports/byte-year. |
exemptionThreshold | number | Amount of time (in years) a balance must include rent for the account to be rent exempt. |
burnPercent | number | The percentage of collected rent that is burned. |
# Defined in
internal.d.ts:71 (opens new window)
# Accessors
# burnPercent
• get
burnPercent(): number
The percentage of collected rent that is burned.
# Returns
number
# Defined in
internal.d.ts:78 (opens new window)
# exemptionThreshold
• get
exemptionThreshold(): number
Amount of time (in years) a balance must include rent for the account to be rent exempt.
# Returns
number
# Defined in
internal.d.ts:76 (opens new window)
# lamportsPerByteYear
• get
lamportsPerByteYear(): bigint
Rental rate in lamports/byte-year.
# Returns
bigint
# Defined in
internal.d.ts:74 (opens new window)
# Methods
# calculateBurn
▸ calculateBurn(rentCollected
): unknown
[]
Calculate how much rent to burn from the collected rent.
The first value returned is the amount burned. The second is the amount to distribute to validators.
# Parameters
Name | Type |
---|---|
rentCollected | bigint |
# Returns
unknown
[]
The amount burned and the amount to distribute to validators.
# Defined in
internal.d.ts:88 (opens new window)
# due
▸ due(balance
, dataLen
, yearsElapsed
): bigint
Rent due on account's data length with balance.
# Parameters
Name | Type | Description |
---|---|---|
balance | bigint | The account balance. |
dataLen | bigint | The account data length. |
yearsElapsed | number | Time elapsed in years. |
# Returns
bigint
The rent due.
# Defined in
internal.d.ts:111 (opens new window)
# dueAmount
▸ dueAmount(dataLen
, yearsElapsed
): bigint
Rent due for account that is known to be not exempt.
# Parameters
Name | Type | Description |
---|---|---|
dataLen | bigint | The account data length. |
yearsElapsed | number | Time elapsed in years. |
# Returns
bigint
The amount due.
# Defined in
internal.d.ts:119 (opens new window)
# isExempt
▸ isExempt(balance
, dataLen
): boolean
Whether a given balance and data length would be exempt.
# Parameters
Name | Type |
---|---|
balance | bigint |
dataLen | bigint |
# Returns
boolean
# Defined in
internal.d.ts:102 (opens new window)
# minimumBalance
▸ minimumBalance(dataLen
): bigint
Minimum balance due for rent-exemption of a given account data size.
Note: a stripped-down version of this calculation is used in
calculate_split_rent_exempt_reserve
in the stake program. When this
function is updated, eg. when making rent variable, the stake program
will need to be refactored.
# Parameters
Name | Type | Description |
---|---|---|
dataLen | bigint | The account data size. |
# Returns
bigint
The minimum balance due.
# Defined in
internal.d.ts:100 (opens new window)
# default
▸ Static
default(): Rent
# Returns
# Defined in
internal.d.ts:72 (opens new window)
# free
▸ Static
free(): Rent
Creates a Rent
that charges no lamports.
This is used for testing.
# Returns
# Defined in
internal.d.ts:126 (opens new window)
# withSlotsPerEpoch
▸ Static
withSlotsPerEpoch(slotsPerEpoch
): Rent
Creates a Rent
that is scaled based on the number of slots in an epoch.
This is used for testing.
# Parameters
Name | Type |
---|---|
slotsPerEpoch | bigint |