UNPKG

lotus-sdk

Version:

Central repository for several classes of tools for integrating with, and building for, the Lotusia ecosystem

13 lines (12 loc) 389 B
import { Transaction } from '../bitcore/transaction/index.js'; export function processTransaction(tx) { if (typeof tx === 'string') { if (!/^[a-fA-F0-9]+$/.test(tx)) { throw new Error('Invalid transaction string format'); } tx = Transaction.fromString(tx); } else if (tx instanceof Buffer) { tx = Transaction.fromBuffer(tx); } }