Function formatDuration

  • Name

    formatDuration

    Summary

    Returns an object representing a duration in either fixed or subscription format.

    Parameters

    • type: "fixed" | "subscription"

      The type of duration. Can be either 'fixed' or 'subscription'.

    • duration: number

      The length of the contract duration in blocks.

    • Optional maxDuration: number

      (Optional) The maximum length of the contract subscription duration in blocks. Only applicable for subscriptions.

    • isChangeable: boolean = false

      (Optional) A boolean indicating if the duration can be changed. Only applicable for subscriptions.

    Returns DurationType

    An object representing the duration of a contract.

Generated using TypeDoc