Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AccountStore

Hierarchy

  • AccountStore

Implements

Index

Constructors

constructor

Properties

Readonly account

Readonly address

address: string

amount

amount: bigint

appsLocalState

appsLocalState: Map<number, AppLocalStateM>

appsTotalSchema

appsTotalSchema: ApplicationStateSchema

assets

assets: Map<number, AssetHoldingM>

createdApps

createdApps: Map<number, SSCAttributesM>

createdAssets

createdAssets: Map<number, AssetParams>

minBalance

minBalance: number

Methods

addApp

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

    Parameters

    • appID: number

      application index

    • params: AppDeploymentFlags

      SSCDeployment Flags

    • approvalProgram: string

      application approval program

    • clearProgram: string

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

    Returns CreatedAppM

addAsset

  • addAsset(assetId: number, name: 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 }): AssetParams
  • Creates Asset in account's state

    Parameters

    • assetId: number
    • name: string

      Asset Name

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

      Asset Definitions

      • 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

    Returns AssetParams

balance

  • balance(): bigint

closeApp

  • closeApp(appID: number): void

closeAsset

  • closeAsset(assetId: number): void

deleteApp

  • deleteApp(appID: number): void

destroyAsset

  • destroyAsset(assetId: number): void

getApp

getAppFromLocal

getAssetDef

  • getAssetDef(assetId: number): undefined | AssetParams

getAssetHolding

getGlobalState

  • getGlobalState(appID: number, key: string | Uint8Array): undefined | StackElem

getLocalState

  • getLocalState(appID: number, key: string | Uint8Array): undefined | StackElem

modifyAsset

  • modifyAsset(assetId: number, fields: AssetModFields): void

optInToASA

  • optInToASA(assetIndex: number, assetHolding: AssetHoldingM): void

optInToApp

setFreezeState

  • setFreezeState(assetId: number, state: boolean): void

setGlobalState

  • setGlobalState(appID: number, key: string | Uint8Array, value: StackElem, line?: number): void

setLocalState

  • 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