Is there a way to get raw transaction bytes from a transaction ID?

Given a transaction ID, is it possible to get raw bytes?
I have this transaction: Algorand Transaction
and cannot recreate it obtaining the same ID from the JS SDK.

For instance, I am using

const algosdk = require('algosdk');
const suggestedParams = {
        fee: 1000,
        firstRound: 29285108,
        lastRound: 29286108,
        genesisHash: 'wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8=',
        genesisID: 'mainnet-v1.0',
    }
const a = new algosdk.makePaymentTxnWithSuggestedParamsFromObject({
        from: 'X5SKLROIIFMUJWB6HS4AD3YJ7OQGBFNCFBJ2HGGGFFBX3M62ZECVX7I2WE',
        to: 'XNFT36FUCFRR6CK675FW4BEBCCCOJ4HOSMGCN6J2W6ZMB34KM2ENTNQCP4',
        suggestedParams,
        amount: 0,
        closeRemainderTo: 'XNFT36FUCFRR6CK675FW4BEBCCCOJ4HOSMGCN6J2W6ZMB34KM2ENTNQCP4'
    })
a.group = 'uuWEqwPI7c/tWT1YDqyEdjCyfkuw1WILO4f9+XSi/8Y='
a.fee = 1000
console.info('a', a.txID())
// R4IS6ZFVO5OXZT2IIMFYIT2V4HQY27ERLC7WOFM77KMHISU5GD7Q
// expected JOSKWFOAUVOYCMRTGBKV6L5U767WA4UHD5XERYSUNCC2QP7I5NGQ

this works for me…

const algosdk = require("algosdk");
const suggestedParams = {
  fee: 1000,
  firstRound: 29285108,
  lastRound: 29286108,
  genesisHash: "wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8=",
  genesisID: "mainnet-v1.0",
};
const a = new algosdk.makePaymentTxnWithSuggestedParamsFromObject({
  from: "X5SKLROIIFMUJWB6HS4AD3YJ7OQGBFNCFBJ2HGGGFFBX3M62ZECVX7I2WE",
  to: "XNFT36FUCFRR6CK675FW4BEBCCCOJ4HOSMGCN6J2W6ZMB34KM2ENTNQCP4",
  suggestedParams,
  amount: 0,
  closeRemainderTo:
    "XNFT36FUCFRR6CK675FW4BEBCCCOJ4HOSMGCN6J2W6ZMB34KM2ENTNQCP4",
});
a.group = new Uint8Array(
  Buffer.from("uuWEqwPI7c/tWT1YDqyEdjCyfkuw1WILO4f9+XSi/8Y=", "base64")
);
a.fee = 1000;

console.info("a", a.txID());

returns

a JOSKWFOAUVOYCMRTGBKV6L5U767WA4UHD5XERYSUNCC2QP7I5NGQ

you have to parse the group as uint8array

1 Like