I am creating a transaction and signing it offline. I want to send this data to algo blockchain by pasting it into the algoexplorer.io Developer API utility.
Can anyone advise me how to obtain the binary string from the signed transaction blob?
const algo = require('algosdk');
var testTxn = { ... };
var signedTxn = algo.signTransaction(testTxn, secretKey);
^^^ This works, I obtain an object.
// convert Uint8Array to string
var raw = String.fromCharCode.apply(null, signedTxn.blob);
^^^ This gives me a string, but when I submit it to the API, I get this error: "msgpack decode error [pos 1]: only encoded map or array can be decoded into a struct"
How should I obtain the raw data of signed transaction blob that an api such as algoexplorer or PureStake will accept?
I’ve tried using client.sendRawTransaction(signedTxn.blob).do() with PureStake and this works, but it’s not exactly offline since there needs to be a connected client.
My goal with this (tedious) workflow is to create an airgap for the signing computer.
Why not save the signed tx and move to another computer and use goal to sumbit it or curl?
ie curl -s -X POST --data-binary “@./rawsigned.tx” -H "X-Algo-API-Token: APITOK" "http://{API}/v2/transactions