Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ContractDataView

Helper class for contracts

A contract owns additional data, which is split in 8 byte blocks. The content is encoded in hexadecimal representation and big endianness. This class facilitates access to these data

Hierarchy

  • ContractDataView

Index

Constructors

constructor

Properties

Static VariableLength

VariableLength: number = 16

The length of a contracts variable (considering Hex notation)

Methods

countCodePages

  • countCodePages(): number

getContract

getDataBlocksAsString

  • getDataBlocksAsString(index: number, count?: number): string
  • Get multiple data blocks as string

    Parameters

    • index: number

      The index of variable (starting at 0)

    • Optional count: number

      Number of blocks

    Returns string

    The data as string (Utf-8)

getHexDataAt

  • getHexDataAt(index: number, length?: number): string
  • Get a hexadecimal data block of arbitrary length at given position/index

    Parameters

    • index: number

      The index of variable (starting at 0)

    • Optional length: number

      The length of the data block (must be a multiple of 2)

    Returns string

    The data as hexadecimal string (in little endianness)

getVariable

  • getVariable(index: number): string
  • Get a variable at given position/index

    Parameters

    • index: number

      The index of variable (starting at 0)

    Returns string

    The data as hexadecimal string (in little endianness)

getVariableAsDecimal

  • getVariableAsDecimal(index: number): string

getVariableAsString

  • getVariableAsString(index: number): string