Options
All
  • Public
  • Public/Protected
  • All
Menu

External module util

Index

Functions

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 convertByteArrayToHexString

  • convertByteArrayToHexString(bytes: number[], uppercase?: boolean): string
  • Converts byte array to hexadecimal string Inverse operation of convertHexStringToByteArray

    Parameters

    • bytes: number[]

      The byte array to be converted

    • Default value uppercase: boolean = false

      If true, converts hex string with uppercase characters (Default: false)

    Returns string

    A hex string representing the byte array input

Const convertByteArrayToString

  • convertByteArrayToString(byteArray: number[], startIndex?: number, length?: number): string
  • Converts a byte array into string Inverse function convertStringToByteArray

    Parameters

    • byteArray: number[]

      The byte array to be converted

    • Default value startIndex: number = 0

      The starting index of array to be converted (Default: 0)

    • Default value length: number = null

      The number of bytes to be considered, iff startIndex is given. If null the byte array's length is considered

    Returns string

    The converted string

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 convertHexStringToByteArray

  • convertHexStringToByteArray(hex: string): number[]
  • Converts an hexadecimal string to byte array

    Parameters

    • hex: string

      The hexadecimal string to be converted

    Returns number[]

    An byte array representing the hexadecimal input

Const convertHexStringToDecString

  • convertHexStringToDecString(hexStr: string): string

Const convertHexStringToString

  • convertHexStringToString(hex: string): string

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 convertStringToByteArray

  • convertStringToByteArray(str: string): number[]

Const convertStringToHexString

  • convertStringToHexString(str: string): string

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

sumNQTStringToNumber

  • sumNQTStringToNumber(...nqts: string[]): number
  • Sums various NQT values and returns in Burst

    Parameters

    • Rest ...nqts: string[]

      Variable amount list with NQT string

    Returns number

    The sum of all amounts in BURST

Generated using TypeDoc