UNPKG

@bigmi/core

Version:

TypeScript library for Bitcoin apps.

26 lines 725 B
export 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, })), }); //# sourceMappingURL=utils.js.map