tfchain/TFChainWallet.py
def initiate(self, participator, amount, refund_time='+48h', source=None, refund=None, data=None, submit=True):
        """
        Initiate an atomic swap contract, targeted at the specified address,
        with the given amount. By default a 48 hours duration (starting from last block time)
        is used as time until contract can be refunded, but this can be changed.

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

        The amount can be a str or an int:
            - when it is an int, you are defining the amount in the smallest unit (that is 1 == 0.000000001 TFT)
            - when defining as a str you can use the following space-stripped and case-insentive formats:
                - '123456789': same as when defining the amount as an int
                - '123.456': define the amount in TFT (that is '123.456' == 123.456 TFT == 123456000000)
                - '123456 TFT': define the amount in TFT (that is '123456 TFT' == 123456 TFT == 123456000000000)
                - '123.456 TFT': define the amount in TFT (that is '123.456 TFT' == 123.456 TFT == 123456000000)

        Returns the AtomicSwapInitiationResult.

        @param participator: see explanation above
        @param amount: int or str that defines the amount of TFT to set, see explanation above
        @param duration: the duration until the atomic swap contract becomes refundable
        @param source: one or multiple addresses/unlockhashes from which to fund this coin send transaction, by default all personal wallet addresses are used, only known addresses can be used
        @param refund: optional refund address, by default is uses the source if it specifies a single address otherwise it uses the default wallet address (recipient type, with None being the exception in its interpretation)
        @param data: optional data that can be attached ot the sent transaction (str or bytes), with a max length of 83
        @param submit: True by default, if False the transaction will not be sent even if possible (e.g. if you want to double check)
        """
        # create a random secret
        secret = AtomicSwapSecret.random()
        secret_hash = AtomicSwapSecretHash.from_secret(secret)

        # create the contract
        result = self._create_contract(
            recipient=participator, amount=amount, refund_time=refund_time,
            source=source, refund=refund, data=data, secret_hash=secret_hash,
            submit=submit)

        # return the contract, transaction, submission status as well as secret
        return AtomicSwapInitiationResult(
            AtomicSwapContract(coinoutput=result.transaction.coin_outputs[0], unspent=True,
                current_timestamp=self._chain_time),
            secret, result.transaction, result.submitted)

        Initiate an atomic swap contract, targeted at the specified address,
        with the given amount. By default a 48 hours duration (starting from last block time)
        is used as time until contract can be refunded, but this can be changed.

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

        The amount can be a str or an int:
            - when it is an int, you are defining the amount in the smallest unit (that is 1 == 0.000000001 TFT)
            - when defining as a str you can use the following space-stripped and case-insentive formats:
                - '123456789': same as when defining the amount as an int
                - '123.456': define the amount in TFT (that is '123.456' == 123.456 TFT == 123456000000)
                - '123456 TFT': define the amount in TFT (that is '123456 TFT' == 123456 TFT == 123456000000000)
                - '123.456 TFT': define the amount in TFT (that is '123.456 TFT' == 123.456 TFT == 123456000000)

        Returns the AtomicSwapInitiationResult.

        @param participator: see explanation above
        @param amount: int or str that defines the amount of TFT to set, see explanation above
        @param duration: the duration until the atomic swap contract becomes refundable
        @param source: one or multiple addresses/unlockhashes from which to fund this coin send transaction, by default all personal wallet addresses are used, only known addresses can be used
        @param refund: optional refund address, by default is uses the source if it specifies a single address otherwise it uses the default wallet address (recipient type, with None being the exception in its interpretation)
        @param data: optional data that can be attached ot the sent transaction (str or bytes), with a max length of 83
        @param submit: True by default, if False the transaction will not be sent even if possible (e.g. if you want to double check)
        
Initiate an atomic swap contract, targeted at the specified address,
with the given amount. By default a 48 hours duration (starting from last block time)
is used as time until contract can be refunded, but this can be changed.






