UNPKG

@bigmi/core

Version:

TypeScript library for Bitcoin apps.

21 lines 601 B
import { TransactionNotFoundError } from '../errors/transaction.js'; export async function getUTXOTransaction(client, { txId, blockHash }) { try { const params = [txId, true]; if (blockHash) { params.push(blockHash); } const data = await client.request({ method: 'getrawtransaction', params: params, }); return data; } catch (_error) { throw new TransactionNotFoundError({ blockHash: blockHash, hash: txId, }); } } //# sourceMappingURL=getUTXOTransaction.js.map