Options
All
  • Public
  • Public/Protected
  • All
Menu

Class PolicyConstraints

This captures the Treasury module's tax_policy and reward_policy parameters, which determine how the Tax Rate and Reward Weight values are allowed to change.

Hierarchy

Index

Constructors

constructor

  • new PolicyConstraints(rate_min: Value, rate_max: Value, cap: Coin, change_rate_max: Value): PolicyConstraints
  • Parameters

    • rate_min: Value

      minimum value

    • rate_max: Value

      maximum value

    • cap: Coin

      Tax Cap (only applicable for Tax Rate)

    • change_rate_max: Value

      max change %

    Returns PolicyConstraints

Properties

cap

cap: Coin

change_rate_max

change_rate_max: Dec

Ratio of current value that rate is allowed to change in one update.

rate_max

rate_max: Dec

Maximum value for rate.

rate_min

rate_min: Dec

Minimum value for rate.

Methods

clamp

  • clamp(prevRate: Value, newRate: Value): Dec
  • You can simulate the result of the clamping algorithm, which subjects updates in rate to the rules defined by the PolicyConstraints.

    Parameters

    • prevRate: Value

      previous rate

    • newRate: Value

      next rate

    Returns Dec

    New rate, after clamping constraints have been applied

toAmino

toAminoJSON

  • toAminoJSON(): string
  • Returns string

toData

toJSON

  • toJSON(): string
  • Returns string

toProto

  • toProto(): PolicyConstraints

Static fromAmino

Static fromData

Static fromProto