Initiate an atomic swap contract targeted at the specified address with the given amount . By default a 48 hours duration ( starting from last block time ) is used as time until contract can be refunded but this can be changed .
def initiate(self, participator, amount, refund_time='+48h', source=None, refund=None, data=None, submit=True):
        secret = AtomicSwapSecret.random()
        secret_hash = AtomicSwapSecretHash.from_secret(secret)
        result = self._create_contract(
            recipient=participator, amount=amount, refund_time=refund_time,
            source=source, refund=refund, data=data, secret_hash=secret_hash,
            submit=submit)
        return AtomicSwapInitiationResult(
            AtomicSwapContract(coinoutput=result.transaction.coin_outputs[0], unspent=True,
                current_timestamp=self._chain_time),
            secret, result.transaction, result.submitted)
def initiate ( self , participator , amount , refund_time = '+48h' , source = None , refund = None , data = None , submit = True ) : secret = AtomicSwapSecret . random ( ) secret_hash = AtomicSwapSecretHash . from_secret ( secret ) result = self . _create_contract ( recipient = participator , amount = amount , refund_time = refund_time , source = source , refund = refund , data = data , secret_hash = secret_hash , submit = submit ) return AtomicSwapInitiationResult ( AtomicSwapContract ( coinoutput = result . transaction . coin_outputs [ 0 ] , unspent = True , current_timestamp = self . _chain_time ) , secret , result . transaction , result . submitted )
Initiate an atomic swap contract, targeted at the specified address,
with the given amount.
Initiate an atomic swap contract targeted at the specified address with the given amount .
"""
        Initiate an atomic swap contract, targeted at the specified address,
        with the given amount. By default a 48 hours duration (starting from last block time)
        is used as time until contract can be refunded, but this can be changed.

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

        The amount can be a str or an int:
            - when it is an int, you are defining the amount in the smallest unit (that is 1 == 0.000000001 TFT)
            - when defining as a str you can use the following space-stripped and case-insentive formats:
                - '123456789': same as when defining the amount as an int
                - '123.456': define the amount in TFT (that is '123.456' == 123.456 TFT == 123456000000)
                - '123456 TFT': define the amount in TFT (that is '123456 TFT' == 123456 TFT == 123456000000000)
                - '123.456 TFT': define the amount in TFT (that is '123.456 TFT' == 123.456 TFT == 123456000000)

        Returns the AtomicSwapInitiationResult.

        @param participator: see explanation above
        @param amount: int or str that defines the amount of TFT to set, see explanation above
        @param duration: the duration until the atomic swap contract becomes refundable
        @param source: one or multiple addresses/unlockhashes from which to fund this coin send transaction, by default all personal wallet addresses are used, only known addresses can be used
        @param refund: optional refund address, by default is uses the source if it specifies a single address otherwise it uses the default wallet address (recipient type, with None being the exception in its interpretation)
        @param data: optional data that can be attached ot the sent transaction (str or bytes), with a max length of 83
        @param submit: True by default, if False the transaction will not be sent even if possible (e.g. if you want to double check)
        """ # create a random secret # create the contract # return the contract, transaction, submission status as well as secret
self
participator
see explanation above
see explanation above
amount
int or str that defines the amount of TFT to set, see explanation above
int or str that defines the amount of TFT to set see explanation above
refund_time
source
one or multiple addresses/unlockhashes from which to fund this coin send transaction, by default all personal wallet addresses are used, only known addresses can be used
one or multiple addresses / unlockhashes from which to fund this coin send transaction by default all personal wallet addresses are used only known addresses can be used
refund
optional refund address, by default is uses the source if it specifies a single address otherwise it uses the default wallet address (recipient type, with None being the exception in its interpretation)
optional refund address by default is uses the source if it specifies a single address otherwise it uses the default wallet address ( recipient type with None being the exception in its interpretation )
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
submit
True by default, if False the transaction will not be sent even if possible
True by default if False the transaction will not be sent even if possible
duration
the duration until the atomic swap contract becomes refundable
the duration until the atomic swap contract becomes refundable