Ejemplo n.º 1
0
 def afrz(self, sender, index: int, target, frozen, send=None, **kwargs):
     params = self.algod.suggested_params()
     tx = txn.AssetFreezeTxn(sender, params, index, target, frozen, **kwargs)
     return self.finish(tx, send)
Ejemplo n.º 2
0
def unfreeze_txn(context):
    params = context.acl.suggested_params_as_object()
    context.txn = transaction.AssetFreezeTxn(context.pk, params,
                                             context.asset_index, context.rcv,
                                             False)
Ejemplo n.º 3
0
# Example: freezing or unfreezing an account

from algosdk import account
from algosdk.future import transaction

# his transaction must be sent from the account specified as the freeze manager for the asset
freeze_private_key, freeze_address = account.generate_account()

fee_per_byte = 10
first_valid_round = 1000
last_valid_round = 2000
genesis_hash = "SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI="
_, freeze_target = account.generate_account()

index = 1234  # identifying index of the asset

# create the asset freeze transaction
sp = transaction.SuggestedParams(fee_per_byte, first_valid_round,
                                 last_valid_round, genesis_hash)
txn = transaction.AssetFreezeTxn(freeze_address,
                                 sp,
                                 index=index,
                                 target=freeze_target,
                                 new_freeze_state=True)

# sign the transaction
signed_txn = txn.sign(freeze_private_key)