MyAlgo connect not working

When I try to send a grouped transaction with myalgo connect, the signing works fine,

        const myAlgoConnect = new MyAlgoConnect();
        const txnsToGroup = [ optinapp1txn, optinassettxn];
        const groupID = algosdk.computeGroupID(txnsToGroup)
        for (let i = 0; i < 2; i++) txnsToGroup[i].group = groupID;
        const signedTxns = await myAlgoConnect.signTransaction( => txn.toByte()));

however, when I send the transaction

        (await algodClient.sendRawTransaction(signedTxns.blob).do());

it displays the error TypeError: Argument must be byte array

Please help me!

const blobs = [  ];
signedTxns.forEach((signedTxn) => {
await algodClient.sendRawTransaction(blobs).do()

This is an old thread, but here goes anyways. I’m learning and have a question in your code.

Isn’t “await” only valid in async function? i.e.

async function asyncCall() {
    const signedTxns = await myAlgoConnect.signTransaction......

How is it running outside of async function?

await is only valid inside an async function.
Most likely the code was inside an async function (it is just that it was not shown).

1 Like