UNPKG

@bigmi/core

Version:

TypeScript library for Bitcoin apps.

30 lines 914 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.mempoolTransactionTransformer = void 0; const mempoolTransactionTransformer = (txn) => ({ hash: txn.txid, txid: txn.txid, vout: txn.vout.map((vout, index) => ({ n: index, scriptPubKey: { address: vout.scriptpubkey_address, asm: vout.scriptpubkey_asm, type: vout.scriptpubkey_type, desc: vout.scriptpubkey, hex: vout.scriptpubkey, }, value: vout.value, })), vin: txn.vin.map((vin) => ({ scriptSig: { asm: vin.scriptsig_asm, hex: vin.scriptsig, }, sequence: vin.sequence, txinwitness: vin.witness, txid: vin.txid, vout: vin.vout, })), }); exports.mempoolTransactionTransformer = mempoolTransactionTransformer; //# sourceMappingURL=utils.js.map