Hierarchy

  • AccountStore

Implements

Constructors

  • Creates a new Algorand state account. @balance: initial Algo balance (in micro Algo) @account: algo-sdk Account type or string. If strirng is provided then it is used as an account name. If algo-sdk Account is not used than a random account is generated (with an associated private key)

    Parameters

    • balance: number | bigint
    • Optional account: string | default

    Returns AccountStore

Properties

address: string
amount: bigint
appsLocalState: Map<number, AppLocalStateM>
appsTotalSchema: ApplicationStateSchema
assets: Map<number, AssetHoldingM>
createdApps: Map<number, SSCAttributesM>
createdAssets: Map<number, AssetParams>
minBalance: number

Methods

  • Deploy application in account's state check maximum account creation limit

    Parameters

    • appID: number

      application index

    • appDefinition: AppDefinitionFromSource

      application definition metadata NOTE - approval and clear program must be the TEAL code as string

    Returns CreatedAppM

  • Deploy Asset in account's state

    Parameters

    • assetId: number

      Asset Index

    • name: string

      Asset 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;
      }

      Asset Definitions

      • 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

    Returns AssetParams

  • removes asset holding from account

    Parameters

    • assetId: number

      asset index

    Returns void

  • Destroys asset

    Parameters

    • assetId: number

      Asset Index

    Returns void

  • Queries application by application index from account's global state. Returns undefined if app is not found.

    Parameters

    • appID: number

      application index

    Returns undefined | SSCAttributesM

  • Queries application by application index from account's local state. Returns undefined if app is not found.

    Parameters

    • appID: number

      application index

    Returns undefined | AppLocalStateM

  • Queries asset definition by assetId

    Parameters

    • assetId: number

      asset index

    Returns undefined | AssetParams

  • Queries app global state value. Returns undefined if the key is not present.

    Parameters

    • appID: number
    • key: string | Uint8Array

    Returns undefined | StackElem

  • Fetches local state value for key present in account returns undefined otherwise

    Parameters

    • appID: number
    • key: string | Uint8Array

    Returns undefined | StackElem

  • Modifies Asset fields

    Parameters

    • assetId: number

      Asset Index

    • fields: AssetModFields

      Fields for modification

    Returns void

  • Parameters

    • authAccountAddress: string

    Returns void

  • Freeze asset

    State

    new freeze state

    Parameters

    • assetId: number

      Asset Index

    • state: boolean

    Returns void

  • Updates app global state. Throws error if app is not found.

    Parameters

    • appID: number
    • key: string | Uint8Array
    • value: StackElem
    • Optional line: number

    Returns void

  • Set new key-value pair or update pair with existing key in account for application id: appID, throw error otherwise

    Parameters

    • appID: number
    • key: string | Uint8Array
    • value: StackElem
    • Optional line: number

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

    Returns AppLocalStateM

Generated using TypeDoc