tfchain/TFChainWallet.py
def definition_set(self, minter, data=None):
        """
        Redefine the current minter definition.
        Arbitrary data can be attached as well if desired.

        The minter is one of:
            - str (or unlockhash): minter is a personal wallet
            - list: minter is a MultiSig wallet where all owners (specified as a list of addresses) have to sign
            - tuple (addresses, sigcount): minter is a sigcount-of-addresscount MultiSig wallet

        Returns a TransactionSendResult.

        @param minter: see explanation above
        @param data: optional data that can be attached ot the sent transaction (str or bytes), with a max length of 83
        """
        # create empty Mint Definition Txn, with a newly generated Nonce set already
        txn = tftransactions.mint_definition_new()

        # add the minimum miner fee
        txn.miner_fee_add(self._minium_miner_fee)

        # set the new mint condition
        txn.mint_condition = ConditionTypes.from_recipient(minter)
        # minter definition must be of unlock type 1 or 3
        ut = txn.mint_condition.unlockhash.type
        if ut not in (UnlockHashType.PUBLIC_KEY, UnlockHashType.MULTI_SIG):
            raise ValueError("{} is an invalid unlock hash type and cannot be used for a minter definition".format(ut))

        # optionally set the data
        if data is not None:
            txn.data = data

        # get and set the current mint condition
        txn.parent_mint_condition = self._current_mint_condition_get()
        # create a raw fulfillment based on the current mint condition
        txn.mint_fulfillment = FulfillmentTypes.from_condition(txn.parent_mint_condition)

        # get all signature requests
        sig_requests = txn.signature_requests_new()
        if len(sig_requests) == 0:
            raise Exception("BUG: sig requests should not be empty at this point, please fix or report as an issue")

        # fulfill the signature requests that we can fulfill
        for request in sig_requests:
            try:
                key_pair = self._wallet.key_pair_get(request.wallet_address)
                input_hash = request.input_hash_new(public_key=key_pair.public_key)
                signature = key_pair.sign(input_hash)
                request.signature_fulfill(public_key=key_pair.public_key, signature=signature)
            except KeyError:
                pass # this is acceptable due to how we directly try the key_pair_get method

        submit = txn.is_fulfilled()
        if submit:
            txn.id = self._transaction_put(transaction=txn)

        # return the txn, as well as the submit status as a boolean
        return TransactionSendResult(txn, submit)

        Redefine the current minter definition.
        Arbitrary data can be attached as well if desired.

        The minter is one of:
            - str (or unlockhash): minter is a personal wallet
            - list: minter is a MultiSig wallet where all owners (specified as a list of addresses) have to sign
            - tuple (addresses, sigcount): minter is a sigcount-of-addresscount MultiSig wallet

        Returns a TransactionSendResult.

        @param minter: see explanation above
        @param data: optional data that can be attached ot the sent transaction (str or bytes), with a max length of 83
        
Redefine the current minter definition.
Arbitrary data can be attached as well if desired.

The minter is one of:
str (or unlockhash): minter is a personal wallet
list: minter is a MultiSig wallet where all owners (specified as a list of addresses) have to sign
tuple (addresses, sigcount): minter is a sigcount-of-addresscount MultiSig wallet


Redefine the current minter definition . Arbitrary data can be attached as well if desired . The minter is one of : str ( or unlockhash ) : minter is a personal wallet list : minter is a MultiSig wallet where all owners ( specified as a list of addresses ) have to sign tuple ( addresses sigcount ) : minter is a sigcount - of - addresscount MultiSig wallet
def definition_set(self, minter, data=None):
        txn = tftransactions.mint_definition_new()
        txn.miner_fee_add(self._minium_miner_fee)
        txn.mint_condition = ConditionTypes.from_recipient(minter)
        ut = txn.mint_condition.unlockhash.type
        if ut not in (UnlockHashType.PUBLIC_KEY, UnlockHashType.MULTI_SIG):
            raise ValueError("{} is an invalid unlock hash type and cannot be used for a minter definition".format(ut))
        if data is not None:
            txn.data = data
        txn.parent_mint_condition = self._current_mint_condition_get()
        txn.mint_fulfillment = FulfillmentTypes.from_condition(txn.parent_mint_condition)
        sig_requests = txn.signature_requests_new()
        if len(sig_requests) == 0:
            raise Exception("BUG: sig requests should not be empty at this point, please fix or report as an issue")
        for request in sig_requests:
            try:
                key_pair = self._wallet.key_pair_get(request.wallet_address)
                input_hash = request.input_hash_new(public_key=key_pair.public_key)
                signature = key_pair.sign(input_hash)
                request.signature_fulfill(public_key=key_pair.public_key, signature=signature)
            except KeyError:
                pass 
        submit = txn.is_fulfilled()
        if submit:
            txn.id = self._transaction_put(transaction=txn)
        return TransactionSendResult(txn, submit)
def definition_set ( self , minter , data = None ) : txn = tftransactions . mint_definition_new ( ) txn . miner_fee_add ( self . _minium_miner_fee ) txn . mint_condition = ConditionTypes . from_recipient ( minter ) ut = txn . mint_condition . unlockhash . type if ut not in ( UnlockHashType . PUBLIC_KEY , UnlockHashType . MULTI_SIG ) : raise ValueError ( "{} is an invalid unlock hash type and cannot be used for a minter definition" . format ( ut ) ) if data is not None : txn . data = data txn . parent_mint_condition = self . _current_mint_condition_get ( ) txn . mint_fulfillment = FulfillmentTypes . from_condition ( txn . parent_mint_condition ) sig_requests = txn . signature_requests_new ( ) if len ( sig_requests ) == 0 : raise Exception ( "BUG: sig requests should not be empty at this point, please fix or report as an issue" ) for request in sig_requests : try : key_pair = self . _wallet . key_pair_get ( request . wallet_address ) input_hash = request . input_hash_new ( public_key = key_pair . public_key ) signature = key_pair . sign ( input_hash ) request . signature_fulfill ( public_key = key_pair . public_key , signature = signature ) except KeyError : pass submit = txn . is_fulfilled ( ) if submit : txn . id = self . _transaction_put ( transaction = txn ) return TransactionSendResult ( txn , submit )
Redefine the current minter definition.
Redefine the current minter definition .
"""
        Redefine the current minter definition.
        Arbitrary data can be attached as well if desired.

        The minter is one of:
            - str (or unlockhash): minter is a personal wallet
            - list: minter is a MultiSig wallet where all owners (specified as a list of addresses) have to sign
            - tuple (addresses, sigcount): minter is a sigcount-of-addresscount MultiSig wallet

        Returns a TransactionSendResult.

        @param minter: see explanation above
        @param data: optional data that can be attached ot the sent transaction (str or bytes), with a max length of 83
        """ # create empty Mint Definition Txn, with a newly generated Nonce set already # add the minimum miner fee # set the new mint condition # minter definition must be of unlock type 1 or 3 # optionally set the data # get and set the current mint condition # create a raw fulfillment based on the current mint condition # get all signature requests # fulfill the signature requests that we can fulfill # this is acceptable due to how we directly try the key_pair_get method # return the txn, as well as the submit status as a boolean
self
minter
see explanation above
see explanation above
data
optional data that can be attached ot the sent transaction (str or bytes), with a max length of 83
optional data that can be attached ot the sent transaction ( str or bytes ) with a max length of 83