{"version":3,"file":"resolve-signed-transactions.mjs","names":[],"sources":["../../src/transaction/resolve-signed-transactions.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport Transaction = algosdk.Transaction\n\n/**\n * Resolve the transactions as they were signed.\n *\n * Signers (e.g. wallets) can mutate the transactions they are given, so the signed transactions are the source of truth\n * for what is actually sent to the network. Without this, a mutated transaction would be reported (and waited for)\n * under the transaction ID of the transaction that was built, which was never sent.\n *\n * The built transaction is returned when it wasn't mutated, so callers keep the exact transaction they built.\n *\n * @param builtTransactions The transactions that were given to the signers\n * @param encodedSignedTransactions The signed transactions returned by the signers\n * @returns The transactions as they were signed\n */\nexport function resolveSignedTransactions(builtTransactions: Transaction[], encodedSignedTransactions: Uint8Array[]): Transaction[] {\n  return encodedSignedTransactions.map((encodedSignedTransaction, index) => {\n    const { txn } = algosdk.decodeSignedTransaction(encodedSignedTransaction)\n    const builtTransaction = builtTransactions[index]\n    return builtTransaction !== undefined && builtTransaction.txID() === txn.txID() ? builtTransaction : txn\n  })\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,SAAgB,0BAA0B,mBAAkC,2BAAwD;CAClI,OAAO,0BAA0B,KAAK,0BAA0B,UAAU;EACxE,MAAM,EAAE,QAAQ,QAAQ,wBAAwB,wBAAwB;EACxE,MAAM,mBAAmB,kBAAkB;EAC3C,OAAO,qBAAqB,KAAA,KAAa,iBAAiB,KAAK,MAAM,IAAI,KAAK,IAAI,mBAAmB;CACvG,CAAC;AACH"}