Options
All
  • Public
  • Public/Protected
  • All
Menu

External module contracts

The Contracts package provides functions and messages to interact with Signum Smart Contracts, i.e. generate method calls and inspect contract data

Index

Functions

calculateMinimumCreationFee

convertShortStringToContractData

  • convertShortStringToContractData(shortString: string): ContractData

countCodePages

  • countCodePages(hexCode: string): number
  • Counts the code pages for given machine code

    Parameters

    • hexCode: string

      The contracts code in hex form

    Returns number

    The number of code pages for the passed code

countDataPages

  • countDataPages(dataHex: string): number
  • Counts the data pages for given initialization data stack

    Parameters

    • dataHex: string

      The contracts initial data stack in hex form

    Returns number

    The number of data pages for the passed data

Const generateDataStack

Const generateMethodCall

getContractDatablock

  • getContractDatablock(contract: Contract, position: number, length?: number): string
  • Extracts a variables value as hexadecimal string from a contract's machine data

    This is a generic function to extract arbitrary data from a contract. It's recommended to use the ContractDataView class instead

    Parameters

    • contract: Contract

      The contract

    • position: number

      The variables position

    • Default value length: number = 16

      The length of data to be extracted

    Returns string

    The value as hexadecimal string (already considering endianness)

Type aliases

ContractData

ContractData: string | number | boolean

Generic Datatype for contracts

The data type can only be a numeric as contracts accept only longs. Text is not supported</>

see

GenerateMethodCallArgs and generateMethodCall