Options
All
  • Public
  • Public/Protected
  • All
Menu

External module contracts

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

Index

Functions

calculateMinimumCreationFee

  • calculateMinimumCreationFee(hexCode: string, isCIP20active?: boolean): BurstValue
  • Calculates the minimum creation fee of the contract

    Parameters

    • hexCode: string

      The contracts code in hex form

    • Default value isCIP20active: boolean = false

      If is true, the fee calculation for active CIP20 is applied (lowered fees), otherwise the legacy calculation (BRS <V2.5) is applied

    Returns BurstValue

    The minimum fee

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

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

MethodArgument

MethodArgument: string | number | boolean