# All files / src/api/methods sendRawTransaction.js

100% Statements 7/7
100% Branches 0/0
100% Functions 1/1
100% Lines 7/7

    1
    2
    3
    4
    5
    6
    7
    8
    9
    101x
    1x

    1x
    1x
    1x
    1x
    1x

     const { Tx } = require('leap-core');
    const sendTx = require('../../txHelpers/sendTx');

    module.exports = async (lotionPort, rawTx) => {
      const data = Buffer.from(rawTx.data);
      const tx = Tx.fromRaw(data);
      await sendTx(lotionPort, `0x${data.toString('hex')}`);
      return tx.hash();
    };