Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Runtime

Index

Constructors

Properties

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

Accessors

  • get defaultBalance(): number

Methods

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

    deprecated

    deployASADef should be used instead

    Parameters

    • asa: string

      ASA name

    • asaDef: { clawback?: string; decimals: number | bigint; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: string | Uint8Array | Buffer; name?: string; 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 name?: string
      • 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 ASAInfo

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

    deprecated

    deployApp should be used instead.

    Parameters

    • approvalProgram: string

      application approval program

    • clearProgram: string

      application clear program

    • flags: AppDeploymentFlags

      SSCDeployment flags

    • payFlags: TxParams

      Transaction parameters

    • Optional debugStack: number

    Returns AppInfo

  • addCtxAppCreateTxn(creator: default, appDef: AppDefinition, payFlags: TxParams): void
  • addCtxAppUpdateTx(senderAddr: string, appID: number, payFlags: TxParams, flags: AppOptionalFlags): void
  • addCtxOptInTx(senderAddr: string, appID: number, payFlags: TxParams, flags: AppOptionalFlags): void
  • asserts if account is defined.

    Parameters

    • address: string

      address

    • 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(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

  • 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(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(amt: bigint, address: string): void
  • assertNoDuplicateTransaction(gtxns: EncTx[]): void
  • Creates a new account with logic signature and smart contract arguments in the runtime store. The arguments are used when we send a transaction with this account and verify it.

    Parameters

    • program: string

      TEAL code

    • args: Uint8Array[]

      arguments passed

    Returns LogicSigAccount

    logic signature with arguments.

  • createTxnContext(txnParams: ExecParams | ExecParams[]): [EncTx, EncTx[]]
  • 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 [EncTx, EncTx[]]

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

    Parameters

    • asa: string

      ASA name

    • asaDef: { clawback?: string; decimals: number | bigint; defaultFrozen?: boolean; freeze?: string; manager?: string; metadataHash?: string | Uint8Array | Buffer; name?: string; 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 name?: string
      • 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 ASAInfo

  • deployApp(sender: default, appDefinition: AppDefinition, payFlags: TxParams, scTmplParams?: SCParams, debugStack?: number): AppInfo
  • deploy a new application and returns application id

    Parameters

    • sender: default
    • appDefinition: AppDefinition

      app definition

    • payFlags: TxParams

      Transaction parameters

    • Optional scTmplParams: SCParams

      Smart Contract template parameters

    • Optional debugStack: number

    Returns AppInfo

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

    Parameters

    • txnParams: ExecParams[] | TransactionAndSign[]

      : Transaction parameters

    • Optional debugStack: number

    Returns TxReceipt[]

  • getAppByName(appName: string): undefined | AppInfo
  • getAppInfoFromName(approval: string, clear: string): undefined | AppInfo
  • getAssetDef(assetId: number): AssetParams
  • getAssetHolding(assetIndex: number, address: string): AssetHoldingM
  • getAssetInfoFromName(name: string): undefined | ASAInfo
  • 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(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

  • getRound(): number
  • getTimestamp(): number
  • getTxReceipt(txID: string): undefined | TxReceipt
  • Loads logic signature for contract mode, creates a new runtime account associated with lsig

    Parameters

    • fileName: string

      ASC filename

    • Optional scTmplParams: SCParams
    • logs: boolean = true

      only show logs on console when set as true. By default this value is true

    Returns LogicSigAccount

    loaded logic signature from assets/.teal

  • optInToASA(assetIndex: number, address: string, flags: TxParams): TxReceipt
  • 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 TxReceipt

  • 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[]

      list account opt to asa

    Returns 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 TxReceipt

  • resetDefaultAccounts(): void
  • setRoundAndTimestamp(r: number, timestamp: number): void
  • updateApp(appName: string, senderAddr: string, appID: number, newAppCode: SmartContract, payFlags: TxParams, flags: AppOptionalFlags, scTmplParams?: SCParams, debugStack?: number): TxReceipt
  • Update application

    Parameters

    • appName: string

      application Name. Note in runtime application name just placeholder params

    • senderAddr: string

      sender address

    • appID: number

      application Id

    • newAppCode: SmartContract

      new application source code

    • payFlags: TxParams

      Transaction parameters

    • flags: AppOptionalFlags

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

    • Optional scTmplParams: SCParams
    • Optional debugStack: number

    Returns TxReceipt

  • validateAccountSignature(txParam: ExecParams): void
  • Validate signature for Algorand account on transaction params. Include check spending account when creating a transaction from Algorand account Throw RuntimeError if signature is invalid.

    Parameters

    • txParam: ExecParams

      transaction parameters.

    Returns void

  • validateLsigAndRun(txnParam: ExecParams, debugStack?: number): TxReceipt
  • validateTxRound(gtxns: EncTx[]): void

Generated using TypeDoc