# algopy

## Package Contents

[Section titled “Package Contents”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#package-contents)

### Classes

[Section titled “Classes”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#classes)

| [`ARC4Contract`](https://dev.algorand.co/reference/algorand-python/api/api-algopyarc4/#algopy.arc4.ARC4Contract) | A contract that conforms to the ARC-4 ABI specification, functions decorated with<br>`@abimethod` or `@baremethod` will form the public interface of the contract |
| --- | --- |
| [`Account`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account) | An Account on the Algorand network. |
| [`Application`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Application) | An Application on the Algorand network. |
| [`Array`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Array) | A dynamically sized Array of the specified type |
| [`Asset`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Asset) | An Asset on the Algorand network. |
| [`BigUInt`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) | A variable length (max 512-bit) unsigned integer |
| [`Box`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Box) | Box abstracts the reading and writing of a single value to a single box.<br>The box size will be reconfigured dynamically to fit the size of the value being assigned to<br>it. |
| [`BoxMap`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BoxMap) | BoxMap abstracts the reading and writing of a set of boxes using a common key and content type.<br>Each composite key (prefix + key) still needs to be made available to the application via the<br>`boxes` property of the Transaction. |
| [`BoxRef`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BoxRef) | BoxRef abstracts the reading and writing of boxes containing raw binary data. The size is<br>configured manually, and can be set to values larger than what the AVM can handle in a single<br>value. |
| [`Bytes`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) | A byte sequence, with a maximum length of 4096 bytes, one of the primary data types on the AVM |
| [`BytesBacked`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BytesBacked) | Represents a type that is a single bytes value |
| [`CompiledContract`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.CompiledContract) | Provides compiled programs and state allocation values for a Contract.<br>Create by calling [`compile_contract`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.compile_contract). |
| [`CompiledLogicSig`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.CompiledLogicSig) | Provides account for a Logic Signature.<br>Create by calling [`compile_logicsig`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.compile_logicsig). |
| [`Contract`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Contract) | Base class for an Algorand Smart Contract |
| [`FixedArray`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.FixedArray) | A fixed length Array of the specified type and length |
| [`Global`](https://dev.algorand.co/reference/algorand-python/api/api-algopyop/#algopy.op.Global) | Get Global values<br>Native TEAL op: [`global`](https://dev.algorand.co/reference/algorand-teal/opcodes/#global) |
| [`GlobalState`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.GlobalState) | Global state associated with the application, the key will be the name of the member, this<br>is assigned to |
| [`ImmutableArray`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.ImmutableArray) | An immutable array that supports fixed and dynamically sized immutable elements.<br>Modifications are done by returning a new copy of the array with the modifications applied. |
| [`ImmutableFixedArray`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.ImmutableFixedArray) | An immutable fixed length Array of the specified type and length |
| [`LocalState`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.LocalState) | Local state associated with the application and an account |
| [`LogicSig`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.LogicSig) | A logic signature |
| [`OnCompleteAction`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.OnCompleteAction) | On Completion actions available in an application call transaction |
| [`OpUpFeeSource`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.OpUpFeeSource) | Defines the source of fees for the OpUp utility. |
| [`ReferenceArray`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.ReferenceArray) | A mutable array that supports fixed sized immutable elements. All references to this array<br>will see any updates made to it. |
| [`StateTotals`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.StateTotals) | Options class to manually define the total amount of global and local state contract will use,<br>used by [`Contract.__init_subclass__`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Contract.__init_subclass__). |
| [`String`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.String) | A UTF-8 encoded string. |
| [`Struct`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Struct) | Base class for Struct types |
| [`TransactionType`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.TransactionType) | The different transaction types available in a transaction |
| [`Txn`](https://dev.algorand.co/reference/algorand-python/api/api-algopyop/#algopy.op.Txn) | Get values for the current executing transaction<br>Native TEAL ops: [`txn`](https://dev.algorand.co/reference/algorand-teal/opcodes/#txn), [`txnas`](https://dev.algorand.co/reference/algorand-teal/opcodes/#txnas) |
| [`UInt64`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) | A 64-bit unsigned integer, one of the primary data types on the AVM |
| [`uenumerate`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.uenumerate) | Yields pairs containing a count (from zero) and a value yielded by the iterable argument. |
| [`urange`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.urange) | Produces a sequence of UInt64 from start (inclusive) to stop (exclusive) by step. |

### Functions

[Section titled “Functions”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#functions)

| [`compile_contract`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.compile_contract) | Returns the compiled data for the specified contract |
| --- | --- |
| [`compile_logicsig`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.compile_logicsig) | Returns the Account for the specified logic signature |
| [`ensure_budget`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.ensure_budget) | Ensure the available op code budget is greater than or equal to required\_budget |
| [`log`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.log) | Concatenates and logs supplied args as a single bytes value. |
| [`logicsig`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.logicsig) | Decorator to indicate a function is a logic signature |
| [`size_of`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.size_of) | Returns the number of bytes required to store the provided type object<br>or the type of provided expression |
| [`subroutine`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.subroutine) | Decorator to indicate functions or methods that can be called by a Smart Contract |
| [`zero_bytes`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.zero_bytes) | Initializes a new value of the specified type, based on it’s zero bytes representation. |

### Data

[Section titled “Data”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#data)

| [`TemplateVar`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.TemplateVar) | Template variables can be used to represent a placeholder for a deploy-time provided value. |
| --- | --- |

### API

[Section titled “API”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#api)

#### _class_ algopy.ARC4Contract

[Section titled “class algopy.ARC4Contract”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopyarc4contract)

A contract that conforms to the ARC-4 ABI specification, functions decorated with
`@abimethod` or `@baremethod` will form the public interface of the contract

The approval\_program will be implemented by the compiler, and route application args
according to the ARC-4 ABI specification

The clear\_state\_program will by default return True, but can be overridden

##### _classmethod_ \_\_init _subclass_\_

[Section titled “classmethod \_\_initsubclass\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#classmethod-__initsubclass_)

\* _classmethod_ \_\_init _subclass_\_(\*, name: [str](https://docs.python.org/3/library/stdtypes.html#str) = …, scratch\_slots: [algopy.urange](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.urange) \| [tuple](https://docs.python.org/3/library/stdtypes.html#tuple)\[ [int](https://docs.python.org/3/library/functions.html#int) \| [algopy.urange](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.urange), …\] \| [list](https://docs.python.org/3/library/stdtypes.html#list)\[ [int](https://docs.python.org/3/library/functions.html#int) \| [algopy.urange](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.urange)\] = …, state\_totals: [algopy.StateTotals](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.StateTotals) = …, avm\_version: [int](https://docs.python.org/3/library/functions.html#int) = …)\*

When declaring a Contract subclass, options and configuration are passed in
the base class list:

```
class MyContract(algopy.Contract, name="CustomName"):

...
```

- **Parameters:**
  - **name** –

Will affect the output TEAL file name if there are multiple non-abstract contracts
    in the same file.

If the contract is a subclass of algopy.ARC4Contract, `name` will also be used as the
    contract name in the ARC-32 application.json, instead of the class name.

- **scratch\_slots** –

Allows you to mark a slot ID or range of slot IDs as “off limits” to Puya.
    These slot ID(s) will never be written to or otherwise manipulating by the compiler itself.
    This is particularly useful in combination with `algopy.op.gload_bytes` / `algopy.op.gload_uint64`
    which lets a contract in a group transaction read from the scratch slots of another contract
    that occurs earlier in the transaction group.

In the case of inheritance, scratch slots reserved become cumulative. It is not an error
    to have overlapping ranges or values either, so if a base class contract reserves slots
    0-5 inclusive and the derived contract reserves 5-10 inclusive, then within the derived
    contract all slots 0-10 will be marked as reserved.

- **state\_totals** –

Allows defining what values should be used for global and local uint and bytes storage
    values when creating a contract. Used when outputting ARC-32 application.json schemas.

If let unspecified, the totals will be determined by the compiler based on state
    variables assigned to `self`.

This setting is not inherited, and only applies to the exact `Contract` it is specified
    on. If a base class does specify this setting, and a derived class does not, a warning
    will be emitted for the derived class. To resolve this warning, `state_totals` must be
    specified. Note that it is valid to not provide any arguments to the `StateTotals`
    constructor, like so `state_totals=StateTotals()`, in which case all values will be
    automatically calculated.

- **avm\_version** – Determines which AVM version to use, this affects what operations are supported.
    Defaults to value provided supplied on command line (which defaults to current mainnet version)

##### approval\_program

[Section titled “approval\_program”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#approval_program)

_approval\_program() → [bool](https://docs.python.org/3/library/functions.html#bool)_

Represents the program called for all transactions
where `OnCompletion` != `ClearState`

##### clear\_state\_program

[Section titled “clear\_state\_program”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#clear_state_program)

_clear\_state\_program() → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [bool](https://docs.python.org/3/library/functions.html#bool)_

Represents the program called when `OnCompletion` == `ClearState`

#### _class_ algopy.Account

[Section titled “class algopy.Account”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopyaccount)

\* _class_ algopy.Account(value: [str](https://docs.python.org/3/library/stdtypes.html#str) \| [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) = …, /)\*

An Account on the Algorand network.

Note: must be an available resource to access properties other than `bytes`

##### Initialization

[Section titled “Initialization”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#initialization)

If `value` is a string, it should be a 58 character base32 string,
ie a base32 string-encoded 32 bytes public key + 4 bytes checksum.
If `value` is a Bytes, it’s length checked to be 32 bytes - to avoid this
check, use `Address.from_bytes(...)` instead.
Defaults to the zero-address.

##### \_\_bool\_\_

[Section titled “\_\_bool\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__bool__)

_\_\_bool\_\_() → [bool](https://docs.python.org/3/library/functions.html#bool)_

Returns `True` if not equal to the zero-address

##### \_\_eq\_\_

[Section titled “\_\_eq\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__eq__)

_\_\_eq\_\_(other: [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account) \| [str](https://docs.python.org/3/library/stdtypes.html#str)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

Account equality is determined by the address of another `Account` or `str`

##### \_\_ne\_\_

[Section titled “\_\_ne\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ne__)

_\_\_ne\_\_(other: [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account) \| [str](https://docs.python.org/3/library/stdtypes.html#str)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

Account equality is determined by the address of another `Account` or `str`

##### _property_ auth\_address \*: \[algopy.Account\]

[Section titled “property auth\_address \*: \[algopy.Account\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-auth_address--algopyaccount)

_property auth\_address : [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)_

Address the account is rekeyed to

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note)

Account must be an available resource

##### _property_ balance \*: \[algopy.UInt64\]

[Section titled “property balance \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-balance--algopyuint64)

_property balance : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Account balance in microalgos

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-1)

Account must be an available resource

##### _property_ bytes \*: \[algopy.Bytes\]

[Section titled “property bytes \*: \[algopy.Bytes\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-bytes--algopybytes)

_property bytes : [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Get the underlying Bytes

##### _classmethod_ from\_bytes

[Section titled “classmethod from\_bytes”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#classmethod-from_bytes)

\* _classmethod_ from\_bytes(value: [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [bytes](https://docs.python.org/3/library/stdtypes.html#bytes), /) → [Self](https://docs.python.org/3/library/typing.html#typing.Self)\*

Construct an instance from the underlying bytes (no validation)

##### is\_opted\_in

[Section titled “is\_opted\_in”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#is_opted_in)

_is\_opted\_in(asset\_or\_app: [algopy.Asset](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Asset) \| [algopy.Application](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Application), /) → [bool](https://docs.python.org/3/library/functions.html#bool)_

Returns true if this account is opted in to the specified Asset or Application.

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-2)

Account and Asset/Application must be an available resource

##### _property_ min\_balance \*: \[algopy.UInt64\]

[Section titled “property min\_balance \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-min_balance--algopyuint64)

_property min\_balance : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Minimum required balance for account, in microalgos

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-3)

Account must be an available resource

##### _property_ total\_apps\_created \*: \[algopy.UInt64\]

[Section titled “property total\_apps\_created \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-total_apps_created--algopyuint64)

_property total\_apps\_created : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

The number of existing apps created by this account.

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-4)

Account must be an available resource

##### _property_ total\_apps\_opted\_in \*: \[algopy.UInt64\]

[Section titled “property total\_apps\_opted\_in \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-total_apps_opted_in--algopyuint64)

_property total\_apps\_opted\_in : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

The number of apps this account is opted into.

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-5)

Account must be an available resource

##### _property_ total\_assets \*: \[algopy.UInt64\]

[Section titled “property total\_assets \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-total_assets--algopyuint64)

_property total\_assets : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

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

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-6)

Account must be an available resource

##### _property_ total\_assets\_created \*: \[algopy.UInt64\]

[Section titled “property total\_assets\_created \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-total_assets_created--algopyuint64)

_property total\_assets\_created : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

The number of existing ASAs created by this account.

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-7)

Account must be an available resource

##### _property_ total\_box\_bytes \*: \[algopy.UInt64\]

[Section titled “property total\_box\_bytes \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-total_box_bytes--algopyuint64)

_property total\_box\_bytes : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

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

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-8)

Account must be an available resource

##### _property_ total\_boxes \*: \[algopy.UInt64\]

[Section titled “property total\_boxes \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-total_boxes--algopyuint64)

_property total\_boxes : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

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

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-9)

Account must be an available resource

##### _property_ total\_extra\_app\_pages \*: \[algopy.UInt64\]

[Section titled “property total\_extra\_app\_pages \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-total_extra_app_pages--algopyuint64)

_property total\_extra\_app\_pages : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

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

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-10)

Account must be an available resource

##### _property_ total\_num\_byte\_slice \*: \[algopy.UInt64\]

[Section titled “property total\_num\_byte\_slice \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-total_num_byte_slice--algopyuint64)

_property total\_num\_byte\_slice : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

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

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-11)

Account must be an available resource

##### _property_ total\_num\_uint \*: \[algopy.UInt64\]

[Section titled “property total\_num\_uint \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-total_num_uint--algopyuint64)

_property total\_num\_uint : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

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

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-12)

Account must be an available resource

##### validate

[Section titled “validate”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#validate)

_validate() → [None](https://docs.python.org/3/library/constants.html#None)_

Performs validation to ensure the value is well-formed, errors if it is not

#### _class_ algopy.Application

[Section titled “class algopy.Application”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopyapplication)

\* _class_ algopy.Application(application\_id: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int) = 0, /)\*

An Application on the Algorand network.

##### Initialization

[Section titled “Initialization”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#initialization-1)

Initialized with the id of an application. Defaults to zero (an invalid ID).

##### \_\_bool\_\_

[Section titled “\_\_bool\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__bool__-1)

_\_\_bool\_\_() → [bool](https://docs.python.org/3/library/functions.html#bool)_

Returns `True` if `application_id` is not `0`

##### \_\_eq\_\_

[Section titled “\_\_eq\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__eq__-1)

_\_\_eq\_\_(other: [algopy.Application](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Application)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

Application equality is determined by the equality of an Application’s id

##### \_\_ne\_\_

[Section titled “\_\_ne\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ne__-1)

_\_\_ne\_\_(other: [algopy.Application](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Application)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

Application equality is determined by the equality of an Application’s id

##### _property_ address \*: \[algopy.Account\]

[Section titled “property address \*: \[algopy.Account\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-address--algopyaccount)

_property address : [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)_

Address for which this application has authority

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-13)

Application must be an available resource

##### _property_ approval\_program \*: \[algopy.Bytes\]

[Section titled “property approval\_program \*: \[algopy.Bytes\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-approval_program--algopybytes)

_property approval\_program : [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Bytecode of Approval Program

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-14)

Application must be an available resource

##### _property_ clear\_state\_program \*: \[algopy.Bytes\]

[Section titled “property clear\_state\_program \*: \[algopy.Bytes\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-clear_state_program--algopybytes)

_property clear\_state\_program : [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Bytecode of Clear State Program

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-15)

Application must be an available resource

##### _property_ creator \*: \[algopy.Account\]

[Section titled “property creator \*: \[algopy.Account\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-creator--algopyaccount)

_property creator : [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)_

Creator address

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-16)

Application must be an available resource

##### _property_ extra\_program\_pages \*: \[algopy.UInt64\]

[Section titled “property extra\_program\_pages \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-extra_program_pages--algopyuint64)

_property extra\_program\_pages : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Number of Extra Program Pages of code space

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-17)

Application must be an available resource

##### _property_ global\_num\_bytes \*: \[algopy.UInt64\]

[Section titled “property global\_num\_bytes \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-global_num_bytes--algopyuint64)

_property global\_num\_bytes : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Number of byte array values allowed in Global State

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-18)

Application must be an available resource

##### _property_ global\_num\_uint \*: \[algopy.UInt64\]

[Section titled “property global\_num\_uint \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-global_num_uint--algopyuint64)

_property global\_num\_uint : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Number of uint64 values allowed in Global State

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-19)

Application must be an available resource

##### _property_ id \*: \[algopy.UInt64\]

[Section titled “property id \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-id--algopyuint64)

_property id : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Returns the id of the application

##### _property_ local\_num\_bytes \*: \[algopy.UInt64\]

[Section titled “property local\_num\_bytes \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-local_num_bytes--algopyuint64)

_property local\_num\_bytes : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Number of byte array values allowed in Local State

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-20)

Application must be an available resource

##### _property_ local\_num\_uint \*: \[algopy.UInt64\]

[Section titled “property local\_num\_uint \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-local_num_uint--algopyuint64)

_property local\_num\_uint : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Number of uint64 values allowed in Local State

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-21)

Application must be an available resource

##### _property_ version \*: \[algopy.UInt64\]

[Section titled “property version \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-version--algopyuint64)

_property version : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Version of the app, incremented each time the approval or clear program changes

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-22)

Application must be an available resource

#### _class_ algopy.Array

[Section titled “class algopy.Array”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopyarray)

A dynamically sized Array of the specified type

##### \_\_add\_\_

[Section titled “\_\_add\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__add__)

\_\_\_add\_\_(other: [collections.abc.Iterable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterable)\[algopy.\_TArrayItem\]) → [algopy.Array](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Array)\[algopy. _TArrayItem\]_

Concat two arrays together, returning a new array

##### \_\_bool\_\_

[Section titled “\_\_bool\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__bool__-2)

_\_\_bool\_\_() → [bool](https://docs.python.org/3/library/functions.html#bool)_

Returns `True` if not an empty array

##### \_\_getitem\_\_

[Section titled “\_\_getitem\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__getitem__)

_\_\_getitem\_\_(index: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → algopy.\_TArrayItem_

Gets the item of the array at provided index

##### \_\_reversed\_\_

[Section titled “\_\_reversed\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__reversed__)

\_\_\_reversed\_\_() → [Iterator](https://docs.python.org/3/library/typing.html#typing.Iterator)\[algopy. _TArrayItem\]_

Returns an iterator for the items in the array, in reverse order

##### \_\_setitem\_\_

[Section titled “\_\_setitem\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__setitem__)

_\_\_setitem\_\_(index: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int), value: algopy.\_TArrayItem) → algopy.\_TArrayItem_

Sets the item of the array at specified index to provided value

##### append

[Section titled “append”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#append)

_append(item: algopy.\_TArrayItem, /) → [None](https://docs.python.org/3/library/constants.html#None)_

Append an item to this array

##### copy

[Section titled “copy”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#copy)

_copy() → [Self](https://docs.python.org/3/library/typing.html#typing.Self)_

Create a copy of this array

##### extend

[Section titled “extend”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#extend)

\_extend(other: [collections.abc.Iterable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterable)\[algopy. _TArrayItem\], /) → [None](https://docs.python.org/3/library/constants.html#None)_

Extend this array with the contents of another array

##### freeze

[Section titled “freeze”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#freeze)

\_freeze() → [algopy.ImmutableArray](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.ImmutableArray)\[algopy. _TArrayItem\]_

Returns an immutable copy of this array

##### _property_ length \*: \[algopy.UInt64\]

[Section titled “property length \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-length--algopyuint64)

_property length : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Returns the current length of the array

##### pop

[Section titled “pop”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#pop)

_pop() → algopy.\_TArrayItem_

Remove and return the last item of this array

##### validate

[Section titled “validate”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#validate-1)

_validate() → [None](https://docs.python.org/3/library/constants.html#None)_

Performs validation to ensure the value is well-formed, errors if it is not

#### _class_ algopy.Asset

[Section titled “class algopy.Asset”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopyasset)

\* _class_ algopy.Asset(asset\_id: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int) = 0, /)\*

An Asset on the Algorand network.

##### Initialization

[Section titled “Initialization”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#initialization-2)

Initialized with the id of an asset. Defaults to zero (an invalid ID).

##### \_\_bool\_\_

[Section titled “\_\_bool\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__bool__-3)

_\_\_bool\_\_() → [bool](https://docs.python.org/3/library/functions.html#bool)_

Returns `True` if `asset_id` is not `0`

##### \_\_eq\_\_

[Section titled “\_\_eq\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__eq__-2)

_\_\_eq\_\_(other: [algopy.Asset](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Asset)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

Asset equality is determined by the equality of an Asset’s id

##### \_\_ne\_\_

[Section titled “\_\_ne\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ne__-2)

_\_\_ne\_\_(other: [algopy.Asset](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Asset)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

Asset equality is determined by the equality of an Asset’s id

##### balance

[Section titled “balance”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#balance)

_balance(account: [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account), /) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Amount of the asset unit held by this account. Fails if the account has not
opted in to the asset.

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-23)

Asset and supplied Account must be an available resource

##### _property_ clawback \*: \[algopy.Account\]

[Section titled “property clawback \*: \[algopy.Account\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-clawback--algopyaccount)

_property clawback : [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)_

Clawback address

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-24)

Asset must be an available resource

##### _property_ creator \*: \[algopy.Account\]

[Section titled “property creator \*: \[algopy.Account\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-creator--algopyaccount-1)

_property creator : [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)_

Creator address

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-25)

Asset must be an available resource

##### _property_ decimals \*: \[algopy.UInt64\]

[Section titled “property decimals \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-decimals--algopyuint64)

_property decimals : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

See AssetParams.Decimals

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-26)

Asset must be an available resource

##### _property_ default\_frozen \*: \[bool\]

[Section titled “property default\_frozen \*: \[bool\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-default_frozen--bool)

_property default\_frozen : [bool](https://docs.python.org/3/library/functions.html#bool)_

Frozen by default or not

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-27)

Asset must be an available resource

##### _property_ freeze \*: \[algopy.Account\]

[Section titled “property freeze \*: \[algopy.Account\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-freeze--algopyaccount)

_property freeze : [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)_

Freeze address

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-28)

Asset must be an available resource

##### frozen

[Section titled “frozen”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#frozen)

_frozen(account: [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account), /) → [bool](https://docs.python.org/3/library/functions.html#bool)_

Is the asset frozen or not. Fails if the account has not
opted in to the asset.

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-29)

Asset and supplied Account must be an available resource

##### _property_ id \*: \[algopy.UInt64\]

[Section titled “property id \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-id--algopyuint64-1)

_property id : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Returns the id of the Asset

##### _property_ manager \*: \[algopy.Account\]

[Section titled “property manager \*: \[algopy.Account\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-manager--algopyaccount)

_property manager : [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)_

Manager address

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-30)

Asset must be an available resource

##### _property_ metadata\_hash \*: \[algopy.Bytes\]

[Section titled “property metadata\_hash \*: \[algopy.Bytes\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-metadata_hash--algopybytes)

_property metadata\_hash : [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Arbitrary commitment

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-31)

Asset must be an available resource

##### _property_ name \*: \[algopy.Bytes\]

[Section titled “property name \*: \[algopy.Bytes\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-name--algopybytes)

_property name : [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Asset name

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-32)

Asset must be an available resource

##### _property_ reserve \*: \[algopy.Account\]

[Section titled “property reserve \*: \[algopy.Account\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-reserve--algopyaccount)

_property reserve : [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)_

Reserve address

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-33)

Asset must be an available resource

##### _property_ total \*: \[algopy.UInt64\]

[Section titled “property total \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-total--algopyuint64)

_property total : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Total number of units of this asset

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-34)

Asset must be an available resource

##### _property_ unit\_name \*: \[algopy.Bytes\]

[Section titled “property unit\_name \*: \[algopy.Bytes\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-unit_name--algopybytes)

_property unit\_name : [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Asset unit name

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-35)

Asset must be an available resource

##### _property_ url \*: \[algopy.Bytes\]

[Section titled “property url \*: \[algopy.Bytes\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-url--algopybytes)

_property url : [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

URL with additional info about the asset

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-36)

Asset must be an available resource

#### _class_ algopy.BigUInt

[Section titled “class algopy.BigUInt”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopybiguint)

\* _class_ algopy.BigUInt(value: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int) = 0, /)\*

A variable length (max 512-bit) unsigned integer

##### Initialization

[Section titled “Initialization”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#initialization-3)

A BigUInt can be initialized with a UInt64, a Python int literal, or an int variable
declared at the module level

##### \_\_add\_\_

[Section titled “\_\_add\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__add__-1)

_\_\_add\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can be added with another BigUInt, UInt64 or int e.g. `BigUInt(4) + 2`.

##### \_\_and\_\_

[Section titled “\_\_and\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__and__)

_\_\_and\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can bitwise and with another BigUInt, UInt64 or int e.g. `BigUInt(4) & 2`

##### \_\_bool\_\_

[Section titled “\_\_bool\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__bool__-4)

_\_\_bool\_\_() → [bool](https://docs.python.org/3/library/functions.html#bool)_

A BigUInt will evaluate to `False` if zero, and `True` otherwise

##### \_\_eq\_\_

[Section titled “\_\_eq\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__eq__-3)

_\_\_eq\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

A BigUInt can use the `==` operator with another BigUInt, UInt64 or int

##### \_\_floordiv\_\_

[Section titled “\_\_floordiv\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__floordiv__)

_\_\_floordiv\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can be floor divided with another BigUInt, UInt64 or int e.g. `BigUInt(4) // 2`.

This will error on divide by zero

##### \_\_ge\_\_

[Section titled “\_\_ge\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ge__)

_\_\_ge\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

A BigUInt can use the `>=` operator with another BigUInt, UInt64 or int

##### \_\_gt\_\_

[Section titled “\_\_gt\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__gt__)

_\_\_gt\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

A BigUInt can use the `>` operator with another BigUInt, UInt64 or int

##### \_\_iadd\_\_

[Section titled “\_\_iadd\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__iadd__)

_\_\_iadd\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can be incremented with another BigUInt, UInt64 or int e.g. `a += BigUInt(2)`.

##### \_\_iand\_\_

[Section titled “\_\_iand\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__iand__)

_\_\_iand\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can bitwise and with another BigUInt, UInt64 or int e.g. `a &= BigUInt(2)`

##### \_\_ifloordiv\_\_

[Section titled “\_\_ifloordiv\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ifloordiv__)

_\_\_ifloordiv\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can be floor divided with another BigUInt, UInt64 or int e.g. `a //= BigUInt(2)`.

This will error on divide by zero

##### \_\_imod\_\_

[Section titled “\_\_imod\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__imod__)

_\_\_imod\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can be modded with another BigUInt, UInt64 or int e.g. `a %= BigUInt(2)`.

This will error on mod by zero

##### \_\_imul\_\_

[Section titled “\_\_imul\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__imul__)

_\_\_imul\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can be multiplied with another BigUInt, UInt64 or int e.g. `a*= BigUInt(2)`.

##### \_\_ior\_\_

[Section titled “\_\_ior\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ior__)

_\_\_ior\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can bitwise or with another BigUInt, UInt64 or int e.g. `a |= BigUInt(2)`

##### \_\_isub\_\_

[Section titled “\_\_isub\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__isub__)

_\_\_isub\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can be subtracted with another BigUInt, UInt64 or int e.g. `a -= BigUInt(2)`.

This will error on underflow

##### \_\_ixor\_\_

[Section titled “\_\_ixor\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ixor__)

_\_\_ixor\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can bitwise xor with another BigUInt, UInt64 or int e.g. `a ^= BigUInt(2)`

##### \_\_le\_\_

[Section titled “\_\_le\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__le__)

_\_\_le\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

A BigUInt can use the `<=` operator with another BigUInt, UInt64 or int

##### \_\_lt\_\_

[Section titled “\_\_lt\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__lt__)

_\_\_lt\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

A BigUInt can use the `<` operator with another BigUInt, UInt64 or int

##### \_\_mod\_\_

[Section titled “\_\_mod\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__mod__)

_\_\_mod\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can be modded with another BigUInt, UInt64 or int e.g. `BigUInt(4) % 2`.

This will error on mod by zero

##### \_\_mul\_\_

[Section titled “\_\_mul\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__mul__)

_\_\_mul\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can be multiplied with another BigUInt, UInt64 or int e.g. `4 + BigUInt(2)`.

##### \_\_ne\_\_

[Section titled “\_\_ne\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ne__-3)

_\_\_ne\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

A BigUInt can use the `!=` operator with another BigUInt, UInt64 or int

##### \_\_or\_\_

[Section titled “\_\_or\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__or__)

_\_\_or\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can bitwise or with another BigUInt, UInt64 or int e.g. `BigUInt(4) | 2`

##### \_\_pos\_\_

[Section titled “\_\_pos\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__pos__)

_\_\_pos\_\_() → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

Supports unary + operator. Redundant given the type is unsigned

##### \_\_radd\_\_

[Section titled “\_\_radd\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__radd__)

_\_\_radd\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can be added with another BigUInt, UInt64 or int e.g. `4 + BigUInt(2)`.

##### \_\_rand\_\_

[Section titled “\_\_rand\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rand__)

_\_\_rand\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can bitwise and with another BigUInt, UInt64 or int e.g. `4 & BigUInt(2)`

##### \_\_rfloordiv\_\_

[Section titled “\_\_rfloordiv\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rfloordiv__)

_\_\_rfloordiv\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can be floor divided with another BigUInt, UInt64 or int e.g. `4 // BigUInt(2)`.

This will error on divide by zero

##### \_\_rmod\_\_

[Section titled “\_\_rmod\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rmod__)

_\_\_rmod\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can be modded with another BigUInt, UInt64 or int e.g. `4 % BigUInt(2)`.

This will error on mod by zero

##### \_\_rmul\_\_

[Section titled “\_\_rmul\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rmul__)

_\_\_rmul\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can be multiplied with another BigUInt, UInt64 or int e.g. `BigUInt(4) + 2`.

##### \_\_ror\_\_

[Section titled “\_\_ror\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ror__)

_\_\_ror\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can bitwise or with another BigUInt, UInt64 or int e.g. `4 | BigUInt(2)`

##### \_\_rsub\_\_

[Section titled “\_\_rsub\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rsub__)

_\_\_rsub\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can be subtracted with another BigUInt, UInt64 or int e.g. `4 - BigUInt(2)`.

This will error on underflow

##### \_\_rxor\_\_

[Section titled “\_\_rxor\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rxor__)

_\_\_rxor\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can bitwise xor with another BigUInt, UInt64 or int e.g. `4 ^ BigUInt(2)`

##### \_\_sub\_\_

[Section titled “\_\_sub\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__sub__)

_\_\_sub\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can be subtracted with another BigUInt, UInt64 or int e.g. `BigUInt(4) - 2`.

This will error on underflow

##### \_\_xor\_\_

[Section titled “\_\_xor\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__xor__)

_\_\_xor\_\_(other: [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.BigUInt](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BigUInt)_

A BigUInt can bitwise xor with another BigUInt, UInt64 or int e.g. `BigUInt(4) ^ 2`

##### _property_ bytes \*: \[algopy.Bytes\]

[Section titled “property bytes \*: \[algopy.Bytes\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-bytes--algopybytes-1)

_property bytes : [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Get the underlying Bytes

##### _classmethod_ from\_bytes

[Section titled “classmethod from\_bytes”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#classmethod-from_bytes-1)

Construct an instance from the underlying bytes (no validation)

#### _class_ algopy.Box

[Section titled “class algopy.Box”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopybox)

\* _class_ algopy.Box(type\_: [type](https://docs.python.org/3/library/functions.html#type)\[algopy.\_TValue\], /, \*, key: [bytes](https://docs.python.org/3/library/stdtypes.html#bytes) \| [str](https://docs.python.org/3/library/stdtypes.html#str) \| [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [algopy.String](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.String) = …)\*

Box abstracts the reading and writing of a single value to a single box.
The box size will be reconfigured dynamically to fit the size of the value being assigned to
it.

##### Initialization

[Section titled “Initialization”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#initialization-4)

##### \_\_bool\_\_

[Section titled “\_\_bool\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__bool__-5)

_\_\_bool\_\_() → [bool](https://docs.python.org/3/library/functions.html#bool)_

Returns True if the box exists, regardless of the truthiness of the contents
of the box

##### create

[Section titled “create”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#create)

_create(\*, size: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int) = …) → [bool](https://docs.python.org/3/library/functions.html#bool)_

Creates the box with the specified size setting all bits to zero.
If size is not specified and the type is a fixed size, then the storage size of the type
will be used.
Fails if the box already exists with a different size.
Fails if the specified size is greater than the max box size (32,768)
Fails if size is omitted and the type is not fixed size.

Returns True if the box was created, False if the box already existed

##### extract

[Section titled “extract”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#extract)

_extract(start\_index: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int), length: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Extract a slice of bytes from the box.

Fails if the box does not exist, or if `start_index + length > len(box)`

- **Parameters:**
  - **start\_index** – The offset to start extracting bytes from
  - **length** – The number of bytes to extract

##### get

[Section titled “get”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#get)

_get(\*, default: algopy.\_TValue) → algopy.\_TValue_

Retrieve the contents of the box, or return the default value if the box has not been
created.

- **Parameters:** **default** – The default value to return if the box has not been created

##### _property_ key \*: \[algopy.Bytes\]

[Section titled “property key \*: \[algopy.Bytes\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-key--algopybytes)

_property key : [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Provides access to the raw storage key

##### _property_ length \*: \[algopy.UInt64\]

[Section titled “property length \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-length--algopyuint64-1)

_property length : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Get the length of this Box. Fails if the box does not exist

##### maybe

[Section titled “maybe”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#maybe)

_maybe() → [tuple](https://docs.python.org/3/library/stdtypes.html#tuple)\[algopy.\_TValue, [bool](https://docs.python.org/3/library/functions.html#bool)\]_

Retrieve the contents of the box if it exists, and return a boolean indicating if the box
exists.

##### _property_ ref \*: \[algopy.BoxRef\]

[Section titled “property ref \*: \[algopy.BoxRef\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-ref--algopyboxref)

_property ref : [algopy.BoxRef](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.BoxRef)_

Provides a BoxRef for this box

##### replace

[Section titled “replace”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#replace)

_replace(start\_index: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int), value: [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [bytes](https://docs.python.org/3/library/stdtypes.html#bytes)) → [None](https://docs.python.org/3/library/constants.html#None)_

Write `value` to the box starting at `start_index`. Fails if the box does not exist,
or if `start_index + len(value) > len(box)`

- **Parameters:**
  - **start\_index** – The offset to start writing bytes from
  - **value** – The bytes to be written

##### resize

[Section titled “resize”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#resize)

_resize(new\_size: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [None](https://docs.python.org/3/library/constants.html#None)_

Resizes the box the specified `new_size`. Truncating existing data if the new value is
shorter or padding with zero bytes if it is longer.

- **Parameters:** **new\_size** – The new size of the box

##### splice

[Section titled “splice”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#splice)

_splice(start\_index: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int), length: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int), value: [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [bytes](https://docs.python.org/3/library/stdtypes.html#bytes)) → [None](https://docs.python.org/3/library/constants.html#None)_

set box to contain its previous bytes up to index `start_index`, followed by `bytes`,
followed by the original bytes of the box that began at index `start_index + length`

**Important: This op does not resize the box**
If the new value is longer than the box size, it will be truncated.
If the new value is shorter than the box size, it will be padded with zero bytes

- **Parameters:**
  - **start\_index** – The index to start inserting `value`
  - **length** – The number of bytes after `start_index` to omit from the new value
  - **value** – The `value` to be inserted.

##### _property_ value _: algopy.\_TValue_

[Section titled “property value : algopy.\_TValue”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-value--algopy_tvalue)

Retrieve the contents of the box. Fails if the box has not been created.

#### _class_ algopy.BoxMap

[Section titled “class algopy.BoxMap”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopyboxmap)

\* _class_ algopy.BoxMap(key\_type: [type](https://docs.python.org/3/library/functions.html#type)\[algopy.\_TKey\], value\_type: [type](https://docs.python.org/3/library/functions.html#type)\[algopy.\_TValue\], /, \*, key\_prefix: [bytes](https://docs.python.org/3/library/stdtypes.html#bytes) \| [str](https://docs.python.org/3/library/stdtypes.html#str) \| [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [algopy.String](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.String) = …)\*

BoxMap abstracts the reading and writing of a set of boxes using a common key and content type.
Each composite key (prefix + key) still needs to be made available to the application via the
`boxes` property of the Transaction.

##### Initialization

[Section titled “Initialization”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#initialization-5)

Declare a box map.

- **Parameters:**
  - **key\_type** – The type of the keys
  - **value\_type** – The type of the values
  - **key\_prefix** – The value used as a prefix to key data, can be empty.
    When the BoxMap is being assigned to a member variable,
    this argument is optional and defaults to the member variable name,
    and if a custom value is supplied it must be static.

##### \_\_contains\_\_

[Section titled “\_\_contains\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__contains__)

_\_\_contains\_\_(key: algopy.\_TKey) → [bool](https://docs.python.org/3/library/functions.html#bool)_

Returns True if a box with the specified key exists in the map, regardless of the
truthiness of the contents of the box

##### \_\_delitem\_\_

[Section titled “\_\_delitem\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__delitem__)

_\_\_delitem\_\_(key: algopy.\_TKey) → [None](https://docs.python.org/3/library/constants.html#None)_

Deletes a keyed box

##### \_\_getitem\_\_

[Section titled “\_\_getitem\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__getitem__-1)

_\_\_getitem\_\_(key: algopy.\_TKey) → algopy.\_TValue_

Retrieve the contents of a keyed box. Fails if the box for the key has not been created.

##### \_\_setitem\_\_

[Section titled “\_\_setitem\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__setitem__-1)

_\_\_setitem\_\_(key: algopy.\_TKey, value: algopy.\_TValue) → [None](https://docs.python.org/3/library/constants.html#None)_

Write _value_ to a keyed box. Creates the box if it does not exist

##### box

[Section titled “box”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#box)

\_box(key: algopy.\_TKey) → [algopy.Box](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Box)\[algopy. _TValue\]_

Returns a Box holding the box value at key

##### get

[Section titled “get”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#get-1)

_get(key: algopy.\_TKey, \*, default: algopy.\_TValue) → algopy.\_TValue_

Retrieve the contents of a keyed box, or return the default value if the box has not been
created.

- **Parameters:**
  - **key** – The key of the box to get
  - **default** – The default value to return if the box has not been created.

##### _property_ key\_prefix \*: \[algopy.Bytes\]

[Section titled “property key\_prefix \*: \[algopy.Bytes\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-key_prefix--algopybytes)

_property key\_prefix : [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Provides access to the raw storage key-prefix

##### length

[Section titled “length”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#length)

_length(key: algopy.\_TKey) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Get the length of an item in this BoxMap. Fails if the box does not exist

- **Parameters:** **key** – The key of the box to get

##### maybe

[Section titled “maybe”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#maybe-1)

_maybe(key: algopy.\_TKey) → [tuple](https://docs.python.org/3/library/stdtypes.html#tuple)\[algopy.\_TValue, [bool](https://docs.python.org/3/library/functions.html#bool)\]_

Retrieve the contents of a keyed box if it exists, and return a boolean indicating if the
box exists.

- **Parameters:** **key** – The key of the box to get

#### _class_ algopy.BoxRef

[Section titled “class algopy.BoxRef”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopyboxref)

\* _class_ algopy.BoxRef(/, \*, key: bytes \| str \| algopy.Bytes \| algopy.String = …)\*

BoxRef abstracts the reading and writing of boxes containing raw binary data. The size is
configured manually, and can be set to values larger than what the AVM can handle in a single
value.

##### Initialization

[Section titled “Initialization”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#initialization-6)

##### \_\_bool\_\_

[Section titled “\_\_bool\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__bool__-6)

_\_\_bool\_\_() → [bool](https://docs.python.org/3/library/functions.html#bool)_

Returns True if the box has a value set, regardless of the truthiness of that value

##### create

[Section titled “create”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#create-1)

_create(\*, size: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

Creates a box with the specified size, setting all bits to zero. Fails if the box already
exists with a different size. Fails if the specified size is greater than the max box size
(32,768)

Returns True if the box was created, False if the box already existed

##### delete

[Section titled “delete”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#delete)

_delete() → [bool](https://docs.python.org/3/library/functions.html#bool)_

Deletes the box if it exists and returns a value indicating if the box existed

##### extract

[Section titled “extract”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#extract-1)

Extract a slice of bytes from the box.

Fails if the box does not exist, or if `start_index + length > len(box)`

- **Parameters:**
  - **start\_index** – The offset to start extracting bytes from
  - **length** – The number of bytes to extract

##### get

[Section titled “get”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#get-2)

_get(\*, default: [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [bytes](https://docs.python.org/3/library/stdtypes.html#bytes)) → [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Retrieve the contents of the box, or return the default value if the box has not been
created.

- **Parameters:** **default** – The default value to return if the box has not been created

##### _property_ key \*: \[algopy.Bytes\]

[Section titled “property key \*: \[algopy.Bytes\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-key--algopybytes-1)

_property key : [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Provides access to the raw storage key

##### _property_ length \*: \[algopy.UInt64\]

[Section titled “property length \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-length--algopyuint64-2)

_property length : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Get the length of this Box. Fails if the box does not exist

##### maybe

[Section titled “maybe”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#maybe-2)

_maybe() → [tuple](https://docs.python.org/3/library/stdtypes.html#tuple)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes), [bool](https://docs.python.org/3/library/functions.html#bool)\]_

Retrieve the contents of the box if it exists, and return a boolean indicating if the box
exists.

##### put

[Section titled “put”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#put)

_put(value: [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [bytes](https://docs.python.org/3/library/stdtypes.html#bytes)) → [None](https://docs.python.org/3/library/constants.html#None)_

Replaces the contents of box with value. Fails if box exists and len(box) != len(value).
Creates box if it does not exist

- **Parameters:** **value** – The value to write to the box

##### replace

[Section titled “replace”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#replace-1)

Write `value` to the box starting at `start_index`. Fails if the box does not exist,
or if `start_index + len(value) > len(box)`

- **Parameters:**
  - **start\_index** – The offset to start writing bytes from
  - **value** – The bytes to be written

##### resize

[Section titled “resize”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#resize-1)

Resizes the box the specified `new_size`. Truncating existing data if the new value is
shorter or padding with zero bytes if it is longer.

- **Parameters:** **new\_size** – The new size of the box

##### splice

[Section titled “splice”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#splice-1)

#### _class_ algopy.Bytes

[Section titled “class algopy.Bytes”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopybytes)

\* _class_ algopy.Bytes(value: [bytes](https://docs.python.org/3/library/stdtypes.html#bytes) = b”, /)\*

A byte sequence, with a maximum length of 4096 bytes, one of the primary data types on the AVM

##### Initialization

[Section titled “Initialization”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#initialization-7)

Bytes can be initialized with a Python bytes literal, or bytes variable
declared at the module level

##### \_\_add\_\_

[Section titled “\_\_add\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__add__-2)

_\_\_add\_\_(other: [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [bytes](https://docs.python.org/3/library/stdtypes.html#bytes)) → [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Concatenate Bytes with another Bytes or bytes literal
e.g. `Bytes(b"Hello ") + b"World"`.

##### \_\_and\_\_

[Section titled “\_\_and\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__and__-1)

_\_\_and\_\_(other: [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [bytes](https://docs.python.org/3/library/stdtypes.html#bytes)) → [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Bytes can bitwise and with another Bytes or bytes e.g. `Bytes(b"FF") & b"0F")`

##### \_\_bool\_\_

[Section titled “\_\_bool\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__bool__-7)

_\_\_bool\_\_() → [bool](https://docs.python.org/3/library/functions.html#bool)_

Returns `True` if length of bytes is >0

##### \_\_contains\_\_

[Section titled “\_\_contains\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__contains__-1)

_\_\_contains\_\_(other: [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [bytes](https://docs.python.org/3/library/stdtypes.html#bytes)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

Test whether another Bytes is a substring of this one.
Note this is expensive due to a lack of AVM support.

##### \_\_eq\_\_

[Section titled “\_\_eq\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__eq__-4)

_\_\_eq\_\_(other: [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [bytes](https://docs.python.org/3/library/stdtypes.html#bytes)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

Bytes can be compared using the `==` operator with another Bytes or bytes

##### \_\_getitem\_\_

[Section titled “\_\_getitem\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__getitem__-2)

_\_\_getitem\_\_(index: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int) \| [slice](https://docs.python.org/3/library/functions.html#slice)\[ [int](https://docs.python.org/3/library/functions.html#int) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [None](https://docs.python.org/3/library/constants.html#None), [int](https://docs.python.org/3/library/functions.html#int) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [None](https://docs.python.org/3/library/constants.html#None), [None](https://docs.python.org/3/library/constants.html#None)\]) → [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Returns a Bytes containing a single byte if indexed with UInt64 or int
otherwise the substring o bytes described by the slice

##### \_\_iadd\_\_

[Section titled “\_\_iadd\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__iadd__-1)

_\_\_iadd\_\_(other: [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [bytes](https://docs.python.org/3/library/stdtypes.html#bytes)) → [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Concatenate Bytes with another Bytes or bytes literal
e.g. `a += Bytes(b"World")`.

##### \_\_iand\_\_

[Section titled “\_\_iand\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__iand__-1)

_\_\_iand\_\_(other: [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [bytes](https://docs.python.org/3/library/stdtypes.html#bytes)) → [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Bytes can bitwise and with another Bytes or bytes e.g. `a &= Bytes(b"0F")`

##### \_\_invert\_\_

[Section titled “\_\_invert\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__invert__)

_\_\_invert\_\_() → [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Bytes can be bitwise inverted e.g. `~Bytes(b"FF)`

##### \_\_ior\_\_

[Section titled “\_\_ior\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ior__-1)

_\_\_ior\_\_(other: [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [bytes](https://docs.python.org/3/library/stdtypes.html#bytes)) → [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Bytes can bitwise or with another Bytes or bytes e.g. `a |= Bytes(b"0F")`

##### \_\_iter\_\_

[Section titled “\_\_iter\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__iter__)

_\_\_iter\_\_() → [collections.abc.Iterator](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterator)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\]_

Bytes can be iterated, yielding each consecutive byte

##### \_\_ixor\_\_

[Section titled “\_\_ixor\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ixor__-1)

_\_\_ixor\_\_(other: [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [bytes](https://docs.python.org/3/library/stdtypes.html#bytes)) → [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Bytes can bitwise xor with another Bytes or bytes e.g. `a ^= Bytes(b"0F")`

##### \_\_ne\_\_

[Section titled “\_\_ne\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ne__-4)

_\_\_ne\_\_(other: [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [bytes](https://docs.python.org/3/library/stdtypes.html#bytes)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

Bytes can be compared using the `!=` operator with another Bytes or bytes

##### \_\_or\_\_

[Section titled “\_\_or\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__or__-1)

_\_\_or\_\_(other: [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [bytes](https://docs.python.org/3/library/stdtypes.html#bytes)) → [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Bytes can bitwise or with another Bytes or bytes e.g. `Bytes(b"FF") | b"0F")`

##### \_\_radd\_\_

[Section titled “\_\_radd\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__radd__-1)

_\_\_radd\_\_(other: [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [bytes](https://docs.python.org/3/library/stdtypes.html#bytes)) → [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Concatenate Bytes with another Bytes or bytes literal
e.g. `b"Hello " + Bytes(b"World")`.

##### \_\_reversed\_\_

[Section titled “\_\_reversed\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__reversed__-1)

_\_\_reversed\_\_() → [collections.abc.Iterator](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterator)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\]_

Bytes can be iterated in reverse, yield each preceding byte starting at the end

##### \_\_xor\_\_

[Section titled “\_\_xor\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__xor__-1)

_\_\_xor\_\_(other: [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [bytes](https://docs.python.org/3/library/stdtypes.html#bytes)) → [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Bytes can bitwise xor with another Bytes or bytes e.g. `Bytes(b"FF") ^ b"0F")`

##### _static_ from\_base32

[Section titled “static from\_base32”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#static-from_base32)

\* _static_ from\_base32(value: [str](https://docs.python.org/3/library/stdtypes.html#str), /) → [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\*

Creates Bytes from a base32 encoded string e.g. `Bytes.from_base32("74======")`

##### _static_ from\_base64

[Section titled “static from\_base64”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#static-from_base64)

\* _static_ from\_base64(value: [str](https://docs.python.org/3/library/stdtypes.html#str), /) → [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\*

Creates Bytes from a base64 encoded string e.g. `Bytes.from_base64("RkY=")`

##### _static_ from\_hex

[Section titled “static from\_hex”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#static-from_hex)

\* _static_ from\_hex(value: [str](https://docs.python.org/3/library/stdtypes.html#str), /) → [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\*

Creates Bytes from a hex/octal encoded string e.g. `Bytes.from_hex("FF")`

##### _property_ length \*: \[algopy.UInt64\]

[Section titled “property length \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-length--algopyuint64-3)

_property length : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Returns the length of the Bytes

#### _class_ algopy.BytesBacked

[Section titled “class algopy.BytesBacked”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopybytesbacked)

Represents a type that is a single bytes value

##### _property_ bytes \*: \[algopy.Bytes\]

[Section titled “property bytes \*: \[algopy.Bytes\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-bytes--algopybytes-2)

_property bytes : [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Get the underlying Bytes

##### _classmethod_ from\_bytes

[Section titled “classmethod from\_bytes”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#classmethod-from_bytes-2)

Construct an instance from the underlying bytes (no validation)

#### _class_ algopy.CompiledContract

[Section titled “class algopy.CompiledContract”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopycompiledcontract)

Provides compiled programs and state allocation values for a Contract.
Create by calling [`compile_contract`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.compile_contract).

##### approval\_program \*: \[tuple\]

[Section titled “approval\_program \*: \[tuple\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#approval_program--tuple)

\_approval\_program \_: [tuple](https://docs.python.org/3/library/stdtypes.html#tuple)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes), [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\]\*\*

None

Approval program pages for a contract, after template variables have been replaced
and compiled to AVM bytecode

##### clear\_state\_program \*: \[tuple\]

[Section titled “clear\_state\_program \*: \[tuple\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#clear_state_program--tuple)

\_clear\_state\_program \_: [tuple](https://docs.python.org/3/library/stdtypes.html#tuple)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes), [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\]\*\*

None

Clear state program pages for a contract, after template variables have been replaced
and compiled to AVM bytecode

##### extra\_program\_pages \*: \[algopy.UInt64\]

[Section titled “extra\_program\_pages \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#extra_program_pages--algopyuint64)

\_extra\_program\_pages \_: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\*\*

None

By default, provides extra program pages required based on approval and clear state program
size, can be overridden when calling compile\_contract

##### global\_bytes \*: \[algopy.UInt64\]

[Section titled “global\_bytes \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#global_bytes--algopyuint64)

\_global\_bytes \_: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\*\*

None

By default, provides global num bytes based on contract state totals, can be overridden
when calling compile\_contract

##### global\_uints \*: \[algopy.UInt64\]

[Section titled “global\_uints \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#global_uints--algopyuint64)

\_global\_uints \_: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\*\*

None

By default, provides global num uints based on contract state totals, can be overridden
when calling compile\_contract

##### local\_bytes \*: \[algopy.UInt64\]

[Section titled “local\_bytes \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#local_bytes--algopyuint64)

\_local\_bytes \_: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\*\*

None

By default, provides local num bytes based on contract state totals, can be overridden
when calling compile\_contract

##### local\_uints \*: \[algopy.UInt64\]

[Section titled “local\_uints \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#local_uints--algopyuint64)

\_local\_uints \_: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\*\*

None

By default, provides local num uints based on contract state totals, can be overridden
when calling compile\_contract

#### _class_ algopy.CompiledLogicSig

[Section titled “class algopy.CompiledLogicSig”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopycompiledlogicsig)

Provides account for a Logic Signature.
Create by calling [`compile_logicsig`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.compile_logicsig).

##### account \*: \[algopy.Account\]

[Section titled “account \*: \[algopy.Account\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#account--algopyaccount)

\_account \_: [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)\*\*

None

Address of a logic sig program, after template variables have been replaced and compiled
to AVM bytecode

#### _class_ algopy.Contract

[Section titled “class algopy.Contract”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopycontract)

Base class for an Algorand Smart Contract

##### _classmethod_ \_\_init _subclass_\_

[Section titled “classmethod \_\_initsubclass\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#classmethod-__initsubclass_-1)

When declaring a Contract subclass, options and configuration are passed in
the base class list:

```
class MyContract(algopy.Contract, name="CustomName"):

...
```

- **Parameters:**
  - **name** –

Will affect the output TEAL file name if there are multiple non-abstract contracts
    in the same file.

If the contract is a subclass of algopy.ARC4Contract, `name` will also be used as the
    contract name in the ARC-32 application.json, instead of the class name.

- **scratch\_slots** –

- **state\_totals** –

If let unspecified, the totals will be determined by the compiler based on state
    variables assigned to `self`.

##### _abstract_ approval\_program

[Section titled “abstract approval\_program”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#abstract-approval_program)

\* _abstract_ approval\_program() → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [bool](https://docs.python.org/3/library/functions.html#bool)\*

Represents the program called for all transactions
where `OnCompletion` != `ClearState`

##### _abstract_ clear\_state\_program

[Section titled “abstract clear\_state\_program”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#abstract-clear_state_program)

\* _abstract_ clear\_state\_program() → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [bool](https://docs.python.org/3/library/functions.html#bool)\*

Represents the program called when `OnCompletion` == `ClearState`

#### _class_ algopy.FixedArray

[Section titled “class algopy.FixedArray”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopyfixedarray)

\* _class_ algopy.FixedArray(values: [collections.abc.Iterable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterable)\[algopy.\_TArrayItem\])\*

A fixed length Array of the specified type and length

##### Initialization

[Section titled “Initialization”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#initialization-8)

##### \_\_getitem\_\_

[Section titled “\_\_getitem\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__getitem__-3)

Gets the item of the array at the provided index

##### \_\_iter\_\_

[Section titled “\_\_iter\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__iter__-1)

\_\_\_iter\_\_() → [Iterator](https://docs.python.org/3/library/typing.html#typing.Iterator)\[algopy. _TArrayItem\]_

Returns an iterator for the items in the array

##### \_\_reversed\_\_

[Section titled “\_\_reversed\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__reversed__-2)

\_\_\_reversed\_\_() → [Iterator](https://docs.python.org/3/library/typing.html#typing.Iterator)\[algopy. _TArrayItem\]_

Returns an iterator for the items in the array, in reverse order

##### \_\_setitem\_\_

[Section titled “\_\_setitem\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__setitem__-2)

Sets the item of the array at the specified index to provided value

##### copy

[Section titled “copy”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#copy-1)

_copy() → [Self](https://docs.python.org/3/library/typing.html#typing.Self)_

Create a copy of this array

##### freeze

[Section titled “freeze”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#freeze-1)

\_freeze() → [algopy.ImmutableFixedArray](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.ImmutableFixedArray)\[algopy.\_TArrayItem, algopy. _TArrayLength\]_

Returns an immutable copy of this array

##### _classmethod_ full

[Section titled “classmethod full”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#classmethod-full)

\* _classmethod_ full(item: algopy.\_TArrayItem) → [Self](https://docs.python.org/3/library/typing.html#typing.Self)\*

Initializes a new array, filled with copies of the specified value

##### _property_ length \*: \[algopy.UInt64\]

[Section titled “property length \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-length--algopyuint64-4)

_property length : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Returns the (compile-time) length of the array

##### replace

[Section titled “replace”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#replace-2)

_replace(index: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int), value: algopy.\_TArrayItem) → [Self](https://docs.python.org/3/library/typing.html#typing.Self)_

Returns a copy of the array with the item at the specified index replaced with the specified value

##### validate

[Section titled “validate”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#validate-2)

_validate() → [None](https://docs.python.org/3/library/constants.html#None)_

Performs validation to ensure the value is well-formed, errors if it is not

#### _class_ algopy.Global

[Section titled “class algopy.Global”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopyglobal)

Get Global values
Native TEAL op: [`global`](https://dev.algorand.co/reference/algorand-teal/opcodes/#global)

##### asset\_create\_min\_balance \*: \[Final\]

[Section titled “asset\_create\_min\_balance \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#asset_create_min_balance--final)

\_asset\_create\_min\_balance \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#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\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#asset_opt_in_min_balance--final)

\_asset\_opt\_in\_min\_balance \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

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

##### caller\_application\_address \*: \[Final\]

[Section titled “caller\_application\_address \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#caller_application_address--final)

\_caller\_application\_address \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#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\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#caller_application_id--final)

\_caller\_application\_id \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#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\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#creator_address--final)

\_creator\_address \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)\]\*\*

Ellipsis

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

##### current\_application\_address \*: \[Final\]

[Section titled “current\_application\_address \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#current_application_address--final)

\_current\_application\_address \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)\]\*\*

Ellipsis

Address that the current application controls. Application mode only.

##### current\_application\_id \*: \[Final\]

[Section titled “current\_application\_id \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#current_application_id--final)

\_current\_application\_id \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Application](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Application)\]\*\*

Ellipsis

ID of current application executing. Application mode only.

##### genesis\_hash \*: \[Final\]

[Section titled “genesis\_hash \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#genesis_hash--final)

\_genesis\_hash \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\]\*\*

Ellipsis

The Genesis Hash for the network.

##### group\_id \*: \[Final\]

[Section titled “group\_id \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#group_id--final)

\_group\_id \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#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\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#group_size--final)

\_group\_size \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

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

##### latest\_timestamp \*: \[Final\]

[Section titled “latest\_timestamp \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#latest_timestamp--final)

\_latest\_timestamp \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

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

##### logic\_sig\_version \*: \[Final\]

[Section titled “logic\_sig\_version \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#logic_sig_version--final)

\_logic\_sig\_version \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

Maximum supported version

##### max\_txn\_life \*: \[Final\]

[Section titled “max\_txn\_life \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#max_txn_life--final)

\_max\_txn\_life \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

rounds

##### min\_balance \*: \[Final\]

[Section titled “min\_balance \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#min_balance--final)

\_min\_balance \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

microalgos

##### min\_txn\_fee \*: \[Final\]

[Section titled “min\_txn\_fee \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#min_txn_fee--final)

\_min\_txn\_fee \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

microalgos

##### _static_ opcode\_budget

[Section titled “static opcode\_budget”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#static-opcode_budget)

\* _static_ opcode\_budget() → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\*

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

Native TEAL opcode: [`global`](https://dev.algorand.co/reference/algorand-teal/opcodes/#global)

##### payouts\_enabled \*: \[Final\]

[Section titled “payouts\_enabled \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#payouts_enabled--final)

\_payouts\_enabled \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [bool](https://docs.python.org/3/library/functions.html#bool)\]\*\*

Ellipsis

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

##### payouts\_go\_online\_fee \*: \[Final\]

[Section titled “payouts\_go\_online\_fee \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#payouts_go_online_fee--final)

\_payouts\_go\_online\_fee \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#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\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#payouts_max_balance--final)

\_payouts\_max\_balance \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#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\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#payouts_min_balance--final)

\_payouts\_min\_balance \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#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\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#payouts_percent--final)

\_payouts\_percent \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#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\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#round--final)

\_round \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

Current round number. Application mode only.

##### zero\_address \*: \[Final\]

[Section titled “zero\_address \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#zero_address--final)

\_zero\_address \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)\]\*\*

Ellipsis

32 byte address of all zero bytes

#### _class_ algopy.GlobalState

[Section titled “class algopy.GlobalState”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopyglobalstate)

Global state associated with the application, the key will be the name of the member, this
is assigned to

##### NOTE

[Section titled “NOTE”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note-37)

The `GlobalState` class provides a richer API that in addition to storing and retrieving
values, can test if a value is set or unset it. However if this extra functionality is not
needed then it is simpler to just store the data without the GlobalState proxy
e.g. `self.some_variable = UInt64(0)`

##### \_\_bool\_\_

[Section titled “\_\_bool\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__bool__-8)

_\_\_bool\_\_() → [bool](https://docs.python.org/3/library/functions.html#bool)_

Returns `True` if the key has a value set, regardless of the truthiness of that value

##### get

[Section titled “get”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#get-3)

_get(default: algopy.\_TState) → algopy.\_TState_

Returns the value or `default` if no value is set

```
name = self.name.get(Bytes(b"no name")
```

##### _property_ key \*: \[algopy.Bytes\]

[Section titled “property key \*: \[algopy.Bytes\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-key--algopybytes-2)

_property key : [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Provides access to the raw storage key

##### maybe

[Section titled “maybe”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#maybe-3)

_maybe() → [tuple](https://docs.python.org/3/library/stdtypes.html#tuple)\[algopy.\_TState, [bool](https://docs.python.org/3/library/functions.html#bool)\]_

Returns the value, and a bool

```
name, name_exists = self.name.maybe()

if not name_exists:

name = Bytes(b"no name")
```

##### _property_ value _: algopy.\_TState_

[Section titled “property value : algopy.\_TState”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-value--algopy_tstate)

Returns the value or and error if the value is not set

```
name = self.name.value
```

#### _class_ algopy.ImmutableArray

[Section titled “class algopy.ImmutableArray”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopyimmutablearray)

An immutable array that supports fixed and dynamically sized immutable elements.
Modifications are done by returning a new copy of the array with the modifications applied.

Example:

```
arr = ImmutableArray[UInt64]()

arr = arr.append(UInt64(42))

element = arr[0]

assert element == 42

arr = arr.pop()
```

##### \_\_add\_\_

[Section titled “\_\_add\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__add__-3)

\_\_\_add\_\_(other: [collections.abc.Iterable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterable)\[algopy. _TArrayItem\], /) → [Self](https://docs.python.org/3/library/typing.html#typing.Self)_

Return a copy of this array extended with the contents of another array

##### \_\_bool\_\_

[Section titled “\_\_bool\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__bool__-9)

_\_\_bool\_\_() → [bool](https://docs.python.org/3/library/functions.html#bool)_

Returns `True` if not an empty array

##### \_\_getitem\_\_

[Section titled “\_\_getitem\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__getitem__-4)

Gets the item of the array at provided index

##### \_\_reversed\_\_

[Section titled “\_\_reversed\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__reversed__-3)

\_\_\_reversed\_\_() → [collections.abc.Iterator](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterator)\[algopy. _TArrayItem\]_

Returns an iterator for the items in the array, in reverse order

##### append

[Section titled “append”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#append-1)

_append(item: algopy.\_TArrayItem, /) → [Self](https://docs.python.org/3/library/typing.html#typing.Self)_

Return a copy of the array with a another value appended to the end

##### _property_ length \*: \[algopy.UInt64\]

[Section titled “property length \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-length--algopyuint64-5)

_property length : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Returns the current length of the array

##### pop

[Section titled “pop”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#pop-1)

_pop() → [Self](https://docs.python.org/3/library/typing.html#typing.Self)_

Return a copy of this array with the last item removed

##### replace

[Section titled “replace”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#replace-3)

Returns a copy of the array with the item at specified index replaced with the specified value

##### validate

[Section titled “validate”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#validate-3)

_validate() → [None](https://docs.python.org/3/library/constants.html#None)_

Performs validation to ensure the value is well-formed, errors if it is not

#### _class_ algopy.ImmutableFixedArray

[Section titled “class algopy.ImmutableFixedArray”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopyimmutablefixedarray)

\* _class_ algopy.ImmutableFixedArray(values: [collections.abc.Iterable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterable)\[algopy.\_TArrayItem\])\*

An immutable fixed length Array of the specified type and length

##### Initialization

[Section titled “Initialization”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#initialization-9)

##### \_\_getitem\_\_

[Section titled “\_\_getitem\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__getitem__-5)

Gets the item of the array at the provided index

##### \_\_iter\_\_

[Section titled “\_\_iter\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__iter__-2)

\_\_\_iter\_\_() → [Iterator](https://docs.python.org/3/library/typing.html#typing.Iterator)\[algopy. _TArrayItem\]_

Returns an iterator for the items in the array

##### \_\_reversed\_\_

[Section titled “\_\_reversed\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__reversed__-4)

\_\_\_reversed\_\_() → [Iterator](https://docs.python.org/3/library/typing.html#typing.Iterator)\[algopy. _TArrayItem\]_

Returns an iterator for the items in the array, in reverse order

##### copy

[Section titled “copy”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#copy-2)

_copy() → [Self](https://docs.python.org/3/library/typing.html#typing.Self)_

Create a copy of this array

##### _classmethod_ full

[Section titled “classmethod full”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#classmethod-full-1)

\* _classmethod_ full(item: algopy.\_TArrayItem) → [Self](https://docs.python.org/3/library/typing.html#typing.Self)\*

Initializes a new array, filled with copies of the specified value

##### _property_ length \*: \[algopy.UInt64\]

[Section titled “property length \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-length--algopyuint64-6)

_property length : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Returns the (compile-time) length of the array

##### replace

[Section titled “replace”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#replace-4)

Returns a copy of the array with the item at the specified index replaced with the specified value

##### validate

[Section titled “validate”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#validate-4)

_validate() → [None](https://docs.python.org/3/library/constants.html#None)_

Performs validation to ensure the value is well-formed, errors if it is not

#### _class_ algopy.LocalState

[Section titled “class algopy.LocalState”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopylocalstate)

\* _class_ algopy.LocalState(type\_: [type](https://docs.python.org/3/library/functions.html#type)\[algopy.\_TState\], /, \*, key: [algopy.String](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.String) \| [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [bytes](https://docs.python.org/3/library/stdtypes.html#bytes) \| [str](https://docs.python.org/3/library/stdtypes.html#str) = …, description: [str](https://docs.python.org/3/library/stdtypes.html#str) = ”)\*

Local state associated with the application and an account

##### Initialization

[Section titled “Initialization”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#initialization-10)

Declare the local state key and it’s associated type

```
self.names = LocalState(algopy.Bytes)
```

##### \_\_contains\_\_

[Section titled “\_\_contains\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__contains__-2)

_\_\_contains\_\_(account: [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

Can test if data exists by using an `Account` reference or foreign account index

```
assert account in self.names
```

##### \_\_delitem\_\_

[Section titled “\_\_delitem\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__delitem__-1)

_\_\_delitem\_\_(account: [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [None](https://docs.python.org/3/library/constants.html#None)_

Data can be removed by using an `Account` reference or foreign account index

```
del self.names[account]
```

##### \_\_getitem\_\_

[Section titled “\_\_getitem\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__getitem__-6)

_\_\_getitem\_\_(account: [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → algopy.\_TState_

Data can be accessed by an `Account` reference or foreign account index

```
account_name = self.names[account]
```

##### \_\_setitem\_\_

[Section titled “\_\_setitem\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__setitem__-3)

_\_\_setitem\_\_(account: [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int), value: algopy.\_TState) → [None](https://docs.python.org/3/library/constants.html#None)_

Data can be stored by using an `Account` reference or foreign account index

```
self.names[account] = account_name
```

##### get

[Section titled “get”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#get-4)

_get(account: [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int), default: algopy.\_TState) → algopy.\_TState_

Can retrieve value using an `Account` reference or foreign account index,
and a fallback default value.

```
name = self.names.get(account, Bytes(b"no name")
```

##### _property_ key \*: \[algopy.Bytes\]

[Section titled “property key \*: \[algopy.Bytes\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-key--algopybytes-3)

_property key : [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Provides access to the raw storage key

##### maybe

[Section titled “maybe”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#maybe-4)

_maybe(account: [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [tuple](https://docs.python.org/3/library/stdtypes.html#tuple)\[algopy.\_TState, [bool](https://docs.python.org/3/library/functions.html#bool)\]_

Can retrieve value, and a bool indicating if the value was present
using an `Account` reference or foreign account index.

```
name, name_exists = self.names.maybe(account)

if not name_exists:

name = Bytes(b"no name")
```

#### _class_ algopy.LogicSig

[Section titled “class algopy.LogicSig”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopylogicsig)

A logic signature

#### _class_ algopy.OnCompleteAction

[Section titled “class algopy.OnCompleteAction”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopyoncompleteaction)

\* _class_ algopy.OnCompleteAction(value: [int](https://docs.python.org/3/library/functions.html#int) = 0, /)\*

On Completion actions available in an application call transaction

##### Initialization

[Section titled “Initialization”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#initialization-11)

A UInt64 can be initialized with a Python int literal, or an int variable
declared at the module level

##### ClearState \*: \[algopy.OnCompleteAction\]

[Section titled “ClearState \*: \[algopy.OnCompleteAction\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#clearstate--algopyoncompleteaction)

\_ClearState \_: [algopy.OnCompleteAction](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.OnCompleteAction)\*\*

Ellipsis

ClearState is similar to CloseOut, but may never fail. This
allows users to reclaim their minimum balance from an application
they no longer wish to opt in to.

##### CloseOut \*: \[algopy.OnCompleteAction\]

[Section titled “CloseOut \*: \[algopy.OnCompleteAction\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#closeout--algopyoncompleteaction)

\_CloseOut \_: [algopy.OnCompleteAction](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.OnCompleteAction)\*\*

Ellipsis

CloseOut indicates that an application transaction will deallocate
some LocalState for the application from the user’s account

##### DeleteApplication \*: \[algopy.OnCompleteAction\]

[Section titled “DeleteApplication \*: \[algopy.OnCompleteAction\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#deleteapplication--algopyoncompleteaction)

\_DeleteApplication \_: [algopy.OnCompleteAction](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.OnCompleteAction)\*\*

Ellipsis

DeleteApplication indicates that an application transaction will
delete the AppParams for the application from the creator’s balance
record

##### NoOp \*: \[algopy.OnCompleteAction\]

[Section titled “NoOp \*: \[algopy.OnCompleteAction\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#noop--algopyoncompleteaction)

\_NoOp \_: [algopy.OnCompleteAction](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.OnCompleteAction)\*\*

Ellipsis

NoOP indicates that no additional action is performed when the transaction completes

##### OptIn \*: \[algopy.OnCompleteAction\]

[Section titled “OptIn \*: \[algopy.OnCompleteAction\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#optin--algopyoncompleteaction)

\_OptIn \_: [algopy.OnCompleteAction](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.OnCompleteAction)\*\*

Ellipsis

OptIn indicates that an application transaction will allocate some
LocalState for the application in the sender’s account

##### UpdateApplication \*: \[algopy.OnCompleteAction\]

[Section titled “UpdateApplication \*: \[algopy.OnCompleteAction\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#updateapplication--algopyoncompleteaction)

\_UpdateApplication \_: [algopy.OnCompleteAction](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.OnCompleteAction)\*\*

Ellipsis

UpdateApplication indicates that an application transaction will
update the ApprovalProgram and ClearStateProgram for the application

##### \_\_add\_\_

[Section titled “\_\_add\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__add__-4)

_\_\_add\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be added with another UInt64 or int e.g. `UInt(4) + 2`.

This will error on overflow

##### \_\_and\_\_

[Section titled “\_\_and\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__and__-2)

_\_\_and\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can bitwise and with another UInt64 or int e.g. `UInt64(4) & 2`

##### \_\_bool\_\_

[Section titled “\_\_bool\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__bool__-10)

_\_\_bool\_\_() → [bool](https://docs.python.org/3/library/functions.html#bool)_

A UInt64 will evaluate to `False` if zero, and `True` otherwise

##### \_\_eq\_\_

[Section titled “\_\_eq\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__eq__-5)

_\_\_eq\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

A UInt64 can use the `==` operator with another UInt64 or int

##### \_\_floordiv\_\_

[Section titled “\_\_floordiv\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__floordiv__-1)

_\_\_floordiv\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be floor divided with another UInt64 or int e.g. `UInt64(4) // 2`.

This will error on divide by zero

##### \_\_ge\_\_

[Section titled “\_\_ge\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ge__-1)

_\_\_ge\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

A UInt64 can use the `>=` operator with another UInt64 or int

##### \_\_gt\_\_

[Section titled “\_\_gt\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__gt__-1)

_\_\_gt\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

A UInt64 can use the `>` operator with another UInt64 or int

##### \_\_iadd\_\_

[Section titled “\_\_iadd\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__iadd__-2)

_\_\_iadd\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be incremented with another UInt64 or int e.g. `a += UInt(2)`.

This will error on overflow

##### \_\_iand\_\_

[Section titled “\_\_iand\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__iand__-2)

_\_\_iand\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can bitwise and with another UInt64 or int e.g. `a &= UInt64(2)`

##### \_\_ifloordiv\_\_

[Section titled “\_\_ifloordiv\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ifloordiv__-1)

_\_\_ifloordiv\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be floor divided with another UInt64 or int e.g. `a //= UInt64(2)`.

This will error on divide by zero

##### \_\_ilshift\_\_

[Section titled “\_\_ilshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ilshift__)

_\_\_ilshift\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be left shifted by another UInt64 or int e.g. `a <<= UInt64(2)`

##### \_\_imod\_\_

[Section titled “\_\_imod\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__imod__-1)

_\_\_imod\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be modded with another UInt64 or int e.g. `a %= UInt64(2)`.

This will error on mod by zero

##### \_\_imul\_\_

[Section titled “\_\_imul\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__imul__-1)

_\_\_imul\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be multiplied with another UInt64 or int e.g. `a*= UInt64(2)`.

This will error on overflow

##### \_\_index\_\_

[Section titled “\_\_index\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__index__)

_\_\_index\_\_() → [int](https://docs.python.org/3/library/functions.html#int)_

A UInt64 can be used in indexing/slice expressions

##### \_\_invert\_\_

[Section titled “\_\_invert\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__invert__-1)

_\_\_invert\_\_() → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be bitwise inverted e.g. `~UInt64(4)`

##### \_\_ior\_\_

[Section titled “\_\_ior\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ior__-2)

_\_\_ior\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can bitwise or with another UInt64 or int e.g. `a |= UInt64(2)`

##### \_\_ipow\_\_

[Section titled “\_\_ipow\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ipow__)

_\_\_ipow\_\_(power: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be raised to the power of another UInt64 or int e.g. `a **= UInt64(2)`.

This will error on overflow

##### \_\_irshift\_\_

[Section titled “\_\_irshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__irshift__)

_\_\_irshift\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be right shifted by another UInt64 or int e.g. `a >>= UInt64(2)`

##### \_\_isub\_\_

[Section titled “\_\_isub\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__isub__-1)

_\_\_isub\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be subtracted with another UInt64 or int e.g. `a -= UInt64(2)`.

This will error on underflow

##### \_\_ixor\_\_

[Section titled “\_\_ixor\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ixor__-2)

_\_\_ixor\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can bitwise xor with another UInt64 or int e.g. `a ^= UInt64(2)`

##### \_\_le\_\_

[Section titled “\_\_le\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__le__-1)

_\_\_le\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

A UInt64 can use the `<=` operator with another UInt64 or int

##### \_\_lshift\_\_

[Section titled “\_\_lshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__lshift__)

_\_\_lshift\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be left shifted by another UInt64 or int e.g. `UInt64(4) << 2`

##### \_\_lt\_\_

[Section titled “\_\_lt\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__lt__-1)

_\_\_lt\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

A UInt64 can use the `<` operator with another UInt64 or int

##### \_\_mod\_\_

[Section titled “\_\_mod\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__mod__-1)

_\_\_mod\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be modded with another UInt64 or int e.g. `UInt64(4) % 2`.

This will error on mod by zero

##### \_\_mul\_\_

[Section titled “\_\_mul\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__mul__-1)

_\_\_mul\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be multiplied with another UInt64 or int e.g. `4 + UInt64(2)`.

This will error on overflow

##### \_\_ne\_\_

[Section titled “\_\_ne\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ne__-5)

_\_\_ne\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

A UInt64 can use the `!=` operator with another UInt64 or int

##### \_\_or\_\_

[Section titled “\_\_or\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__or__-2)

_\_\_or\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can bitwise or with another UInt64 or int e.g. `UInt64(4) | 2`

##### \_\_pos\_\_

[Section titled “\_\_pos\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__pos__-1)

_\_\_pos\_\_() → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Supports unary + operator. Redundant given the type is unsigned

##### \_\_pow\_\_

[Section titled “\_\_pow\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__pow__)

_\_\_pow\_\_(power: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be raised to the power of another UInt64 or int e.g. `UInt64(4) ** 2`.

This will error on overflow

##### \_\_radd\_\_

[Section titled “\_\_radd\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__radd__-2)

_\_\_radd\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be added with another UInt64 or int e.g. `4 + UInt64(2)`.

This will error on overflow

##### \_\_rand\_\_

[Section titled “\_\_rand\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rand__-1)

_\_\_rand\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can bitwise and with another UInt64 or int e.g. `4 & UInt64(2)`

##### \_\_rfloordiv\_\_

[Section titled “\_\_rfloordiv\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rfloordiv__-1)

_\_\_rfloordiv\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be floor divided with another UInt64 or int e.g. `4 // UInt64(2)`.

This will error on divide by zero

##### \_\_rlshift\_\_

[Section titled “\_\_rlshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rlshift__)

_\_\_rlshift\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be left shifted by another UInt64 or int e.g. `4 << UInt64(2)`

##### \_\_rmod\_\_

[Section titled “\_\_rmod\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rmod__-1)

_\_\_rmod\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be modded with another UInt64 or int e.g. `4 % UInt64(2)`.

This will error on mod by zero

##### \_\_rmul\_\_

[Section titled “\_\_rmul\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rmul__-1)

_\_\_rmul\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be multiplied with another UInt64 or int e.g. `UInt64(4) + 2`.

This will error on overflow

##### \_\_ror\_\_

[Section titled “\_\_ror\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ror__-1)

_\_\_ror\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can bitwise or with another UInt64 or int e.g. `4 | UInt64(2)`

##### \_\_rpow\_\_

[Section titled “\_\_rpow\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rpow__)

_\_\_rpow\_\_(power: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be raised to the power of another UInt64 or int e.g. `4 ** UInt64(2)`.

This will error on overflow

##### \_\_rrshift\_\_

[Section titled “\_\_rrshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rrshift__)

_\_\_rrshift\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be right shifted by another UInt64 or int e.g. `4 >> UInt64(2)`

##### \_\_rshift\_\_

[Section titled “\_\_rshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rshift__)

_\_\_rshift\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be right shifted by another UInt64 or int e.g. `UInt64(4) >> 2`

##### \_\_rsub\_\_

[Section titled “\_\_rsub\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rsub__-1)

_\_\_rsub\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be subtracted with another UInt64 or int e.g. `4 - UInt64(2)`.

This will error on underflow

##### \_\_rxor\_\_

[Section titled “\_\_rxor\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rxor__-1)

_\_\_rxor\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can bitwise xor with another UInt64 or int e.g. `4 ^ UInt64(2)`

##### \_\_sub\_\_

[Section titled “\_\_sub\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__sub__-1)

_\_\_sub\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be subtracted with another UInt64 or int e.g. `UInt(4) - 2`.

This will error on underflow

##### \_\_xor\_\_

[Section titled “\_\_xor\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__xor__-2)

_\_\_xor\_\_(other: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int)) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can bitwise xor with another UInt64 or int e.g. `UInt64(4) ^ 2`

#### _class_ algopy.OpUpFeeSource

[Section titled “class algopy.OpUpFeeSource”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopyopupfeesource)

\* _class_ algopy.OpUpFeeSource(value: [int](https://docs.python.org/3/library/functions.html#int) = 0, /)\*

Defines the source of fees for the OpUp utility.

##### Initialization

[Section titled “Initialization”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#initialization-12)

A UInt64 can be initialized with a Python int literal, or an int variable
declared at the module level

##### Any \*: \[algopy.OpUpFeeSource\]

[Section titled “Any \*: \[algopy.OpUpFeeSource\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#any--algopyopupfeesource)

\_Any \_: [algopy.OpUpFeeSource](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.OpUpFeeSource)\*\*

Ellipsis

First the excess will be used, remaining fees will be taken from the app account

##### AppAccount \*: \[algopy.OpUpFeeSource\]

[Section titled “AppAccount \*: \[algopy.OpUpFeeSource\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#appaccount--algopyopupfeesource)

\_AppAccount \_: [algopy.OpUpFeeSource](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.OpUpFeeSource)\*\*

Ellipsis

The app’s account will cover all fees (set inner\_tx.fee=Global.min\_tx\_fee())

##### GroupCredit \*: \[algopy.OpUpFeeSource\]

[Section titled “GroupCredit \*: \[algopy.OpUpFeeSource\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#groupcredit--algopyopupfeesource)

\_GroupCredit \_: [algopy.OpUpFeeSource](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.OpUpFeeSource)\*\*

Ellipsis

Only the excess fee (credit) on the outer group should be used (set inner\_tx.fee=0)

##### \_\_add\_\_

[Section titled “\_\_add\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__add__-5)

A UInt64 can be added with another UInt64 or int e.g. `UInt(4) + 2`.

This will error on overflow

##### \_\_and\_\_

[Section titled “\_\_and\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__and__-3)

A UInt64 can bitwise and with another UInt64 or int e.g. `UInt64(4) & 2`

##### \_\_bool\_\_

[Section titled “\_\_bool\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__bool__-11)

_\_\_bool\_\_() → [bool](https://docs.python.org/3/library/functions.html#bool)_

A UInt64 will evaluate to `False` if zero, and `True` otherwise

##### \_\_eq\_\_

[Section titled “\_\_eq\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__eq__-6)

A UInt64 can use the `==` operator with another UInt64 or int

##### \_\_floordiv\_\_

[Section titled “\_\_floordiv\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__floordiv__-2)

A UInt64 can be floor divided with another UInt64 or int e.g. `UInt64(4) // 2`.

This will error on divide by zero

##### \_\_ge\_\_

[Section titled “\_\_ge\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ge__-2)

A UInt64 can use the `>=` operator with another UInt64 or int

##### \_\_gt\_\_

[Section titled “\_\_gt\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__gt__-2)

A UInt64 can use the `>` operator with another UInt64 or int

##### \_\_iadd\_\_

[Section titled “\_\_iadd\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__iadd__-3)

A UInt64 can be incremented with another UInt64 or int e.g. `a += UInt(2)`.

This will error on overflow

##### \_\_iand\_\_

[Section titled “\_\_iand\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__iand__-3)

A UInt64 can bitwise and with another UInt64 or int e.g. `a &= UInt64(2)`

##### \_\_ifloordiv\_\_

[Section titled “\_\_ifloordiv\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ifloordiv__-2)

A UInt64 can be floor divided with another UInt64 or int e.g. `a //= UInt64(2)`.

This will error on divide by zero

##### \_\_ilshift\_\_

[Section titled “\_\_ilshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ilshift__-1)

A UInt64 can be left shifted by another UInt64 or int e.g. `a <<= UInt64(2)`

##### \_\_imod\_\_

[Section titled “\_\_imod\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__imod__-2)

A UInt64 can be modded with another UInt64 or int e.g. `a %= UInt64(2)`.

This will error on mod by zero

##### \_\_imul\_\_

[Section titled “\_\_imul\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__imul__-2)

A UInt64 can be multiplied with another UInt64 or int e.g. `a*= UInt64(2)`.

This will error on overflow

##### \_\_index\_\_

[Section titled “\_\_index\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__index__-1)

_\_\_index\_\_() → [int](https://docs.python.org/3/library/functions.html#int)_

A UInt64 can be used in indexing/slice expressions

##### \_\_invert\_\_

[Section titled “\_\_invert\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__invert__-2)

_\_\_invert\_\_() → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be bitwise inverted e.g. `~UInt64(4)`

##### \_\_ior\_\_

[Section titled “\_\_ior\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ior__-3)

A UInt64 can bitwise or with another UInt64 or int e.g. `a |= UInt64(2)`

##### \_\_ipow\_\_

[Section titled “\_\_ipow\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ipow__-1)

A UInt64 can be raised to the power of another UInt64 or int e.g. `a **= UInt64(2)`.

This will error on overflow

##### \_\_irshift\_\_

[Section titled “\_\_irshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__irshift__-1)

A UInt64 can be right shifted by another UInt64 or int e.g. `a >>= UInt64(2)`

##### \_\_isub\_\_

[Section titled “\_\_isub\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__isub__-2)

A UInt64 can be subtracted with another UInt64 or int e.g. `a -= UInt64(2)`.

This will error on underflow

##### \_\_ixor\_\_

[Section titled “\_\_ixor\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ixor__-3)

A UInt64 can bitwise xor with another UInt64 or int e.g. `a ^= UInt64(2)`

##### \_\_le\_\_

[Section titled “\_\_le\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__le__-2)

A UInt64 can use the `<=` operator with another UInt64 or int

##### \_\_lshift\_\_

[Section titled “\_\_lshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__lshift__-1)

A UInt64 can be left shifted by another UInt64 or int e.g. `UInt64(4) << 2`

##### \_\_lt\_\_

[Section titled “\_\_lt\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__lt__-2)

A UInt64 can use the `<` operator with another UInt64 or int

##### \_\_mod\_\_

[Section titled “\_\_mod\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__mod__-2)

A UInt64 can be modded with another UInt64 or int e.g. `UInt64(4) % 2`.

This will error on mod by zero

##### \_\_mul\_\_

[Section titled “\_\_mul\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__mul__-2)

A UInt64 can be multiplied with another UInt64 or int e.g. `4 + UInt64(2)`.

This will error on overflow

##### \_\_ne\_\_

[Section titled “\_\_ne\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ne__-6)

A UInt64 can use the `!=` operator with another UInt64 or int

##### \_\_or\_\_

[Section titled “\_\_or\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__or__-3)

A UInt64 can bitwise or with another UInt64 or int e.g. `UInt64(4) | 2`

##### \_\_pos\_\_

[Section titled “\_\_pos\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__pos__-2)

_\_\_pos\_\_() → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Supports unary + operator. Redundant given the type is unsigned

##### \_\_pow\_\_

[Section titled “\_\_pow\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__pow__-1)

A UInt64 can be raised to the power of another UInt64 or int e.g. `UInt64(4) ** 2`.

This will error on overflow

##### \_\_radd\_\_

[Section titled “\_\_radd\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__radd__-3)

A UInt64 can be added with another UInt64 or int e.g. `4 + UInt64(2)`.

This will error on overflow

##### \_\_rand\_\_

[Section titled “\_\_rand\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rand__-2)

A UInt64 can bitwise and with another UInt64 or int e.g. `4 & UInt64(2)`

##### \_\_rfloordiv\_\_

[Section titled “\_\_rfloordiv\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rfloordiv__-2)

A UInt64 can be floor divided with another UInt64 or int e.g. `4 // UInt64(2)`.

This will error on divide by zero

##### \_\_rlshift\_\_

[Section titled “\_\_rlshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rlshift__-1)

A UInt64 can be left shifted by another UInt64 or int e.g. `4 << UInt64(2)`

##### \_\_rmod\_\_

[Section titled “\_\_rmod\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rmod__-2)

A UInt64 can be modded with another UInt64 or int e.g. `4 % UInt64(2)`.

This will error on mod by zero

##### \_\_rmul\_\_

[Section titled “\_\_rmul\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rmul__-2)

A UInt64 can be multiplied with another UInt64 or int e.g. `UInt64(4) + 2`.

This will error on overflow

##### \_\_ror\_\_

[Section titled “\_\_ror\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ror__-2)

A UInt64 can bitwise or with another UInt64 or int e.g. `4 | UInt64(2)`

##### \_\_rpow\_\_

[Section titled “\_\_rpow\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rpow__-1)

A UInt64 can be raised to the power of another UInt64 or int e.g. `4 ** UInt64(2)`.

This will error on overflow

##### \_\_rrshift\_\_

[Section titled “\_\_rrshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rrshift__-1)

A UInt64 can be right shifted by another UInt64 or int e.g. `4 >> UInt64(2)`

##### \_\_rshift\_\_

[Section titled “\_\_rshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rshift__-1)

A UInt64 can be right shifted by another UInt64 or int e.g. `UInt64(4) >> 2`

##### \_\_rsub\_\_

[Section titled “\_\_rsub\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rsub__-2)

A UInt64 can be subtracted with another UInt64 or int e.g. `4 - UInt64(2)`.

This will error on underflow

##### \_\_rxor\_\_

[Section titled “\_\_rxor\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rxor__-2)

A UInt64 can bitwise xor with another UInt64 or int e.g. `4 ^ UInt64(2)`

##### \_\_sub\_\_

[Section titled “\_\_sub\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__sub__-2)

A UInt64 can be subtracted with another UInt64 or int e.g. `UInt(4) - 2`.

This will error on underflow

##### \_\_xor\_\_

[Section titled “\_\_xor\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__xor__-3)

A UInt64 can bitwise xor with another UInt64 or int e.g. `UInt64(4) ^ 2`

#### _class_ algopy.ReferenceArray

[Section titled “class algopy.ReferenceArray”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopyreferencearray)

A mutable array that supports fixed sized immutable elements. All references to this array
will see any updates made to it.

These arrays may use scratch slots if required. If a contract also needs to use scratch slots
for other purposes then they should be reserved using the `scratch_slots` parameter
in [`algopy.Contract`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Contract),
[`algopy.arc4.ARC4Contract`](https://dev.algorand.co/reference/algorand-python/api/api-algopyarc4/#algopy.arc4.ARC4Contract) or [`algopy.logicsig`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.logicsig)

##### \_\_bool\_\_

[Section titled “\_\_bool\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__bool__-12)

_\_\_bool\_\_() → [bool](https://docs.python.org/3/library/functions.html#bool)_

Returns `True` if not an empty array

##### \_\_getitem\_\_

[Section titled “\_\_getitem\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__getitem__-7)

Gets the item of the array at provided index

##### \_\_iter\_\_

[Section titled “\_\_iter\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__iter__-3)

\_\_\_iter\_\_() → [collections.abc.Iterator](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterator)\[algopy. _TArrayItem\]_

Returns an iterator for the items in the array

##### \_\_reversed\_\_

[Section titled “\_\_reversed\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__reversed__-5)

\_\_\_reversed\_\_() → [collections.abc.Iterator](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterator)\[algopy. _TArrayItem\]_

Returns an iterator for the items in the array, in reverse order

##### \_\_setitem\_\_

[Section titled “\_\_setitem\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__setitem__-4)

Sets the item of the array at specified index to provided value

##### append

[Section titled “append”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#append-2)

_append(item: algopy.\_TArrayItem, /) → [None](https://docs.python.org/3/library/constants.html#None)_

Append an item to this array

##### copy

[Section titled “copy”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#copy-3)

_copy() → [Self](https://docs.python.org/3/library/typing.html#typing.Self)_

Create a copy of this array

##### extend

[Section titled “extend”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#extend-1)

Extend this array with the contents of another array

##### freeze

[Section titled “freeze”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#freeze-2)

\_freeze() → [algopy.ImmutableArray](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.ImmutableArray)\[algopy. _TArrayItem\]_

Returns an immutable copy of this array

##### _property_ length \*: \[algopy.UInt64\]

[Section titled “property length \*: \[algopy.UInt64\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-length--algopyuint64-7)

_property length : [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Returns the current length of the array

##### pop

[Section titled “pop”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#pop-2)

_pop() → algopy.\_TArrayItem_

Remove and return the last item of this array

#### _class_ algopy.StateTotals

[Section titled “class algopy.StateTotals”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopystatetotals)

\* _class_ algopy.StateTotals(\*, global\_uints: [int](https://docs.python.org/3/library/functions.html#int) = …, global\_bytes: [int](https://docs.python.org/3/library/functions.html#int) = …, local\_uints: [int](https://docs.python.org/3/library/functions.html#int) = …, local\_bytes: [int](https://docs.python.org/3/library/functions.html#int) = …)\*

Options class to manually define the total amount of global and local state contract will use,
used by [`Contract.__init_subclass__`](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Contract.__init_subclass__).

This is not required when all state is assigned to `self.`, but is required if a
contract dynamically interacts with state via `AppGlobal.get_bytes` etc, or if you want
to reserve additional state storage for future contract updates, since the Algorand protocol
doesn’t allow increasing them after creation.

##### Initialization

[Section titled “Initialization”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#initialization-13)

Specify the totals for both global and local, and for each type. Any arguments not
specified default to their automatically calculated values.

Values are validated against the known totals assigned through `self.`, a warning is
produced if the total specified is insufficient to accommodate all `self.` state values
at once.

#### _class_ algopy.String

[Section titled “class algopy.String”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopystring)

\* _class_ algopy.String(value: [str](https://docs.python.org/3/library/stdtypes.html#str) = ”, /)\*

A UTF-8 encoded string.

In comparison to `arc4.String`, this type does not store the array length prefix, since that
information is always available through the `len` AVM op. This makes it more efficient to
operate on when doing operations such as concatenation.

Note that due to the lack of UTF-8 support in the AVM, indexing and length operations are not
currently supported.

##### Initialization

[Section titled “Initialization”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#initialization-14)

A String can be initialized with a Python `str` literal, or a `str` variable
declared at the module level

##### \_\_add\_\_

[Section titled “\_\_add\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__add__-6)

_\_\_add\_\_(other: [algopy.String](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.String) \| [str](https://docs.python.org/3/library/stdtypes.html#str)) → [algopy.String](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.String)_

Concatenate `String` with another `String` or `str` literal
e.g. `String("Hello ") + "World"`.

##### \_\_bool\_\_

[Section titled “\_\_bool\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__bool__-13)

_\_\_bool\_\_() → [bool](https://docs.python.org/3/library/functions.html#bool)_

Returns `True` if the string is not empty

##### \_\_contains\_\_

[Section titled “\_\_contains\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__contains__-3)

_\_\_contains\_\_(other: [algopy.String](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.String) \| [str](https://docs.python.org/3/library/stdtypes.html#str)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

Test whether another string is a substring of this one.
Note this is expensive due to a lack of AVM support.

##### \_\_eq\_\_

[Section titled “\_\_eq\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__eq__-7)

_\_\_eq\_\_(other: [algopy.String](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.String) \| [str](https://docs.python.org/3/library/stdtypes.html#str)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

Supports using the `==` operator with another `String` or literal `str`

##### \_\_iadd\_\_

[Section titled “\_\_iadd\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__iadd__-4)

_\_\_iadd\_\_(other: [algopy.String](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.String) \| [str](https://docs.python.org/3/library/stdtypes.html#str)) → [algopy.String](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.String)_

Concatenate `String` with another `String` or `str` literal
e.g. `a = String("Hello"); a += "World"`.

##### \_\_ne\_\_

[Section titled “\_\_ne\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ne__-7)

_\_\_ne\_\_(other: [algopy.String](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.String) \| [str](https://docs.python.org/3/library/stdtypes.html#str)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

Supports using the `!=` operator with another `String` or literal `str`

##### \_\_radd\_\_

[Section titled “\_\_radd\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__radd__-4)

_\_\_radd\_\_(other: [algopy.String](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.String) \| [str](https://docs.python.org/3/library/stdtypes.html#str)) → [algopy.String](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.String)_

Concatenate String with another `String` or `str` literal
e.g. `"Hello " + String("World")`.

##### _property_ bytes \*: \[algopy.Bytes\]

[Section titled “property bytes \*: \[algopy.Bytes\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#property-bytes--algopybytes-3)

_property bytes : [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)_

Get the underlying Bytes

##### endswith

[Section titled “endswith”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#endswith)

_endswith(suffix: [algopy.String](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.String) \| [str](https://docs.python.org/3/library/stdtypes.html#str)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

Check if this string ends with another string.

The behaviour should mirror `str.endswith`, for example, if `suffix` is the empty string,
the result will always be `True`.

Only a single argument is currently supported.

##### _classmethod_ from\_bytes

[Section titled “classmethod from\_bytes”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#classmethod-from_bytes-3)

Construct an instance from the underlying bytes (no validation)

##### join

[Section titled “join”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#join)

_join(others: [tuple](https://docs.python.org/3/library/stdtypes.html#tuple)\[ [algopy.String](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.String) \| [str](https://docs.python.org/3/library/stdtypes.html#str), …\], /) → [algopy.String](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.String)_

Join a sequence of Strings with a common separator.

The behaviour should mirror `str.join`.

##### startswith

[Section titled “startswith”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#startswith)

_startswith(prefix: [algopy.String](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.String) \| [str](https://docs.python.org/3/library/stdtypes.html#str)) → [bool](https://docs.python.org/3/library/functions.html#bool)_

Check if this string starts with another string.

The behaviour should mirror `str.startswith`, for example, if `prefix` is the empty string,
the result will always be `True`.

Only a single argument is currently supported.

#### _class_ algopy.Struct

[Section titled “class algopy.Struct”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopystruct)

Base class for Struct types

##### \_replace

[Section titled “\_replace”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#_replace)

_\_replace(\*\*kwargs: [Any](https://docs.python.org/3/library/typing.html#typing.Any)) → [Self](https://docs.python.org/3/library/typing.html#typing.Self)_

Return a new instance of the struct replacing specified fields with new values.

Note that any mutable fields must be explicitly copied to avoid aliasing.

##### copy

[Section titled “copy”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#copy-4)

_copy() → [Self](https://docs.python.org/3/library/typing.html#typing.Self)_

Create a copy of this struct

##### validate

[Section titled “validate”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#validate-5)

_validate() → [None](https://docs.python.org/3/library/constants.html#None)_

Performs validation to ensure the value is well-formed, errors if it is not

##### algopy.TemplateVar _: algopy.\_TemplateVarGeneric_

[Section titled “algopy.TemplateVar : algopy.\_TemplateVarGeneric”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopytemplatevar--algopy_templatevargeneric)

Ellipsis

Template variables can be used to represent a placeholder for a deploy-time provided value.

#### _class_ algopy.TransactionType

[Section titled “class algopy.TransactionType”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopytransactiontype)

\* _class_ algopy.TransactionType(value: [int](https://docs.python.org/3/library/functions.html#int) = 0, /)\*

The different transaction types available in a transaction

##### Initialization

[Section titled “Initialization”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#initialization-15)

A UInt64 can be initialized with a Python int literal, or an int variable
declared at the module level

##### ApplicationCall \*: \[algopy.TransactionType\]

[Section titled “ApplicationCall \*: \[algopy.TransactionType\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#applicationcall--algopytransactiontype)

\_ApplicationCall \_: [algopy.TransactionType](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.TransactionType)\*\*

Ellipsis

An Application Call transaction

##### AssetConfig \*: \[algopy.TransactionType\]

[Section titled “AssetConfig \*: \[algopy.TransactionType\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#assetconfig--algopytransactiontype)

\_AssetConfig \_: [algopy.TransactionType](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.TransactionType)\*\*

Ellipsis

An Asset Config transaction

##### AssetFreeze \*: \[algopy.TransactionType\]

[Section titled “AssetFreeze \*: \[algopy.TransactionType\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#assetfreeze--algopytransactiontype)

\_AssetFreeze \_: [algopy.TransactionType](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.TransactionType)\*\*

Ellipsis

An Asset Freeze transaction

##### AssetTransfer \*: \[algopy.TransactionType\]

[Section titled “AssetTransfer \*: \[algopy.TransactionType\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#assettransfer--algopytransactiontype)

\_AssetTransfer \_: [algopy.TransactionType](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.TransactionType)\*\*

Ellipsis

An Asset Transfer transaction

##### KeyRegistration \*: \[algopy.TransactionType\]

[Section titled “KeyRegistration \*: \[algopy.TransactionType\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#keyregistration--algopytransactiontype)

\_KeyRegistration \_: [algopy.TransactionType](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.TransactionType)\*\*

Ellipsis

A Key Registration transaction

##### Payment \*: \[algopy.TransactionType\]

[Section titled “Payment \*: \[algopy.TransactionType\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#payment--algopytransactiontype)

\_Payment \_: [algopy.TransactionType](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.TransactionType)\*\*

Ellipsis

A Payment transaction

##### \_\_add\_\_

[Section titled “\_\_add\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__add__-7)

A UInt64 can be added with another UInt64 or int e.g. `UInt(4) + 2`.

This will error on overflow

##### \_\_and\_\_

[Section titled “\_\_and\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__and__-4)

A UInt64 can bitwise and with another UInt64 or int e.g. `UInt64(4) & 2`

##### \_\_bool\_\_

[Section titled “\_\_bool\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__bool__-14)

_\_\_bool\_\_() → [bool](https://docs.python.org/3/library/functions.html#bool)_

A UInt64 will evaluate to `False` if zero, and `True` otherwise

##### \_\_eq\_\_

[Section titled “\_\_eq\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__eq__-8)

A UInt64 can use the `==` operator with another UInt64 or int

##### \_\_floordiv\_\_

[Section titled “\_\_floordiv\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__floordiv__-3)

A UInt64 can be floor divided with another UInt64 or int e.g. `UInt64(4) // 2`.

This will error on divide by zero

##### \_\_ge\_\_

[Section titled “\_\_ge\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ge__-3)

A UInt64 can use the `>=` operator with another UInt64 or int

##### \_\_gt\_\_

[Section titled “\_\_gt\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__gt__-3)

A UInt64 can use the `>` operator with another UInt64 or int

##### \_\_iadd\_\_

[Section titled “\_\_iadd\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__iadd__-5)

A UInt64 can be incremented with another UInt64 or int e.g. `a += UInt(2)`.

This will error on overflow

##### \_\_iand\_\_

[Section titled “\_\_iand\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__iand__-4)

A UInt64 can bitwise and with another UInt64 or int e.g. `a &= UInt64(2)`

##### \_\_ifloordiv\_\_

[Section titled “\_\_ifloordiv\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ifloordiv__-3)

A UInt64 can be floor divided with another UInt64 or int e.g. `a //= UInt64(2)`.

This will error on divide by zero

##### \_\_ilshift\_\_

[Section titled “\_\_ilshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ilshift__-2)

A UInt64 can be left shifted by another UInt64 or int e.g. `a <<= UInt64(2)`

##### \_\_imod\_\_

[Section titled “\_\_imod\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__imod__-3)

A UInt64 can be modded with another UInt64 or int e.g. `a %= UInt64(2)`.

This will error on mod by zero

##### \_\_imul\_\_

[Section titled “\_\_imul\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__imul__-3)

A UInt64 can be multiplied with another UInt64 or int e.g. `a*= UInt64(2)`.

This will error on overflow

##### \_\_index\_\_

[Section titled “\_\_index\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__index__-2)

_\_\_index\_\_() → [int](https://docs.python.org/3/library/functions.html#int)_

A UInt64 can be used in indexing/slice expressions

##### \_\_invert\_\_

[Section titled “\_\_invert\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__invert__-3)

_\_\_invert\_\_() → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be bitwise inverted e.g. `~UInt64(4)`

##### \_\_ior\_\_

[Section titled “\_\_ior\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ior__-4)

A UInt64 can bitwise or with another UInt64 or int e.g. `a |= UInt64(2)`

##### \_\_ipow\_\_

[Section titled “\_\_ipow\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ipow__-2)

A UInt64 can be raised to the power of another UInt64 or int e.g. `a **= UInt64(2)`.

This will error on overflow

##### \_\_irshift\_\_

[Section titled “\_\_irshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__irshift__-2)

A UInt64 can be right shifted by another UInt64 or int e.g. `a >>= UInt64(2)`

##### \_\_isub\_\_

[Section titled “\_\_isub\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__isub__-3)

A UInt64 can be subtracted with another UInt64 or int e.g. `a -= UInt64(2)`.

This will error on underflow

##### \_\_ixor\_\_

[Section titled “\_\_ixor\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ixor__-4)

A UInt64 can bitwise xor with another UInt64 or int e.g. `a ^= UInt64(2)`

##### \_\_le\_\_

[Section titled “\_\_le\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__le__-3)

A UInt64 can use the `<=` operator with another UInt64 or int

##### \_\_lshift\_\_

[Section titled “\_\_lshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__lshift__-2)

A UInt64 can be left shifted by another UInt64 or int e.g. `UInt64(4) << 2`

##### \_\_lt\_\_

[Section titled “\_\_lt\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__lt__-3)

A UInt64 can use the `<` operator with another UInt64 or int

##### \_\_mod\_\_

[Section titled “\_\_mod\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__mod__-3)

A UInt64 can be modded with another UInt64 or int e.g. `UInt64(4) % 2`.

This will error on mod by zero

##### \_\_mul\_\_

[Section titled “\_\_mul\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__mul__-3)

A UInt64 can be multiplied with another UInt64 or int e.g. `4 + UInt64(2)`.

This will error on overflow

##### \_\_ne\_\_

[Section titled “\_\_ne\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ne__-8)

A UInt64 can use the `!=` operator with another UInt64 or int

##### \_\_or\_\_

[Section titled “\_\_or\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__or__-4)

A UInt64 can bitwise or with another UInt64 or int e.g. `UInt64(4) | 2`

##### \_\_pos\_\_

[Section titled “\_\_pos\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__pos__-3)

_\_\_pos\_\_() → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Supports unary + operator. Redundant given the type is unsigned

##### \_\_pow\_\_

[Section titled “\_\_pow\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__pow__-2)

A UInt64 can be raised to the power of another UInt64 or int e.g. `UInt64(4) ** 2`.

This will error on overflow

##### \_\_radd\_\_

[Section titled “\_\_radd\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__radd__-5)

A UInt64 can be added with another UInt64 or int e.g. `4 + UInt64(2)`.

This will error on overflow

##### \_\_rand\_\_

[Section titled “\_\_rand\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rand__-3)

A UInt64 can bitwise and with another UInt64 or int e.g. `4 & UInt64(2)`

##### \_\_rfloordiv\_\_

[Section titled “\_\_rfloordiv\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rfloordiv__-3)

A UInt64 can be floor divided with another UInt64 or int e.g. `4 // UInt64(2)`.

This will error on divide by zero

##### \_\_rlshift\_\_

[Section titled “\_\_rlshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rlshift__-2)

A UInt64 can be left shifted by another UInt64 or int e.g. `4 << UInt64(2)`

##### \_\_rmod\_\_

[Section titled “\_\_rmod\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rmod__-3)

A UInt64 can be modded with another UInt64 or int e.g. `4 % UInt64(2)`.

This will error on mod by zero

##### \_\_rmul\_\_

[Section titled “\_\_rmul\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rmul__-3)

A UInt64 can be multiplied with another UInt64 or int e.g. `UInt64(4) + 2`.

This will error on overflow

##### \_\_ror\_\_

[Section titled “\_\_ror\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ror__-3)

A UInt64 can bitwise or with another UInt64 or int e.g. `4 | UInt64(2)`

##### \_\_rpow\_\_

[Section titled “\_\_rpow\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rpow__-2)

A UInt64 can be raised to the power of another UInt64 or int e.g. `4 ** UInt64(2)`.

This will error on overflow

##### \_\_rrshift\_\_

[Section titled “\_\_rrshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rrshift__-2)

A UInt64 can be right shifted by another UInt64 or int e.g. `4 >> UInt64(2)`

##### \_\_rshift\_\_

[Section titled “\_\_rshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rshift__-2)

A UInt64 can be right shifted by another UInt64 or int e.g. `UInt64(4) >> 2`

##### \_\_rsub\_\_

[Section titled “\_\_rsub\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rsub__-3)

A UInt64 can be subtracted with another UInt64 or int e.g. `4 - UInt64(2)`.

This will error on underflow

##### \_\_rxor\_\_

[Section titled “\_\_rxor\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rxor__-3)

A UInt64 can bitwise xor with another UInt64 or int e.g. `4 ^ UInt64(2)`

##### \_\_sub\_\_

[Section titled “\_\_sub\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__sub__-3)

A UInt64 can be subtracted with another UInt64 or int e.g. `UInt(4) - 2`.

This will error on underflow

##### \_\_xor\_\_

[Section titled “\_\_xor\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__xor__-4)

A UInt64 can bitwise xor with another UInt64 or int e.g. `UInt64(4) ^ 2`

#### _class_ algopy.Txn

[Section titled “class algopy.Txn”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopytxn)

Get values for the current executing transaction
Native TEAL ops: [`txn`](https://dev.algorand.co/reference/algorand-teal/opcodes/#txn), [`txnas`](https://dev.algorand.co/reference/algorand-teal/opcodes/#txnas)

##### _static_ accounts

[Section titled “static accounts”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#static-accounts)

\* _static_ accounts(a: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int), /) → [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)\*

Accounts listed in the ApplicationCall transaction

Native TEAL opcode: [`txna`](https://dev.algorand.co/reference/algorand-teal/opcodes/#txna), [`txnas`](https://dev.algorand.co/reference/algorand-teal/opcodes/#txnas)

##### amount \*: \[Final\]

[Section titled “amount \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#amount--final)

\_amount \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

microalgos

##### _static_ application\_args

[Section titled “static application\_args”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#static-application_args)

\* _static_ application\_args(a: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int), /) → [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\*

Arguments passed to the application in the ApplicationCall transaction

##### application\_id \*: \[Final\]

[Section titled “application\_id \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#application_id--final)

\_application\_id \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Application](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Application)\]\*\*

Ellipsis

ApplicationID from ApplicationCall transaction

##### _static_ applications

[Section titled “static applications”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#static-applications)

\* _static_ applications(a: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int), /) → [algopy.Application](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Application)\*

Foreign Apps listed in the ApplicationCall transaction

##### approval\_program \*: \[Final\]

[Section titled “approval\_program \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#approval_program--final)

\_approval\_program \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\]\*\*

Ellipsis

Approval program

##### _static_ approval\_program\_pages

[Section titled “static approval\_program\_pages”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#static-approval_program_pages)

\* _static_ approval\_program\_pages(a: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int), /) → [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\*

Approval Program as an array of pages

##### asset\_amount \*: \[Final\]

[Section titled “asset\_amount \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#asset_amount--final)

\_asset\_amount \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

value in Asset’s units

##### asset\_close\_to \*: \[Final\]

[Section titled “asset\_close\_to \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#asset_close_to--final)

\_asset\_close\_to \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)\]\*\*

Ellipsis

32 byte address

##### asset\_receiver \*: \[Final\]

[Section titled “asset\_receiver \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#asset_receiver--final)

\_asset\_receiver \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)\]\*\*

Ellipsis

32 byte address

##### asset\_sender \*: \[Final\]

[Section titled “asset\_sender \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#asset_sender--final)

\_asset\_sender \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)\]\*\*

Ellipsis

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

##### _static_ assets

[Section titled “static assets”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#static-assets)

\* _static_ assets(a: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int), /) → [algopy.Asset](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Asset)\*

Foreign Assets listed in the ApplicationCall transaction

##### clear\_state\_program \*: \[Final\]

[Section titled “clear\_state\_program \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#clear_state_program--final)

\_clear\_state\_program \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\]\*\*

Ellipsis

Clear state program

##### _static_ clear\_state\_program\_pages

[Section titled “static clear\_state\_program\_pages”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#static-clear_state_program_pages)

\* _static_ clear\_state\_program\_pages(a: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int), /) → [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\*

ClearState Program as an array of pages

##### close\_remainder\_to \*: \[Final\]

[Section titled “close\_remainder\_to \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#close_remainder_to--final)

\_close\_remainder\_to \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)\]\*\*

Ellipsis

32 byte address

##### config\_asset \*: \[Final\]

[Section titled “config\_asset \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#config_asset--final)

\_config\_asset \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Asset](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Asset)\]\*\*

Ellipsis

Asset ID in asset config transaction

##### config\_asset\_clawback \*: \[Final\]

[Section titled “config\_asset\_clawback \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#config_asset_clawback--final)

\_config\_asset\_clawback \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)\]\*\*

Ellipsis

32 byte address

##### config\_asset\_decimals \*: \[Final\]

[Section titled “config\_asset\_decimals \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#config_asset_decimals--final)

\_config\_asset\_decimals \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#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\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#config_asset_default_frozen--final)

\_config\_asset\_default\_frozen \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [bool](https://docs.python.org/3/library/functions.html#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\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#config_asset_freeze--final)

\_config\_asset\_freeze \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)\]\*\*

Ellipsis

32 byte address

##### config\_asset\_manager \*: \[Final\]

[Section titled “config\_asset\_manager \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#config_asset_manager--final)

\_config\_asset\_manager \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)\]\*\*

Ellipsis

32 byte address

##### config\_asset\_metadata\_hash \*: \[Final\]

[Section titled “config\_asset\_metadata\_hash \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#config_asset_metadata_hash--final)

\_config\_asset\_metadata\_hash \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\]\*\*

Ellipsis

32 byte commitment to unspecified asset metadata

##### config\_asset\_name \*: \[Final\]

[Section titled “config\_asset\_name \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#config_asset_name--final)

\_config\_asset\_name \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\]\*\*

Ellipsis

The asset name

##### config\_asset\_reserve \*: \[Final\]

[Section titled “config\_asset\_reserve \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#config_asset_reserve--final)

\_config\_asset\_reserve \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)\]\*\*

Ellipsis

32 byte address

##### config\_asset\_total \*: \[Final\]

[Section titled “config\_asset\_total \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#config_asset_total--final)

\_config\_asset\_total \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

Total number of units of this asset created

##### config\_asset\_unit\_name \*: \[Final\]

[Section titled “config\_asset\_unit\_name \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#config_asset_unit_name--final)

\_config\_asset\_unit\_name \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\]\*\*

Ellipsis

Unit name of the asset

##### config\_asset\_url \*: \[Final\]

[Section titled “config\_asset\_url \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#config_asset_url--final)

\_config\_asset\_url \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\]\*\*

Ellipsis

URL

##### created\_application\_id \*: \[Final\]

[Section titled “created\_application\_id \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#created_application_id--final)

\_created\_application\_id \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Application](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#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\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#created_asset_id--final)

\_created\_asset\_id \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Asset](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#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\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#extra_program_pages--final)

\_extra\_program\_pages \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

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.

##### fee \*: \[Final\]

[Section titled “fee \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#fee--final)

\_fee \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

microalgos

##### first\_valid \*: \[Final\]

[Section titled “first\_valid \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#first_valid--final)

\_first\_valid \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

round number

##### first\_valid\_time \*: \[Final\]

[Section titled “first\_valid\_time \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#first_valid_time--final)

\_first\_valid\_time \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

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

##### freeze\_asset \*: \[Final\]

[Section titled “freeze\_asset \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#freeze_asset--final)

\_freeze\_asset \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Asset](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Asset)\]\*\*

Ellipsis

Asset ID being frozen or un-frozen

##### freeze\_asset\_account \*: \[Final\]

[Section titled “freeze\_asset\_account \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#freeze_asset_account--final)

\_freeze\_asset\_account \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#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\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#freeze_asset_frozen--final)

\_freeze\_asset\_frozen \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [bool](https://docs.python.org/3/library/functions.html#bool)\]\*\*

Ellipsis

The new frozen value, 0 or 1

##### global\_num\_byte\_slice \*: \[Final\]

[Section titled “global\_num\_byte\_slice \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#global_num_byte_slice--final)

\_global\_num\_byte\_slice \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

Number of global state byteslices in ApplicationCall

##### global\_num\_uint \*: \[Final\]

[Section titled “global\_num\_uint \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#global_num_uint--final)

\_global\_num\_uint \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

Number of global state integers in ApplicationCall

##### group\_index \*: \[Final\]

[Section titled “group\_index \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#group_index--final)

\_group\_index \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#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\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#last_log--final)

\_last\_log \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\]\*\*

Ellipsis

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

##### last\_valid \*: \[Final\]

[Section titled “last\_valid \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#last_valid--final)

\_last\_valid \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

round number

##### lease \*: \[Final\]

[Section titled “lease \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#lease--final)

\_lease \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\]\*\*

Ellipsis

32 byte lease value

##### local\_num\_byte\_slice \*: \[Final\]

[Section titled “local\_num\_byte\_slice \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#local_num_byte_slice--final)

\_local\_num\_byte\_slice \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

Number of local state byteslices in ApplicationCall

##### local\_num\_uint \*: \[Final\]

[Section titled “local\_num\_uint \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#local_num_uint--final)

\_local\_num\_uint \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

Number of local state integers in ApplicationCall

##### _static_ logs

[Section titled “static logs”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#static-logs)

\* _static_ logs(a: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int), /) → [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\*

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

##### nonparticipation \*: \[Final\]

[Section titled “nonparticipation \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#nonparticipation--final)

\_nonparticipation \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [bool](https://docs.python.org/3/library/functions.html#bool)\]\*\*

Ellipsis

Marks an account nonparticipating for rewards

##### note \*: \[Final\]

[Section titled “note \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#note--final)

\_note \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\]\*\*

Ellipsis

Any data up to 1024 bytes

##### num\_accounts \*: \[Final\]

[Section titled “num\_accounts \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#num_accounts--final)

\_num\_accounts \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

Number of Accounts

##### num\_app\_args \*: \[Final\]

[Section titled “num\_app\_args \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#num_app_args--final)

\_num\_app\_args \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

Number of ApplicationArgs

##### num\_applications \*: \[Final\]

[Section titled “num\_applications \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#num_applications--final)

\_num\_applications \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

Number of Applications

##### num\_approval\_program\_pages \*: \[Final\]

[Section titled “num\_approval\_program\_pages \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#num_approval_program_pages--final)

\_num\_approval\_program\_pages \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

Number of Approval Program pages

##### num\_assets \*: \[Final\]

[Section titled “num\_assets \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#num_assets--final)

\_num\_assets \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

Number of Assets

##### num\_clear\_state\_program\_pages \*: \[Final\]

[Section titled “num\_clear\_state\_program\_pages \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#num_clear_state_program_pages--final)

\_num\_clear\_state\_program\_pages \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

Number of ClearState Program pages

##### num\_logs \*: \[Final\]

[Section titled “num\_logs \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#num_logs--final)

\_num\_logs \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

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

##### on\_completion \*: \[Final\]

[Section titled “on\_completion \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#on_completion--final)

\_on\_completion \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.OnCompleteAction](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.OnCompleteAction)\]\*\*

Ellipsis

ApplicationCall transaction on completion action

##### receiver \*: \[Final\]

[Section titled “receiver \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#receiver--final)

\_receiver \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)\]\*\*

Ellipsis

32 byte address

##### reject\_version \*: \[Final\]

[Section titled “reject\_version \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#reject_version--final)

\_reject\_version \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

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

##### rekey\_to \*: \[Final\]

[Section titled “rekey\_to \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#rekey_to--final)

\_rekey\_to \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)\]\*\*

Ellipsis

32 byte Sender’s new AuthAddr

##### selection\_pk \*: \[Final\]

[Section titled “selection\_pk \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#selection_pk--final)

\_selection\_pk \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\]\*\*

Ellipsis

32 byte address

##### sender \*: \[Final\]

[Section titled “sender \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#sender--final)

\_sender \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Account](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Account)\]\*\*

Ellipsis

32 byte address

##### state\_proof\_pk \*: \[Final\]

[Section titled “state\_proof\_pk \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#state_proof_pk--final)

\_state\_proof\_pk \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\]\*\*

Ellipsis

State proof public key

##### tx\_id \*: \[Final\]

[Section titled “tx\_id \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#tx_id--final)

\_tx\_id \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\]\*\*

Ellipsis

The computed ID for this transaction. 32 bytes.

##### type \*: \[Final\]

[Section titled “type \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#type--final)

\_type \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\]\*\*

Ellipsis

Transaction type as bytes

##### type\_enum \*: \[Final\]

[Section titled “type\_enum \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#type_enum--final)

\_type\_enum \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.TransactionType](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.TransactionType)\]\*\*

Ellipsis

Transaction type as integer

##### vote\_first \*: \[Final\]

[Section titled “vote\_first \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#vote_first--final)

\_vote\_first \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

The first round that the participation key is valid.

##### vote\_key\_dilution \*: \[Final\]

[Section titled “vote\_key\_dilution \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#vote_key_dilution--final)

\_vote\_key\_dilution \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

Dilution for the 2-level participation key

##### vote\_last \*: \[Final\]

[Section titled “vote\_last \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#vote_last--final)

\_vote\_last \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\*\*

Ellipsis

The last round that the participation key is valid.

##### vote\_pk \*: \[Final\]

[Section titled “vote\_pk \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#vote_pk--final)

\_vote\_pk \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes)\]\*\*

Ellipsis

32 byte address

##### xfer\_asset \*: \[Final\]

[Section titled “xfer\_asset \*: \[Final\]”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#xfer_asset--final)

\_xfer\_asset \_: [Final](https://docs.python.org/3/library/typing.html#typing.Final)\[ [algopy.Asset](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Asset)\]\*\*

Ellipsis

Asset ID

#### _class_ algopy.UInt64

[Section titled “class algopy.UInt64”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopyuint64)

\* _class_ algopy.UInt64(value: [int](https://docs.python.org/3/library/functions.html#int) = 0, /)\*

A 64-bit unsigned integer, one of the primary data types on the AVM

##### Initialization

[Section titled “Initialization”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#initialization-16)

A UInt64 can be initialized with a Python int literal, or an int variable
declared at the module level

##### \_\_add\_\_

[Section titled “\_\_add\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__add__-8)

A UInt64 can be added with another UInt64 or int e.g. `UInt(4) + 2`.

This will error on overflow

##### \_\_and\_\_

[Section titled “\_\_and\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__and__-5)

A UInt64 can bitwise and with another UInt64 or int e.g. `UInt64(4) & 2`

##### \_\_bool\_\_

[Section titled “\_\_bool\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__bool__-15)

_\_\_bool\_\_() → [bool](https://docs.python.org/3/library/functions.html#bool)_

A UInt64 will evaluate to `False` if zero, and `True` otherwise

##### \_\_eq\_\_

[Section titled “\_\_eq\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__eq__-9)

A UInt64 can use the `==` operator with another UInt64 or int

##### \_\_floordiv\_\_

[Section titled “\_\_floordiv\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__floordiv__-4)

A UInt64 can be floor divided with another UInt64 or int e.g. `UInt64(4) // 2`.

This will error on divide by zero

##### \_\_ge\_\_

[Section titled “\_\_ge\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ge__-4)

A UInt64 can use the `>=` operator with another UInt64 or int

##### \_\_gt\_\_

[Section titled “\_\_gt\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__gt__-4)

A UInt64 can use the `>` operator with another UInt64 or int

##### \_\_iadd\_\_

[Section titled “\_\_iadd\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__iadd__-6)

A UInt64 can be incremented with another UInt64 or int e.g. `a += UInt(2)`.

This will error on overflow

##### \_\_iand\_\_

[Section titled “\_\_iand\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__iand__-5)

A UInt64 can bitwise and with another UInt64 or int e.g. `a &= UInt64(2)`

##### \_\_ifloordiv\_\_

[Section titled “\_\_ifloordiv\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ifloordiv__-4)

A UInt64 can be floor divided with another UInt64 or int e.g. `a //= UInt64(2)`.

This will error on divide by zero

##### \_\_ilshift\_\_

[Section titled “\_\_ilshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ilshift__-3)

A UInt64 can be left shifted by another UInt64 or int e.g. `a <<= UInt64(2)`

##### \_\_imod\_\_

[Section titled “\_\_imod\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__imod__-4)

A UInt64 can be modded with another UInt64 or int e.g. `a %= UInt64(2)`.

This will error on mod by zero

##### \_\_imul\_\_

[Section titled “\_\_imul\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__imul__-4)

A UInt64 can be multiplied with another UInt64 or int e.g. `a*= UInt64(2)`.

This will error on overflow

##### \_\_index\_\_

[Section titled “\_\_index\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__index__-3)

_\_\_index\_\_() → [int](https://docs.python.org/3/library/functions.html#int)_

A UInt64 can be used in indexing/slice expressions

##### \_\_invert\_\_

[Section titled “\_\_invert\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__invert__-4)

_\_\_invert\_\_() → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

A UInt64 can be bitwise inverted e.g. `~UInt64(4)`

##### \_\_ior\_\_

[Section titled “\_\_ior\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ior__-5)

A UInt64 can bitwise or with another UInt64 or int e.g. `a |= UInt64(2)`

##### \_\_ipow\_\_

[Section titled “\_\_ipow\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ipow__-3)

A UInt64 can be raised to the power of another UInt64 or int e.g. `a **= UInt64(2)`.

This will error on overflow

##### \_\_irshift\_\_

[Section titled “\_\_irshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__irshift__-3)

A UInt64 can be right shifted by another UInt64 or int e.g. `a >>= UInt64(2)`

##### \_\_isub\_\_

[Section titled “\_\_isub\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__isub__-4)

A UInt64 can be subtracted with another UInt64 or int e.g. `a -= UInt64(2)`.

This will error on underflow

##### \_\_ixor\_\_

[Section titled “\_\_ixor\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ixor__-5)

A UInt64 can bitwise xor with another UInt64 or int e.g. `a ^= UInt64(2)`

##### \_\_le\_\_

[Section titled “\_\_le\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__le__-4)

A UInt64 can use the `<=` operator with another UInt64 or int

##### \_\_lshift\_\_

[Section titled “\_\_lshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__lshift__-3)

A UInt64 can be left shifted by another UInt64 or int e.g. `UInt64(4) << 2`

##### \_\_lt\_\_

[Section titled “\_\_lt\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__lt__-4)

A UInt64 can use the `<` operator with another UInt64 or int

##### \_\_mod\_\_

[Section titled “\_\_mod\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__mod__-4)

A UInt64 can be modded with another UInt64 or int e.g. `UInt64(4) % 2`.

This will error on mod by zero

##### \_\_mul\_\_

[Section titled “\_\_mul\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__mul__-4)

A UInt64 can be multiplied with another UInt64 or int e.g. `4 + UInt64(2)`.

This will error on overflow

##### \_\_ne\_\_

[Section titled “\_\_ne\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ne__-9)

A UInt64 can use the `!=` operator with another UInt64 or int

##### \_\_or\_\_

[Section titled “\_\_or\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__or__-5)

A UInt64 can bitwise or with another UInt64 or int e.g. `UInt64(4) | 2`

##### \_\_pos\_\_

[Section titled “\_\_pos\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__pos__-4)

_\_\_pos\_\_() → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Supports unary + operator. Redundant given the type is unsigned

##### \_\_pow\_\_

[Section titled “\_\_pow\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__pow__-3)

A UInt64 can be raised to the power of another UInt64 or int e.g. `UInt64(4) ** 2`.

This will error on overflow

##### \_\_radd\_\_

[Section titled “\_\_radd\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__radd__-6)

A UInt64 can be added with another UInt64 or int e.g. `4 + UInt64(2)`.

This will error on overflow

##### \_\_rand\_\_

[Section titled “\_\_rand\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rand__-4)

A UInt64 can bitwise and with another UInt64 or int e.g. `4 & UInt64(2)`

##### \_\_rfloordiv\_\_

[Section titled “\_\_rfloordiv\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rfloordiv__-4)

A UInt64 can be floor divided with another UInt64 or int e.g. `4 // UInt64(2)`.

This will error on divide by zero

##### \_\_rlshift\_\_

[Section titled “\_\_rlshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rlshift__-3)

A UInt64 can be left shifted by another UInt64 or int e.g. `4 << UInt64(2)`

##### \_\_rmod\_\_

[Section titled “\_\_rmod\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rmod__-4)

A UInt64 can be modded with another UInt64 or int e.g. `4 % UInt64(2)`.

This will error on mod by zero

##### \_\_rmul\_\_

[Section titled “\_\_rmul\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rmul__-4)

A UInt64 can be multiplied with another UInt64 or int e.g. `UInt64(4) + 2`.

This will error on overflow

##### \_\_ror\_\_

[Section titled “\_\_ror\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__ror__-4)

A UInt64 can bitwise or with another UInt64 or int e.g. `4 | UInt64(2)`

##### \_\_rpow\_\_

[Section titled “\_\_rpow\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rpow__-3)

A UInt64 can be raised to the power of another UInt64 or int e.g. `4 ** UInt64(2)`.

This will error on overflow

##### \_\_rrshift\_\_

[Section titled “\_\_rrshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rrshift__-3)

A UInt64 can be right shifted by another UInt64 or int e.g. `4 >> UInt64(2)`

##### \_\_rshift\_\_

[Section titled “\_\_rshift\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rshift__-3)

A UInt64 can be right shifted by another UInt64 or int e.g. `UInt64(4) >> 2`

##### \_\_rsub\_\_

[Section titled “\_\_rsub\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rsub__-4)

A UInt64 can be subtracted with another UInt64 or int e.g. `4 - UInt64(2)`.

This will error on underflow

##### \_\_rxor\_\_

[Section titled “\_\_rxor\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__rxor__-4)

A UInt64 can bitwise xor with another UInt64 or int e.g. `4 ^ UInt64(2)`

##### \_\_sub\_\_

[Section titled “\_\_sub\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__sub__-4)

A UInt64 can be subtracted with another UInt64 or int e.g. `UInt(4) - 2`.

This will error on underflow

##### \_\_xor\_\_

[Section titled “\_\_xor\_\_”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#__xor__-5)

A UInt64 can bitwise xor with another UInt64 or int e.g. `UInt64(4) ^ 2`

##### algopy.compile\_contract

[Section titled “algopy.compile\_contract”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopycompile_contract)

_algopy.compile\_contract(contract: [type](https://docs.python.org/3/library/functions.html#type)\[ [Contract](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Contract)\], /, \*, extra\_program\_pages: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int) = …, global\_uints: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int) = …, global\_bytes: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int) = …, local\_uints: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int) = …, local\_bytes: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int) = …, template\_vars: [collections.abc.Mapping](https://docs.python.org/3/library/collections.abc.html#collections.abc.Mapping)\[ [str](https://docs.python.org/3/library/stdtypes.html#str), [object](https://docs.python.org/3/library/functions.html#object)\] = …, template\_vars\_prefix: [str](https://docs.python.org/3/library/stdtypes.html#str) = …) → [algopy.CompiledContract](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.CompiledContract)_

Returns the compiled data for the specified contract

- **Parameters:**
  - **contract** – Algorand Python Contract to compile
  - **extra\_program\_pages** – Number of extra program pages, defaults to minimum required for contract
  - **global\_uints** – Number of global uint64s, defaults to value defined for contract
  - **global\_bytes** – Number of global bytes, defaults to value defined for contract
  - **local\_uints** – Number of local uint64s, defaults to value defined for contract
  - **local\_bytes** – Number of local bytes, defaults to value defined for contract
  - **template\_vars** – Template variables to substitute into the contract,
    key should be without the prefix, must evaluate to a compile time constant
    and match the type of the template var declaration
  - **template\_vars\_prefix** – Prefix to add to provided template vars,
    defaults to the prefix supplied on command line (which defaults to TMPL\_)

##### algopy.compile\_logicsig

[Section titled “algopy.compile\_logicsig”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopycompile_logicsig)

_algopy.compile\_logicsig(logicsig: [LogicSig](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.LogicSig), /, \*, template\_vars: [collections.abc.Mapping](https://docs.python.org/3/library/collections.abc.html#collections.abc.Mapping)\[ [str](https://docs.python.org/3/library/stdtypes.html#str), [object](https://docs.python.org/3/library/functions.html#object)\] = …, template\_vars\_prefix: [str](https://docs.python.org/3/library/stdtypes.html#str) = …) → [algopy.CompiledLogicSig](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.CompiledLogicSig)_

Returns the Account for the specified logic signature

- **Parameters:**
  - **logicsig** – Algorand Python Logic Signature to compile
  - **template\_vars** – Template variables to substitute into the logic signature,
    key should be without the prefix, must evaluate to a compile time constant
    and match the type of the template var declaration
  - **template\_vars\_prefix** – Prefix to add to provided template vars,
    defaults to the prefix supplied on command line (which defaults to TMPL\_)

##### algopy.ensure\_budget

[Section titled “algopy.ensure\_budget”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopyensure_budget)

_algopy.ensure\_budget(required\_budget: [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64) \| [int](https://docs.python.org/3/library/functions.html#int), fee\_source: [algopy.OpUpFeeSource](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.OpUpFeeSource) = …) → [None](https://docs.python.org/3/library/constants.html#None)_

Ensure the available op code budget is greater than or equal to required\_budget

##### algopy.log

[Section titled “algopy.log”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopylog)

_algopy.log(\*args: [object](https://docs.python.org/3/library/functions.html#object), sep: [algopy.String](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.String) \| [str](https://docs.python.org/3/library/stdtypes.html#str) \| [algopy.Bytes](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.Bytes) \| [bytes](https://docs.python.org/3/library/stdtypes.html#bytes) = ”) → [None](https://docs.python.org/3/library/constants.html#None)_

Concatenates and logs supplied args as a single bytes value.

UInt64 args are converted to bytes and each argument is separated by `sep`.
Literal `str` values will be encoded as UTF8.

##### algopy.logicsig

[Section titled “algopy.logicsig”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopylogicsig)

_algopy.logicsig(\*, name: [str](https://docs.python.org/3/library/stdtypes.html#str) = …, avm\_version: [int](https://docs.python.org/3/library/functions.html#int) = …, scratch\_slots: [algopy.urange](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.urange) \| [tuple](https://docs.python.org/3/library/stdtypes.html#tuple)\[ [int](https://docs.python.org/3/library/functions.html#int) \| [algopy.urange](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.urange), …\] \| [list](https://docs.python.org/3/library/stdtypes.html#list)\[ [int](https://docs.python.org/3/library/functions.html#int) \| [algopy.urange](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.urange)\] = ()) → [collections.abc.Callable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable)\[\[ [collections.abc.Callable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable)\[\[\], [bool](https://docs.python.org/3/library/functions.html#bool) \| [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)\]\], [algopy.LogicSig](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.LogicSig)\]_

Decorator to indicate a function is a logic signature

##### algopy.size\_of

[Section titled “algopy.size\_of”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopysize_of)

_algopy.size\_of(type\_or\_expression: [type](https://docs.python.org/3/library/functions.html#type) \| [object](https://docs.python.org/3/library/functions.html#object), /) → [algopy.UInt64](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopy.UInt64)_

Returns the number of bytes required to store the provided type object
or the type of provided expression

##### algopy.subroutine

[Section titled “algopy.subroutine”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopysubroutine)

\_algopy.subroutine(\*, inline: [bool](https://docs.python.org/3/library/functions.html#bool) \| [Literal](https://docs.python.org/3/library/typing.html#typing.Literal)\[auto\] = ‘auto’) → [collections.abc.Callable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable)\[\[ [collections.abc.Callable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable)\[algopy.\_P, algopy.\_R\]\], [collections.abc.Callable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable)\[algopy.\_P, algopy. _R\]\]_

Decorator to indicate functions or methods that can be called by a Smart Contract

Inlining can be controlled with the decorator argument `inline`.
When unspecified it defaults to auto, which allows the optimizer to decide whether to inline
or not. Setting `inline=True` forces inlining, and `inline=False` ensures the function will
never be inlined.

#### _class_ algopy.uenumerate

[Section titled “class algopy.uenumerate”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopyuenumerate)

\* _class_ algopy.uenumerate(iterable: [collections.abc.Iterable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Iterable)\[algopy.\_T\])\*

Yields pairs containing a count (from zero) and a value yielded by the iterable argument.

enumerate is useful for obtaining an indexed list:
(0, seq\[0\]), (1, seq\[1\]), (2, seq\[2\]), …

enumerate((a, b, c)) produces (0, a), (1, b), (2, c)

##### Initialization

[Section titled “Initialization”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#initialization-17)

#### _class_ algopy.urange

[Section titled “class algopy.urange”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#class-algopyurange)

Produces a sequence of UInt64 from start (inclusive) to stop (exclusive) by step.

urange(4) produces 0, 1, 2, 3
urange(i, j) produces i, i+1, i+2, …, j-1.
urange(i, j, 2) produces i, i+2, i+4, …, i+2n where n is the largest value where i+2n < j

##### algopy.zero\_bytes

[Section titled “algopy.zero\_bytes”](https://dev.algorand.co/reference/algorand-python/api/api-algopy/#algopyzero_bytes)

_algopy.zero\_bytes(typ: [type](https://docs.python.org/3/library/functions.html#type)\[algopy.zero\_bytes.T\]) → algopy.zero\_bytes.T_

Initializes a new value of the specified type, based on it’s zero bytes representation.

Only works for fixed size types that are bytes encoded.

Ask AI

reCAPTCHA

Recaptcha requires verification.

protected by **reCAPTCHA**
