algopy.op | Algorand Developer Portal

algopy.op

Module Contents

Section titled “Module Contents”

Classes

Section titled “Classes”

AcctParamsGet X is field F from account A. Y is 1 if A owns positive algos, else 0
Native TEAL op: acct_params_get
AppGlobal Get or modify Global app state
Native TEAL ops: app_global_del, app_global_get, app_global_get_ex, app_global_put
AppLocal Get or modify Local app state
Native TEAL ops: app_local_del, app_local_get, app_local_get_ex, app_local_put
AppParamsGet X is field F from app A. Y is 1 if A exists, else 0 params: Txn.ForeignApps offset or an available app id. Return: did_exist flag (1 if the application existed and 0 otherwise), value.
Native TEAL op: app_params_get
AssetHoldingGet X is field F from account A’s holding of asset B. Y is 1 if A is opted into B, else 0 params: Txn.Accounts offset (or, since v4, an available address), asset id (or, since v4, a Txn.ForeignAssets offset). Return: did_exist flag (1 if the asset existed and 0 otherwise), value.
Native TEAL op: asset_holding_get
AssetParamsGet X is field F from asset A. Y is 1 if A exists, else 0 params: Txn.ForeignAssets offset (or, since v4, an available asset id. Return: did_exist flag (1 if the asset existed and 0 otherwise), value.
Native TEAL op: asset_params_get
Base64 Available values for the base64 enum
Block field F of block A. Fail unless A falls between txn.LastValid-1002 and txn.FirstValid (exclusive)
Native TEAL op: block
Box Get or modify box state
Native TEAL ops: box_create, box_del, box_extract, box_get, box_len, box_put, box_replace, box_resize, box_splice
EC Available values for the EC enum
ECDSA Available values for the ECDSA enum
EllipticCurve Elliptic Curve functions
Native TEAL ops: ec_add, ec_map_to, ec_multi_scalar_mul, ec_pairing_check, ec_scalar_mul, ec_subgroup_check
GITxn Get values for inner transaction in the last group submitted
Native TEAL ops: gitxn, gitxnas
GTxn Get values for transactions in the current group
Native TEAL ops: gtxns, gtxnsas
Global Get Global values
Native TEAL op: global
ITxn Get values for the last inner transaction
Native TEAL ops: itxn, itxnas
ITxnCreate Create inner transactions
Native TEAL ops: itxn_begin, itxn_field, itxn_next, itxn_submit
JsonRef key B’s value, of type R, from a valid utf-8 encoded json object A Warning: Usage should be restricted to very rare use cases, as JSON decoding is expensive and quite limited. In addition, JSON objects are large and not optimized for size. Almost all smart contracts should use simpler and smaller methods (such as the ABI. This opcode should only be used in cases where JSON is only available option, e.g. when a third-party only signs JSON.
Native TEAL op: json_ref
MiMCConfigurations Available values for the Mimc Configurations enum
Scratch Load or store scratch values
Native TEAL ops: loads, stores
Txn Get values for the current executing transaction
Native TEAL ops: txn, txnas
VoterParamsGet X is field F from online account A as of the balance round: 320 rounds before the current round. Y is 1 if A had positive algos online in the agreement round, else Y is 0 and X is a type specific zero-value
Native TEAL op: voter_params_get
VrfVerify Available values for the vrf_verify enum

Functions

Section titled “Functions”

| addw | A plus B as a 128-bit result. X is the carry-bit, Y is the low-order 64 bits. | | ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --- | ------------ | --- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | app_opted_in | 1 if account A is opted in to application B, else 0

params: Txn.Accounts offset (or, since v4, an available account address), available application id (or, since v4, a Txn.ForeignApps offset). Return: 1 if opted in and 0 otherwise. | | arg | Ath LogicSig argument | | balance | balance for account A, in microalgos. The balance is observed after the effects of previous transactions in the group, and after the fee for the current transaction is deducted. Changes caused by inner transactions are observable immediately following itxn_submit

params: Txn.Accounts offset (or, since v4, an available account address), available application id (or, since v4, a Txn.ForeignApps offset). Return: value. | | base64_decode | decode A which was base64-encoded using encoding E. Fail if A is not base64 encoded with encoding E

Warning: Usage should be restricted to very rare use cases. In almost all cases, smart contracts should directly handle non-encoded byte-strings. This opcode should only be used in cases where base64 is the only available option, e.g. interoperability with a third-party that only signs base64 strings. | | bitlen | The highest set bit in A. If A is a byte-array, it is interpreted as a big-endian unsigned integer. bitlen of 0 is 0, bitlen of 8 is 4

bitlen interprets arrays as big-endian integers, unlike setbit/getbit | | bsqrt | The largest integer I such that I^2 <= A. A and I are interpreted as big-endian unsigned integers | | btoi | converts big-endian byte array A to uint64. Fails if len(A) > 8. Padded by leading 0s if len(A) < 8.

btoi fails if the input is longer than 8 bytes. | | bzero | zero filled byte-array of length A | | concat | join A and B

concat fails if the result would be greater than 4096 bytes. | | divmodw | W,X = (A,B / C,D); Y,Z = (A,B modulo C,D)

The notation J,K indicates that two uint64 values J and K are interpreted as a uint128 value, with J as the high uint64 and K the low. | | divw | A,B / C. Fail if C == 0 or if result overflows.

The notation A,B indicates that A and B are interpreted as a uint128 value, with A as the high uint64 and B the low. | | ecdsa_pk_decompress | decompress pubkey A into components X, Y

The 33 byte public key in a compressed form to be decompressed into X and Y (top) components. All values are big-endian encoded. | | ecdsa_pk_recover | for (data A, recovery id B, signature C, D) recover a public key

S (top) and R elements of a signature, recovery id and data (bottom) are expected on the stack and used to deriver a public key. All values are big-endian encoded. The signed data must be 32 bytes long. | | ecdsa_verify | for (data A, signature B, C and pubkey D, E) verify the signature of the data against the pubkey => {0 or 1}

The 32 byte Y-component of a public key is the last element on the stack, preceded by X-component of a pubkey, preceded by S and R components of a signature, preceded by the data that is fifth element on the stack. All values are big-endian encoded. The signed data must be 32 bytes long, and signatures in lower-S form are only accepted. | | ed25519verify | for (data A, signature B, pubkey C) verify the signature of (“ProgData” | | program_hash | | data) against the pubkey => {0 or 1}

The 32 byte public key is the last element on the stack, preceded by the 64 byte signature at the second-to-last element on the stack, preceded by the data which was signed at the third-to-last element on the stack. | | ed25519verify_bare | for (data A, signature B, pubkey C) verify the signature of the data against the pubkey => {0 or 1} | | err | Fail immediately. | | exit | use A as success value; end | | exp | A raised to the Bth power. Fail if A == B == 0 and on overflow | | expw | A raised to the Bth power as a 128-bit result in two uint64s. X is the high 64 bits, Y is the low. Fail if A == B == 0 or if the results exceeds 2^128-1 | | extract | A range of bytes from A starting at B up to but not including B+C. If B+C is larger than the array length, the program fails

extract3 can be called using extract with no immediates. | | extract_uint16 | A uint16 formed from a range of big-endian bytes from A starting at B up to but not including B+2. If B+2 is larger than the array length, the program fails | | extract_uint32 | A uint32 formed from a range of big-endian bytes from A starting at B up to but not including B+4. If B+4 is larger than the array length, the program fails | | extract_uint64 | A uint64 formed from a range of big-endian bytes from A starting at B up to but not including B+8. If B+8 is larger than the array length, the program fails | | falcon_verify | for (data A, compressed-format signature B, pubkey C) verify the signature of data against the pubkey => {0 or 1}

Min AVM version: 12 | | gaid | ID of the asset or application created in the Ath transaction of the current group

gaids fails unless the requested transaction created an asset or application and A < GroupIndex. | | getbit | Bth bit of (byte-array or integer) A. If B is greater than or equal to the bit length of the value (8*byte length), the program fails

see explanation of bit ordering in setbit | | getbyte | Bth byte of A, as an integer. If B is greater than or equal to the array length, the program fails | | gload_bytes | Bth scratch space value of the Ath transaction in the current group | | gload_uint64 | Bth scratch space value of the Ath transaction in the current group | | itob | converts uint64 A to big-endian byte array, always of length 8 | | keccak256 | Keccak256 hash of value A, yields [32]byte | | mimc | MiMC hash of scalars A, using curve and parameters specified by configuration C

A is a list of concatenated 32 byte big-endian unsigned integer scalars. Fail if A’s length is not a multiple of 32 or any element exceeds the curve modulus. | | min_balance | minimum required balance for account A, in microalgos. Required balance is affected by ASA, App, and Box usage. When creating or opting into an app, the minimum balance grows before the app code runs, therefore the increase is visible there. When deleting or closing out, the minimum balance decreases after the app executes. Changes caused by inner transactions or box usage are observable immediately following the opcode effecting the change.

params: Txn.Accounts offset (or, since v4, an available account address), available application id (or, since v4, a Txn.ForeignApps offset). Return: value. | | mulw | A times B as a 128-bit result in two uint64s. X is the high 64 bits, Y is the low | | online_stake | the total online stake in the agreement round

Min AVM version: 11 | | replace | Copy of A with the bytes starting at B replaced by the bytes of C. Fails if B+len(C) exceeds len(A)

replace3 can be called using replace with no immediates. | | select_bytes | selects one of two values based on top-of-stack: B if C != 0, else A | | select_uint64 | selects one of two values based on top-of-stack: B if C != 0, else A | | setbit_bytes | Copy of (byte-array or integer) A, with the Bth bit set to (0 or 1) C. If B is greater than or equal to the bit length of the value (8*byte length), the program fails

When A is a uint64, index 0 is the least significant bit. Setting bit 3 to 1 on the integer 0 yields 8, or 2^3. When A is a byte array, index 0 is the leftmost bit of the leftmost byte. Setting bits 0 through 11 to 1 in a 4-byte-array of 0s yields the byte array 0xfff00000. Setting bit 3 to 1 on the 1-byte-array 0x00 yields the byte array 0x10. | | setbit_uint64 | Copy of (byte-array or integer) A, with the Bth bit set to (0 or 1) C. If B is greater than or equal to the bit length of the value (8*byte length), the program fails

When A is a uint64, index 0 is the least significant bit. Setting bit 3 to 1 on the integer 0 yields 8, or 2^3. When A is a byte array, index 0 is the leftmost bit of the leftmost byte. Setting bits 0 through 11 to 1 in a 4-byte-array of 0s yields the byte array 0xfff00000. Setting bit 3 to 1 on the 1-byte-array 0x00 yields the byte array 0x10. | | setbyte | Copy of A with the Bth byte set to small integer (between 0..255) C. If B is greater than or equal to the array length, the program fails | | sha256 | SHA256 hash of value A, yields [32]byte | | sha3_256 | SHA3_256 hash of value A, yields [32]byte | | sha512_256 | SHA512_256 hash of value A, yields [32]byte | | shl | A times 2^B, modulo 2^64 | | shr | A divided by 2^B | | sqrt | The largest integer I such that I^2 <= A | | substring | A range of bytes from A starting at B up to but not including C. If C < B, or either is larger than the array length, the program fails | | sumhash512 | sumhash512 of value A, yields [64]byte

Min AVM version: 13 | | vrf_verify | Verify the proof B of message A against pubkey C. Returns vrf output and verification flag.

VrfAlgorand is the VRF used in Algorand. It is ECVRF-ED25519-SHA512-Elligator2, specified in the IETF internet draft draft-irtf-cfrg-vrf-03. |

API

Section titled “API”

class algopy.op.AcctParamsGet

Section titled “class algopy.op.AcctParamsGet”

X is field F from account A. Y is 1 if A owns positive algos, else 0 Native TEAL op: acct_params_get

static acct_auth_addr

Section titled “static acct_auth_addr”

* static acct_auth_addr(a: algopy.Account | algopy.UInt64 | int, /) → tuple[ algopy.Account, bool]*

Address the account is rekeyed to.

Native TEAL opcode: acct_params_get

static acct_balance

Section titled “static acct_balance”

* static acct_balance(a: algopy.Account | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

Account balance in microalgos

Native TEAL opcode: acct_params_get

static acct_incentive_eligible

Section titled “static acct_incentive_eligible”

* static acct_incentive_eligible(a: algopy.Account | algopy.UInt64 | int, /) → tuple[ bool, bool]*

Min AVM version: 11

Native TEAL opcode: acct_params_get

static acct_last_heartbeat

Section titled “static acct_last_heartbeat”

* static acct_last_heartbeat(a: algopy.Account | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

Min AVM version: 11

Native TEAL opcode: acct_params_get

static acct_last_proposed

Section titled “static acct_last_proposed”

* static acct_last_proposed(a: algopy.Account | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

Min AVM version: 11

Native TEAL opcode: acct_params_get

static acct_min_balance

Section titled “static acct_min_balance”

* static acct_min_balance(a: algopy.Account | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

Minimum required balance for account, in microalgos

Native TEAL opcode: acct_params_get

static acct_total_apps_created

Section titled “static acct_total_apps_created”

* static acct_total_apps_created(a: algopy.Account | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

The number of existing apps created by this account.

Native TEAL opcode: acct_params_get

static acct_total_apps_opted_in

Section titled “static acct_total_apps_opted_in”

* static acct_total_apps_opted_in(a: algopy.Account | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

The number of apps this account is opted into.

Native TEAL opcode: acct_params_get

static acct_total_assets

Section titled “static acct_total_assets”

* static acct_total_assets(a: algopy.Account | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

The numbers of ASAs held by this account (including ASAs this account created).

Native TEAL opcode: acct_params_get

static acct_total_assets_created

Section titled “static acct_total_assets_created”

* static acct_total_assets_created(a: algopy.Account | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

The number of existing ASAs created by this account.

Native TEAL opcode: acct_params_get

static acct_total_box_bytes

Section titled “static acct_total_box_bytes”

* static acct_total_box_bytes(a: algopy.Account | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

The total number of bytes used by this account’s app’s box keys and values.

Native TEAL opcode: acct_params_get

static acct_total_boxes

Section titled “static acct_total_boxes”

* static acct_total_boxes(a: algopy.Account | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

The number of existing boxes created by this account’s app.

Native TEAL opcode: acct_params_get

static acct_total_extra_app_pages

Section titled “static acct_total_extra_app_pages”

* static acct_total_extra_app_pages(a: algopy.Account | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

The number of extra app code pages used by this account.

Native TEAL opcode: acct_params_get

static acct_total_num_byte_slice

Section titled “static acct_total_num_byte_slice”

* static acct_total_num_byte_slice(a: algopy.Account | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

The total number of byte array values allocated by this account in Global and Local States.

Native TEAL opcode: acct_params_get

static acct_total_num_uint

Section titled “static acct_total_num_uint”

* static acct_total_num_uint(a: algopy.Account | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

The total number of uint64 values allocated by this account in Global and Local States.

Native TEAL opcode: acct_params_get

class algopy.op.AppGlobal

Section titled “class algopy.op.AppGlobal”

Get or modify Global app state Native TEAL ops: app_global_del, app_global_get, app_global_get_ex, app_global_put

static delete

Section titled “static delete”

* static delete(a: algopy.Bytes | bytes, /) → None*

delete key A from the global state of the current application params: state key.

Deleting a key which is already absent has no effect on the application global state. (In particular, it does not cause the program to fail.)

Native TEAL opcode: app_global_del

static get_bytes

Section titled “static get_bytes”

* static get_bytes(a: algopy.Bytes | bytes, /) → algopy.Bytes*

global state of the key A in the current application params: state key. Return: value. The value is zero (of type uint64) if the key does not exist.

Native TEAL opcode: app_global_get

static get_ex_bytes

Section titled “static get_ex_bytes”

* static get_ex_bytes(a: algopy.Application | algopy.UInt64 | int, b: algopy.Bytes | bytes, /) → tuple[ algopy.Bytes, bool]*

X is the global state of application A, key B. Y is 1 if key existed, else 0 params: Txn.ForeignApps offset (or, since v4, an available application id), state key. Return: did_exist flag (top of the stack, 1 if the application and key existed and 0 otherwise), value. The value is zero (of type uint64) if the key does not exist.

Native TEAL opcode: app_global_get_ex

static get_ex_uint64

Section titled “static get_ex_uint64”

* static get_ex_uint64(a: algopy.Application | algopy.UInt64 | int, b: algopy.Bytes | bytes, /) → tuple[ algopy.UInt64, bool]*

Native TEAL opcode: app_global_get_ex

static get_uint64

Section titled “static get_uint64”

* static get_uint64(a: algopy.Bytes | bytes, /) → algopy.UInt64*

global state of the key A in the current application params: state key. Return: value. The value is zero (of type uint64) if the key does not exist.

Native TEAL opcode: app_global_get

static put

Section titled “static put”

* static put(a: algopy.Bytes | bytes, b: algopy.Bytes | algopy.UInt64 | bytes | int, /) → None*

write B to key A in the global state of the current application

Native TEAL opcode: app_global_put

class algopy.op.AppLocal

Section titled “class algopy.op.AppLocal”

Get or modify Local app state Native TEAL ops: app_local_del, app_local_get, app_local_get_ex, app_local_put

static delete

Section titled “static delete”

* static delete(a: algopy.Account | algopy.UInt64 | int, b: algopy.Bytes | bytes, /) → None*

delete key B from account A’s local state of the current application params: Txn.Accounts offset (or, since v4, an available account address), state key.

Deleting a key which is already absent has no effect on the application local state. (In particular, it does not cause the program to fail.)

Native TEAL opcode: app_local_del

static get_bytes

Section titled “static get_bytes”

* static get_bytes(a: algopy.Account | algopy.UInt64 | int, b: algopy.Bytes | bytes, /) → algopy.Bytes*

local state of the key B in the current application in account A params: Txn.Accounts offset (or, since v4, an available account address), state key. Return: value. The value is zero (of type uint64) if the key does not exist.

Native TEAL opcode: app_local_get

static get_ex_bytes

Section titled “static get_ex_bytes”

* static get_ex_bytes(a: algopy.Account | algopy.UInt64 | int, b: algopy.Application | algopy.UInt64 | int, c: algopy.Bytes | bytes, /) → tuple[ algopy.Bytes, bool]*

X is the local state of application B, key C in account A. Y is 1 if key existed, else 0 params: Txn.Accounts offset (or, since v4, an available account address), available application id (or, since v4, a Txn.ForeignApps offset), state key. Return: did_exist flag (top of the stack, 1 if the application and key existed and 0 otherwise), value. The value is zero (of type uint64) if the key does not exist.

Native TEAL opcode: app_local_get_ex

static get_ex_uint64

Section titled “static get_ex_uint64”

* static get_ex_uint64(a: algopy.Account | algopy.UInt64 | int, b: algopy.Application | algopy.UInt64 | int, c: algopy.Bytes | bytes, /) → tuple[ algopy.UInt64, bool]*

Native TEAL opcode: app_local_get_ex

static get_uint64

Section titled “static get_uint64”

* static get_uint64(a: algopy.Account | algopy.UInt64 | int, b: algopy.Bytes | bytes, /) → algopy.UInt64*

Native TEAL opcode: app_local_get

static put

Section titled “static put”

* static put(a: algopy.Account | algopy.UInt64 | int, b: algopy.Bytes | bytes, c: algopy.Bytes | algopy.UInt64 | bytes | int, /) → None*

write C to key B in account A’s local state of the current application params: Txn.Accounts offset (or, since v4, an available account address), state key, value.

Native TEAL opcode: app_local_put

class algopy.op.AppParamsGet

Section titled “class algopy.op.AppParamsGet”

X is field F from app A. Y is 1 if A exists, else 0 params: Txn.ForeignApps offset or an available app id. Return: did_exist flag (1 if the application existed and 0 otherwise), value. Native TEAL op: app_params_get

static app_address

Section titled “static app_address”

* static app_address(a: algopy.Application | algopy.UInt64 | int, /) → tuple[ algopy.Account, bool]*

Address for which this application has authority

Native TEAL opcode: app_params_get

static app_approval_program

Section titled “static app_approval_program”

* static app_approval_program(a: algopy.Application | algopy.UInt64 | int, /) → tuple[ algopy.Bytes, bool]*

Bytecode of Approval Program

Native TEAL opcode: app_params_get

static app_clear_state_program

Section titled “static app_clear_state_program”

* static app_clear_state_program(a: algopy.Application | algopy.UInt64 | int, /) → tuple[ algopy.Bytes, bool]*

Bytecode of Clear State Program

Native TEAL opcode: app_params_get

static app_creator

Section titled “static app_creator”

* static app_creator(a: algopy.Application | algopy.UInt64 | int, /) → tuple[ algopy.Account, bool]*

Creator address

Native TEAL opcode: app_params_get

static app_extra_program_pages

Section titled “static app_extra_program_pages”

* static app_extra_program_pages(a: algopy.Application | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

Number of Extra Program Pages of code space

Native TEAL opcode: app_params_get

static app_global_num_byte_slice

Section titled “static app_global_num_byte_slice”

* static app_global_num_byte_slice(a: algopy.Application | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

Number of byte array values allowed in Global State

Native TEAL opcode: app_params_get

static app_global_num_uint

Section titled “static app_global_num_uint”

* static app_global_num_uint(a: algopy.Application | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

Number of uint64 values allowed in Global State

Native TEAL opcode: app_params_get

static app_local_num_byte_slice

Section titled “static app_local_num_byte_slice”

* static app_local_num_byte_slice(a: algopy.Application | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

Number of byte array values allowed in Local State

Native TEAL opcode: app_params_get

static app_local_num_uint

Section titled “static app_local_num_uint”

* static app_local_num_uint(a: algopy.Application | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

Number of uint64 values allowed in Local State

Native TEAL opcode: app_params_get

static app_version

Section titled “static app_version”

* static app_version(a: algopy.Application | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

Min AVM version: 12

Native TEAL opcode: app_params_get

class algopy.op.AssetHoldingGet

Section titled “class algopy.op.AssetHoldingGet”

X is field F from account A’s holding of asset B. Y is 1 if A is opted into B, else 0 params: Txn.Accounts offset (or, since v4, an available address), asset id (or, since v4, a Txn.ForeignAssets offset). Return: did_exist flag (1 if the asset existed and 0 otherwise), value. Native TEAL op: asset_holding_get

static asset_balance

Section titled “static asset_balance”

* static asset_balance(a: algopy.Account | algopy.UInt64 | int, b: algopy.Asset | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

Amount of the asset unit held by this account

Native TEAL opcode: asset_holding_get

static asset_frozen

Section titled “static asset_frozen”

* static asset_frozen(a: algopy.Account | algopy.UInt64 | int, b: algopy.Asset | algopy.UInt64 | int, /) → tuple[ bool, bool]*

Is the asset frozen or not

Native TEAL opcode: asset_holding_get

class algopy.op.AssetParamsGet

Section titled “class algopy.op.AssetParamsGet”

X is field F from asset A. Y is 1 if A exists, else 0 params: Txn.ForeignAssets offset (or, since v4, an available asset id. Return: did_exist flag (1 if the asset existed and 0 otherwise), value. Native TEAL op: asset_params_get

static asset_clawback

Section titled “static asset_clawback”

* static asset_clawback(a: algopy.Asset | algopy.UInt64 | int, /) → tuple[ algopy.Account, bool]*

Clawback address

Native TEAL opcode: asset_params_get

static asset_creator

Section titled “static asset_creator”

* static asset_creator(a: algopy.Asset | algopy.UInt64 | int, /) → tuple[ algopy.Account, bool]*

Creator address

Native TEAL opcode: asset_params_get

static asset_decimals

Section titled “static asset_decimals”

* static asset_decimals(a: algopy.Asset | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

See AssetParams.Decimals

Native TEAL opcode: asset_params_get

static asset_default_frozen

Section titled “static asset_default_frozen”

* static asset_default_frozen(a: algopy.Asset | algopy.UInt64 | int, /) → tuple[ bool, bool]*

Frozen by default or not

Native TEAL opcode: asset_params_get

static asset_freeze

Section titled “static asset_freeze”

* static asset_freeze(a: algopy.Asset | algopy.UInt64 | int, /) → tuple[ algopy.Account, bool]*

Freeze address

Native TEAL opcode: asset_params_get

static asset_manager

Section titled “static asset_manager”

* static asset_manager(a: algopy.Asset | algopy.UInt64 | int, /) → tuple[ algopy.Account, bool]*

Manager address

Native TEAL opcode: asset_params_get

static asset_metadata_hash

Section titled “static asset_metadata_hash”

* static asset_metadata_hash(a: algopy.Asset | algopy.UInt64 | int, /) → tuple[ algopy.Bytes, bool]*

Arbitrary commitment

Native TEAL opcode: asset_params_get

static asset_name

Section titled “static asset_name”

* static asset_name(a: algopy.Asset | algopy.UInt64 | int, /) → tuple[ algopy.Bytes, bool]*

Asset name

Native TEAL opcode: asset_params_get

static asset_reserve

Section titled “static asset_reserve”

* static asset_reserve(a: algopy.Asset | algopy.UInt64 | int, /) → tuple[ algopy.Account, bool]*

Reserve address

Native TEAL opcode: asset_params_get

static asset_total

Section titled “static asset_total”

* static asset_total(a: algopy.Asset | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

Total number of units of this asset

Native TEAL opcode: asset_params_get

static asset_unit_name

Section titled “static asset_unit_name”

* static asset_unit_name(a: algopy.Asset | algopy.UInt64 | int, /) → tuple[ algopy.Bytes, bool]*

Asset unit name

Native TEAL opcode: asset_params_get

static asset_url

Section titled “static asset_url”

* static asset_url(a: algopy.Asset | algopy.UInt64 | int, /) → tuple[ algopy.Bytes, bool]*

URL with additional info about the asset

Native TEAL opcode: asset_params_get

class algopy.op.Base64

Section titled “class algopy.op.Base64”

Available values for the base64 enum

Initialization

Section titled “Initialization”

Initialize self. See help(type(self)) for accurate signature.

__add__

Section titled “__add__”

__add__()

Return self+value.

__contains__

Section titled “__contains__”

__contains__()

Return bool(key in self).

__delattr__

Section titled “__delattr__”

__delattr__()

Implement delattr(self, name).

__dir__

Section titled “__dir__”

__dir__()

Default dir() implementation.

__eq__

Section titled “__eq__”

__eq__()

Return self==value.

__format__

Section titled “__format__”

__format__()

Return a formatted version of the string as described by format_spec.

__ge__

Section titled “__ge__”

__ge__()

Return self>=value.

__getattribute__

Section titled “__getattribute__”

__getattribute__()

Return getattr(self, name).

__getitem__

Section titled “__getitem__”

__getitem__()

Return self[key].

__getstate__

Section titled “__getstate__”

__getstate__()

Helper for pickle.

__gt__

Section titled “__gt__”

__gt__()

Return self>value.

__hash__

Section titled “__hash__”

__hash__()

Return hash(self).

__iter__

Section titled “__iter__”

__iter__()

Implement iter(self).

__le__

Section titled “__le__”

__le__()

Return self<=value.

__len__

Section titled “__len__”

__len__()

Return len(self).

__lt__

Section titled “__lt__”

__lt__()

Return self<value.

__mod__

Section titled “__mod__”

__mod__()

Return self%value.

__mul__

Section titled “__mul__”

__mul__()

Return self*value.

__ne__

Section titled “__ne__”

__ne__()

Return self!=value.

__new__

Section titled “__new__”

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__

Section titled “__reduce__”

__reduce__()

Helper for pickle.

__reduce ex_

Section titled “__reduceex_”

__reduceex_()

Helper for pickle.

__repr__

Section titled “__repr__”

__repr__()

Return repr(self).

__rmod__

Section titled “__rmod__”

__rmod__()

Return value%self.

__rmul__

Section titled “__rmul__”

__rmul__()

Return value*self.

__setattr__

Section titled “__setattr__”

__setattr__()

Implement setattr(self, name, value).

__sizeof__

Section titled “__sizeof__”

__sizeof__()

Return the size of the string in memory, in bytes.

__str__

Section titled “__str__”

__str__()

Return str(self).

capitalize

Section titled “capitalize”

capitalize()

Return a capitalized version of the string.

More specifically, make the first character have upper case and the rest lower case.

casefold

Section titled “casefold”

casefold()

Return a version of the string suitable for caseless comparisons.

center

Section titled “center”

center()

Return a centered string of length width.

Padding is done using the specified fill character (default is a space).

count

Section titled “count”

count()

S.count(sub[, start[, end]]) -> int

Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

encode

Section titled “encode”

encode()

Encode the string using the codec registered for encoding.

encoding The encoding in which to encode the string. errors The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

endswith

Section titled “endswith”

endswith()

S.endswith(suffix[, start[, end]]) -> bool

Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

expandtabs

Section titled “expandtabs”

expandtabs()

Return a copy where all tab characters are expanded using spaces.

If tabsize is not given, a tab size of 8 characters is assumed.

find

Section titled “find”

find()

S.find(sub[, start[, end]]) -> int

Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

format

Section titled “format”

format()

S.format(*args, **kwargs) -> str

Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

format_map

Section titled “format_map”

format_map()

S.format_map(mapping) -> str

Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

index

Section titled “index”

index()

S.index(sub[, start[, end]]) -> int

Raises ValueError when the substring is not found.

isalnum

Section titled “isalnum”

isalnum()

Return True if the string is an alpha-numeric string, False otherwise.

A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

isalpha

Section titled “isalpha”

isalpha()

Return True if the string is an alphabetic string, False otherwise.

A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

isascii

Section titled “isascii”

isascii()

Return True if all characters in the string are ASCII, False otherwise.

ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

isdecimal

Section titled “isdecimal”

isdecimal()

Return True if the string is a decimal string, False otherwise.

A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

isdigit

Section titled “isdigit”

isdigit()

Return True if the string is a digit string, False otherwise.

A string is a digit string if all characters in the string are digits and there is at least one character in the string.

isidentifier

Section titled “isidentifier”

isidentifier()

Return True if the string is a valid Python identifier, False otherwise.

Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

islower

Section titled “islower”

islower()

Return True if the string is a lowercase string, False otherwise.

A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

isnumeric

Section titled “isnumeric”

isnumeric()

Return True if the string is a numeric string, False otherwise.

A string is numeric if all characters in the string are numeric and there is at least one character in the string.

isprintable

Section titled “isprintable”

isprintable()

Return True if the string is printable, False otherwise.

A string is printable if all of its characters are considered printable in repr() or if it is empty.

isspace

Section titled “isspace”

isspace()

Return True if the string is a whitespace string, False otherwise.

A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

istitle

Section titled “istitle”

istitle()

Return True if the string is a title-cased string, False otherwise.

In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

isupper

Section titled “isupper”

isupper()

Return True if the string is an uppercase string, False otherwise.

A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

join

Section titled “join”

join()

Concatenate any number of strings.

The string whose method is called is inserted in between each given string. The result is returned as a new string.

Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

ljust

Section titled “ljust”

ljust()

Return a left-justified string of length width.

Padding is done using the specified fill character (default is a space).

lower

Section titled “lower”

lower()

Return a copy of the string converted to lowercase.

lstrip

Section titled “lstrip”

lstrip()

Return a copy of the string with leading whitespace removed.

If chars is given and not None, remove characters in chars instead.

partition

Section titled “partition”

partition()

Partition the string into three parts using the given separator.

This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

removeprefix

Section titled “removeprefix”

removeprefix()

Return a str with the given prefix string removed if present.

If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

removesuffix

Section titled “removesuffix”

removesuffix()

Return a str with the given suffix string removed if present.

If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

replace

Section titled “replace”

replace()

Return a copy with all occurrences of substring old replaced by new.

count Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

If the optional argument count is given, only the first count occurrences are replaced.

rfind

Section titled “rfind”

rfind()

S.rfind(sub[, start[, end]]) -> int

Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

Return -1 on failure.

rindex

Section titled “rindex”

rindex()

S.rindex(sub[, start[, end]]) -> int

Raises ValueError when the substring is not found.

rjust

Section titled “rjust”

rjust()

Return a right-justified string of length width.

Padding is done using the specified fill character (default is a space).

rpartition

Section titled “rpartition”

rpartition()

Partition the string into three parts using the given separator.

This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

rsplit

Section titled “rsplit”

rsplit()

Return a list of the substrings in the string, using sep as the separator string.

sep The separator used to split the string.

When set to None (the default value), will split on any whitespace

character (including \n \r \t \f and spaces) and will discard

empty strings from the result.

maxsplit Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the end of the string and works to the front.

rstrip

Section titled “rstrip”

rstrip()

Return a copy of the string with trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

split

Section titled “split”

split()

Return a list of the substrings in the string, using sep as the separator string.

sep The separator used to split the string.

When set to None (the default value), will split on any whitespace

character (including \n \r \t \f and spaces) and will discard

empty strings from the result.

maxsplit Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the front of the string and works to the end.

Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

splitlines

Section titled “splitlines”

splitlines()

Return a list of the lines in the string, breaking at line boundaries.

Line breaks are not included in the resulting list unless keepends is given and true.

startswith

Section titled “startswith”

startswith()

S.startswith(prefix[, start[, end]]) -> bool

Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

strip

Section titled “strip”

strip()

Return a copy of the string with leading and trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

swapcase

Section titled “swapcase”

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title

Section titled “title”

title()

Return a version of the string where each word is titlecased.

More specifically, words start with uppercased characters and all remaining cased characters have lower case.

translate

Section titled “translate”

translate()

Replace each character in the string using the given translation table.

table Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

The table must implement lookup/indexing via getitem, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

upper

Section titled “upper”

upper()

Return a copy of the string converted to uppercase.

zfill

Section titled “zfill”

zfill()

Pad a numeric string with zeros on the left, to fill a field of the given width.

The string is never truncated.

class algopy.op.Block

Section titled “class algopy.op.Block”

field F of block A. Fail unless A falls between txn.LastValid-1002 and txn.FirstValid (exclusive) Native TEAL op: block

static blk_bonus

Section titled “static blk_bonus”

* static blk_bonus(a: algopy.UInt64 | int, /) → algopy.UInt64*

Min AVM version: 11

Native TEAL opcode: block

static blk_branch

Section titled “static blk_branch”

* static blk_branch(a: algopy.UInt64 | int, /) → algopy.Bytes*

Min AVM version: 11

Native TEAL opcode: block

static blk_fee_sink

Section titled “static blk_fee_sink”

* static blk_fee_sink(a: algopy.UInt64 | int, /) → algopy.Account*

Min AVM version: 11

Native TEAL opcode: block

static blk_fees_collected

Section titled “static blk_fees_collected”

* static blk_fees_collected(a: algopy.UInt64 | int, /) → algopy.UInt64*

Min AVM version: 11

Native TEAL opcode: block

static blk_proposer

Section titled “static blk_proposer”

* static blk_proposer(a: algopy.UInt64 | int, /) → algopy.Account*

Min AVM version: 11

Native TEAL opcode: block

static blk_proposer_payout

Section titled “static blk_proposer_payout”

* static blk_proposer_payout(a: algopy.UInt64 | int, /) → algopy.UInt64*

Min AVM version: 11

Native TEAL opcode: block

static blk_protocol

Section titled “static blk_protocol”

* static blk_protocol(a: algopy.UInt64 | int, /) → algopy.Bytes*

Min AVM version: 11

Native TEAL opcode: block

static blk_seed

Section titled “static blk_seed”

* static blk_seed(a: algopy.UInt64 | int, /) → algopy.Bytes*

Native TEAL opcode: block

static blk_timestamp

Section titled “static blk_timestamp”

* static blk_timestamp(a: algopy.UInt64 | int, /) → algopy.UInt64*

Native TEAL opcode: block

static blk_txn_counter

Section titled “static blk_txn_counter”

* static blk_txn_counter(a: algopy.UInt64 | int, /) → algopy.UInt64*

Min AVM version: 11

Native TEAL opcode: block

class algopy.op.Box

Section titled “class algopy.op.Box”

Get or modify box state Native TEAL ops: box_create, box_del, box_extract, box_get, box_len, box_put, box_replace, box_resize, box_splice

static create

Section titled “static create”

* static create(a: algopy.Bytes | bytes, b: algopy.UInt64 | int, /) → bool*

create a box named A, of length B. Fail if the name A is empty or B exceeds 32,768. Returns 0 if A already existed, else 1 Newly created boxes are filled with 0 bytes. box_create will fail if the referenced box already exists with a different size. Otherwise, existing boxes are unchanged by box_create.

Native TEAL opcode: box_create

static delete

Section titled “static delete”

* static delete(a: algopy.Bytes | bytes, /) → bool*

delete box named A if it exists. Return 1 if A existed, 0 otherwise

Native TEAL opcode: box_del

static extract

Section titled “static extract”

* static extract(a: algopy.Bytes | bytes, b: algopy.UInt64 | int, c: algopy.UInt64 | int, /) → algopy.Bytes*

read C bytes from box A, starting at offset B. Fail if A does not exist, or the byte range is outside A’s size.

Native TEAL opcode: box_extract

static get

Section titled “static get”

* static get(a: algopy.Bytes | bytes, /) → tuple[ algopy.Bytes, bool]*

X is the contents of box A if A exists, else ‘’. Y is 1 if A exists, else 0. For boxes that exceed 4,096 bytes, consider box_create, box_extract, and box_replace

Native TEAL opcode: box_get

static length

Section titled “static length”

* static length(a: algopy.Bytes | bytes, /) → tuple[ algopy.UInt64, bool]*

X is the length of box A if A exists, else 0. Y is 1 if A exists, else 0.

Native TEAL opcode: box_len

static put

Section titled “static put”

* static put(a: algopy.Bytes | bytes, b: algopy.Bytes | bytes, /) → None*

replaces the contents of box A with byte-array B. Fails if A exists and len(B) != len(box A). Creates A if it does not exist For boxes that exceed 4,096 bytes, consider box_create, box_extract, and box_replace

Native TEAL opcode: box_put

static replace

Section titled “static replace”

* static replace(a: algopy.Bytes | bytes, b: algopy.UInt64 | int, c: algopy.Bytes | bytes, /) → None*

write byte-array C into box A, starting at offset B. Fail if A does not exist, or the byte range is outside A’s size.

Native TEAL opcode: box_replace

static resize

Section titled “static resize”

* static resize(a: algopy.Bytes | bytes, b: algopy.UInt64 | int, /) → None*

change the size of box named A to be of length B, adding zero bytes to end or removing bytes from the end, as needed. Fail if the name A is empty, A is not an existing box, or B exceeds 32,768.

Native TEAL opcode: box_resize

static splice

Section titled “static splice”

* static splice(a: algopy.Bytes | bytes, b: algopy.UInt64 | int, c: algopy.UInt64 | int, d: algopy.Bytes | bytes, /) → None*

set box A to contain its previous bytes up to index B, followed by D, followed by the original bytes of A that began at index B+C. Boxes are of constant length. If C < len(D), then len(D)-C bytes will be removed from the end. If C > len(D), zero bytes will be appended to the end to reach the box length.

Native TEAL opcode: box_splice

class algopy.op.EC

Section titled “class algopy.op.EC”

Available values for the EC enum

Initialization

Section titled “Initialization”

Initialize self. See help(type(self)) for accurate signature.

BLS12_381g1 *: [algopy.op.EC]

Section titled “BLS12_381g1 *: [algopy.op.EC]”

_BLS12_381g1 _: algopy.op.EC**

Ellipsis

G1 of the BLS 12-381 curve. Points encoded as 48 byte X following by 48 byte Y

BLS12_381g2 *: [algopy.op.EC]

Section titled “BLS12_381g2 *: [algopy.op.EC]”

_BLS12_381g2 _: algopy.op.EC**

Ellipsis

G2 of the BLS 12-381 curve. Points encoded as 96 byte X following by 96 byte Y

BN254g1 *: [algopy.op.EC]

Section titled “BN254g1 *: [algopy.op.EC]”

_BN254g1 _: algopy.op.EC**

Ellipsis

G1 of the BN254 curve. Points encoded as 32 byte X following by 32 byte Y

BN254g2 *: [algopy.op.EC]

Section titled “BN254g2 *: [algopy.op.EC]”

_BN254g2 _: algopy.op.EC**

Ellipsis

G2 of the BN254 curve. Points encoded as 64 byte X following by 64 byte Y

__add__

Section titled “__add__”

__add__()

Return self+value.

__contains__

Section titled “__contains__”

__contains__()

Return bool(key in self).

__delattr__

Section titled “__delattr__”

__delattr__()

Implement delattr(self, name).

__dir__

Section titled “__dir__”

__dir__()

Default dir() implementation.

__eq__

Section titled “__eq__”

__eq__()

Return self==value.

__format__

Section titled “__format__”

__format__()

Return a formatted version of the string as described by format_spec.

__ge__

Section titled “__ge__”

__ge__()

Return self>=value.

__getattribute__

Section titled “__getattribute__”

__getattribute__()

Return getattr(self, name).

__getitem__

Section titled “__getitem__”

__getitem__()

Return self[key].

__getstate__

Section titled “__getstate__”

__getstate__()

Helper for pickle.

__gt__

Section titled “__gt__”

__gt__()

Return self>value.

__hash__

Section titled “__hash__”

__hash__()

Return hash(self).

__iter__

Section titled “__iter__”

__iter__()

Implement iter(self).

__le__

Section titled “__le__”

__le__()

Return self<=value.

__len__

Section titled “__len__”

__len__()

Return len(self).

__lt__

Section titled “__lt__”

__lt__()

Return self<value.

__mod__

Section titled “__mod__”

__mod__()

Return self%value.

__mul__

Section titled “__mul__”

__mul__()

Return self*value.

__ne__

Section titled “__ne__”

__ne__()

Return self!=value.

__new__

Section titled “__new__”

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__

Section titled “__reduce__”

__reduce__()

Helper for pickle.

__reduce ex_

Section titled “__reduceex_”

__reduceex_()

Helper for pickle.

__repr__

Section titled “__repr__”

__repr__()

Return repr(self).

__rmod__

Section titled “__rmod__”

__rmod__()

Return value%self.

__rmul__

Section titled “__rmul__”

__rmul__()

Return value*self.

__setattr__

Section titled “__setattr__”

__setattr__()

Implement setattr(self, name, value).

__sizeof__

Section titled “__sizeof__”

__sizeof__()

Return the size of the string in memory, in bytes.

__str__

Section titled “__str__”

__str__()

Return str(self).

capitalize

Section titled “capitalize”

capitalize()

Return a capitalized version of the string.

More specifically, make the first character have upper case and the rest lower case.

casefold

Section titled “casefold”

casefold()

Return a version of the string suitable for caseless comparisons.

center

Section titled “center”

center()

Return a centered string of length width.

Padding is done using the specified fill character (default is a space).

count

Section titled “count”

count()

S.count(sub[, start[, end]]) -> int

encode

Section titled “encode”

encode()

Encode the string using the codec registered for encoding.

endswith

Section titled “endswith”

endswith()

S.endswith(suffix[, start[, end]]) -> bool

expandtabs

Section titled “expandtabs”

expandtabs()

Return a copy where all tab characters are expanded using spaces.

If tabsize is not given, a tab size of 8 characters is assumed.

find

Section titled “find”

find()

S.find(sub[, start[, end]]) -> int

Return -1 on failure.

format

Section titled “format”

format()

S.format(*args, **kwargs) -> str

Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

format_map

Section titled “format_map”

format_map()

S.format_map(mapping) -> str

Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

index

Section titled “index”

index()

S.index(sub[, start[, end]]) -> int

Raises ValueError when the substring is not found.

isalnum

Section titled “isalnum”

isalnum()

Return True if the string is an alpha-numeric string, False otherwise.

A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

isalpha

Section titled “isalpha”

isalpha()

Return True if the string is an alphabetic string, False otherwise.

A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

isascii

Section titled “isascii”

isascii()

Return True if all characters in the string are ASCII, False otherwise.

ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

isdecimal

Section titled “isdecimal”

isdecimal()

Return True if the string is a decimal string, False otherwise.

A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

isdigit

Section titled “isdigit”

isdigit()

Return True if the string is a digit string, False otherwise.

A string is a digit string if all characters in the string are digits and there is at least one character in the string.

isidentifier

Section titled “isidentifier”

isidentifier()

Return True if the string is a valid Python identifier, False otherwise.

Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

islower

Section titled “islower”

islower()

Return True if the string is a lowercase string, False otherwise.

A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

isnumeric

Section titled “isnumeric”

isnumeric()

Return True if the string is a numeric string, False otherwise.

A string is numeric if all characters in the string are numeric and there is at least one character in the string.

isprintable

Section titled “isprintable”

isprintable()

Return True if the string is printable, False otherwise.

A string is printable if all of its characters are considered printable in repr() or if it is empty.

isspace

Section titled “isspace”

isspace()

Return True if the string is a whitespace string, False otherwise.

A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

istitle

Section titled “istitle”

istitle()

Return True if the string is a title-cased string, False otherwise.

In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

isupper

Section titled “isupper”

isupper()

Return True if the string is an uppercase string, False otherwise.

A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

join

Section titled “join”

join()

Concatenate any number of strings.

The string whose method is called is inserted in between each given string. The result is returned as a new string.

Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

ljust

Section titled “ljust”

ljust()

Return a left-justified string of length width.

Padding is done using the specified fill character (default is a space).

lower

Section titled “lower”

lower()

Return a copy of the string converted to lowercase.

lstrip

Section titled “lstrip”

lstrip()

Return a copy of the string with leading whitespace removed.

If chars is given and not None, remove characters in chars instead.

partition

Section titled “partition”

partition()

Partition the string into three parts using the given separator.

If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

removeprefix

Section titled “removeprefix”

removeprefix()

Return a str with the given prefix string removed if present.

If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

removesuffix

Section titled “removesuffix”

removesuffix()

Return a str with the given suffix string removed if present.

If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

replace

Section titled “replace”

replace()

Return a copy with all occurrences of substring old replaced by new.

count Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

If the optional argument count is given, only the first count occurrences are replaced.

rfind

Section titled “rfind”

rfind()

S.rfind(sub[, start[, end]]) -> int

Return -1 on failure.

rindex

Section titled “rindex”

rindex()

S.rindex(sub[, start[, end]]) -> int

Raises ValueError when the substring is not found.

rjust

Section titled “rjust”

rjust()

Return a right-justified string of length width.

Padding is done using the specified fill character (default is a space).

rpartition

Section titled “rpartition”

rpartition()

Partition the string into three parts using the given separator.

If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

rsplit

Section titled “rsplit”

rsplit()

Return a list of the substrings in the string, using sep as the separator string.

sep The separator used to split the string.

When set to None (the default value), will split on any whitespace

character (including \n \r \t \f and spaces) and will discard

empty strings from the result.

maxsplit Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the end of the string and works to the front.

rstrip

Section titled “rstrip”

rstrip()

Return a copy of the string with trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

split

Section titled “split”

split()

Return a list of the substrings in the string, using sep as the separator string.

sep The separator used to split the string.

When set to None (the default value), will split on any whitespace

character (including \n \r \t \f and spaces) and will discard

empty strings from the result.

maxsplit Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the front of the string and works to the end.

splitlines

Section titled “splitlines”

splitlines()

Return a list of the lines in the string, breaking at line boundaries.

Line breaks are not included in the resulting list unless keepends is given and true.

startswith

Section titled “startswith”

startswith()

S.startswith(prefix[, start[, end]]) -> bool

strip

Section titled “strip”

strip()

Return a copy of the string with leading and trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

swapcase

Section titled “swapcase”

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title

Section titled “title”

title()

Return a version of the string where each word is titlecased.

More specifically, words start with uppercased characters and all remaining cased characters have lower case.

translate

Section titled “translate”

translate()

Replace each character in the string using the given translation table.

table Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

upper

Section titled “upper”

upper()

Return a copy of the string converted to uppercase.

zfill

Section titled “zfill”

zfill()

Pad a numeric string with zeros on the left, to fill a field of the given width.

The string is never truncated.

class algopy.op.ECDSA

Section titled “class algopy.op.ECDSA”

Available values for the ECDSA enum

Initialization

Section titled “Initialization”

Initialize self. See help(type(self)) for accurate signature.

Secp256k1 *: [algopy.op.ECDSA]

Section titled “Secp256k1 *: [algopy.op.ECDSA]”

_Secp256k1 _: algopy.op.ECDSA**

Ellipsis

secp256k1 curve, used in Bitcoin

Secp256r1 *: [algopy.op.ECDSA]

Section titled “Secp256r1 *: [algopy.op.ECDSA]”

_Secp256r1 _: algopy.op.ECDSA**

Ellipsis

secp256r1 curve, NIST standard

__add__

Section titled “__add__”

__add__()

Return self+value.

__contains__

Section titled “__contains__”

__contains__()

Return bool(key in self).

__delattr__

Section titled “__delattr__”

__delattr__()

Implement delattr(self, name).

__dir__

Section titled “__dir__”

__dir__()

Default dir() implementation.

__eq__

Section titled “__eq__”

__eq__()

Return self==value.

__format__

Section titled “__format__”

__format__()

Return a formatted version of the string as described by format_spec.

__ge__

Section titled “__ge__”

__ge__()

Return self>=value.

__getattribute__

Section titled “__getattribute__”

__getattribute__()

Return getattr(self, name).

__getitem__

Section titled “__getitem__”

__getitem__()

Return self[key].

__getstate__

Section titled “__getstate__”

__getstate__()

Helper for pickle.

__gt__

Section titled “__gt__”

__gt__()

Return self>value.

__hash__

Section titled “__hash__”

__hash__()

Return hash(self).

__iter__

Section titled “__iter__”

__iter__()

Implement iter(self).

__le__

Section titled “__le__”

__le__()

Return self<=value.

__len__

Section titled “__len__”

__len__()

Return len(self).

__lt__

Section titled “__lt__”

__lt__()

Return self<value.

__mod__

Section titled “__mod__”

__mod__()

Return self%value.

__mul__

Section titled “__mul__”

__mul__()

Return self*value.

__ne__

Section titled “__ne__”

__ne__()

Return self!=value.

__new__

Section titled “__new__”

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__

Section titled “__reduce__”

__reduce__()

Helper for pickle.

__reduce ex_

Section titled “__reduceex_”

__reduceex_()

Helper for pickle.

__repr__

Section titled “__repr__”

__repr__()

Return repr(self).

__rmod__

Section titled “__rmod__”

__rmod__()

Return value%self.

__rmul__

Section titled “__rmul__”

__rmul__()

Return value*self.

__setattr__

Section titled “__setattr__”

__setattr__()

Implement setattr(self, name, value).

__sizeof__

Section titled “__sizeof__”

__sizeof__()

Return the size of the string in memory, in bytes.

__str__

Section titled “__str__”

__str__()

Return str(self).

capitalize

Section titled “capitalize”

capitalize()

Return a capitalized version of the string.

More specifically, make the first character have upper case and the rest lower case.

casefold

Section titled “casefold”

casefold()

Return a version of the string suitable for caseless comparisons.

center

Section titled “center”

center()

Return a centered string of length width.

Padding is done using the specified fill character (default is a space).

count

Section titled “count”

count()

S.count(sub[, start[, end]]) -> int

encode

Section titled “encode”

encode()

Encode the string using the codec registered for encoding.

endswith

Section titled “endswith”

endswith()

S.endswith(suffix[, start[, end]]) -> bool

expandtabs

Section titled “expandtabs”

expandtabs()

Return a copy where all tab characters are expanded using spaces.

If tabsize is not given, a tab size of 8 characters is assumed.

find

Section titled “find”

find()

S.find(sub[, start[, end]]) -> int

Return -1 on failure.

format

Section titled “format”

format()

S.format(*args, **kwargs) -> str

Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

format_map

Section titled “format_map”

format_map()

S.format_map(mapping) -> str

Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

index

Section titled “index”

index()

S.index(sub[, start[, end]]) -> int

Raises ValueError when the substring is not found.

isalnum

Section titled “isalnum”

isalnum()

Return True if the string is an alpha-numeric string, False otherwise.

A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

isalpha

Section titled “isalpha”

isalpha()

Return True if the string is an alphabetic string, False otherwise.

A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

isascii

Section titled “isascii”

isascii()

Return True if all characters in the string are ASCII, False otherwise.

ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

isdecimal

Section titled “isdecimal”

isdecimal()

Return True if the string is a decimal string, False otherwise.

A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

isdigit

Section titled “isdigit”

isdigit()

Return True if the string is a digit string, False otherwise.

A string is a digit string if all characters in the string are digits and there is at least one character in the string.

isidentifier

Section titled “isidentifier”

isidentifier()

Return True if the string is a valid Python identifier, False otherwise.

Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

islower

Section titled “islower”

islower()

Return True if the string is a lowercase string, False otherwise.

A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

isnumeric

Section titled “isnumeric”

isnumeric()

Return True if the string is a numeric string, False otherwise.

A string is numeric if all characters in the string are numeric and there is at least one character in the string.

isprintable

Section titled “isprintable”

isprintable()

Return True if the string is printable, False otherwise.

A string is printable if all of its characters are considered printable in repr() or if it is empty.

isspace

Section titled “isspace”

isspace()

Return True if the string is a whitespace string, False otherwise.

A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

istitle

Section titled “istitle”

istitle()

Return True if the string is a title-cased string, False otherwise.

In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

isupper

Section titled “isupper”

isupper()

Return True if the string is an uppercase string, False otherwise.

A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

join

Section titled “join”

join()

Concatenate any number of strings.

The string whose method is called is inserted in between each given string. The result is returned as a new string.

Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

ljust

Section titled “ljust”

ljust()

Return a left-justified string of length width.

Padding is done using the specified fill character (default is a space).

lower

Section titled “lower”

lower()

Return a copy of the string converted to lowercase.

lstrip

Section titled “lstrip”

lstrip()

Return a copy of the string with leading whitespace removed.

If chars is given and not None, remove characters in chars instead.

partition

Section titled “partition”

partition()

Partition the string into three parts using the given separator.

If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

removeprefix

Section titled “removeprefix”

removeprefix()

Return a str with the given prefix string removed if present.

If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

removesuffix

Section titled “removesuffix”

removesuffix()

Return a str with the given suffix string removed if present.

If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

replace

Section titled “replace”

replace()

Return a copy with all occurrences of substring old replaced by new.

count Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

If the optional argument count is given, only the first count occurrences are replaced.

rfind

Section titled “rfind”

rfind()

S.rfind(sub[, start[, end]]) -> int

Return -1 on failure.

rindex

Section titled “rindex”

rindex()

S.rindex(sub[, start[, end]]) -> int

Raises ValueError when the substring is not found.

rjust

Section titled “rjust”

rjust()

Return a right-justified string of length width.

Padding is done using the specified fill character (default is a space).

rpartition

Section titled “rpartition”

rpartition()

Partition the string into three parts using the given separator.

If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

rsplit

Section titled “rsplit”

rsplit()

Return a list of the substrings in the string, using sep as the separator string.

sep The separator used to split the string.

When set to None (the default value), will split on any whitespace

character (including \n \r \t \f and spaces) and will discard

empty strings from the result.

maxsplit Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the end of the string and works to the front.

rstrip

Section titled “rstrip”

rstrip()

Return a copy of the string with trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

split

Section titled “split”

split()

Return a list of the substrings in the string, using sep as the separator string.

sep The separator used to split the string.

When set to None (the default value), will split on any whitespace

character (including \n \r \t \f and spaces) and will discard

empty strings from the result.

maxsplit Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the front of the string and works to the end.

splitlines

Section titled “splitlines”

splitlines()

Return a list of the lines in the string, breaking at line boundaries.

Line breaks are not included in the resulting list unless keepends is given and true.

startswith

Section titled “startswith”

startswith()

S.startswith(prefix[, start[, end]]) -> bool

strip

Section titled “strip”

strip()

Return a copy of the string with leading and trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

swapcase

Section titled “swapcase”

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title

Section titled “title”

title()

Return a version of the string where each word is titlecased.

More specifically, words start with uppercased characters and all remaining cased characters have lower case.

translate

Section titled “translate”

translate()

Replace each character in the string using the given translation table.

table Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

upper

Section titled “upper”

upper()

Return a copy of the string converted to uppercase.

zfill

Section titled “zfill”

zfill()

Pad a numeric string with zeros on the left, to fill a field of the given width.

The string is never truncated.

class algopy.op.EllipticCurve

Section titled “class algopy.op.EllipticCurve”

Elliptic Curve functions Native TEAL ops: ec_add, ec_map_to, ec_multi_scalar_mul, ec_pairing_check, ec_scalar_mul, ec_subgroup_check

static add

Section titled “static add”

* static add(g: algopy.op.EC, a: algopy.Bytes | bytes, b: algopy.Bytes | bytes, /) → algopy.Bytes*

for curve points A and B, return the curve point A + B A and B are curve points in affine representation: field element X concatenated with field element Y. Field element Z is encoded as follows. For the base field elements (Fp), Z is encoded as a big-endian number and must be lower than the field modulus. For the quadratic field extension (Fp2), Z is encoded as the concatenation of the individual encoding of the coefficients. For an Fp2 element of the form Z = Z0 + Z1 i, where i is a formal quadratic non-residue, the encoding of Z is the concatenation of the encoding of Z0 and Z1 in this order. (Z0 and Z1 must be less than the field modulus).

The point at infinity is encoded as (X,Y) = (0,0). Groups G1 and G2 are denoted additively.

Fails if A or B is not in G. A and/or B are allowed to be the point at infinity. Does not check if A and B are in the main prime-order subgroup.

Native TEAL opcode: ec_add

static map_to

Section titled “static map_to”

* static map_to(g: algopy.op.EC, a: algopy.Bytes | bytes, /) → algopy.Bytes*

maps field element A to group G BN254 points are mapped by the SVDW map. BLS12-381 points are mapped by the SSWU map. G1 element inputs are base field elements and G2 element inputs are quadratic field elements, with nearly the same encoding rules (for field elements) as defined in ec_add. There is one difference of encoding rule: G1 element inputs do not need to be 0-padded if they fit in less than 32 bytes for BN254 and less than 48 bytes for BLS12-381. (As usual, the empty byte array represents 0.) G2 elements inputs need to be always have the required size.

Native TEAL opcode: ec_map_to

static pairing_check

Section titled “static pairing_check”

* static pairing_check(g: algopy.op.EC, a: algopy.Bytes | bytes, b: algopy.Bytes | bytes, /) → bool*

1 if the product of the pairing of each point in A with its respective point in B is equal to the identity element of the target group Gt, else 0 A and B are concatenated points, encoded and checked as described in ec_add. A contains points of the group G, B contains points of the associated group (G2 if G is G1, and vice versa). Fails if A and B have a different number of points, or if any point is not in its described group or outside the main prime-order subgroup - a stronger condition than other opcodes. AVM values are limited to 4096 bytes, so ec_pairing_check is limited by the size of the points in the groups being operated upon.

Native TEAL opcode: ec_pairing_check

static scalar_mul

Section titled “static scalar_mul”

* static scalar_mul(g: algopy.op.EC, a: algopy.Bytes | bytes, b: algopy.Bytes | bytes, /) → algopy.Bytes*

for curve point A and scalar B, return the curve point BA, the point A multiplied by the scalar B. A is a curve point encoded and checked as described in ec_add. Scalar B is interpreted as a big-endian unsigned integer. Fails if B exceeds 32 bytes.

Native TEAL opcode: ec_scalar_mul

static scalar_mul_multi

Section titled “static scalar_mul_multi”

* static scalar_mul_multi(g: algopy.op.EC, a: algopy.Bytes | bytes, b: algopy.Bytes | bytes, /) → algopy.Bytes*

for curve points A and scalars B, return curve point B0A0 + B1A1 + B2A2 + … + BnAn A is a list of concatenated points, encoded and checked as described in ec_add. B is a list of concatenated scalars which, unlike ec_scalar_mul, must all be exactly 32 bytes long. The name ec_multi_scalar_mul was chosen to reflect common usage, but a more consistent name would be ec_multi_scalar_mul. AVM values are limited to 4096 bytes, so ec_multi_scalar_mul is limited by the size of the points in the group being operated upon.

Native TEAL opcode: ec_multi_scalar_mul

static subgroup_check

Section titled “static subgroup_check”

* static subgroup_check(g: algopy.op.EC, a: algopy.Bytes | bytes, /) → bool*

1 if A is in the main prime-order subgroup of G (including the point at infinity) else 0. Program fails if A is not in G at all.

Native TEAL opcode: ec_subgroup_check

class algopy.op.GITxn

Section titled “class algopy.op.GITxn”

Get values for inner transaction in the last group submitted Native TEAL ops: gitxn, gitxnas

static accounts

Section titled “static accounts”

* static accounts(t: int, a: algopy.UInt64 | int, /) → algopy.Account*

Native TEAL opcode: gitxna, gitxnas

static amount

Section titled “static amount”

* static amount(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static application_args

Section titled “static application_args”

* static application_args(t: int, a: algopy.UInt64 | int, /) → algopy.Bytes*

static application_id

Section titled “static application_id”

* static application_id(t: int, /) → algopy.Application*

Native TEAL opcode: gitxn

static applications

Section titled “static applications”

* static applications(t: int, a: algopy.UInt64 | int, /) → algopy.Application*

static approval_program

Section titled “static approval_program”

* static approval_program(t: int, /) → algopy.Bytes*

Native TEAL opcode: gitxn

static approval_program_pages

Section titled “static approval_program_pages”

* static approval_program_pages(t: int, a: algopy.UInt64 | int, /) → algopy.Bytes*

static asset_amount

Section titled “static asset_amount”

* static asset_amount(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static asset_close_to

Section titled “static asset_close_to”

* static asset_close_to(t: int, /) → algopy.Account*

Native TEAL opcode: gitxn

static asset_receiver

Section titled “static asset_receiver”

* static asset_receiver(t: int, /) → algopy.Account*

Native TEAL opcode: gitxn

static asset_sender

Section titled “static asset_sender”

* static asset_sender(t: int, /) → algopy.Account*

Native TEAL opcode: gitxn

static assets

Section titled “static assets”

* static assets(t: int, a: algopy.UInt64 | int, /) → algopy.Asset*

static clear_state_program

Section titled “static clear_state_program”

* static clear_state_program(t: int, /) → algopy.Bytes*

Native TEAL opcode: gitxn

static clear_state_program_pages

Section titled “static clear_state_program_pages”

* static clear_state_program_pages(t: int, a: algopy.UInt64 | int, /) → algopy.Bytes*

static close_remainder_to

Section titled “static close_remainder_to”

* static close_remainder_to(t: int, /) → algopy.Account*

Native TEAL opcode: gitxn

static config_asset

Section titled “static config_asset”

* static config_asset(t: int, /) → algopy.Asset*

Native TEAL opcode: gitxn

static config_asset_clawback

Section titled “static config_asset_clawback”

* static config_asset_clawback(t: int, /) → algopy.Account*

Native TEAL opcode: gitxn

static config_asset_decimals

Section titled “static config_asset_decimals”

* static config_asset_decimals(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static config_asset_default_frozen

Section titled “static config_asset_default_frozen”

* static config_asset_default_frozen(t: int, /) → bool*

Native TEAL opcode: gitxn

static config_asset_freeze

Section titled “static config_asset_freeze”

* static config_asset_freeze(t: int, /) → algopy.Account*

Native TEAL opcode: gitxn

static config_asset_manager

Section titled “static config_asset_manager”

* static config_asset_manager(t: int, /) → algopy.Account*

Native TEAL opcode: gitxn

static config_asset_metadata_hash

Section titled “static config_asset_metadata_hash”

* static config_asset_metadata_hash(t: int, /) → algopy.Bytes*

Native TEAL opcode: gitxn

static config_asset_name

Section titled “static config_asset_name”

* static config_asset_name(t: int, /) → algopy.Bytes*

Native TEAL opcode: gitxn

static config_asset_reserve

Section titled “static config_asset_reserve”

* static config_asset_reserve(t: int, /) → algopy.Account*

Native TEAL opcode: gitxn

static config_asset_total

Section titled “static config_asset_total”

* static config_asset_total(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static config_asset_unit_name

Section titled “static config_asset_unit_name”

* static config_asset_unit_name(t: int, /) → algopy.Bytes*

Native TEAL opcode: gitxn

static config_asset_url

Section titled “static config_asset_url”

* static config_asset_url(t: int, /) → algopy.Bytes*

Native TEAL opcode: gitxn

static created_application_id

Section titled “static created_application_id”

* static created_application_id(t: int, /) → algopy.Application*

Native TEAL opcode: gitxn

static created_asset_id

Section titled “static created_asset_id”

* static created_asset_id(t: int, /) → algopy.Asset*

Native TEAL opcode: gitxn

static extra_program_pages

Section titled “static extra_program_pages”

* static extra_program_pages(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static fee

Section titled “static fee”

* static fee(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static first_valid

Section titled “static first_valid”

* static first_valid(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static first_valid_time

Section titled “static first_valid_time”

* static first_valid_time(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static freeze_asset

Section titled “static freeze_asset”

* static freeze_asset(t: int, /) → algopy.Asset*

Native TEAL opcode: gitxn

static freeze_asset_account

Section titled “static freeze_asset_account”

* static freeze_asset_account(t: int, /) → algopy.Account*

Native TEAL opcode: gitxn

static freeze_asset_frozen

Section titled “static freeze_asset_frozen”

* static freeze_asset_frozen(t: int, /) → bool*

Native TEAL opcode: gitxn

static global_num_byte_slice

Section titled “static global_num_byte_slice”

* static global_num_byte_slice(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static global_num_uint

Section titled “static global_num_uint”

* static global_num_uint(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static group_index

Section titled “static group_index”

* static group_index(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static last_log

Section titled “static last_log”

* static last_log(t: int, /) → algopy.Bytes*

Native TEAL opcode: gitxn

static last_valid

Section titled “static last_valid”

* static last_valid(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static lease

Section titled “static lease”

* static lease(t: int, /) → algopy.Bytes*

Native TEAL opcode: gitxn

static local_num_byte_slice

Section titled “static local_num_byte_slice”

* static local_num_byte_slice(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static local_num_uint

Section titled “static local_num_uint”

* static local_num_uint(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static logs

Section titled “static logs”

* static logs(t: int, a: algopy.UInt64 | int, /) → algopy.Bytes*

static nonparticipation

Section titled “static nonparticipation”

* static nonparticipation(t: int, /) → bool*

Native TEAL opcode: gitxn

static note

Section titled “static note”

* static note(t: int, /) → algopy.Bytes*

Native TEAL opcode: gitxn

static num_accounts

Section titled “static num_accounts”

* static num_accounts(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static num_app_args

Section titled “static num_app_args”

* static num_app_args(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static num_applications

Section titled “static num_applications”

* static num_applications(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static num_approval_program_pages

Section titled “static num_approval_program_pages”

* static num_approval_program_pages(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static num_assets

Section titled “static num_assets”

* static num_assets(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static num_clear_state_program_pages

Section titled “static num_clear_state_program_pages”

* static num_clear_state_program_pages(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static num_logs

Section titled “static num_logs”

* static num_logs(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static on_completion

Section titled “static on_completion”

* static on_completion(t: int, /) → algopy.OnCompleteAction*

Native TEAL opcode: gitxn

static receiver

Section titled “static receiver”

* static receiver(t: int, /) → algopy.Account*

Native TEAL opcode: gitxn

static reject_version

Section titled “static reject_version”

* static reject_version(t: int, /) → algopy.UInt64*

Min AVM version: 12

Native TEAL opcode: gitxn

static rekey_to

Section titled “static rekey_to”

* static rekey_to(t: int, /) → algopy.Account*

Native TEAL opcode: gitxn

static selection_pk

Section titled “static selection_pk”

* static selection_pk(t: int, /) → algopy.Bytes*

Native TEAL opcode: gitxn

static sender

Section titled “static sender”

* static sender(t: int, /) → algopy.Account*

Native TEAL opcode: gitxn

static state_proof_pk

Section titled “static state_proof_pk”

* static state_proof_pk(t: int, /) → algopy.Bytes*

Native TEAL opcode: gitxn

static tx_id

Section titled “static tx_id”

* static tx_id(t: int, /) → algopy.Bytes*

Native TEAL opcode: gitxn

static type

Section titled “static type”

* static type(t: int, /) → algopy.Bytes*

Native TEAL opcode: gitxn

static type_enum

Section titled “static type_enum”

* static type_enum(t: int, /) → algopy.TransactionType*

Native TEAL opcode: gitxn

static vote_first

Section titled “static vote_first”

* static vote_first(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static vote_key_dilution

Section titled “static vote_key_dilution”

* static vote_key_dilution(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static vote_last

Section titled “static vote_last”

* static vote_last(t: int, /) → algopy.UInt64*

Native TEAL opcode: gitxn

static vote_pk

Section titled “static vote_pk”

* static vote_pk(t: int, /) → algopy.Bytes*

Native TEAL opcode: gitxn

static xfer_asset

Section titled “static xfer_asset”

* static xfer_asset(t: int, /) → algopy.Asset*

Native TEAL opcode: gitxn

class algopy.op.GTxn

Section titled “class algopy.op.GTxn”

Get values for transactions in the current group Native TEAL ops: gtxns, gtxnsas

static accounts

Section titled “static accounts”

* static accounts(a: algopy.UInt64 | int, b: algopy.UInt64 | int, /) → algopy.Account*

Accounts listed in the ApplicationCall transaction

Native TEAL opcode: gtxna, gtxnas, gtxnsa, gtxnsas

static amount

Section titled “static amount”

* static amount(a: algopy.UInt64 | int, /) → algopy.UInt64*

microalgos

Native TEAL opcode: gtxn, gtxns

static application_args

Section titled “static application_args”

* static application_args(a: algopy.UInt64 | int, b: algopy.UInt64 | int, /) → algopy.Bytes*

Arguments passed to the application in the ApplicationCall transaction

static application_id

Section titled “static application_id”

* static application_id(a: algopy.UInt64 | int, /) → algopy.Application*

ApplicationID from ApplicationCall transaction

static applications

Section titled “static applications”

* static applications(a: algopy.UInt64 | int, b: algopy.UInt64 | int, /) → algopy.Application*

Foreign Apps listed in the ApplicationCall transaction

static approval_program

Section titled “static approval_program”

* static approval_program(a: algopy.UInt64 | int, /) → algopy.Bytes*

Approval program

static approval_program_pages

Section titled “static approval_program_pages”

* static approval_program_pages(a: algopy.UInt64 | int, b: algopy.UInt64 | int, /) → algopy.Bytes*

Approval Program as an array of pages

static asset_amount

Section titled “static asset_amount”

* static asset_amount(a: algopy.UInt64 | int, /) → algopy.UInt64*

value in Asset’s units

static asset_close_to

Section titled “static asset_close_to”

* static asset_close_to(a: algopy.UInt64 | int, /) → algopy.Account*

32 byte address

static asset_receiver

Section titled “static asset_receiver”

* static asset_receiver(a: algopy.UInt64 | int, /) → algopy.Account*

32 byte address

static asset_sender

Section titled “static asset_sender”

* static asset_sender(a: algopy.UInt64 | int, /) → algopy.Account*

32 byte address. Source of assets if Sender is the Asset’s Clawback address.

static assets

Section titled “static assets”

* static assets(a: algopy.UInt64 | int, b: algopy.UInt64 | int, /) → algopy.Asset*

Foreign Assets listed in the ApplicationCall transaction

static clear_state_program

Section titled “static clear_state_program”

* static clear_state_program(a: algopy.UInt64 | int, /) → algopy.Bytes*

Clear state program

static clear_state_program_pages

Section titled “static clear_state_program_pages”

* static clear_state_program_pages(a: algopy.UInt64 | int, b: algopy.UInt64 | int, /) → algopy.Bytes*

ClearState Program as an array of pages

static close_remainder_to

Section titled “static close_remainder_to”

* static close_remainder_to(a: algopy.UInt64 | int, /) → algopy.Account*

32 byte address

static config_asset

Section titled “static config_asset”

* static config_asset(a: algopy.UInt64 | int, /) → algopy.Asset*

Asset ID in asset config transaction

static config_asset_clawback

Section titled “static config_asset_clawback”

* static config_asset_clawback(a: algopy.UInt64 | int, /) → algopy.Account*

32 byte address

static config_asset_decimals

Section titled “static config_asset_decimals”

* static config_asset_decimals(a: algopy.UInt64 | int, /) → algopy.UInt64*

Number of digits to display after the decimal place when displaying the asset

static config_asset_default_frozen

Section titled “static config_asset_default_frozen”

* static config_asset_default_frozen(a: algopy.UInt64 | int, /) → bool*

Whether the asset’s slots are frozen by default or not, 0 or 1

static config_asset_freeze

Section titled “static config_asset_freeze”

* static config_asset_freeze(a: algopy.UInt64 | int, /) → algopy.Account*

32 byte address

static config_asset_manager

Section titled “static config_asset_manager”

* static config_asset_manager(a: algopy.UInt64 | int, /) → algopy.Account*

32 byte address

static config_asset_metadata_hash

Section titled “static config_asset_metadata_hash”

* static config_asset_metadata_hash(a: algopy.UInt64 | int, /) → algopy.Bytes*

32 byte commitment to unspecified asset metadata

static config_asset_name

Section titled “static config_asset_name”

* static config_asset_name(a: algopy.UInt64 | int, /) → algopy.Bytes*

The asset name

static config_asset_reserve

Section titled “static config_asset_reserve”

* static config_asset_reserve(a: algopy.UInt64 | int, /) → algopy.Account*

32 byte address

static config_asset_total

Section titled “static config_asset_total”

* static config_asset_total(a: algopy.UInt64 | int, /) → algopy.UInt64*

Total number of units of this asset created

static config_asset_unit_name

Section titled “static config_asset_unit_name”

* static config_asset_unit_name(a: algopy.UInt64 | int, /) → algopy.Bytes*

Unit name of the asset

static config_asset_url

Section titled “static config_asset_url”

* static config_asset_url(a: algopy.UInt64 | int, /) → algopy.Bytes*

URL

static created_application_id

Section titled “static created_application_id”

* static created_application_id(a: algopy.UInt64 | int, /) → algopy.Application*

ApplicationID allocated by the creation of an application (only with itxn in v5). Application mode only

static created_asset_id

Section titled “static created_asset_id”

* static created_asset_id(a: algopy.UInt64 | int, /) → algopy.Asset*

Asset ID allocated by the creation of an ASA (only with itxn in v5). Application mode only

static extra_program_pages

Section titled “static extra_program_pages”

* static extra_program_pages(a: algopy.UInt64 | int, /) → algopy.UInt64*

Number of additional pages for each of the application’s approval and clear state programs. An ExtraProgramPages of 1 means 2048 more total bytes, or 1024 for each program.

static fee

Section titled “static fee”

* static fee(a: algopy.UInt64 | int, /) → algopy.UInt64*

microalgos

static first_valid

Section titled “static first_valid”

* static first_valid(a: algopy.UInt64 | int, /) → algopy.UInt64*

round number

static first_valid_time

Section titled “static first_valid_time”

* static first_valid_time(a: algopy.UInt64 | int, /) → algopy.UInt64*

UNIX timestamp of block before txn.FirstValid. Fails if negative

static freeze_asset

Section titled “static freeze_asset”

* static freeze_asset(a: algopy.UInt64 | int, /) → algopy.Asset*

Asset ID being frozen or un-frozen

static freeze_asset_account

Section titled “static freeze_asset_account”

* static freeze_asset_account(a: algopy.UInt64 | int, /) → algopy.Account*

32 byte address of the account whose asset slot is being frozen or un-frozen

static freeze_asset_frozen

Section titled “static freeze_asset_frozen”

* static freeze_asset_frozen(a: algopy.UInt64 | int, /) → bool*

The new frozen value, 0 or 1

static global_num_byte_slice

Section titled “static global_num_byte_slice”

* static global_num_byte_slice(a: algopy.UInt64 | int, /) → algopy.UInt64*

Number of global state byteslices in ApplicationCall

static global_num_uint

Section titled “static global_num_uint”

* static global_num_uint(a: algopy.UInt64 | int, /) → algopy.UInt64*

Number of global state integers in ApplicationCall

static group_index

Section titled “static group_index”

* static group_index(a: algopy.UInt64 | int, /) → algopy.UInt64*

Position of this transaction within an atomic transaction group. A stand-alone transaction is implicitly element 0 in a group of 1

static last_log

Section titled “static last_log”

* static last_log(a: algopy.UInt64 | int, /) → algopy.Bytes*

The last message emitted. Empty bytes if none were emitted. Application mode only

static last_valid

Section titled “static last_valid”

* static last_valid(a: algopy.UInt64 | int, /) → algopy.UInt64*

round number

static lease

Section titled “static lease”

* static lease(a: algopy.UInt64 | int, /) → algopy.Bytes*

32 byte lease value

static local_num_byte_slice

Section titled “static local_num_byte_slice”

* static local_num_byte_slice(a: algopy.UInt64 | int, /) → algopy.UInt64*

Number of local state byteslices in ApplicationCall

static local_num_uint

Section titled “static local_num_uint”

* static local_num_uint(a: algopy.UInt64 | int, /) → algopy.UInt64*

Number of local state integers in ApplicationCall

static logs

Section titled “static logs”

* static logs(a: algopy.UInt64 | int, b: algopy.UInt64 | int, /) → algopy.Bytes*

Log messages emitted by an application call (only with itxn in v5). Application mode only

static nonparticipation

Section titled “static nonparticipation”

* static nonparticipation(a: algopy.UInt64 | int, /) → bool*

Marks an account nonparticipating for rewards

static note

Section titled “static note”

* static note(a: algopy.UInt64 | int, /) → algopy.Bytes*

Any data up to 1024 bytes

static num_accounts

Section titled “static num_accounts”

* static num_accounts(a: algopy.UInt64 | int, /) → algopy.UInt64*

Number of Accounts

static num_app_args

Section titled “static num_app_args”

* static num_app_args(a: algopy.UInt64 | int, /) → algopy.UInt64*

Number of ApplicationArgs

static num_applications

Section titled “static num_applications”

* static num_applications(a: algopy.UInt64 | int, /) → algopy.UInt64*

Number of Applications

static num_approval_program_pages

Section titled “static num_approval_program_pages”

* static num_approval_program_pages(a: algopy.UInt64 | int, /) → algopy.UInt64*

Number of Approval Program pages

static num_assets

Section titled “static num_assets”

* static num_assets(a: algopy.UInt64 | int, /) → algopy.UInt64*

Number of Assets

static num_clear_state_program_pages

Section titled “static num_clear_state_program_pages”

* static num_clear_state_program_pages(a: algopy.UInt64 | int, /) → algopy.UInt64*

Number of ClearState Program pages

static num_logs

Section titled “static num_logs”

* static num_logs(a: algopy.UInt64 | int, /) → algopy.UInt64*

Number of Logs (only with itxn in v5). Application mode only

static on_completion

Section titled “static on_completion”

* static on_completion(a: algopy.UInt64 | int, /) → algopy.OnCompleteAction*

ApplicationCall transaction on completion action

static receiver

Section titled “static receiver”

* static receiver(a: algopy.UInt64 | int, /) → algopy.Account*

32 byte address

static reject_version

Section titled “static reject_version”

* static reject_version(a: algopy.UInt64 | int, /) → algopy.UInt64*

Min AVM version: 12

static rekey_to

Section titled “static rekey_to”

* static rekey_to(a: algopy.UInt64 | int, /) → algopy.Account*

32 byte Sender’s new AuthAddr

static selection_pk

Section titled “static selection_pk”

* static selection_pk(a: algopy.UInt64 | int, /) → algopy.Bytes*

32 byte address

static sender

Section titled “static sender”

* static sender(a: algopy.UInt64 | int, /) → algopy.Account*

32 byte address

static state_proof_pk

Section titled “static state_proof_pk”

* static state_proof_pk(a: algopy.UInt64 | int, /) → algopy.Bytes*

State proof public key

static tx_id

Section titled “static tx_id”

* static tx_id(a: algopy.UInt64 | int, /) → algopy.Bytes*

The computed ID for this transaction. 32 bytes.

static type

Section titled “static type”

* static type(a: algopy.UInt64 | int, /) → algopy.Bytes*

Transaction type as bytes

static type_enum

Section titled “static type_enum”

* static type_enum(a: algopy.UInt64 | int, /) → algopy.TransactionType*

Transaction type as integer

static vote_first

Section titled “static vote_first”

* static vote_first(a: algopy.UInt64 | int, /) → algopy.UInt64*

The first round that the participation key is valid.

static vote_key_dilution

Section titled “static vote_key_dilution”

* static vote_key_dilution(a: algopy.UInt64 | int, /) → algopy.UInt64*

Dilution for the 2-level participation key

static vote_last

Section titled “static vote_last”

* static vote_last(a: algopy.UInt64 | int, /) → algopy.UInt64*

The last round that the participation key is valid.

static vote_pk

Section titled “static vote_pk”

* static vote_pk(a: algopy.UInt64 | int, /) → algopy.Bytes*

32 byte address

static xfer_asset

Section titled “static xfer_asset”

* static xfer_asset(a: algopy.UInt64 | int, /) → algopy.Asset*

Asset ID

class algopy.op.Global

Section titled “class algopy.op.Global”

Get Global values Native TEAL op: global

asset_create_min_balance *: [Final]

Section titled “asset_create_min_balance *: [Final]”

_asset_create_min_balance _: Final[ algopy.UInt64]**

Ellipsis

The additional minimum balance required to create (and opt-in to) an asset.

asset_opt_in_min_balance *: [Final]

Section titled “asset_opt_in_min_balance *: [Final]”

_asset_opt_in_min_balance _: Final[ algopy.UInt64]**

Ellipsis

The additional minimum balance required to opt-in to an asset.

caller_application_address *: [Final]

Section titled “caller_application_address *: [Final]”

_caller_application_address _: Final[ algopy.Account]**

Ellipsis

The application address of the application that called this application. ZeroAddress if this application is at the top-level. Application mode only.

caller_application_id *: [Final]

Section titled “caller_application_id *: [Final]”

_caller_application_id _: Final[ algopy.UInt64]**

Ellipsis

The application ID of the application that called this application. 0 if this application is at the top-level. Application mode only.

creator_address *: [Final]

Section titled “creator_address *: [Final]”

_creator_address _: Final[ algopy.Account]**

Ellipsis

Address of the creator of the current application. Application mode only.

current_application_address *: [Final]

Section titled “current_application_address *: [Final]”

_current_application_address _: Final[ algopy.Account]**

Ellipsis

Address that the current application controls. Application mode only.

current_application_id *: [Final]

Section titled “current_application_id *: [Final]”

_current_application_id _: Final[ algopy.Application]**

Ellipsis

ID of current application executing. Application mode only.

genesis_hash *: [Final]

Section titled “genesis_hash *: [Final]”

_genesis_hash _: Final[ algopy.Bytes]**

Ellipsis

The Genesis Hash for the network.

group_id *: [Final]

Section titled “group_id *: [Final]”

_group_id _: Final[ algopy.Bytes]**

Ellipsis

ID of the transaction group. 32 zero bytes if the transaction is not part of a group.

group_size *: [Final]

Section titled “group_size *: [Final]”

_group_size _: Final[ algopy.UInt64]**

Ellipsis

Number of transactions in this atomic transaction group. At least 1

latest_timestamp *: [Final]

Section titled “latest_timestamp *: [Final]”

_latest_timestamp _: Final[ algopy.UInt64]**

Ellipsis

Last confirmed block UNIX timestamp. Fails if negative. Application mode only.

logic_sig_version *: [Final]

Section titled “logic_sig_version *: [Final]”

_logic_sig_version _: Final[ algopy.UInt64]**

Ellipsis

Maximum supported version

max_txn_life *: [Final]

Section titled “max_txn_life *: [Final]”

_max_txn_life _: Final[ algopy.UInt64]**

Ellipsis

rounds

min_balance *: [Final]

Section titled “min_balance *: [Final]”

_min_balance _: Final[ algopy.UInt64]**

Ellipsis

microalgos

min_txn_fee *: [Final]

Section titled “min_txn_fee *: [Final]”

_min_txn_fee _: Final[ algopy.UInt64]**

Ellipsis

microalgos

static opcode_budget

Section titled “static opcode_budget”

* static opcode_budget() → algopy.UInt64*

The remaining cost that can be spent by opcodes in this program.

Native TEAL opcode: global

payouts_enabled *: [Final]

Section titled “payouts_enabled *: [Final]”

_payouts_enabled _: Final[ bool]**

Ellipsis

Whether block proposal payouts are enabled. Min AVM version: 11

payouts_go_online_fee *: [Final]

Section titled “payouts_go_online_fee *: [Final]”

_payouts_go_online_fee _: Final[ algopy.UInt64]**

Ellipsis

The fee required in a keyreg transaction to make an account incentive eligible. Min AVM version: 11

payouts_max_balance *: [Final]

Section titled “payouts_max_balance *: [Final]”

_payouts_max_balance _: Final[ algopy.UInt64]**

Ellipsis

The maximum balance an account can have in the agreement round to receive block payouts in the proposal round. Min AVM version: 11

payouts_min_balance *: [Final]

Section titled “payouts_min_balance *: [Final]”

_payouts_min_balance _: Final[ algopy.UInt64]**

Ellipsis

The minimum balance an account must have in the agreement round to receive block payouts in the proposal round. Min AVM version: 11

payouts_percent *: [Final]

Section titled “payouts_percent *: [Final]”

_payouts_percent _: Final[ algopy.UInt64]**

Ellipsis

The percentage of transaction fees in a block that can be paid to the block proposer. Min AVM version: 11

round *: [Final]

Section titled “round *: [Final]”

_round _: Final[ algopy.UInt64]**

Ellipsis

Current round number. Application mode only.

zero_address *: [Final]

Section titled “zero_address *: [Final]”

_zero_address _: Final[ algopy.Account]**

Ellipsis

32 byte address of all zero bytes

class algopy.op.ITxn

Section titled “class algopy.op.ITxn”

Get values for the last inner transaction Native TEAL ops: itxn, itxnas

static accounts

Section titled “static accounts”

* static accounts(a: algopy.UInt64 | int, /) → algopy.Account*

Accounts listed in the ApplicationCall transaction

Native TEAL opcode: itxna, itxnas

static amount

Section titled “static amount”

* static amount() → algopy.UInt64*

microalgos

Native TEAL opcode: itxn

static application_args

Section titled “static application_args”

* static application_args(a: algopy.UInt64 | int, /) → algopy.Bytes*

Arguments passed to the application in the ApplicationCall transaction

static application_id

Section titled “static application_id”

* static application_id() → algopy.Application*

ApplicationID from ApplicationCall transaction

Native TEAL opcode: itxn

static applications

Section titled “static applications”

* static applications(a: algopy.UInt64 | int, /) → algopy.Application*

Foreign Apps listed in the ApplicationCall transaction

static approval_program

Section titled “static approval_program”

* static approval_program() → algopy.Bytes*

Approval program

Native TEAL opcode: itxn

static approval_program_pages

Section titled “static approval_program_pages”

* static approval_program_pages(a: algopy.UInt64 | int, /) → algopy.Bytes*

Approval Program as an array of pages

static asset_amount

Section titled “static asset_amount”

* static asset_amount() → algopy.UInt64*

value in Asset’s units

Native TEAL opcode: itxn

static asset_close_to

Section titled “static asset_close_to”

* static asset_close_to() → algopy.Account*

32 byte address

Native TEAL opcode: itxn

static asset_receiver

Section titled “static asset_receiver”

* static asset_receiver() → algopy.Account*

32 byte address

Native TEAL opcode: itxn

static asset_sender

Section titled “static asset_sender”

* static asset_sender() → algopy.Account*

32 byte address. Source of assets if Sender is the Asset’s Clawback address.

Native TEAL opcode: itxn

static assets

Section titled “static assets”

* static assets(a: algopy.UInt64 | int, /) → algopy.Asset*

Foreign Assets listed in the ApplicationCall transaction

static clear_state_program

Section titled “static clear_state_program”

* static clear_state_program() → algopy.Bytes*

Clear state program

Native TEAL opcode: itxn

static clear_state_program_pages

Section titled “static clear_state_program_pages”

* static clear_state_program_pages(a: algopy.UInt64 | int, /) → algopy.Bytes*

ClearState Program as an array of pages

static close_remainder_to

Section titled “static close_remainder_to”

* static close_remainder_to() → algopy.Account*

32 byte address

Native TEAL opcode: itxn

static config_asset

Section titled “static config_asset”

* static config_asset() → algopy.Asset*

Asset ID in asset config transaction

Native TEAL opcode: itxn

static config_asset_clawback

Section titled “static config_asset_clawback”

* static config_asset_clawback() → algopy.Account*

32 byte address

Native TEAL opcode: itxn

static config_asset_decimals

Section titled “static config_asset_decimals”

* static config_asset_decimals() → algopy.UInt64*

Number of digits to display after the decimal place when displaying the asset

Native TEAL opcode: itxn

static config_asset_default_frozen

Section titled “static config_asset_default_frozen”

* static config_asset_default_frozen() → bool*

Whether the asset’s slots are frozen by default or not, 0 or 1

Native TEAL opcode: itxn

static config_asset_freeze

Section titled “static config_asset_freeze”

* static config_asset_freeze() → algopy.Account*

32 byte address

Native TEAL opcode: itxn

static config_asset_manager

Section titled “static config_asset_manager”

* static config_asset_manager() → algopy.Account*

32 byte address

Native TEAL opcode: itxn

static config_asset_metadata_hash

Section titled “static config_asset_metadata_hash”

* static config_asset_metadata_hash() → algopy.Bytes*

32 byte commitment to unspecified asset metadata

Native TEAL opcode: itxn

static config_asset_name

Section titled “static config_asset_name”

* static config_asset_name() → algopy.Bytes*

The asset name

Native TEAL opcode: itxn

static config_asset_reserve

Section titled “static config_asset_reserve”

* static config_asset_reserve() → algopy.Account*

32 byte address

Native TEAL opcode: itxn

static config_asset_total

Section titled “static config_asset_total”

* static config_asset_total() → algopy.UInt64*

Total number of units of this asset created

Native TEAL opcode: itxn

static config_asset_unit_name

Section titled “static config_asset_unit_name”

* static config_asset_unit_name() → algopy.Bytes*

Unit name of the asset

Native TEAL opcode: itxn

static config_asset_url

Section titled “static config_asset_url”

* static config_asset_url() → algopy.Bytes*

URL

Native TEAL opcode: itxn

static created_application_id

Section titled “static created_application_id”

* static created_application_id() → algopy.Application*

ApplicationID allocated by the creation of an application (only with itxn in v5). Application mode only

Native TEAL opcode: itxn

static created_asset_id

Section titled “static created_asset_id”

* static created_asset_id() → algopy.Asset*

Asset ID allocated by the creation of an ASA (only with itxn in v5). Application mode only

Native TEAL opcode: itxn

static extra_program_pages

Section titled “static extra_program_pages”

* static extra_program_pages() → algopy.UInt64*

Native TEAL opcode: itxn

static fee

Section titled “static fee”

* static fee() → algopy.UInt64*

microalgos

Native TEAL opcode: itxn

static first_valid

Section titled “static first_valid”

* static first_valid() → algopy.UInt64*

round number

Native TEAL opcode: itxn

static first_valid_time

Section titled “static first_valid_time”

* static first_valid_time() → algopy.UInt64*

UNIX timestamp of block before txn.FirstValid. Fails if negative

Native TEAL opcode: itxn

static freeze_asset

Section titled “static freeze_asset”

* static freeze_asset() → algopy.Asset*

Asset ID being frozen or un-frozen

Native TEAL opcode: itxn

static freeze_asset_account

Section titled “static freeze_asset_account”

* static freeze_asset_account() → algopy.Account*

32 byte address of the account whose asset slot is being frozen or un-frozen

Native TEAL opcode: itxn

static freeze_asset_frozen

Section titled “static freeze_asset_frozen”

* static freeze_asset_frozen() → bool*

The new frozen value, 0 or 1

Native TEAL opcode: itxn

static global_num_byte_slice

Section titled “static global_num_byte_slice”

* static global_num_byte_slice() → algopy.UInt64*

Number of global state byteslices in ApplicationCall

Native TEAL opcode: itxn

static global_num_uint

Section titled “static global_num_uint”

* static global_num_uint() → algopy.UInt64*

Number of global state integers in ApplicationCall

Native TEAL opcode: itxn

static group_index

Section titled “static group_index”

* static group_index() → algopy.UInt64*

Position of this transaction within an atomic transaction group. A stand-alone transaction is implicitly element 0 in a group of 1

Native TEAL opcode: itxn

static last_log

Section titled “static last_log”

* static last_log() → algopy.Bytes*

The last message emitted. Empty bytes if none were emitted. Application mode only

Native TEAL opcode: itxn

static last_valid

Section titled “static last_valid”

* static last_valid() → algopy.UInt64*

round number

Native TEAL opcode: itxn

static lease

Section titled “static lease”

* static lease() → algopy.Bytes*

32 byte lease value

Native TEAL opcode: itxn

static local_num_byte_slice

Section titled “static local_num_byte_slice”

* static local_num_byte_slice() → algopy.UInt64*

Number of local state byteslices in ApplicationCall

Native TEAL opcode: itxn

static local_num_uint

Section titled “static local_num_uint”

* static local_num_uint() → algopy.UInt64*

Number of local state integers in ApplicationCall

Native TEAL opcode: itxn

static logs

Section titled “static logs”

* static logs(a: algopy.UInt64 | int, /) → algopy.Bytes*

Log messages emitted by an application call (only with itxn in v5). Application mode only

static nonparticipation

Section titled “static nonparticipation”

* static nonparticipation() → bool*

Marks an account nonparticipating for rewards

Native TEAL opcode: itxn

static note

Section titled “static note”

* static note() → algopy.Bytes*

Any data up to 1024 bytes

Native TEAL opcode: itxn

static num_accounts

Section titled “static num_accounts”

* static num_accounts() → algopy.UInt64*

Number of Accounts

Native TEAL opcode: itxn

static num_app_args

Section titled “static num_app_args”

* static num_app_args() → algopy.UInt64*

Number of ApplicationArgs

Native TEAL opcode: itxn

static num_applications

Section titled “static num_applications”

* static num_applications() → algopy.UInt64*

Number of Applications

Native TEAL opcode: itxn

static num_approval_program_pages

Section titled “static num_approval_program_pages”

* static num_approval_program_pages() → algopy.UInt64*

Number of Approval Program pages

Native TEAL opcode: itxn

static num_assets

Section titled “static num_assets”

* static num_assets() → algopy.UInt64*

Number of Assets

Native TEAL opcode: itxn

static num_clear_state_program_pages

Section titled “static num_clear_state_program_pages”

* static num_clear_state_program_pages() → algopy.UInt64*

Number of ClearState Program pages

Native TEAL opcode: itxn

static num_logs

Section titled “static num_logs”

* static num_logs() → algopy.UInt64*

Number of Logs (only with itxn in v5). Application mode only

Native TEAL opcode: itxn

static on_completion

Section titled “static on_completion”

* static on_completion() → algopy.OnCompleteAction*

ApplicationCall transaction on completion action

Native TEAL opcode: itxn

static receiver

Section titled “static receiver”

* static receiver() → algopy.Account*

32 byte address

Native TEAL opcode: itxn

static reject_version

Section titled “static reject_version”

* static reject_version() → algopy.UInt64*

Min AVM version: 12

Native TEAL opcode: itxn

static rekey_to

Section titled “static rekey_to”

* static rekey_to() → algopy.Account*

32 byte Sender’s new AuthAddr

Native TEAL opcode: itxn

static selection_pk

Section titled “static selection_pk”

* static selection_pk() → algopy.Bytes*

32 byte address

Native TEAL opcode: itxn

static sender

Section titled “static sender”

* static sender() → algopy.Account*

32 byte address

Native TEAL opcode: itxn

static state_proof_pk

Section titled “static state_proof_pk”

* static state_proof_pk() → algopy.Bytes*

State proof public key

Native TEAL opcode: itxn

static tx_id

Section titled “static tx_id”

* static tx_id() → algopy.Bytes*

The computed ID for this transaction. 32 bytes.

Native TEAL opcode: itxn

static type

Section titled “static type”

* static type() → algopy.Bytes*

Transaction type as bytes

Native TEAL opcode: itxn

static type_enum

Section titled “static type_enum”

* static type_enum() → algopy.TransactionType*

Transaction type as integer

Native TEAL opcode: itxn

static vote_first

Section titled “static vote_first”

* static vote_first() → algopy.UInt64*

The first round that the participation key is valid.

Native TEAL opcode: itxn

static vote_key_dilution

Section titled “static vote_key_dilution”

* static vote_key_dilution() → algopy.UInt64*

Dilution for the 2-level participation key

Native TEAL opcode: itxn

static vote_last

Section titled “static vote_last”

* static vote_last() → algopy.UInt64*

The last round that the participation key is valid.

Native TEAL opcode: itxn

static vote_pk

Section titled “static vote_pk”

* static vote_pk() → algopy.Bytes*

32 byte address

Native TEAL opcode: itxn

static xfer_asset

Section titled “static xfer_asset”

* static xfer_asset() → algopy.Asset*

Asset ID

Native TEAL opcode: itxn

class algopy.op.ITxnCreate

Section titled “class algopy.op.ITxnCreate”

Create inner transactions Native TEAL ops: itxn_begin, itxn_field, itxn_next, itxn_submit

static begin

Section titled “static begin”

* static begin() → None*

begin preparation of a new inner transaction in a new transaction group itxn_begin initializes Sender to the application address; Fee to the minimum allowable, taking into account MinTxnFee and credit from overpaying in earlier transactions; FirstValid/LastValid to the values in the invoking transaction, and all other fields to zero or empty values.

Native TEAL opcode: itxn_begin

static next

Section titled “static next”

* static next() → None*

begin preparation of a new inner transaction in the same transaction group itxn_next initializes the transaction exactly as itxn_begin does

Native TEAL opcode: itxn_next

static set_accounts

Section titled “static set_accounts”

* static set_accounts(a: algopy.Account, /) → None*

Native TEAL opcode: itxn_field

static set_amount

Section titled “static set_amount”

* static set_amount(a: algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static set_application_args

Section titled “static set_application_args”

* static set_application_args(a: algopy.Bytes | bytes, /) → None*

Native TEAL opcode: itxn_field

static set_application_id

Section titled “static set_application_id”

* static set_application_id(a: algopy.Application | algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static set_applications

Section titled “static set_applications”

* static set_applications(a: algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static set_approval_program

Section titled “static set_approval_program”

* static set_approval_program(a: algopy.Bytes | bytes, /) → None*

Native TEAL opcode: itxn_field

static set_approval_program_pages

Section titled “static set_approval_program_pages”

* static set_approval_program_pages(a: algopy.Bytes | bytes, /) → None*

Native TEAL opcode: itxn_field

static set_asset_amount

Section titled “static set_asset_amount”

* static set_asset_amount(a: algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static set_asset_close_to

Section titled “static set_asset_close_to”

* static set_asset_close_to(a: algopy.Account, /) → None*

Native TEAL opcode: itxn_field

static set_asset_receiver

Section titled “static set_asset_receiver”

* static set_asset_receiver(a: algopy.Account, /) → None*

Native TEAL opcode: itxn_field

static set_asset_sender

Section titled “static set_asset_sender”

* static set_asset_sender(a: algopy.Account, /) → None*

Native TEAL opcode: itxn_field

static set_assets

Section titled “static set_assets”

* static set_assets(a: algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static set_clear_state_program

Section titled “static set_clear_state_program”

* static set_clear_state_program(a: algopy.Bytes | bytes, /) → None*

Native TEAL opcode: itxn_field

static set_clear_state_program_pages

Section titled “static set_clear_state_program_pages”

* static set_clear_state_program_pages(a: algopy.Bytes | bytes, /) → None*

Native TEAL opcode: itxn_field

static set_close_remainder_to

Section titled “static set_close_remainder_to”

* static set_close_remainder_to(a: algopy.Account, /) → None*

Native TEAL opcode: itxn_field

static set_config_asset

Section titled “static set_config_asset”

* static set_config_asset(a: algopy.Asset | algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static set_config_asset_clawback

Section titled “static set_config_asset_clawback”

* static set_config_asset_clawback(a: algopy.Account, /) → None*

Native TEAL opcode: itxn_field

static set_config_asset_decimals

Section titled “static set_config_asset_decimals”

* static set_config_asset_decimals(a: algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static set_config_asset_default_frozen

Section titled “static set_config_asset_default_frozen”

* static set_config_asset_default_frozen(a: bool, /) → None*

Native TEAL opcode: itxn_field

static set_config_asset_freeze

Section titled “static set_config_asset_freeze”

* static set_config_asset_freeze(a: algopy.Account, /) → None*

Native TEAL opcode: itxn_field

static set_config_asset_manager

Section titled “static set_config_asset_manager”

* static set_config_asset_manager(a: algopy.Account, /) → None*

Native TEAL opcode: itxn_field

static set_config_asset_metadata_hash

Section titled “static set_config_asset_metadata_hash”

* static set_config_asset_metadata_hash(a: algopy.Bytes | bytes, /) → None*

Native TEAL opcode: itxn_field

static set_config_asset_name

Section titled “static set_config_asset_name”

* static set_config_asset_name(a: algopy.Bytes | bytes, /) → None*

Native TEAL opcode: itxn_field

static set_config_asset_reserve

Section titled “static set_config_asset_reserve”

* static set_config_asset_reserve(a: algopy.Account, /) → None*

Native TEAL opcode: itxn_field

static set_config_asset_total

Section titled “static set_config_asset_total”

* static set_config_asset_total(a: algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static set_config_asset_unit_name

Section titled “static set_config_asset_unit_name”

* static set_config_asset_unit_name(a: algopy.Bytes | bytes, /) → None*

Native TEAL opcode: itxn_field

static set_config_asset_url

Section titled “static set_config_asset_url”

* static set_config_asset_url(a: algopy.Bytes | bytes, /) → None*

Native TEAL opcode: itxn_field

static set_extra_program_pages

Section titled “static set_extra_program_pages”

* static set_extra_program_pages(a: algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static set_fee

Section titled “static set_fee”

* static set_fee(a: algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static set_freeze_asset

Section titled “static set_freeze_asset”

* static set_freeze_asset(a: algopy.Asset | algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static set_freeze_asset_account

Section titled “static set_freeze_asset_account”

* static set_freeze_asset_account(a: algopy.Account, /) → None*

Native TEAL opcode: itxn_field

static set_freeze_asset_frozen

Section titled “static set_freeze_asset_frozen”

* static set_freeze_asset_frozen(a: bool, /) → None*

Native TEAL opcode: itxn_field

static set_global_num_byte_slice

Section titled “static set_global_num_byte_slice”

* static set_global_num_byte_slice(a: algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static set_global_num_uint

Section titled “static set_global_num_uint”

* static set_global_num_uint(a: algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static set_local_num_byte_slice

Section titled “static set_local_num_byte_slice”

* static set_local_num_byte_slice(a: algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static set_local_num_uint

Section titled “static set_local_num_uint”

* static set_local_num_uint(a: algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static set_nonparticipation

Section titled “static set_nonparticipation”

* static set_nonparticipation(a: bool, /) → None*

Native TEAL opcode: itxn_field

static set_note

Section titled “static set_note”

* static set_note(a: algopy.Bytes | bytes, /) → None*

Native TEAL opcode: itxn_field

static set_on_completion

Section titled “static set_on_completion”

* static set_on_completion(a: algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static set_receiver

Section titled “static set_receiver”

* static set_receiver(a: algopy.Account, /) → None*

Native TEAL opcode: itxn_field

static set_reject_version

Section titled “static set_reject_version”

* static set_reject_version(a: algopy.UInt64 | int, /) → None*

Min AVM version: 12

Native TEAL opcode: itxn_field

static set_rekey_to

Section titled “static set_rekey_to”

* static set_rekey_to(a: algopy.Account, /) → None*

Native TEAL opcode: itxn_field

static set_selection_pk

Section titled “static set_selection_pk”

* static set_selection_pk(a: algopy.Bytes | bytes, /) → None*

Native TEAL opcode: itxn_field

static set_sender

Section titled “static set_sender”

* static set_sender(a: algopy.Account, /) → None*

Native TEAL opcode: itxn_field

static set_state_proof_pk

Section titled “static set_state_proof_pk”

* static set_state_proof_pk(a: algopy.Bytes | bytes, /) → None*

Native TEAL opcode: itxn_field

static set_type

Section titled “static set_type”

* static set_type(a: algopy.Bytes | bytes, /) → None*

Native TEAL opcode: itxn_field

static set_type_enum

Section titled “static set_type_enum”

* static set_type_enum(a: algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static set_vote_first

Section titled “static set_vote_first”

* static set_vote_first(a: algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static set_vote_key_dilution

Section titled “static set_vote_key_dilution”

* static set_vote_key_dilution(a: algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static set_vote_last

Section titled “static set_vote_last”

* static set_vote_last(a: algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static set_vote_pk

Section titled “static set_vote_pk”

* static set_vote_pk(a: algopy.Bytes | bytes, /) → None*

Native TEAL opcode: itxn_field

static set_xfer_asset

Section titled “static set_xfer_asset”

* static set_xfer_asset(a: algopy.Asset | algopy.UInt64 | int, /) → None*

Native TEAL opcode: itxn_field

static submit

Section titled “static submit”

* static submit() → None*

execute the current inner transaction group. Fail if executing this group would exceed the inner transaction limit, or if any transaction in the group fails. itxn_submit resets the current transaction so that it can not be resubmitted. A new itxn_begin is required to prepare another inner transaction.

Native TEAL opcode: itxn_submit

class algopy.op.JsonRef

Section titled “class algopy.op.JsonRef”

key B’s value, of type R, from a valid utf-8 encoded json object A Warning: Usage should be restricted to very rare use cases, as JSON decoding is expensive and quite limited. In addition, JSON objects are large and not optimized for size. Almost all smart contracts should use simpler and smaller methods (such as the ABI. This opcode should only be used in cases where JSON is only available option, e.g. when a third-party only signs JSON. Native TEAL op: json_ref

static json_object

Section titled “static json_object”

* static json_object(a: algopy.Bytes | bytes, b: algopy.Bytes | bytes, /) → algopy.Bytes*

Native TEAL opcode: json_ref

static json_string

Section titled “static json_string”

* static json_string(a: algopy.Bytes | bytes, b: algopy.Bytes | bytes, /) → algopy.Bytes*

Native TEAL opcode: json_ref

static json_uint64

Section titled “static json_uint64”

* static json_uint64(a: algopy.Bytes | bytes, b: algopy.Bytes | bytes, /) → algopy.UInt64*

Native TEAL opcode: json_ref

class algopy.op.MiMCConfigurations

Section titled “class algopy.op.MiMCConfigurations”

Available values for the Mimc Configurations enum

Initialization

Section titled “Initialization”

Initialize self. See help(type(self)) for accurate signature.

BLS12_381Mp111 *: [algopy.op.MiMCConfigurations]

Section titled “BLS12_381Mp111 *: [algopy.op.MiMCConfigurations]”

_BLS12_381Mp111 _: algopy.op.MiMCConfigurations**

Ellipsis

MiMC configuration for the BLS12-381 curve with Miyaguchi-Preneel mode, 111 rounds, exponent 5, seed “seed” Min AVM version: 11

BN254Mp110 *: [algopy.op.MiMCConfigurations]

Section titled “BN254Mp110 *: [algopy.op.MiMCConfigurations]”

_BN254Mp110 _: algopy.op.MiMCConfigurations**

Ellipsis

MiMC configuration for the BN254 curve with Miyaguchi-Preneel mode, 110 rounds, exponent 5, seed “seed” Min AVM version: 11

__add__

Section titled “__add__”

__add__()

Return self+value.

__contains__

Section titled “__contains__”

__contains__()

Return bool(key in self).

__delattr__

Section titled “__delattr__”

__delattr__()

Implement delattr(self, name).

__dir__

Section titled “__dir__”

__dir__()

Default dir() implementation.

__eq__

Section titled “__eq__”

__eq__()

Return self==value.

__format__

Section titled “__format__”

__format__()

Return a formatted version of the string as described by format_spec.

__ge__

Section titled “__ge__”

__ge__()

Return self>=value.

__getattribute__

Section titled “__getattribute__”

__getattribute__()

Return getattr(self, name).

__getitem__

Section titled “__getitem__”

__getitem__()

Return self[key].

__getstate__

Section titled “__getstate__”

__getstate__()

Helper for pickle.

__gt__

Section titled “__gt__”

__gt__()

Return self>value.

__hash__

Section titled “__hash__”

__hash__()

Return hash(self).

__iter__

Section titled “__iter__”

__iter__()

Implement iter(self).

__le__

Section titled “__le__”

__le__()

Return self<=value.

__len__

Section titled “__len__”

__len__()

Return len(self).

__lt__

Section titled “__lt__”

__lt__()

Return self<value.

__mod__

Section titled “__mod__”

__mod__()

Return self%value.

__mul__

Section titled “__mul__”

__mul__()

Return self*value.

__ne__

Section titled “__ne__”

__ne__()

Return self!=value.

__new__

Section titled “__new__”

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__

Section titled “__reduce__”

__reduce__()

Helper for pickle.

__reduce ex_

Section titled “__reduceex_”

__reduceex_()

Helper for pickle.

__repr__

Section titled “__repr__”

__repr__()

Return repr(self).

__rmod__

Section titled “__rmod__”

__rmod__()

Return value%self.

__rmul__

Section titled “__rmul__”

__rmul__()

Return value*self.

__setattr__

Section titled “__setattr__”

__setattr__()

Implement setattr(self, name, value).

__sizeof__

Section titled “__sizeof__”

__sizeof__()

Return the size of the string in memory, in bytes.

__str__

Section titled “__str__”

__str__()

Return str(self).

capitalize

Section titled “capitalize”

capitalize()

Return a capitalized version of the string.

More specifically, make the first character have upper case and the rest lower case.

casefold

Section titled “casefold”

casefold()

Return a version of the string suitable for caseless comparisons.

center

Section titled “center”

center()

Return a centered string of length width.

Padding is done using the specified fill character (default is a space).

count

Section titled “count”

count()

S.count(sub[, start[, end]]) -> int

encode

Section titled “encode”

encode()

Encode the string using the codec registered for encoding.

endswith

Section titled “endswith”

endswith()

S.endswith(suffix[, start[, end]]) -> bool

expandtabs

Section titled “expandtabs”

expandtabs()

Return a copy where all tab characters are expanded using spaces.

If tabsize is not given, a tab size of 8 characters is assumed.

find

Section titled “find”

find()

S.find(sub[, start[, end]]) -> int

Return -1 on failure.

format

Section titled “format”

format()

S.format(*args, **kwargs) -> str

Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

format_map

Section titled “format_map”

format_map()

S.format_map(mapping) -> str

Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

index

Section titled “index”

index()

S.index(sub[, start[, end]]) -> int

Raises ValueError when the substring is not found.

isalnum

Section titled “isalnum”

isalnum()

Return True if the string is an alpha-numeric string, False otherwise.

A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

isalpha

Section titled “isalpha”

isalpha()

Return True if the string is an alphabetic string, False otherwise.

A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

isascii

Section titled “isascii”

isascii()

Return True if all characters in the string are ASCII, False otherwise.

ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

isdecimal

Section titled “isdecimal”

isdecimal()

Return True if the string is a decimal string, False otherwise.

A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

isdigit

Section titled “isdigit”

isdigit()

Return True if the string is a digit string, False otherwise.

A string is a digit string if all characters in the string are digits and there is at least one character in the string.

isidentifier

Section titled “isidentifier”

isidentifier()

Return True if the string is a valid Python identifier, False otherwise.

Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

islower

Section titled “islower”

islower()

Return True if the string is a lowercase string, False otherwise.

A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

isnumeric

Section titled “isnumeric”

isnumeric()

Return True if the string is a numeric string, False otherwise.

A string is numeric if all characters in the string are numeric and there is at least one character in the string.

isprintable

Section titled “isprintable”

isprintable()

Return True if the string is printable, False otherwise.

A string is printable if all of its characters are considered printable in repr() or if it is empty.

isspace

Section titled “isspace”

isspace()

Return True if the string is a whitespace string, False otherwise.

A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

istitle

Section titled “istitle”

istitle()

Return True if the string is a title-cased string, False otherwise.

In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

isupper

Section titled “isupper”

isupper()

Return True if the string is an uppercase string, False otherwise.

A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

join

Section titled “join”

join()

Concatenate any number of strings.

The string whose method is called is inserted in between each given string. The result is returned as a new string.

Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

ljust

Section titled “ljust”

ljust()

Return a left-justified string of length width.

Padding is done using the specified fill character (default is a space).

lower

Section titled “lower”

lower()

Return a copy of the string converted to lowercase.

lstrip

Section titled “lstrip”

lstrip()

Return a copy of the string with leading whitespace removed.

If chars is given and not None, remove characters in chars instead.

partition

Section titled “partition”

partition()

Partition the string into three parts using the given separator.

If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

removeprefix

Section titled “removeprefix”

removeprefix()

Return a str with the given prefix string removed if present.

If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

removesuffix

Section titled “removesuffix”

removesuffix()

Return a str with the given suffix string removed if present.

If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

replace

Section titled “replace”

replace()

Return a copy with all occurrences of substring old replaced by new.

count Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

If the optional argument count is given, only the first count occurrences are replaced.

rfind

Section titled “rfind”

rfind()

S.rfind(sub[, start[, end]]) -> int

Return -1 on failure.

rindex

Section titled “rindex”

rindex()

S.rindex(sub[, start[, end]]) -> int

Raises ValueError when the substring is not found.

rjust

Section titled “rjust”

rjust()

Return a right-justified string of length width.

Padding is done using the specified fill character (default is a space).

rpartition

Section titled “rpartition”

rpartition()

Partition the string into three parts using the given separator.

If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

rsplit

Section titled “rsplit”

rsplit()

Return a list of the substrings in the string, using sep as the separator string.

sep The separator used to split the string.

When set to None (the default value), will split on any whitespace

character (including \n \r \t \f and spaces) and will discard

empty strings from the result.

maxsplit Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the end of the string and works to the front.

rstrip

Section titled “rstrip”

rstrip()

Return a copy of the string with trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

split

Section titled “split”

split()

Return a list of the substrings in the string, using sep as the separator string.

sep The separator used to split the string.

When set to None (the default value), will split on any whitespace

character (including \n \r \t \f and spaces) and will discard

empty strings from the result.

maxsplit Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the front of the string and works to the end.

splitlines

Section titled “splitlines”

splitlines()

Return a list of the lines in the string, breaking at line boundaries.

Line breaks are not included in the resulting list unless keepends is given and true.

startswith

Section titled “startswith”

startswith()

S.startswith(prefix[, start[, end]]) -> bool

strip

Section titled “strip”

strip()

Return a copy of the string with leading and trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

swapcase

Section titled “swapcase”

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title

Section titled “title”

title()

Return a version of the string where each word is titlecased.

More specifically, words start with uppercased characters and all remaining cased characters have lower case.

translate

Section titled “translate”

translate()

Replace each character in the string using the given translation table.

table Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

upper

Section titled “upper”

upper()

Return a copy of the string converted to uppercase.

zfill

Section titled “zfill”

zfill()

Pad a numeric string with zeros on the left, to fill a field of the given width.

The string is never truncated.

class algopy.op.Scratch

Section titled “class algopy.op.Scratch”

Load or store scratch values Native TEAL ops: loads, stores

static load_bytes

Section titled “static load_bytes”

* static load_bytes(a: algopy.UInt64 | int, /) → algopy.Bytes*

Ath scratch space value. All scratch spaces are 0 at program start.

Native TEAL opcode: loads

static load_uint64

Section titled “static load_uint64”

* static load_uint64(a: algopy.UInt64 | int, /) → algopy.UInt64*

Ath scratch space value. All scratch spaces are 0 at program start.

Native TEAL opcode: loads

static store

Section titled “static store”

* static store(a: algopy.UInt64 | int, b: algopy.Bytes | algopy.UInt64 | bytes | int, /) → None*

store B to the Ath scratch space

Native TEAL opcode: stores

class algopy.op.Txn

Section titled “class algopy.op.Txn”

Get values for the current executing transaction Native TEAL ops: txn, txnas

static accounts

Section titled “static accounts”

Accounts listed in the ApplicationCall transaction

Native TEAL opcode: txna, txnas

amount *: [Final]

Section titled “amount *: [Final]”

_amount _: Final[ algopy.UInt64]**

Ellipsis

microalgos

static application_args

Section titled “static application_args”

Arguments passed to the application in the ApplicationCall transaction

application_id *: [Final]

Section titled “application_id *: [Final]”

_application_id _: Final[ algopy.Application]**

Ellipsis

ApplicationID from ApplicationCall transaction

static applications

Section titled “static applications”

Foreign Apps listed in the ApplicationCall transaction

approval_program *: [Final]

Section titled “approval_program *: [Final]”

_approval_program _: Final[ algopy.Bytes]**

Ellipsis

Approval program

static approval_program_pages

Section titled “static approval_program_pages”

Approval Program as an array of pages

asset_amount *: [Final]

Section titled “asset_amount *: [Final]”

_asset_amount _: Final[ algopy.UInt64]**

Ellipsis

value in Asset’s units

asset_close_to *: [Final]

Section titled “asset_close_to *: [Final]”

_asset_close_to _: Final[ algopy.Account]**

Ellipsis

32 byte address

asset_receiver *: [Final]

Section titled “asset_receiver *: [Final]”

_asset_receiver _: Final[ algopy.Account]**

Ellipsis

32 byte address

asset_sender *: [Final]

Section titled “asset_sender *: [Final]”

_asset_sender _: Final[ algopy.Account]**

Ellipsis

32 byte address. Source of assets if Sender is the Asset’s Clawback address.

static assets

Section titled “static assets”

Foreign Assets listed in the ApplicationCall transaction

clear_state_program *: [Final]

Section titled “clear_state_program *: [Final]”

_clear_state_program _: Final[ algopy.Bytes]**

Ellipsis

Clear state program

static clear_state_program_pages

Section titled “static clear_state_program_pages”

ClearState Program as an array of pages

close_remainder_to *: [Final]

Section titled “close_remainder_to *: [Final]”

_close_remainder_to _: Final[ algopy.Account]**

Ellipsis

32 byte address

config_asset *: [Final]

Section titled “config_asset *: [Final]”

_config_asset _: Final[ algopy.Asset]**

Ellipsis

Asset ID in asset config transaction

config_asset_clawback *: [Final]

Section titled “config_asset_clawback *: [Final]”

_config_asset_clawback _: Final[ algopy.Account]**

Ellipsis

32 byte address

config_asset_decimals *: [Final]

Section titled “config_asset_decimals *: [Final]”

_config_asset_decimals _: Final[ algopy.UInt64]**

Ellipsis

Number of digits to display after the decimal place when displaying the asset

config_asset_default_frozen *: [Final]

Section titled “config_asset_default_frozen *: [Final]”

_config_asset_default_frozen _: Final[ bool]**

Ellipsis

Whether the asset’s slots are frozen by default or not, 0 or 1

config_asset_freeze *: [Final]

Section titled “config_asset_freeze *: [Final]”

_config_asset_freeze _: Final[ algopy.Account]**

Ellipsis

32 byte address

config_asset_manager *: [Final]

Section titled “config_asset_manager *: [Final]”

_config_asset_manager _: Final[ algopy.Account]**

Ellipsis

32 byte address

config_asset_metadata_hash *: [Final]

Section titled “config_asset_metadata_hash *: [Final]”

_config_asset_metadata_hash _: Final[ algopy.Bytes]**

Ellipsis

32 byte commitment to unspecified asset metadata

config_asset_name *: [Final]

Section titled “config_asset_name *: [Final]”

_config_asset_name _: Final[ algopy.Bytes]**

Ellipsis

The asset name

config_asset_reserve *: [Final]

Section titled “config_asset_reserve *: [Final]”

_config_asset_reserve _: Final[ algopy.Account]**

Ellipsis

32 byte address

config_asset_total *: [Final]

Section titled “config_asset_total *: [Final]”

_config_asset_total _: Final[ algopy.UInt64]**

Ellipsis

Total number of units of this asset created

config_asset_unit_name *: [Final]

Section titled “config_asset_unit_name *: [Final]”

_config_asset_unit_name _: Final[ algopy.Bytes]**

Ellipsis

Unit name of the asset

config_asset_url *: [Final]

Section titled “config_asset_url *: [Final]”

_config_asset_url _: Final[ algopy.Bytes]**

Ellipsis

URL

created_application_id *: [Final]

Section titled “created_application_id *: [Final]”

_created_application_id _: Final[ algopy.Application]**

Ellipsis

ApplicationID allocated by the creation of an application (only with itxn in v5). Application mode only

created_asset_id *: [Final]

Section titled “created_asset_id *: [Final]”

_created_asset_id _: Final[ algopy.Asset]**

Ellipsis

Asset ID allocated by the creation of an ASA (only with itxn in v5). Application mode only

extra_program_pages *: [Final]

Section titled “extra_program_pages *: [Final]”

_extra_program_pages _: Final[ algopy.UInt64]**

Ellipsis

fee *: [Final]

Section titled “fee *: [Final]”

_fee _: Final[ algopy.UInt64]**

Ellipsis

microalgos

first_valid *: [Final]

Section titled “first_valid *: [Final]”

_first_valid _: Final[ algopy.UInt64]**

Ellipsis

round number

first_valid_time *: [Final]

Section titled “first_valid_time *: [Final]”

_first_valid_time _: Final[ algopy.UInt64]**

Ellipsis

UNIX timestamp of block before txn.FirstValid. Fails if negative

freeze_asset *: [Final]

Section titled “freeze_asset *: [Final]”

_freeze_asset _: Final[ algopy.Asset]**

Ellipsis

Asset ID being frozen or un-frozen

freeze_asset_account *: [Final]

Section titled “freeze_asset_account *: [Final]”

_freeze_asset_account _: Final[ algopy.Account]**

Ellipsis

32 byte address of the account whose asset slot is being frozen or un-frozen

freeze_asset_frozen *: [Final]

Section titled “freeze_asset_frozen *: [Final]”

_freeze_asset_frozen _: Final[ bool]**

Ellipsis

The new frozen value, 0 or 1

global_num_byte_slice *: [Final]

Section titled “global_num_byte_slice *: [Final]”

_global_num_byte_slice _: Final[ algopy.UInt64]**

Ellipsis

Number of global state byteslices in ApplicationCall

global_num_uint *: [Final]

Section titled “global_num_uint *: [Final]”

_global_num_uint _: Final[ algopy.UInt64]**

Ellipsis

Number of global state integers in ApplicationCall

group_index *: [Final]

Section titled “group_index *: [Final]”

_group_index _: Final[ algopy.UInt64]**

Ellipsis

Position of this transaction within an atomic transaction group. A stand-alone transaction is implicitly element 0 in a group of 1

last_log *: [Final]

Section titled “last_log *: [Final]”

_last_log _: Final[ algopy.Bytes]**

Ellipsis

The last message emitted. Empty bytes if none were emitted. Application mode only

last_valid *: [Final]

Section titled “last_valid *: [Final]”

_last_valid _: Final[ algopy.UInt64]**

Ellipsis

round number

lease *: [Final]

Section titled “lease *: [Final]”

_lease _: Final[ algopy.Bytes]**

Ellipsis

32 byte lease value

local_num_byte_slice *: [Final]

Section titled “local_num_byte_slice *: [Final]”

_local_num_byte_slice _: Final[ algopy.UInt64]**

Ellipsis

Number of local state byteslices in ApplicationCall

local_num_uint *: [Final]

Section titled “local_num_uint *: [Final]”

_local_num_uint _: Final[ algopy.UInt64]**

Ellipsis

Number of local state integers in ApplicationCall

static logs

Section titled “static logs”

Log messages emitted by an application call (only with itxn in v5). Application mode only

nonparticipation *: [Final]

Section titled “nonparticipation *: [Final]”

_nonparticipation _: Final[ bool]**

Ellipsis

Marks an account nonparticipating for rewards

note *: [Final]

Section titled “note *: [Final]”

_note _: Final[ algopy.Bytes]**

Ellipsis

Any data up to 1024 bytes

num_accounts *: [Final]

Section titled “num_accounts *: [Final]”

_num_accounts _: Final[ algopy.UInt64]**

Ellipsis

Number of Accounts

num_app_args *: [Final]

Section titled “num_app_args *: [Final]”

_num_app_args _: Final[ algopy.UInt64]**

Ellipsis

Number of ApplicationArgs

num_applications *: [Final]

Section titled “num_applications *: [Final]”

_num_applications _: Final[ algopy.UInt64]**

Ellipsis

Number of Applications

num_approval_program_pages *: [Final]

Section titled “num_approval_program_pages *: [Final]”

_num_approval_program_pages _: Final[ algopy.UInt64]**

Ellipsis

Number of Approval Program pages

num_assets *: [Final]

Section titled “num_assets *: [Final]”

_num_assets _: Final[ algopy.UInt64]**

Ellipsis

Number of Assets

num_clear_state_program_pages *: [Final]

Section titled “num_clear_state_program_pages *: [Final]”

_num_clear_state_program_pages _: Final[ algopy.UInt64]**

Ellipsis

Number of ClearState Program pages

num_logs *: [Final]

Section titled “num_logs *: [Final]”

_num_logs _: Final[ algopy.UInt64]**

Ellipsis

Number of Logs (only with itxn in v5). Application mode only

on_completion *: [Final]

Section titled “on_completion *: [Final]”

_on_completion _: Final[ algopy.OnCompleteAction]**

Ellipsis

ApplicationCall transaction on completion action

receiver *: [Final]

Section titled “receiver *: [Final]”

_receiver _: Final[ algopy.Account]**

Ellipsis

32 byte address

reject_version *: [Final]

Section titled “reject_version *: [Final]”

_reject_version _: Final[ algopy.UInt64]**

Ellipsis

Application version for which the txn must reject Min AVM version: 12

rekey_to *: [Final]

Section titled “rekey_to *: [Final]”

_rekey_to _: Final[ algopy.Account]**

Ellipsis

32 byte Sender’s new AuthAddr

selection_pk *: [Final]

Section titled “selection_pk *: [Final]”

_selection_pk _: Final[ algopy.Bytes]**

Ellipsis

32 byte address

sender *: [Final]

Section titled “sender *: [Final]”

_sender _: Final[ algopy.Account]**

Ellipsis

32 byte address

state_proof_pk *: [Final]

Section titled “state_proof_pk *: [Final]”

_state_proof_pk _: Final[ algopy.Bytes]**

Ellipsis

State proof public key

tx_id *: [Final]

Section titled “tx_id *: [Final]”

_tx_id _: Final[ algopy.Bytes]**

Ellipsis

The computed ID for this transaction. 32 bytes.

type *: [Final]

Section titled “type *: [Final]”

_type _: Final[ algopy.Bytes]**

Ellipsis

Transaction type as bytes

type_enum *: [Final]

Section titled “type_enum *: [Final]”

_type_enum _: Final[ algopy.TransactionType]**

Ellipsis

Transaction type as integer

vote_first *: [Final]

Section titled “vote_first *: [Final]”

_vote_first _: Final[ algopy.UInt64]**

Ellipsis

The first round that the participation key is valid.

vote_key_dilution *: [Final]

Section titled “vote_key_dilution *: [Final]”

_vote_key_dilution _: Final[ algopy.UInt64]**

Ellipsis

Dilution for the 2-level participation key

vote_last *: [Final]

Section titled “vote_last *: [Final]”

_vote_last _: Final[ algopy.UInt64]**

Ellipsis

The last round that the participation key is valid.

vote_pk *: [Final]

Section titled “vote_pk *: [Final]”

_vote_pk _: Final[ algopy.Bytes]**

Ellipsis

32 byte address

xfer_asset *: [Final]

Section titled “xfer_asset *: [Final]”

_xfer_asset _: Final[ algopy.Asset]**

Ellipsis

Asset ID

class algopy.op.VoterParamsGet

Section titled “class algopy.op.VoterParamsGet”

X is field F from online account A as of the balance round: 320 rounds before the current round. Y is 1 if A had positive algos online in the agreement round, else Y is 0 and X is a type specific zero-value Native TEAL op: voter_params_get

static voter_balance

Section titled “static voter_balance”

* static voter_balance(a: algopy.Account | algopy.UInt64 | int, /) → tuple[ algopy.UInt64, bool]*

Min AVM version: 11

Native TEAL opcode: voter_params_get

static voter_incentive_eligible

Section titled “static voter_incentive_eligible”

* static voter_incentive_eligible(a: algopy.Account | algopy.UInt64 | int, /) → tuple[ bool, bool]*

Min AVM version: 11

Native TEAL opcode: voter_params_get

class algopy.op.VrfVerify

Section titled “class algopy.op.VrfVerify”

Available values for the vrf_verify enum

Initialization

Section titled “Initialization”

Initialize self. See help(type(self)) for accurate signature.

__add__

Section titled “__add__”

__add__()

Return self+value.

__contains__

Section titled “__contains__”

__contains__()

Return bool(key in self).

__delattr__

Section titled “__delattr__”

__delattr__()

Implement delattr(self, name).

__dir__

Section titled “__dir__”

__dir__()

Default dir() implementation.

__eq__

Section titled “__eq__”

__eq__()

Return self==value.

__format__

Section titled “__format__”

__format__()

Return a formatted version of the string as described by format_spec.

__ge__

Section titled “__ge__”

__ge__()

Return self>=value.

__getattribute__

Section titled “__getattribute__”

__getattribute__()

Return getattr(self, name).

__getitem__

Section titled “__getitem__”

__getitem__()

Return self[key].

__getstate__

Section titled “__getstate__”

__getstate__()

Helper for pickle.

__gt__

Section titled “__gt__”

__gt__()

Return self>value.

__hash__

Section titled “__hash__”

__hash__()

Return hash(self).

__iter__

Section titled “__iter__”

__iter__()

Implement iter(self).

__le__

Section titled “__le__”

__le__()

Return self<=value.

__len__

Section titled “__len__”

__len__()

Return len(self).

__lt__

Section titled “__lt__”

__lt__()

Return self<value.

__mod__

Section titled “__mod__”

__mod__()

Return self%value.

__mul__

Section titled “__mul__”

__mul__()

Return self*value.

__ne__

Section titled “__ne__”

__ne__()

Return self!=value.

__new__

Section titled “__new__”

__new__()

Create and return a new object. See help(type) for accurate signature.

__reduce__

Section titled “__reduce__”

__reduce__()

Helper for pickle.

__reduce ex_

Section titled “__reduceex_”

__reduceex_()

Helper for pickle.

__repr__

Section titled “__repr__”

__repr__()

Return repr(self).

__rmod__

Section titled “__rmod__”

__rmod__()

Return value%self.

__rmul__

Section titled “__rmul__”

__rmul__()

Return value*self.

__setattr__

Section titled “__setattr__”

__setattr__()

Implement setattr(self, name, value).

__sizeof__

Section titled “__sizeof__”

__sizeof__()

Return the size of the string in memory, in bytes.

__str__

Section titled “__str__”

__str__()

Return str(self).

capitalize

Section titled “capitalize”

capitalize()

Return a capitalized version of the string.

More specifically, make the first character have upper case and the rest lower case.

casefold

Section titled “casefold”

casefold()

Return a version of the string suitable for caseless comparisons.

center

Section titled “center”

center()

Return a centered string of length width.

Padding is done using the specified fill character (default is a space).

count

Section titled “count”

count()

S.count(sub[, start[, end]]) -> int

encode

Section titled “encode”

encode()

Encode the string using the codec registered for encoding.

endswith

Section titled “endswith”

endswith()

S.endswith(suffix[, start[, end]]) -> bool

expandtabs

Section titled “expandtabs”

expandtabs()

Return a copy where all tab characters are expanded using spaces.

If tabsize is not given, a tab size of 8 characters is assumed.

find

Section titled “find”

find()

S.find(sub[, start[, end]]) -> int

Return -1 on failure.

format

Section titled “format”

format()

S.format(*args, **kwargs) -> str

Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

format_map

Section titled “format_map”

format_map()

S.format_map(mapping) -> str

Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

index

Section titled “index”

index()

S.index(sub[, start[, end]]) -> int

Raises ValueError when the substring is not found.

isalnum

Section titled “isalnum”

isalnum()

Return True if the string is an alpha-numeric string, False otherwise.

A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

isalpha

Section titled “isalpha”

isalpha()

Return True if the string is an alphabetic string, False otherwise.

A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

isascii

Section titled “isascii”

isascii()

Return True if all characters in the string are ASCII, False otherwise.

ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

isdecimal

Section titled “isdecimal”

isdecimal()

Return True if the string is a decimal string, False otherwise.

A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

isdigit

Section titled “isdigit”

isdigit()

Return True if the string is a digit string, False otherwise.

A string is a digit string if all characters in the string are digits and there is at least one character in the string.

isidentifier

Section titled “isidentifier”

isidentifier()

Return True if the string is a valid Python identifier, False otherwise.

Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

islower

Section titled “islower”

islower()

Return True if the string is a lowercase string, False otherwise.

A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

isnumeric

Section titled “isnumeric”

isnumeric()

Return True if the string is a numeric string, False otherwise.

A string is numeric if all characters in the string are numeric and there is at least one character in the string.

isprintable

Section titled “isprintable”

isprintable()

Return True if the string is printable, False otherwise.

A string is printable if all of its characters are considered printable in repr() or if it is empty.

isspace

Section titled “isspace”

isspace()

Return True if the string is a whitespace string, False otherwise.

A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

istitle

Section titled “istitle”

istitle()

Return True if the string is a title-cased string, False otherwise.

In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

isupper

Section titled “isupper”

isupper()

Return True if the string is an uppercase string, False otherwise.

A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

join

Section titled “join”

join()

Concatenate any number of strings.

The string whose method is called is inserted in between each given string. The result is returned as a new string.

Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

ljust

Section titled “ljust”

ljust()

Return a left-justified string of length width.

Padding is done using the specified fill character (default is a space).

lower

Section titled “lower”

lower()

Return a copy of the string converted to lowercase.

lstrip

Section titled “lstrip”

lstrip()

Return a copy of the string with leading whitespace removed.

If chars is given and not None, remove characters in chars instead.

partition

Section titled “partition”

partition()

Partition the string into three parts using the given separator.

If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

removeprefix

Section titled “removeprefix”

removeprefix()

Return a str with the given prefix string removed if present.

If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

removesuffix

Section titled “removesuffix”

removesuffix()

Return a str with the given suffix string removed if present.

If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

replace

Section titled “replace”

replace()

Return a copy with all occurrences of substring old replaced by new.

count Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

If the optional argument count is given, only the first count occurrences are replaced.

rfind

Section titled “rfind”

rfind()

S.rfind(sub[, start[, end]]) -> int

Return -1 on failure.

rindex

Section titled “rindex”

rindex()

S.rindex(sub[, start[, end]]) -> int

Raises ValueError when the substring is not found.

rjust

Section titled “rjust”

rjust()

Return a right-justified string of length width.

Padding is done using the specified fill character (default is a space).

rpartition

Section titled “rpartition”

rpartition()

Partition the string into three parts using the given separator.

If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

rsplit

Section titled “rsplit”

rsplit()

Return a list of the substrings in the string, using sep as the separator string.

sep The separator used to split the string.

When set to None (the default value), will split on any whitespace

character (including \n \r \t \f and spaces) and will discard

empty strings from the result.

maxsplit Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the end of the string and works to the front.

rstrip

Section titled “rstrip”

rstrip()

Return a copy of the string with trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

split

Section titled “split”

split()

Return a list of the substrings in the string, using sep as the separator string.

sep The separator used to split the string.

When set to None (the default value), will split on any whitespace

character (including \n \r \t \f and spaces) and will discard

empty strings from the result.

maxsplit Maximum number of splits. -1 (the default value) means no limit.

Splitting starts at the front of the string and works to the end.

splitlines

Section titled “splitlines”

splitlines()

Return a list of the lines in the string, breaking at line boundaries.

Line breaks are not included in the resulting list unless keepends is given and true.

startswith

Section titled “startswith”

startswith()

S.startswith(prefix[, start[, end]]) -> bool

strip

Section titled “strip”

strip()

Return a copy of the string with leading and trailing whitespace removed.

If chars is given and not None, remove characters in chars instead.

swapcase

Section titled “swapcase”

swapcase()

Convert uppercase characters to lowercase and lowercase characters to uppercase.

title

Section titled “title”

title()

Return a version of the string where each word is titlecased.

More specifically, words start with uppercased characters and all remaining cased characters have lower case.

translate

Section titled “translate”

translate()

Replace each character in the string using the given translation table.

table Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

upper

Section titled “upper”

upper()

Return a copy of the string converted to uppercase.

zfill

Section titled “zfill”

zfill()

Pad a numeric string with zeros on the left, to fill a field of the given width.

The string is never truncated.

algopy.op.addw

Section titled “algopy.op.addw”

algopy.op.addw(a: algopy.UInt64 | int, b: algopy.UInt64 | int, /) → tuple[ algopy.UInt64, algopy.UInt64]

A plus B as a 128-bit result. X is the carry-bit, Y is the low-order 64 bits.

Native TEAL opcode: addw

algopy.op.app_opted_in

Section titled “algopy.op.app_opted_in”

algopy.op.app_opted_in(a: algopy.Account | algopy.UInt64 | int, b: algopy.Application | algopy.UInt64 | int, /) → bool

1 if account A is opted in to application B, else 0 params: Txn.Accounts offset (or, since v4, an available account address), available application id (or, since v4, a Txn.ForeignApps offset). Return: 1 if opted in and 0 otherwise.

Native TEAL opcode: app_opted_in

algopy.op.arg

Section titled “algopy.op.arg”

algopy.op.arg(a: algopy.UInt64 | int, /) → algopy.Bytes

Ath LogicSig argument

Native TEAL opcode: arg, args

algopy.op.balance

Section titled “algopy.op.balance”

algopy.op.balance(a: algopy.Account | algopy.UInt64 | int, /) → algopy.UInt64

balance for account A, in microalgos. The balance is observed after the effects of previous transactions in the group, and after the fee for the current transaction is deducted. Changes caused by inner transactions are observable immediately following itxn_submit params: Txn.Accounts offset (or, since v4, an available account address), available application id (or, since v4, a Txn.ForeignApps offset). Return: value.

Native TEAL opcode: balance

algopy.op.base64_decode

Section titled “algopy.op.base64_decode”

algopy.op.base64_decode(e: algopy.op.Base64, a: algopy.Bytes | bytes, /) → algopy.Bytes

decode A which was base64-encoded using encoding E. Fail if A is not base64 encoded with encoding E Warning: Usage should be restricted to very rare use cases. In almost all cases, smart contracts should directly handle non-encoded byte-strings. This opcode should only be used in cases where base64 is the only available option, e.g. interoperability with a third-party that only signs base64 strings.

Decodes A using the base64 encoding E. Specify the encoding with an immediate arg either as URL and Filename Safe (URLEncoding) or Standard (StdEncoding). See RFC 4648 sections 4 and 5. It is assumed that the encoding ends with the exact number of = padding characters as required by the RFC. When padding occurs, any unused pad bits in the encoding must be set to zero or the decoding will fail. The special cases of \n and \r are allowed but completely ignored. An error will result when attempting to decode a string with a character that is not in the encoding alphabet or not one of =, \r, or \n.

Native TEAL opcode: base64_decode

algopy.op.bitlen

Section titled “algopy.op.bitlen”

algopy.op.bitlen(a: algopy.Bytes | algopy.UInt64 | bytes | int, /) → algopy.UInt64

The highest set bit in A. If A is a byte-array, it is interpreted as a big-endian unsigned integer. bitlen of 0 is 0, bitlen of 8 is 4 bitlen interprets arrays as big-endian integers, unlike setbit/getbit

Native TEAL opcode: bitlen

algopy.op.bsqrt

Section titled “algopy.op.bsqrt”

algopy.op.bsqrt(a: algopy.BigUInt | int, /) → algopy.BigUInt

The largest integer I such that I^2 <= A. A and I are interpreted as big-endian unsigned integers

Native TEAL opcode: bsqrt

algopy.op.btoi

Section titled “algopy.op.btoi”

algopy.op.btoi(a: algopy.Bytes | bytes, /) → algopy.UInt64

converts big-endian byte array A to uint64. Fails if len(A) > 8. Padded by leading 0s if len(A) < 8. btoi fails if the input is longer than 8 bytes.

Native TEAL opcode: btoi

algopy.op.bzero

Section titled “algopy.op.bzero”

algopy.op.bzero(a: algopy.UInt64 | int, /) → algopy.Bytes

zero filled byte-array of length A

Native TEAL opcode: bzero

algopy.op.concat

Section titled “algopy.op.concat”

algopy.op.concat(a: algopy.Bytes | bytes, b: algopy.Bytes | bytes, /) → algopy.Bytes

join A and B concat fails if the result would be greater than 4096 bytes.

Native TEAL opcode: concat

algopy.op.divmodw

Section titled “algopy.op.divmodw”

algopy.op.divmodw(a: algopy.UInt64 | int, b: algopy.UInt64 | int, c: algopy.UInt64 | int, d: algopy.UInt64 | int, /) → tuple[ algopy.UInt64, algopy.UInt64, algopy.UInt64, algopy.UInt64]

W,X = (A,B / C,D); Y,Z = (A,B modulo C,D) The notation J,K indicates that two uint64 values J and K are interpreted as a uint128 value, with J as the high uint64 and K the low.

Native TEAL opcode: divmodw

algopy.op.divw

Section titled “algopy.op.divw”

algopy.op.divw(a: algopy.UInt64 | int, b: algopy.UInt64 | int, c: algopy.UInt64 | int, /) → algopy.UInt64

A,B / C. Fail if C == 0 or if result overflows. The notation A,B indicates that A and B are interpreted as a uint128 value, with A as the high uint64 and B the low.

Native TEAL opcode: divw

algopy.op.ecdsa_pk_decompress

Section titled “algopy.op.ecdsa_pk_decompress”

algopy.op.ecdsa_pk_decompress(v: algopy.op.ECDSA, a: algopy.Bytes | bytes, /) → tuple[ algopy.Bytes, algopy.Bytes]

decompress pubkey A into components X, Y The 33 byte public key in a compressed form to be decompressed into X and Y (top) components. All values are big-endian encoded.

Native TEAL opcode: ecdsa_pk_decompress

algopy.op.ecdsa_pk_recover

Section titled “algopy.op.ecdsa_pk_recover”

algopy.op.ecdsa_pk_recover(v: algopy.op.ECDSA, a: algopy.Bytes | bytes, b: algopy.UInt64 | int, c: algopy.Bytes | bytes, d: algopy.Bytes | bytes, /) → tuple[ algopy.Bytes, algopy.Bytes]

for (data A, recovery id B, signature C, D) recover a public key S (top) and R elements of a signature, recovery id and data (bottom) are expected on the stack and used to deriver a public key. All values are big-endian encoded. The signed data must be 32 bytes long.

Native TEAL opcode: ecdsa_pk_recover

algopy.op.ecdsa_verify

Section titled “algopy.op.ecdsa_verify”

algopy.op.ecdsa_verify(v: algopy.op.ECDSA, a: algopy.Bytes | bytes, b: algopy.Bytes | bytes, c: algopy.Bytes | bytes, d: algopy.Bytes | bytes, e: algopy.Bytes | bytes, /) → bool

for (data A, signature B, C and pubkey D, E) verify the signature of the data against the pubkey => {0 or 1} The 32 byte Y-component of a public key is the last element on the stack, preceded by X-component of a pubkey, preceded by S and R components of a signature, preceded by the data that is fifth element on the stack. All values are big-endian encoded. The signed data must be 32 bytes long, and signatures in lower-S form are only accepted.

Native TEAL opcode: ecdsa_verify

algopy.op.ed25519verify

Section titled “algopy.op.ed25519verify”

algopy.op.ed25519verify(a: algopy.Bytes | bytes, b: algopy.Bytes | bytes, c: algopy.Bytes | bytes, /) → bool

for (data A, signature B, pubkey C) verify the signature of (“ProgData” || program_hash || data) against the pubkey => {0 or 1} The 32 byte public key is the last element on the stack, preceded by the 64 byte signature at the second-to-last element on the stack, preceded by the data which was signed at the third-to-last element on the stack.

Native TEAL opcode: ed25519verify

algopy.op.ed25519verify_bare

Section titled “algopy.op.ed25519verify_bare”

algopy.op.ed25519verify_bare(a: algopy.Bytes | bytes, b: algopy.Bytes | bytes, c: algopy.Bytes | bytes, /) → bool

for (data A, signature B, pubkey C) verify the signature of the data against the pubkey => {0 or 1}

Native TEAL opcode: ed25519verify_bare

algopy.op.err

Section titled “algopy.op.err”

algopy.op.err() → Never

Fail immediately.

Native TEAL opcode: err

algopy.op.exit

Section titled “algopy.op.exit”

algopy.op.exit(a: algopy.UInt64 | int, /) → Never

use A as success value; end

Native TEAL opcode: return

algopy.op.exp

Section titled “algopy.op.exp”

algopy.op.exp(a: algopy.UInt64 | int, b: algopy.UInt64 | int, /) → algopy.UInt64

A raised to the Bth power. Fail if A == B == 0 and on overflow

Native TEAL opcode: exp

algopy.op.expw

Section titled “algopy.op.expw”

algopy.op.expw(a: algopy.UInt64 | int, b: algopy.UInt64 | int, /) → tuple[ algopy.UInt64, algopy.UInt64]

A raised to the Bth power as a 128-bit result in two uint64s. X is the high 64 bits, Y is the low. Fail if A == B == 0 or if the results exceeds 2^128-1

Native TEAL opcode: expw

algopy.op.extract

Section titled “algopy.op.extract”

algopy.op.extract(a: algopy.Bytes | bytes, b: algopy.UInt64 | int, c: algopy.UInt64 | int, /) → algopy.Bytes

A range of bytes from A starting at B up to but not including B+C. If B+C is larger than the array length, the program fails extract3 can be called using extract with no immediates.

Native TEAL opcode: extract, extract3

algopy.op.extract_uint16

Section titled “algopy.op.extract_uint16”

algopy.op.extract_uint16(a: algopy.Bytes | bytes, b: algopy.UInt64 | int, /) → algopy.UInt64

A uint16 formed from a range of big-endian bytes from A starting at B up to but not including B+2. If B+2 is larger than the array length, the program fails

Native TEAL opcode: extract_uint16

algopy.op.extract_uint32

Section titled “algopy.op.extract_uint32”

algopy.op.extract_uint32(a: algopy.Bytes | bytes, b: algopy.UInt64 | int, /) → algopy.UInt64

A uint32 formed from a range of big-endian bytes from A starting at B up to but not including B+4. If B+4 is larger than the array length, the program fails

Native TEAL opcode: extract_uint32

algopy.op.extract_uint64

Section titled “algopy.op.extract_uint64”

algopy.op.extract_uint64(a: algopy.Bytes | bytes, b: algopy.UInt64 | int, /) → algopy.UInt64

A uint64 formed from a range of big-endian bytes from A starting at B up to but not including B+8. If B+8 is larger than the array length, the program fails

Native TEAL opcode: extract_uint64

algopy.op.falcon_verify

Section titled “algopy.op.falcon_verify”

algopy.op.falcon_verify(a: algopy.Bytes | bytes, b: algopy.Bytes | bytes, c: algopy.Bytes | bytes, /) → bool

for (data A, compressed-format signature B, pubkey C) verify the signature of data against the pubkey => {0 or 1} Min AVM version: 12

Native TEAL opcode: falcon_verify

algopy.op.gaid

Section titled “algopy.op.gaid”

algopy.op.gaid(a: algopy.UInt64 | int, /) → algopy.UInt64

ID of the asset or application created in the Ath transaction of the current group gaids fails unless the requested transaction created an asset or application and A < GroupIndex.

Native TEAL opcode: gaid, gaids

algopy.op.getbit

Section titled “algopy.op.getbit”

algopy.op.getbit(a: algopy.Bytes | algopy.UInt64 | bytes | int, b: algopy.UInt64 | int, /) → bool

Bth bit of (byte-array or integer) A. If B is greater than or equal to the bit length of the value (8*byte length), the program fails see explanation of bit ordering in setbit

Native TEAL opcode: getbit

algopy.op.getbyte

Section titled “algopy.op.getbyte”

algopy.op.getbyte(a: algopy.Bytes | bytes, b: algopy.UInt64 | int, /) → algopy.UInt64

Bth byte of A, as an integer. If B is greater than or equal to the array length, the program fails

Native TEAL opcode: getbyte

algopy.op.gload_bytes

Section titled “algopy.op.gload_bytes”

algopy.op.gload_bytes(a: algopy.UInt64 | int, b: algopy.UInt64 | int, /) → algopy.Bytes

Bth scratch space value of the Ath transaction in the current group

Native TEAL opcode: gload, gloads, gloadss

algopy.op.gload_uint64

Section titled “algopy.op.gload_uint64”

algopy.op.gload_uint64(a: algopy.UInt64 | int, b: algopy.UInt64 | int, /) → algopy.UInt64

Bth scratch space value of the Ath transaction in the current group

algopy.op.itob

Section titled “algopy.op.itob”

algopy.op.itob(a: algopy.UInt64 | int, /) → algopy.Bytes

converts uint64 A to big-endian byte array, always of length 8

Native TEAL opcode: itob

algopy.op.keccak256

Section titled “algopy.op.keccak256”

algopy.op.keccak256(a: algopy.Bytes | bytes, /) → algopy.Bytes

Keccak256 hash of value A, yields [32]byte

Native TEAL opcode: keccak256

algopy.op.mimc

Section titled “algopy.op.mimc”

algopy.op.mimc(c: algopy.op.MiMCConfigurations, a: algopy.Bytes | bytes, /) → algopy.Bytes

MiMC hash of scalars A, using curve and parameters specified by configuration C A is a list of concatenated 32 byte big-endian unsigned integer scalars. Fail if A’s length is not a multiple of 32 or any element exceeds the curve modulus.

The MiMC hash function has known collisions since any input which is a multiple of the elliptic curve modulus will hash to the same value. MiMC is thus not a general purpose hash function, but meant to be used in zero knowledge applications to match a zk-circuit implementation. Min AVM version: 11

Native TEAL opcode: mimc

algopy.op.min_balance

Section titled “algopy.op.min_balance”

algopy.op.min_balance(a: algopy.Account | algopy.UInt64 | int, /) → algopy.UInt64

minimum required balance for account A, in microalgos. Required balance is affected by ASA, App, and Box usage. When creating or opting into an app, the minimum balance grows before the app code runs, therefore the increase is visible there. When deleting or closing out, the minimum balance decreases after the app executes. Changes caused by inner transactions or box usage are observable immediately following the opcode effecting the change. params: Txn.Accounts offset (or, since v4, an available account address), available application id (or, since v4, a Txn.ForeignApps offset). Return: value.

Native TEAL opcode: min_balance

algopy.op.mulw

Section titled “algopy.op.mulw”

algopy.op.mulw(a: algopy.UInt64 | int, b: algopy.UInt64 | int, /) → tuple[ algopy.UInt64, algopy.UInt64]

A times B as a 128-bit result in two uint64s. X is the high 64 bits, Y is the low

Native TEAL opcode: mulw

algopy.op.online_stake

Section titled “algopy.op.online_stake”

algopy.op.online_stake() → algopy.UInt64

the total online stake in the agreement round Min AVM version: 11

Native TEAL opcode: online_stake

algopy.op.replace

Section titled “algopy.op.replace”

algopy.op.replace(a: algopy.Bytes | bytes, b: algopy.UInt64 | int, c: algopy.Bytes | bytes, /) → algopy.Bytes

Copy of A with the bytes starting at B replaced by the bytes of C. Fails if B+len(C) exceeds len(A) replace3 can be called using replace with no immediates.

Native TEAL opcode: replace2, replace3

algopy.op.select_bytes

Section titled “algopy.op.select_bytes”

algopy.op.select_bytes(a: algopy.Bytes | bytes, b: algopy.Bytes | bytes, c: bool | algopy.UInt64 | int, /) → algopy.Bytes

selects one of two values based on top-of-stack: B if C != 0, else A

Native TEAL opcode: select

algopy.op.select_uint64

Section titled “algopy.op.select_uint64”

algopy.op.select_uint64(a: algopy.UInt64 | int, b: algopy.UInt64 | int, c: bool | algopy.UInt64 | int, /) → algopy.UInt64

selects one of two values based on top-of-stack: B if C != 0, else A

Native TEAL opcode: select

algopy.op.setbit_bytes

Section titled “algopy.op.setbit_bytes”

algopy.op.setbit_bytes(a: algopy.Bytes | bytes, b: algopy.UInt64 | int, c: bool, /) → algopy.Bytes

Copy of (byte-array or integer) A, with the Bth bit set to (0 or 1) C. If B is greater than or equal to the bit length of the value (8*byte length), the program fails When A is a uint64, index 0 is the least significant bit. Setting bit 3 to 1 on the integer 0 yields 8, or 2^3. When A is a byte array, index 0 is the leftmost bit of the leftmost byte. Setting bits 0 through 11 to 1 in a 4-byte-array of 0s yields the byte array 0xfff00000. Setting bit 3 to 1 on the 1-byte-array 0x00 yields the byte array 0x10.

Native TEAL opcode: setbit

algopy.op.setbit_uint64

Section titled “algopy.op.setbit_uint64”

algopy.op.setbit_uint64(a: algopy.UInt64 | int, b: algopy.UInt64 | int, c: bool, /) → algopy.UInt64

Native TEAL opcode: setbit

algopy.op.setbyte

Section titled “algopy.op.setbyte”

algopy.op.setbyte(a: algopy.Bytes | bytes, b: algopy.UInt64 | int, c: algopy.UInt64 | int, /) → algopy.Bytes

Copy of A with the Bth byte set to small integer (between 0..255) C. If B is greater than or equal to the array length, the program fails

Native TEAL opcode: setbyte

algopy.op.sha256

Section titled “algopy.op.sha256”

algopy.op.sha256(a: algopy.Bytes | bytes, /) → algopy.Bytes

SHA256 hash of value A, yields [32]byte

Native TEAL opcode: sha256

algopy.op.sha3_256

Section titled “algopy.op.sha3_256”

algopy.op.sha3_256(a: algopy.Bytes | bytes, /) → algopy.Bytes

SHA3_256 hash of value A, yields [32]byte

Native TEAL opcode: sha3_256

algopy.op.sha512_256

Section titled “algopy.op.sha512_256”

algopy.op.sha512_256(a: algopy.Bytes | bytes, /) → algopy.Bytes

SHA512_256 hash of value A, yields [32]byte

Native TEAL opcode: sha512_256

algopy.op.shl

Section titled “algopy.op.shl”

algopy.op.shl(a: algopy.UInt64 | int, b: algopy.UInt64 | int, /) → algopy.UInt64

A times 2^B, modulo 2^64

Native TEAL opcode: shl

algopy.op.shr

Section titled “algopy.op.shr”

algopy.op.shr(a: algopy.UInt64 | int, b: algopy.UInt64 | int, /) → algopy.UInt64

A divided by 2^B

Native TEAL opcode: shr

algopy.op.sqrt

Section titled “algopy.op.sqrt”

algopy.op.sqrt(a: algopy.UInt64 | int, /) → algopy.UInt64

The largest integer I such that I^2 <= A

Native TEAL opcode: sqrt

algopy.op.substring

Section titled “algopy.op.substring”

algopy.op.substring(a: algopy.Bytes | bytes, b: algopy.UInt64 | int, c: algopy.UInt64 | int, /) → algopy.Bytes

A range of bytes from A starting at B up to but not including C. If C < B, or either is larger than the array length, the program fails

Native TEAL opcode: substring, substring3

algopy.op.sumhash512

Section titled “algopy.op.sumhash512”

algopy.op.sumhash512(a: algopy.Bytes | bytes, /) → algopy.Bytes

sumhash512 of value A, yields [64]byte Min AVM version: 13

Native TEAL opcode: sumhash512

algopy.op.vrf_verify

Section titled “algopy.op.vrf_verify”

algopy.op.vrf_verify(s: algopy.op.VrfVerify, a: algopy.Bytes | bytes, b: algopy.Bytes | bytes, c: algopy.Bytes | bytes, /) → tuple[ algopy.Bytes, bool]

Verify the proof B of message A against pubkey C. Returns vrf output and verification flag. VrfAlgorand is the VRF used in Algorand. It is ECVRF-ED25519-SHA512-Elligator2, specified in the IETF internet draft draft-irtf-cfrg-vrf-03.

Native TEAL opcode: vrf_verify

Ask AI

reCAPTCHA

Recaptcha requires verification.

protected by reCAPTCHA