# Signing transactions in tx group result into error: 'The transaction group is incomplete or presented in a different order than when it was created.'

**URL:** <https://forum.algorand.co/t/signing-transactions-in-tx-group-result-into-error-the-transaction-group-is-incomplete-or-presented-in-a-different-order-than-when-it-was-created/7098>\
**Category:** Uncategorized\
**Created:** [June 7, 2022, 8:43pm UTC](https://forum.algorand.co/t/signing-transactions-in-tx-group-result-into-error-the-transaction-group-is-incomplete-or-presented-in-a-different-order-than-when-it-was-created/7098 "2022-06-07T20:43:46Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![kubot](https://avatars.discourse-cdn.com/v4/letter/k/5daacb/32.png) [@kubot](https://forum.algorand.co/u/kubot)\
**Post date:** [June 14, 2022, 1:03pm UTC](https://forum.algorand.co/t/signing-transactions-in-tx-group-result-into-error-the-transaction-group-is-incomplete-or-presented-in-a-different-order-than-when-it-was-created/7098/9 "2022-06-14T13:03:50Z")

</div>

Hello fabrice,

1. I’m generating the lsigAccount like this:

From the client side I’m requesting the teal source code of the nft escrow contract (relies on token id and app id) from the server and then the server is returning the teal source as a string and looks something like this:

returned TEAL code:

```auto
#pragma version 4
global GroupSize
int 3
==
assert
gtxn 0 ApplicationID
int 87793081
==
assert
gtxn 1 TypeEnum
int pay
==
assert
gtxn 2 AssetAmount
int 1
==
assert
gtxn 2 XferAsset
int 87793064
==
assert
gtxn 2 Fee
int 1000
<=
assert
gtxn 2 AssetCloseTo
global ZeroAddress
==
assert
gtxn 2 RekeyTo
global ZeroAddress
==
assert
int 1
return

```

Then on the client side a class nftEscrowContract calculates the stateless smart contract related stuff such as lsigAccount and escrowAddress like this:

```auto
    // here this.escrowTealSource is the teal code retrieved from the server mentioned before
    async init()
    {
    try
        {
            this.escrowBytes = await this.calculateEscrowBytes(this.escrowTealSource);
            this.escrowAddress = await this.calculateEscrowAddress();
            return true;
        }
        catch(err)
        {
            console.log(err);
            return false;
        }
    }

    async calculateEscrowBytes(tealSource)
    {
        console.log('calculating escrow bytes...');

        let encoder = new TextEncoder();
        let programBytes = encoder.encode(tealSource);
        let compileResponse = await this.client.compile(programBytes).do();
        let escrowBytes = new Uint8Array(Buffer.from(compileResponse.result, "base64"));

        console.log('escrow bytes calculated: ' + escrowBytes);

        return escrowBytes;
    }

    async calculateEscrowAddress()
    {
        console.log('calculating escrow address...');
        this.lsigAccount = new algosdk.LogicSigAccount(this.escrowBytes);
        let escrowAddress = this.lsigAccount.address();
        console.log('escrow address calculated ' + escrowAddress);
        return escrowAddress;
    }

```

So I’m calculating lsigAccount like this:

```auto
this.lsigAccount = new algosdk.LogicSigAccount(this.escrowBytes);

```

1. Printing signedAxferTx like this

```auto
console.log(Buffer.from(signedAxferTx.blob).toString("base64"));

```

returns:  
**gqRsc2lngaFsxAr///////////8Bo3R4boykYWFtdAGkYXJjdsQgcIQIU3m1yEcmO5GugQcx+aS2hP0gNds8lZ50T0YDfdWkYXNuZMQgGZqLP/+X2hXE75NlJGaJUfSEs8G1FjOspUGdILkaHWmjZmVlzQPoomZ2zgFS9zajZ2VurHRlc3RuZXQtdjEuMKJnaMQgSGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiKjZ3JwxCDO6kV+H6vS+M9ea728TiVKW3HBg1c4KEXmpnYkFauIyqJsds4BUvseo3NuZMQgee0gtqGVdHwlYmkhocmIbTYzn2Q+a/5uvH/aKsHKgLakdHlwZaVheGZlcqR4YWlkzgU7nag=**

1. I’m using TESTNET using purestake’s client.

* * *

Something strange I just noticed, the escrow address generated on the server is different from the one generated on the client but they seemingly using the same source code 🤔 Any ideas what might be the issue?

Many thanks

---

_[View the full topic](https://forum.algorand.co/t/signing-transactions-in-tx-group-result-into-error-the-transaction-group-is-incomplete-or-presented-in-a-different-order-than-when-it-was-created/7098)._
