Hierarchy

  • Runtime

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

Methods

  • Parameters

    • creator: default
    • appDef: AppDefinition
    • payFlags: TxParams

    Returns void

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

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

    Returns

    logic signature with arguments.

    Parameters

    • program: string

      TEAL code

    • args: Uint8Array[]

      arguments passed

    Returns LogicSigAccount

  • Creates new transaction object (tx, gtxs) from given txnParams and signes it

    Parameters

    • txnParams: ExecParams[]

      : Transaction parameters for current txn or txn Group @returns: [current SignedTransaction, SignedTransaction group]

    Returns [SignedTransaction, SignedTransaction[]]

  • 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

  • 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

  • Queries asset id by asset name from global state. Returns undefined if asset is not found.

    Parameters

    • name: string

      Asset name

    Returns undefined | ASAInfo

  • Creates a group transaction array

    Returns

    groupTransactions array of EncTx type

    Parameters

    • signedTransactions: SignedTransaction[]

      : teal code as string

    Returns EncTx[]

  • 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

  • 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

  • Loads logic signature for contract mode, creates a new runtime account associated with lsig

    Returns

    loaded logic signature from assets/.teal

    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

  • Creates an algosdk.Transaction object based on execParams and suggestedParams and signs it using provided signer account

    Returns

    array of algosdk.SignedTransaction objects

    Parameters

    • execParams: ExecParams[]

      execParams containing all txn info

    • txParams: SuggestedParams

      suggestedParams object

    • signer: default

      account object that signes the transaction

    Returns SignedTransaction[]

  • Creates an algosdk.Transaction object based on execParams and suggestedParams

    Returns

    array of algosdk.Transaction objects

    Parameters

    • execParams: ExecParams[]

      execParams containing all txn info

    • txParams: SuggestedParams

      suggestedParams object

    Returns Transaction[]

  • 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

  • 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

  • Sends a SignedTransaction object

    Returns

    const txReceipts = this.ctx.processTransactions(signedTransactions, appDefMap, lsigMap);

    Parameters

    • signedTransaction: SignedTransaction

    Returns TxReceipt[]

  • Sends signedTransaction and waits for the response

    Returns

    TxnReceipt which includes confirmed txn response along with txID

    Parameters

    • transactions: SignedTransaction[]

      array of signedTransaction objects.

    Returns TxnReceipt[]

  • set current round with timestamp for a block

    Parameters

    • r: number

      current round

    • timestamp: number

      block's timestamp

    Returns void

  • Signes a Transaction object with the provided account

    Returns

    SignedTransaction

    Parameters

    • transaction: Transaction

      transaction object.

    • signer: default

      account object that signes the transaction

    Returns SignedTransaction

  • 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

  • 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

  • Verifies extra pages do not exceed the limit

    Parameters

    • extraPages: number = 0

      extra pages for program. Default value is 0

    Returns void

  • validate logic signature and teal logic

    Parameters

    • txnParam: SignWithLsig

      Transaction Parameters

    • Optional debugStack: number

    Returns TxReceipt

  • Verifies multi-signature and throws an error if signatures are not valid

    Parameters

    • signedTransaction: SignedTransaction

      signedTransaction object

    Returns 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

    • signedTransaction: SignedTransaction

      signedTransaction object.

    Returns void

  • Verify multi-signature

    Parameters

    • signedTxn: SignedTransaction

      signedTransaction object

    Returns boolean

Generated using TypeDoc