Algorand TypeScript Testing
    Preparing search index...

    Class LedgerContext

    Index

    Constructors

    Properties

    onlineStake: number = 0

    Methods

    • Checks if a box exists for an application by key.

      Parameters

      • app: BaseContract | Application

        The application.

      • key: BytesCompat

        The key.

      Returns boolean

      True if the box exists, false otherwise.

    • Deletes a box for an application by key.

      Parameters

      • app: BaseContract | Application

        The application.

      • key: BytesCompat

        The key.

      Returns boolean

      True if the box was deleted, false otherwise.

    • Retrieves an account by address.

      Parameters

      • address: BytesCompat | Account

        The account address.

      Returns Account

      The account.

    • Retrieves an application by application ID.

      Parameters

      • applicationId: Uint64Compat

        The application ID.

      Returns Application

      The application.

      If the application is unknown.

    • Retrieves an application for a given approval program.

      Parameters

      • approvalProgram: undefined | bytes | readonly bytes[]

        The approval program.

      Returns undefined | Application

      The application or undefined if not found.

    • Retrieves an application for a given contract.

      Parameters

      • contract: BaseContract

        The contract.

      Returns Application

      The application.

      If the contract is unknown.

    • Retrieves an asset by asset ID.

      Parameters

      • assetId: Uint64Compat

        The asset ID.

      Returns Asset

      The asset.

      If the asset is unknown.

    • Retrieves a box for an application by key.

      Parameters

      • app: BaseContract | Application

        The application.

      • key: BytesCompat

        The key.

      Returns Uint8Array

      The box data.

    • Retrieves global state for an application by key.

      Parameters

      • app: BaseContract | Application

        The application.

      • key: BytesCompat

        The key.

      Returns [GlobalStateCls<unknown>, true] | [undefined, false]

      The global state and a boolean indicating if it was found.

    • Retrieves local state for an application and account by key.

      Parameters

      • app: uint64 | BaseContract | Application

        The application.

      • account: Account

        The account.

      • key: BytesCompat

        The key.

      Returns [undefined, false] | [LocalStateForAccount<unknown>, true]

      The local state and a boolean indicating if it was found.

    • Patches block data with the provided partial data.

      Parameters

      • index: Uint64Compat

        The block index.

      • data: Partial<BlockData>

        The partial block data.

      Returns void

    • Patches voter data with the provided partial data.

      Parameters

      • account: Account

        The account.

      • data: Partial<VoterData>

        The partial voter data.

      Returns void

    • Sets a box for an application by key.

      Parameters

      • app: BaseContract | Application

        The application.

      • key: BytesCompat

        The key.

      • value: Uint8Array<ArrayBufferLike> | BytesCompat

        The box data.

      Returns void

    • Sets global state for an application by key.

      Parameters

      • app: BaseContract | Application

        The application.

      • key: BytesCompat

        The key.

      • value: undefined | BytesCompat | Uint64Compat

        The value (optional).

      Returns void

    • Sets local state for an application and account by key.

      Type Parameters

      • T

      Parameters

      • app: uint64 | BaseContract | Application

        The application.

      • account: Account

        The account.

      • key: BytesCompat

        The key.

      • value: undefined | T

        The value (optional).

      Returns void

    • Update asset holdings for account, only specified values will be updated. AccountType will also be opted-in to asset

      Parameters

      • account: Account
      • assetId: Uint64Compat | Asset
      • Optionalbalance: Uint64Compat
      • Optionalfrozen: boolean

      Returns void