import { ILegacyTxObject , ILegacyTxReceipt , ITxObject , ITxReceipt , ITxType2Object , ITxType2Receipt } from '@types' ; export const isTypedTx = ( tx ) : tx is Partial < ITxType2Object > => { return 'type' in tx && tx . type !== null && tx . type !== undefined && tx . type !== 0 ; } ; export const isType2Tx = ( tx ) : tx is Partial < ITxType2Object > => { return isTypedTx ( tx ) && tx . type === 2 ; } ; export const isLegacyTx = ( tx ) : tx is ILegacyTxObject => { return ! isTypedTx ( tx ) ; } ; export const isTypedReceipt = ( tx ) : tx is ITxType2Receipt => { return 'type' in tx && tx . type !== null && tx . type !== undefined && tx . type !== 0 ; } ; export const isType2Receipt = ( tx ) : tx is ITxType2Receipt => { return isTypedReceipt ( tx ) && tx . type === 2 ; } ; export const isLegacyReceipt = ( tx ) : tx is ILegacyTxReceipt => { return ! isTypedReceipt ( tx ) ; } ;