Skip to content

Commit 598033a

Browse files
authored
Merge pull request #193 from oasisprotocol/ml/add-analytic-event-for-form-submitted-in-withdrawal
move: Add form submitted tracking event
2 parents 6991446 + 9c2dc3e commit 598033a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

move/src/useWithdraw.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { transferToConsensus } from './withdraw/transferToConsensus'
1212
import { useGenerateSapphireAccount } from './withdraw/useGenerateSapphireAccount'
1313
import { minimalWithdrawableAmount, withdrawToConsensus } from './withdraw/withdrawToConsensus'
1414
import { trackEvent } from 'fathom-client'
15-
import { consensusConfig } from './utils/oasisConfig.ts'
15+
import { consensusConfig, sapphireConfig } from './utils/oasisConfig.ts'
1616

1717
// Use global variable here, due to step4 using different context(not in sync with react hooks)
1818
let isInputModeGlobal = true
@@ -48,10 +48,15 @@ export function useWithdraw() {
4848

4949
async function step3(value: bigint) {
5050
if (!generatedSapphireAccount) return
51+
5152
await sendTransactionAsync({
5253
to: generatedSapphireAccount?.address,
5354
value,
5455
})
56+
57+
trackEvent('withdrawal flow form submitted', {
58+
_value: fromBaseUnitsToTrackEventCents(value, sapphireConfig.decimals),
59+
})
5560
}
5661

5762
// Long running promise, doesn't get canceled if this component is destroyed

0 commit comments

Comments
 (0)