/// import type { Account, AssetDef, SSCSchemaConfig } from "algosdk"; import { AppLocalStateM, ASADef, AssetHoldingM, AssetModFields, CreatedAppM, SSCAttributesM, SSCDeploymentFlags, StackElem, StoreAccountI } from "./types"; export declare class StoreAccount implements StoreAccountI { readonly account: Account; readonly address: string; minBalance: number; assets: Map; amount: bigint; appsLocalState: Map; appsTotalSchema: SSCSchemaConfig; createdApps: Map; createdAssets: Map; constructor(balance: number | bigint, account?: Account); balance(): bigint; /** * Fetches local state value for key present in account * returns undefined otherwise * @param appId: current application id * @param key: key to fetch value of from local state */ getLocalState(appId: number, key: Uint8Array | string): StackElem | undefined; /** * Set new key-value pair or update pair with existing key in account * for application id: appId, throw error otherwise * @param appId: current application id * @param key: key to fetch value of from local state * @param value: value of key to put in local state * @param line line number in TEAL file * Note: if user is accessing this function directly through runtime, * then line number is unknown */ setLocalState(appId: number, key: Uint8Array | string, value: StackElem, line?: number): AppLocalStateM; /** * Queries app global state value. Returns `undefined` if the key is not present. * @param appId: current application id * @param key: key to fetch value of from local state */ getGlobalState(appId: number, key: Uint8Array | string): StackElem | undefined; /** * Updates app global state. * Throws error if app is not found. * @param appId: application id * @param key: app global state key * @param value: value associated with a key */ setGlobalState(appId: number, key: Uint8Array | string, value: StackElem, line?: number): void; /** * Queries application by application index from account's global state. * Returns undefined if app is not found. * @param appId application index */ getApp(appId: number): SSCAttributesM | undefined; /** * Queries application by application index from account's local state. * Returns undefined if app is not found. * @param appId application index */ getAppFromLocal(appId: number): AppLocalStateM | undefined; /** * Queries asset definition by assetId * @param assetId asset index */ getAssetDef(assetId: number): AssetDef | undefined; /** * Queries asset holding by assetId * @param assetId asset index */ getAssetHolding(assetId: number): AssetHoldingM | undefined; /** * Creates Asset in account's state * @param name Asset Name * @param asaDef Asset Definitions */ addAsset(assetId: number, name: string, asaDef: ASADef): AssetDef; /** * Modifies Asset fields * @param assetId Asset Index * @param fields Fields for modification */ modifyAsset(assetId: number, fields: AssetModFields): void; /** * Freeze asset * @param assetId Asset Index * @state new freeze state */ setFreezeState(assetId: number, state: boolean): void; /** * Destroys asset * @param assetId Asset Index */ destroyAsset(assetId: number): void; /** * Add application in account's state * check maximum account creation limit * @param appId application index * @param params SSCDeployment Flags * @param approvalProgram application approval program * @param clearProgram application clear program * NOTE - approval and clear program must be the TEAL code as string */ addApp(appId: number, params: SSCDeploymentFlags, approvalProgram: string, clearProgram: string): CreatedAppM; optInToApp(appId: number, appParams: SSCAttributesM): void; optInToASA(assetIndex: number, assetHolding: AssetHoldingM): void; deleteApp(appId: number): void; closeApp(appId: number): void; }