Example #1
0
    def like_memo_tx(self,
                     liked_memo,
                     tip_amount=None,
                     sender_of_liked_memo=None):
        """
        :param liked_memo: the memo or to tip or like, or, the transaction hash of that memo
        :type liked_memo: ``Memo`` or ``str``
        :param tip_amount: 0 for like, >546 for tip, in satoshi
        :type tip_amount: ``int``
        :param sender_of_liked_memo: sender's address of liked memo.If liked_memo is transaction
                    hash and this is None, this need be get from NetworkAPI
        :type sender_of_liked_memo: ``str``
        :return:
        """
        if isinstance(liked_memo, Memo):
            memo = Memo.like_memo(liked_memo,
                                  self._address,
                                  tip_amount=tip_amount)
        elif isinstance(liked_memo, str):
            if sender_of_liked_memo is None:
                liked_memo = Memo.from_txhash(liked_memo)
                memo = Memo.like_memo(liked_memo,
                                      self._address,
                                      tip_amount=tip_amount)
            else:
                memo = Memo.like_memo(
                    liked_memo,
                    self._address,
                    tip_amount=tip_amount,
                    sender_of_liked_memo=sender_of_liked_memo)
        else:
            raise TypeError('liked_memo should be Memo object or string!')

        return self.__send_new_memo(memo)
Example #2
0
    def like_memo(self, liked_memo,tip_amount=None):
        memo=Memo.like_memo(liked_memo,self._address,tip_amount=tip_amount)

        return self.__send_new_memo(memo)