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.

sp = algod_client.suggested_params()
# Create freeze transaction to freeze the asset in acct2 balance
freeze_txn = transaction.AssetFreezeTxn(
sender=acct1.address,
sp=sp,
index=created_asset,
target=acct2.address,
new_freeze_state=True,
)
signed_freeze_txn = freeze_txn.sign(acct1.private_key)
txid = algod_client.send_transaction(signed_freeze_txn)
print(f"Sent freeze transaction with txid: {txid}")
results = transaction.wait_for_confirmation(algod_client, txid, 4)
print(f"Result confirmed in round: {results['confirmed-round']}")

See also