Skip to content

AppReference

A stateful Algorand application

Extends

Constructors

new AppReference()

new AppReference(): AppReference

Returns

AppReference

Inherited from

AppID.constructor

Properties

address

readonly address: Address

The contract address for this application

Inherited from

AppID.address

Source

types/global.d.ts:551


approvalProgram

readonly approvalProgram: Brand<string, "bytes">

The approval program for the application

Inherited from

AppID.approvalProgram

Source

types/global.d.ts:527


clearStateProgram

readonly clearStateProgram: Brand<string, "bytes">

The clear state program for the application

Inherited from

AppID.clearStateProgram

Source

types/global.d.ts:530


creator

readonly creator: Address

The creator of this application

Inherited from

AppID.creator

Source

types/global.d.ts:548


extraProgramPages

readonly extraProgramPages: uint64

The number of extra program pages

Inherited from

AppID.extraProgramPages

Source

types/global.d.ts:545


globalNumByteSlice

readonly globalNumByteSlice: uint64

The number of reserved byteslices in global state

Inherited from

AppID.globalNumByteSlice

Source

types/global.d.ts:536


globalNumUint

readonly globalNumUint: uint64

The number of reserved uint64s in global state

Inherited from

AppID.globalNumUint

Source

types/global.d.ts:533


id

readonly id: uint64

The application index

Inherited from

AppID.id

Source

types/global.d.ts:521


localNumByteSlice

readonly localNumByteSlice: uint64

The number of reserved byteslices in local state

Inherited from

AppID.localNumByteSlice

Source

types/global.d.ts:542


localNumUint

readonly localNumUint: uint64

The number of reserved uint64s in local state

Inherited from

AppID.localNumUint

Source

types/global.d.ts:539


zeroIndex

static readonly zeroIndex: AppID

Application index 0

Inherited from

AppID.zeroIndex

Source

types/global.d.ts:524

Methods

globalState()

globalState(key): unknown

Get the global state value for the given key. MUST use an as expression to specify the value type.

Parameters

key: BytesLike

Returns

unknown

Inherited from

AppID.globalState

Example

someApp.globalState('someKey') as uint64[];

Source

types/global.d.ts:561


globalStateExists()

globalStateExists(key): boolean

Check if the given key exists in the global state

Parameters

key: BytesLike

Returns

boolean

Inherited from

AppID.globalStateExists

Source

types/global.d.ts:576


localState()

localState(account, key): unknown

Get the local state value for the given account and key. MUST use an as expression to specify the value type.

Parameters

account: Address

key: BytesLike

Returns

unknown

Inherited from

AppID.localState

Example

someApp.localState(this.txn.sender, 'someKey') as uint64[];

Source

types/global.d.ts:571


localStateExists()

localStateExists(account, key): boolean

Check if the given key exists in the local state

Parameters

account: Address

key: BytesLike

Returns

boolean

Inherited from

AppID.localStateExists

Source

types/global.d.ts:581


fromUint64()

static fromUint64(appID): AppID

Get an Application instance for the application with the given application index

Parameters

appID: uint64

Returns

AppID

Inherited from

AppID.fromUint64

Source

types/global.d.ts:518