1

I am trying to create a transaction op and I am not being able to get the sequence number. I tried on Stellar lab but it did not work. What's wrong? Below is my code:

# print('Transferring fund to {}'.format(customer_account))
    print('Transferring fund to {}'.format(destination_account))
    response = None
    is_transferred = True

    try:
        # Now create Payment Op
        op = Payment({
            'source': source_account,
            'destination': destination_account,
            'asset': asset_object,
            'amount': str(amount)
        })
        msg = TextMemo('REF ID: {}'.format(refund_code))

        # Getting the next sequence of the address
        sequence = horizon.account(source_account).get('sequence')

        # construct Tx
        tx = Transaction(
            source=source_account,
            opts={
                'sequence': sequence,
                'memo': msg,
                'operations': [
                    op,
                ],
            },
        )

Update

I notice the issue is when the coin is RETURNED BACK to the issuer. No Sequence number issue with the issuer sends coin to the requestor.

10
  • What is the source_account object? – Richard Dunn Mar 13 '19 at 9:22
  • @RichardDunn It is a string variable of Customer Address, in case it is GALSILD7SXIEC3J5B5K3IJJIQCXX2ZI2Z6DZMFEPEYDI6SBW6ILL5R7V – Volatil3 Mar 13 '19 at 9:26
  • @RichardDunn ISSUER is GBRLFJMK4G3K24YVGTXIHOWJHKRL6QHC4UB4OEOCGDLEEW3WE4G7POVZ – Volatil3 Mar 13 '19 at 9:27
  • @RichardDunn It seems accounts are expired horizon-testnet.stellar.org/accounts/… – Volatil3 Mar 13 '19 at 9:31
  • 1
    February 27th, 2019 was the last one, as per the link. – Richard Dunn Mar 13 '19 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.