@@ -20,6 +20,7 @@ import {
2020} from "thirdweb" ;
2121import { useSendTransaction } from "thirdweb/react" ;
2222import { TransactionButton } from "../../../../components/buttons/TransactionButton" ;
23+ import { useTrack } from "../../../../hooks/analytics/useTrack" ;
2324import { useV5DashboardChain } from "../../../../lib/v5-adapter" ;
2425import { getSDKTheme } from "../../../components/sdk-component-theme" ;
2526import type { NebulaTxData } from "./Chats" ;
@@ -78,6 +79,7 @@ export function ExecuteTransactionCardLayout(props: {
7879 const chain = useV5DashboardChain ( txData . chainId ) ;
7980 const isTransactionSent =
8081 props . status . type === "confirming" || props . status . type === "confirmed" ;
82+ const trackEvent = useTrack ( ) ;
8183
8284 const explorer = chain . blockExplorers ?. [ 0 ] ?. url ;
8385
@@ -99,6 +101,13 @@ export function ExecuteTransactionCardLayout(props: {
99101 txChainID = { txData . chainId }
100102 variant = "default"
101103 onClick = { async ( ) => {
104+ trackEvent ( {
105+ category : "nebula" ,
106+ action : "execute_transaction" ,
107+ label : "attempt" ,
108+ chainId : txData . chainId ,
109+ } ) ;
110+
102111 const tx = prepareTransaction ( {
103112 chain : chain ,
104113 client : props . client ,
@@ -115,6 +124,13 @@ export function ExecuteTransactionCardLayout(props: {
115124 const submittedReceipt = await sendTransaction . mutateAsync ( tx ) ;
116125 txHash = submittedReceipt . transactionHash ;
117126
127+ trackEvent ( {
128+ category : "nebula" ,
129+ action : "execute_transaction" ,
130+ label : "sent" ,
131+ chainId : txData . chainId ,
132+ } ) ;
133+
118134 // wait for receipt
119135 props . setStatus ( {
120136 type : "confirming" ,
@@ -127,6 +143,13 @@ export function ExecuteTransactionCardLayout(props: {
127143 type : "confirmed" ,
128144 txHash : confirmReceipt . transactionHash ,
129145 } ) ;
146+
147+ trackEvent ( {
148+ category : "nebula" ,
149+ action : "execute_transaction" ,
150+ label : "confirmed" ,
151+ chainId : txData . chainId ,
152+ } ) ;
130153 } catch {
131154 props . setStatus ( {
132155 type : "failed" ,
0 commit comments