@@ -797,8 +797,29 @@ export class Blockchain extends Plugin {
797
797
( _ ) => this . executionContext . currentblockGasLimit ( )
798
798
)
799
799
800
+ const logTransaction = ( txhash , origin ) => {
801
+ this . detectNetwork ( ( error , network ) => {
802
+ console . log ( `transaction sent: ${ txhash } ` , network )
803
+ if ( network && network . id ) {
804
+ _paq . push ( [ 'trackEvent' , 'udapp' , `sendTransaction-from-${ origin } ` , `${ txhash } -${ network . id } ` ] )
805
+ } else {
806
+ try {
807
+ const networkString = JSON . stringify ( network )
808
+ _paq . push ( [ 'trackEvent' , 'udapp' , `sendTransaction-from-${ origin } ` , `${ txhash } -${ networkString } ` ] )
809
+ } catch ( e ) {
810
+ _paq . push ( [ 'trackEvent' , 'udapp' , `sendTransaction-from-${ origin } ` , `${ txhash } -unknownnetwork` ] )
811
+ }
812
+ }
813
+ } )
814
+ }
815
+
816
+ this . on ( 'web3Provider' , 'transactionBroadcasted' , ( txhash ) => {
817
+ logTransaction ( txhash , 'plugin' )
818
+ } )
819
+
800
820
web3Runner . event . register ( 'transactionBroadcasted' , ( txhash , isUserOp ) => {
801
821
if ( isUserOp ) _paq . push ( [ 'trackEvent' , 'udapp' , 'safeSmartAccount' , `txBroadcastedFromSmartAccount` ] )
822
+ logTransaction ( txhash , 'gui' )
802
823
this . executionContext . detectNetwork ( async ( error , network ) => {
803
824
if ( error || ! network ) return
804
825
if ( network . name === 'VM' ) return
0 commit comments