Skip to content

Commit

Permalink
Add additional mixpanel properties to events 2 (#959)
Browse files Browse the repository at this point in the history
* [UPDATE] @wormhole-foundation/[email protected]

* updated connect dep
  • Loading branch information
danielisaacgeslin authored Jul 30, 2024
1 parent 35ac4a0 commit ebf6597
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
8 changes: 4 additions & 4 deletions apps/connect/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@mui/icons-material": "^5.14.11",
"@mui/material": "^5.12.1",
"@tanstack/react-query": "^5.14.2",
"@wormhole-foundation/wormhole-connect": "^0.3.17",
"@wormhole-foundation/wormhole-connect": "^0.3.18",
"dompurify": "^3.0.6",
"mixpanel-browser": "^2.53.0",
"react": "^18.2.0",
Expand Down
2 changes: 2 additions & 0 deletions apps/connect/src/providers/telemetry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe("telemetry", () => {
fromChain: "bsc",
toChain: "arbitrum",
txId: "txId",
USDAmount: 123.456,
toToken: {
symbol: "osETH",
tokenId: { address: "address", chain: "chain" },
Expand Down Expand Up @@ -65,6 +66,7 @@ describe("telemetry", () => {
toTokenAddress: "address",
route: "wstETH Bridge",
txId: "txId",
USDAmount: 123.456,
});
});

Expand Down
5 changes: 3 additions & 2 deletions apps/connect/src/providers/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,15 @@ export const eventHandler = (e: WormholeConnectEvent) => {
// Convert WormholeConnectEvent to Attributes
const isTransferError =
e.type === "transfer.error" || e.type === "transfer.redeem.error";
const attributes: { [key: string]: string } = {
const attributes: { [key: string]: string | number | undefined } = {
fromChain: e.details.fromChain.toString(),
toChain: e.details.toChain.toString(),
fromTokenSymbol: e.details.fromToken?.symbol,
fromTokenAddress: getTokenAddress(e.details.fromToken),
toTokenSymbol: e.details.toToken?.symbol,
toTokenAddress: getTokenAddress(e.details.toToken),
txId: e.details.txId!,
txId: e.details.txId,
USDAmount: e.details.USDAmount,
route:
{
bridge: "Manual Bridge",
Expand Down

0 comments on commit ebf6597

Please sign in to comment.