Hey folks,
I’m building 3 transactions to be added to a txgroup, the first two transactions needs to be signed by the user and the 3rd by a logic signature account. My code looks like that (I’m using algosigner for allowing users to sign txs on the client side). I’m getting an error:
-
{message: ‘The transaction group is incomplete or presented in a different order than when it was created.’, code: 4300, name: ‘IncompleteOrDisorderedGroup’}
-
code: 4300
-
message: “The transaction group is incomplete or presented in a different order than when it was created.”
-
name: “IncompleteOrDisorderedGroup”
when trying to sign the first two txs (buyCallTx, and payTx) using algosigner, any ideas why?
// APPLICATION CALL TX
let appArgs = [];
const methodName = "buy";
appArgs.push(utils.stringToUint8Array(methodName));
let foreightAssets = [];
let buyCallTx = await transactionWrapper.callApp(
client,
props.connectedAddress,
undefined,
+loadedSound['appID'],
algosdk.OnApplicationComplete.NoOpOC,
appArgs,
foreightAssets,
false);
// PAYMENT TX BUYER -> SELLER
let payTx = await transactionWrapper.pay(
client,
props.connectedAddress,
loadedSound['owner'],
+loadedSound['price'],
undefined,
false);
// ASSET XFER: ESCROW -> BUYER
console.log('3 asset xfer tx');
let axferTx = await transactionWrapper.assetXfer(
client,
nftEscrowContract.escrowAddress,
undefined,
props.connectedAddress,
loadedSound['owner'],
1,
undefined,
+loadedSound['tokenID'],
false);
// ATOMIC TRANSFER of all txs in one
let txns = [
buyCallTx,
payTx,
axferTx
];
console.log('building tx group');
let txgroup = algosdk.assignGroupID(txns);
console.log('tx group built');
let signedBuyTx = await algosignerHelper.signTx(
AlgoSigner,
client,
buyCallTx);
let signedPayTx = await algosignerHelper.signTx(
AlgoSigner,
client,
payTx);
// sign logic sig
let signedAxferTx = algosdk.signLogicSigTransactionObject(axferTx, nftEscrowContract.lsigAccount).blob;
let signedTxs = [
signedBuyTx,
signedPayTx,
signedAxferTx];
console.log('attempting to send all signed txs...');
let tx = undefined;
try
{
tx = (await client.sendRawTransaction(signedTxs).do());
console.log("Transaction : " + tx.txId);
}
catch(err)
{
console.log(err);
throw err
}
// Wait for transaction to be confirmed
const confirmedTxn = await algosdk.waitForConfirmation(client, tx.txId, 4);
//Get the completed Transaction
console.log("Transaction " + tx.txId + " confirmed in round " + confirmedTxn["confirmed-round"]);
My algosigner helper function looks like this:
const signTx = async (
AlgoSigner,
client,
unsignedTx) => {
try
{
let unsigned_tx_b64 = AlgoSigner.encoding.msgpackToBase64(unsignedTx.toByte());
const signedTxns = await AlgoSigner.signTxn([{txn: unsigned_tx_b64}]);
console.log('signed txns:' + signedTxns);
return signedTxns[0];
}
catch(error)
{
console.error(error);
return null;
}
}
Anyone has any ideas why I’m getting this error?
Thanks