Skip to content
This new developer portal is under construction. For complete documentation, please refer to the old developer portal.

Freezing assets

Authorized by: Asset Freeze Address

Freezing or unfreezing an asset for an account requires a transaction that is signed by the freeze account. The code below illustrates the freeze transaction.

1
"""
2
Send an asset freeze transaction freezing an asset with asset id 1234
3
4
Parameters for freezing an asset.
5
- sender: The address of the account that will send the transaction
6
- asset_id: The ID of the asset
7
- account: The account to freeze or unfreeze
8
- frozen: Whether the assets in the account should be frozen
9
"""
10
txn_result = algorand_client.send.asset_freeze(
11
AssetFreezeParams(
12
sender=account_a.address,
13
asset_id=1234,
14
account=account_b.address, # The account to freeze or unfreeze
15
frozen=True,
16
)
17
)
18
19
"""
20
Send an asset unfreeze transaction unfreezing an asset with asset id 1234
21
"""
22
txn_result = algorand_client.send.asset_freeze(
23
AssetFreezeParams(
24
sender=account_a.address,
25
asset_id=1234,
26
account=account_b.address, # The account to freeze or unfreeze
27
frozen=False,
28
)
29
)

See also