user1045: I'm missing transaction prefix in order to get bech32 hash of transaction id using cardano-serialization-lib.
What prefix is used in transaction bech32 hash and how can I find/compute one?
const decodeUtxo =
  (wasm: WasmT) =>
  (encodedUtxo: string): WasmNamespace.TransactionUnspentOutput =>
    wasm.TransactionUnspentOutput.from_bytes(Buffer.from(encodedUtxo, "hex"));

const collateralUtxos = (await wallet.getCollateral()).map(decodeUtxo(wasm));

const prefix = '' // how can I find this?

// to_bech32 function requires prefix
const collateralTxHashes = collateralUtxos.map((utxo) => utxo.input().transaction_id().to_bech32(prefix))


user1045: In order to get transaction id using cardano-serialization-lib you should convert transaction id to bytes and convert them to hex string.
Buffer.from(utxo.input().transaction_id().to_bytes()).toString('hex')


1045: <p>I'm missing transaction prefix in order to get bech32 hash of transaction id using cardano-serialization-lib.</p>
<p>What prefix is used in transaction bech32 hash and how can I find/compute one?</p>
<pre><code>const decodeUtxo =
  (wasm: WasmT) =&gt;
  (encodedUtxo: string): WasmNamespace.TransactionUnspentOutput =&gt;
    wasm.TransactionUnspentOutput.from_bytes(Buffer.from(encodedUtxo, &quot;hex&quot;));

const collateralUtxos = (await wallet.getCollateral()).map(decodeUtxo(wasm));

const prefix = '' // how can I find this?

// to_bech32 function requires prefix
const collateralTxHashes = collateralUtxos.map((utxo) =&gt; utxo.input().transaction_id().to_bech32(prefix))
</code></pre>
 1045: <p>In order to get transaction id using cardano-serialization-lib you should convert transaction id to bytes and convert them to hex string.</p>
<pre><code>Buffer.from(utxo.input().transaction_id().to_bytes()).toString('hex')
</code></pre>
