# Msgpack decode error with multisig transaction with Javascript SDK

**URL:** <https://forum.algorand.co/t/msgpack-decode-error-with-multisig-transaction-with-javascript-sdk/2535>\
**Category:** Uncategorized\
**Created:** [February 4, 2021, 3:08pm UTC](https://forum.algorand.co/t/msgpack-decode-error-with-multisig-transaction-with-javascript-sdk/2535 "2021-02-04T15:08:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bayuobie](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@bayuobie](https://forum.algorand.co/u/bayuobie)\
**Post date:** [February 4, 2021, 3:08pm UTC](https://forum.algorand.co/t/msgpack-decode-error-with-multisig-transaction-with-javascript-sdk/2535/1 "2021-02-04T15:08:47Z")

</div>

I am sending a multisig transaction but get an error when I try posting that to the chain with the error

> msgpack decode error [pos 1]: only encoded map or array can be decoded into a struct

I am not doing any encoding and I get the transaction ID after signing it but submission to the chain then returns a 400 error code with the message above.

Below is a sample transaction details.

{txID: “45EJOSSI7UQW27RHBN6KY5ULMWC5JYUAF4UZ7SERFKHBIGA2TPXQ”, blob: Uint8Array(457)}

---

<div class="post-metadata">

**Author:** ![fabrice](https://avatars.discourse-cdn.com/v4/letter/f/5fc32e/32.png) [@fabrice](https://forum.algorand.co/u/fabrice)\
**Post date:** [February 4, 2021, 3:10pm UTC](https://forum.algorand.co/t/msgpack-decode-error-with-multisig-transaction-with-javascript-sdk/2535/2 "2021-02-04T15:10:40Z")

</div>

Can you provide the code that generates the error?

PS: You can write the code between triple backquotes to make it look nicer. Example:  
```js  
const example = 5;  
```  
is displayed as:

```auto
const example = 5;

```

---

<div class="post-metadata">

**Author:** ![bayuobie](https://avatars.discourse-cdn.com/v4/letter/b/82dd89/32.png) [@bayuobie](https://forum.algorand.co/u/bayuobie)\
**Post date:** [February 4, 2021, 4:46pm UTC](https://forum.algorand.co/t/msgpack-decode-error-with-multisig-transaction-with-javascript-sdk/2535/3 "2021-02-04T16:46:21Z")

</div>

Here is the code

> let txn = {  
> “to”: PayoutRecipient[0],  
> “fee”: getParams.fee,  
> “amount”: amountToPay,  
> “firstRound”: getParams[“last-round”],  
> “lastRound”: getParams[“last-round”] + 1000,  
> “genesisID”: getParams[“genesis-id”],  
> “genesisHash”: getParams[“genesis-hash”],  
> “note”: new Uint8Array(“payment”),  
> };  
> let signedTxn = algosdk.signMultisigTransaction(txn, mparamsAccount, itemPay.sk);  
> fetch(traxUrl, {  
> method: ‘POST’,  
> headers: {  
> ‘Content-Type’: ‘application/x-binary’,  
> },  
> body: signedTxn,  
> })  
> .then(response =\> response.json())  
> .then(data =\> {  
> console.log(data);  
> })  
> .catch((error) =\> {  
> console.error(‘Error:’, error);  
> });  
> });

---

<div class="post-metadata">

**Author:** ![JasonW](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@JasonW](https://forum.algorand.co/u/JasonW)\
**Post date:** [February 4, 2021, 6:34pm UTC](https://forum.algorand.co/t/msgpack-decode-error-with-multisig-transaction-with-javascript-sdk/2535/4 "2021-02-04T18:34:47Z")

</div>

What is the value of traxUrl?

---

<div class="post-metadata">

**Author:** ![fabrice](https://avatars.discourse-cdn.com/v4/letter/f/5fc32e/32.png) [@fabrice](https://forum.algorand.co/u/fabrice)\
**Post date:** [February 4, 2021, 8:07pm UTC](https://forum.algorand.co/t/msgpack-decode-error-with-multisig-transaction-with-javascript-sdk/2535/5 "2021-02-04T20:07:11Z")

</div>

I think the issue is that `signedTxn` is an object with two properties: `txID` and `blob`.  
You need to only send `blob`:

```auto
fetch(traxUrl, {
    method: 'POST',
    headers: {
        'Content-Type': 'application/x-binary',
    },
    body: signedTxn.blob,
})

```

See [js-algorand-sdk/main.js at 5d4dd3102e59366d93545522403cda2eb95196e7 · algorand/js-algorand-sdk · GitHub](https://github.com/algorand/js-algorand-sdk/blob/5d4dd3102e59366d93545522403cda2eb95196e7/src/main.js#L112)
