Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Runtime

Index

Constructors

constructor

Properties

ctx

ctx: Context

loadedAssetsDefs

loadedAssetsDefs: Record<string, { clawback?: string; decimals: number | bigint; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: string | Uint8Array | Buffer; note?: string; noteb64?: string; optInAccNames?: string[]; reserve?: string; total: string | number | bigint; unitName?: string; url?: string }>

Methods

addASADef

  • addASADef(asa: string, asaDef: { clawback?: string; decimals: number | bigint; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: string | Uint8Array | Buffer; note?: string; noteb64?: string; optInAccNames?: string[]; reserve?: string; total: string | number | bigint; unitName?: string; url?: string }, flags: ASADeploymentFlags): number
  • Add Asset in Runtime without using asa.yaml

    Parameters

    • asa: string
    • asaDef: { clawback?: string; decimals: number | bigint; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: string | Uint8Array | Buffer; note?: string; noteb64?: string; optInAccNames?: string[]; reserve?: string; total: string | number | bigint; unitName?: string; url?: string }
      • Optional clawback?: string
      • decimals: number | bigint
      • Optional defaultFrozen?: boolean
      • Optional freeze?: string
      • Optional manager?: string
      • Optional metadataHash?: string | Uint8Array | Buffer
      • Optional note?: string
      • Optional noteb64?: string
      • Optional optInAccNames?: string[]
      • Optional reserve?: string
      • total: string | number | bigint
      • Optional unitName?: string
      • Optional url?: string
    • flags: ASADeploymentFlags

      ASA Deployment Flags

    Returns number

addApp

  • addApp(flags: AppDeploymentFlags, payFlags: TxParams, approvalProgram: string, clearProgram: string, debugStack?: number): number
  • creates new application and returns application id

    Parameters

    • flags: AppDeploymentFlags

      SSCDeployment flags

    • payFlags: TxParams

      Transaction parameters

    • approvalProgram: string

      application approval program

    • clearProgram: string

      application clear program

    • Optional debugStack: number

    Returns number

addAsset

addCtxAppCreateTxn

addCtxAppUpdateTx

  • addCtxAppUpdateTx(senderAddr: string, appID: number, payFlags: TxParams, flags: AppOptionalFlags): void

addCtxOptInTx

  • addCtxOptInTx(senderAddr: string, appID: number, payFlags: TxParams, flags: AppOptionalFlags): void

assertAccountDefined

  • asserts if account is defined.

    Parameters

    • address: string
    • Optional a: AccountStoreI

      account

    • Optional line: number

      line number in TEAL file Note: if user is accessing this function directly through runtime, the line number is unknown

    Returns AccountStoreI

assertAddressDefined

  • assertAddressDefined(addr: undefined | string, line?: number): string
  • asserts if account address is defined

    Parameters

    • addr: undefined | string

      account address

    • Optional line: number

      line number in TEAL file Note: if user is accessing this function directly through runtime, the line number is unknown

    Returns string

assertAppDefined

  • asserts if application exists in state

    Parameters

    • appID: number

      application index

    • Optional app: SSCAttributesM

      application

    • Optional line: number

      line number in TEAL file Note: if user is accessing this function directly through runtime, the line number is unknown

    Returns SSCAttributesM

assertAssetDefined

  • assertAssetDefined(assetId: number, assetDef?: AssetParams, line?: number): AssetParams
  • asserts if asset exists in state

    Parameters

    • assetId: number

      asset index

    • Optional assetDef: AssetParams

      asset definitions

    • Optional line: number

      line number Note: if user is accessing this function directly through runtime, the line number is unknown

    Returns AssetParams

assertMinBalance

  • assertMinBalance(amt: bigint, address: string): void

createTxnContext

  • createTxnContext(txnParams: ExecParams | ExecParams[]): [Txn, Txn[]]
  • Creates new transaction object (tx, gtxs) from given txnParams

    returns:

    [current transaction, transaction group]

    Parameters

    • txnParams: ExecParams | ExecParams[]

      : Transaction parameters for current txn or txn Group

    Returns [Txn, Txn[]]

