Broadcast tx is failing

Hi i’m trying to broadcast a signed tx but fails.

Got this msg

{"message":"msgpack decode error [pos 1]: only encoded map or array can be decoded into a struct"}

Curl as hex:

curl -X 'POST' 'https://testnet.algoexplorerapi.io/v2/transactions' -H 'accept: application/json' -H 'Content-Type: application/x-binary' -d '83a473676e72c4203636643338353335303736663039346238356365336132653062343435386637a3736967c440886851ff3e2274c84788ad9fc8c1ca3c5814fd634d60100e1202efdf2acc8ef4585fcb578eeeacf7e61303c2bc7ed4b3e9c9995f4265761c2e418c1f88d1b90ca374786e89a3616d74ce000f4240a3666565ce0003b538a26676cd03e8a367656eac746573746e65742d76312e30a26768c4204863b518a4b3c84ec810f22d4f1081cb0f71f059a7ac20dec62f7f70e5093a22a26c76cd2710a3726376c4203d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660ca3736e64c420fc51cd8e6218a1'

Curl as base64:

curl -X 'POST' 'https://testnet.algoexplorerapi.io/v2/transactions' -H 'accept: application/json' -H 'Content-Type: application/x-binary' -d 'g6RzZ25yxCA2NmQzODUzNTA3NmYwOTRiODVjZTNhMmUwYjQ0NThmN6NzaWfEQIhoUf8+InTIR4itn8jByjxYFP1jTWAQDhIC798qzI70WF/LV47urPfmEwPCvH7Us+nJmV9CZXYcLkGMH4jRuQyjdHhuiaNhbXTOAA9CQKNmZWXOAAO1OKJmds0D6KNnZW6sdGVzdG5ldC12MS4womdoxCBIY7UYpLPITsgQ8i1PEIHLD3HwWaesIN7GL39w5Qk6IqJsds0nEKNyY3bEID1AF8PoQ4lakrcKp00bfrycmCzPLsSWjMDNVfEq9GYMo3NuZMQg/FHNjmIYoaONpH7QAjDwWAgW7RO6MwOsXeuRFUiQgCWkdHlwZaNwYXk='

There is any other suggested format for this?

Tried also from

https://testnet.algoexplorer.io/api-dev/v2

But also fails

How are you generating the transaction?

The issue is that you need to pass the actual binary data, not a base64/hex encoding of the data.

Export the base64 into a file:

base64 -d <<< g6RzZ25yxCA2NmQzODUzNTA3NmYwOTRiODVjZTNhMmUwYjQ0NThmN6NzaWfEQIhoUf8+InTIR4itn8jByjxYFP1jTWAQDhIC798qzI70WF/LV47urPfmEwPCvH7Us+nJmV9CZXYcLkGMH4jRuQyjdHhuiaNhbXTOAA9CQKNmZWXOAAO1OKJmds0D6KNnZW6sdGVzdG5ldC12MS4womdoxCBIY7UYpLPITsgQ8i1PEIHLD3HwWaesIN7GL39w5Qk6IqJsds0nEKNyY3bEID1AF8PoQ4lakrcKp00bfrycmCzPLsSWjMDNVfEq9GYMo3NuZMQg/FHNjmIYoaONpH7QAjDwWAgW7RO6MwOsXeuRFUiQgCWkdHlwZaNwYXk= > tx.sig

Then send the file:

curl -X POST https://testnet.algoexplorerapi.io/v2/transactions -H 'accept: application/json' -H 'Content-Type: application/x-binary' -T tx.sig

(use of -T)

Remark that you get the following error:

invalid : transaction window size excessive (1000--10000)

because the last valid round must be at most 1000 rounds after the first valid. Furthermore the current round on testnet must be between first valid and last valid, which is not the case.

PS: It is best to write code between triple backquotes ```