Options
All
  • Public
  • Public/Protected
  • All
Menu

External module util

Index

Functions

Const constructBurstAddress

  • constructBurstAddress(parts: string[]): string

Const convertAddressToNumericId

  • convertAddressToNumericId(address: string): string
  • Converts BURST-XXXX-XXXX-XXXX-XXXXX into numeric Id

    Parameters

    • address: string

      The BURST address

    Returns string

    The numeric id, or undefined if address is invalid

Const convertBurstTimeToDate

  • convertBurstTimeToDate(burstTimestamp: number): Date
  • Converts a Burst/Block Time (seconds since genesis block) into Date

    Parameters

    • burstTimestamp: number

      The numeric Id

    Returns Date

    Date

Const convertBurstTimeToEpochTime

  • convertBurstTimeToEpochTime(burstTimestamp: number): number
  • Converts a Burst/Block Time (seconds since genesis block) into Unix Epoch Time (milliseconds since 01.01.1970)

    Parameters

    • burstTimestamp: number

      The numeric Id

    Returns number

    Unix Epoch Time (milliseconds since 01.01.1970)

Const convertDateToBurstTime

  • convertDateToBurstTime(date: Date): number
  • Converts a Date into Burst/Block Time (seconds since genesis block)

    Parameters

    • date: Date

      The date to be converted

    Returns number

    The Burst Timestamp

Const convertNQTStringToNumber

  • convertNQTStringToNumber(amount: string): number

Const convertNumberToNQTString

  • convertNumberToNQTString(n: number): string

Const convertNumericIdToAddress

  • convertNumericIdToAddress(numericId: string): string
  • Encode a numeric id into BURST-XXXX-XXXX-XXXX-XXXXX

    Parameters

    • numericId: string

      The numeric Id

    Returns string

    the BURST address in Reed-Solomon encoding, or undefined if passed null, undefined

Const isBurstAddress

  • isBurstAddress(address: string): boolean
  • Check for valid Burst address (format: BURST-XXXX-XXXX-XXXX-XXXXX, XXXX-XXXX-XXXX-XXXXX)

    Parameters

    • address: string

      The address

    Returns boolean

    true, if is a valid address, else false

Const isValid

  • isValid(address: string): boolean
  • Check for valid Burst address (format: BURST-XXXX-XXXX-XXXX-XXXXX, XXXX-XXXX-XXXX-XXXXX)

    Parameters

    • address: string

      The address

    Returns boolean

    true, if is a valid address, else false

Const splitBurstAddress

  • splitBurstAddress(address: string): string[]
  • Split the Burst address string into an array of 4 parts

    Parameters

    • address: string

      A valid Burst address

    Returns string[]

Object literals

Const burstAddressPattern

burstAddressPattern: object

A useful regex for matching burst addresses

_

_: object

pattern

pattern: RegExp = new RegExp('\[a-zA-Z0-9\]')

Generated using TypeDoc