executeTx

  • executeTx(txnParams: ExecParams | ExecParams[], debugStack?: number): void
  • This function executes a transaction based on a smart contract logic and updates state afterwards

    Parameters

    • txnParams: ExecParams | ExecParams[]

      : Transaction parameters

    • Optional debugStack: number

    Returns void

fundLsig

getAccount

getApp

getAppInfoFromName

  • getAppInfoFromName(approval: string, clear: string): undefined | SSCInfo

getAssetAccount

getAssetDef

  • getAssetDef(assetId: number): AssetParams

getAssetHolding

  • getAssetHolding(assetIndex: number, address: string): AssetHoldingM

getAssetInfoFromName

  • getAssetInfoFromName(name: string): undefined | ASAInfo

getGlobalState

  • getGlobalState(appID: number, key: string | Uint8Array): undefined | StackElem
  • Fetches global state value for key present in creator's global state for given appID, returns undefined otherwise

    Parameters

    • appID: number
    • key: string | Uint8Array

    Returns undefined | StackElem

getLocalState

  • getLocalState(appID: number, accountAddr: string, key: string | Uint8Array): undefined | StackElem
  • Fetches local state for account address and application index

    Parameters

    • appID: number

      application index

    • accountAddr: string

      address for which local state needs to be retrieved

    • key: string | Uint8Array

    Returns undefined | StackElem

getLogicSig

getRound

  • getRound(): number

getTimestamp

  • getTimestamp(): number

initializeAccounts

mkAssetCreateTx

optInToASAMultiple

  • optInToASAMultiple(assetID: number, accounts?: string[]): void
  • Opt-In to all accounts given in asa.yaml to a specific asset.

    Parameters

    • assetID: number

      Asset Index

    • Optional accounts: string[]

    Returns void

optInToApp

  • optInToApp(accountAddr: string, appID: number, flags: AppOptionalFlags, payFlags: TxParams, debugStack?: number): void
  • Account address opt-in for application Id

    Parameters

    • accountAddr: string

      Account address

    • appID: number

      Application Id

    • flags: AppOptionalFlags

      Stateful smart contract transaction optional parameters (accounts, args..)

    • payFlags: TxParams

      Transaction Parameters

    • Optional debugStack: number

    Returns void

optIntoASA

  • optIntoASA(assetIndex: number, address: string, flags: TxParams): void
  • Asset Opt-In for account in Runtime

    Parameters

    • assetIndex: number

      Asset Index

    • address: string

      Account address to opt-into asset

    • flags: TxParams

      Transaction Parameters

    Returns void

run

  • run(program: string, executionMode: ExecutionMode, indexInGroup: number, debugStack?: number): void
  • This function executes TEAL code line by line

    Parameters

    • program: string

      : teal code as string

    • executionMode: ExecutionMode

      : execution Mode (Stateless or Stateful)

    • indexInGroup: number
    • Optional debugStack: number

    Returns void

setRoundAndTimestamp

  • setRoundAndTimestamp(r: number, timestamp: number): void
  • set current round with timestamp for a block

    Parameters

    • r: number

      current round

    • timestamp: number

      block's timestamp

    Returns void

updateApp

  • updateApp(senderAddr: string, appID: number, approvalProgram: string, clearProgram: string, payFlags: TxParams, flags: AppOptionalFlags, debugStack?: number): void
  • Update application

    Parameters

    • senderAddr: string

      sender address

    • appID: number

      application Id

    • approvalProgram: string

      new approval program

    • clearProgram: string

      new clear program

    • payFlags: TxParams

      Transaction parameters

    • flags: AppOptionalFlags

      Stateful smart contract transaction optional parameters (accounts, args..)

    • Optional debugStack: number

    Returns void

validateLsigAndRun

  • validateLsigAndRun(txnParam: ExecParams, debugStack?: number): void
  • validate logic signature and teal logic

    Parameters

    • txnParam: ExecParams

      Transaction Parameters

    • Optional debugStack: number

    Returns void

validateTxRound

  • validateTxRound(gtxns: Txn[]): void

Generated using TypeDoc