@@ -4,7 +4,6 @@ import Tx from 'ethereumjs-tx';
44import { toWei, fromWei, toHex } from 'web3-utils';
55import * as retry from 'async-retry';
66
7−import { BRIDGE_ERROR } from './error';
87import { NETWORK_TYPES } from './network';
98import { ledgerSignTransaction } from './ledger';
109import { trezorSignTransaction } from './trezor';
@@ -114,21 +113,7 @@ const signTransaction = async config => {
114113 ? Object.assign(txParams, eip155Params)
115114 : txParams;
116115
117− const wal = wallet.matchWith({
118− Just: w => w.value,
119− Nothing: () => {
120− throw BRIDGE_ERROR.MISSING_WALLET;
121− },
122− });
123−
124− const sec = wal.privateKey;
125−
126− const utx = txn.matchWith({
127− Just: tx => Object.assign(tx.value, signingParams),
128− Nothing: () => {
129− throw BRIDGE_ERROR.MISSING_TXN;
130− },
131− });
116+ const utx = Object.assign(txn, signingParams);
132117
133118 const stx = new Tx(utx);
134119
@@ -137,7 +122,7 @@ const signTransaction = async config => {
137122 } else if (walletType === WALLET_TYPES.TREZOR) {
138123 await trezorSignTransaction(stx, walletHdPath);
139124 } else {
140− stx.sign(sec);
125+ stx.sign(wallet.privateKey);
141126 }
142127
143128 setStx(Just(stx));