MyCrypto/common/libs/transaction/utils/index.ts

27 lines
583 B
TypeScript

import { Wei } from 'libs/units';
import * as eth from './ether';
import { IFullWallet } from 'libs/wallet';
import { ITransaction } from '../typings';
export const signTransaction = async (
t: ITransaction,
w: IFullWallet,
accountBalance: Wei,
isOffline: boolean
) => {
eth.validateTx(t, accountBalance, isOffline);
const signedT = await eth.signTx(t, w);
return signedT;
};
export {
enoughBalanceViaTx,
validateTx,
validGasLimit,
makeTransaction,
getTransactionFields,
getTransactionFee,
computeIndexingHash
} from './ether';
export * from './token';