I am trying to post a test transaction to the chain getting this error. I am using Purestake and Algo SDK for javascript. Here is my code
const legacyServer = "https://testnet-algorand.api.purestake.io/ps1";
const newServer = "https://testnet-algorand.api.purestake.io/ps2";
const indexServer = "https://testnet-algorand.api.purestake.io/idx2";
const port = "";
const token = {
'X-API-key' : 'b0r9BtPAG64Adngz6DO6e6wo4FhQenSw1OUpXLHT',
}
let algodClient = new algosdk.Algod(token, legacyServer, port);
let algodClientV2 = new algosdk.Algodv2(token, newServer, port);
let indexerClient = new algosdk.Indexer(token, indexServer, port);
async function sendtrx (){
let params = await algodClientV2.getTransactionParams().do();
let amount = 1000000;
var mnemonic = "XXX-XXX-YYY";
var recoveredAccount = algosdk.mnemonicToSecretKey(mnemonic);
document.getElementById("examples").value = JSON.stringify(recoveredAccount.addr)
let txn = {
"from": recoveredAccount.addr,
"to": "AXTW46L6EPL4V7XSJAR7X24ATUM4N43BA6HQT3IBG3RS6GZCOBJNR735NI",
"fee": 1000,
"amount": amount,
"firstRound": params.firstRound,
"lastRound": params.lastRound,
"genesisID": params.genesisID,
"genesisHash": params.genesisHash,
"note": new Uint8Array(0),
"type": "pay",
};
let signedTxn = algosdk.signTransaction(txn2, recoveredAccount.sk);
let sendTx = await algodClientV2.sendRawTransaction(signedTxn.blob).do();
console.log("Transaction : " + sendTx.txId);
}
I will appreciate any help