Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transfer dialog: add metrics to usdc bridge form #211

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions app/components/datadog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export function LazyDatadog() {
applicationId: process.env.NEXT_PUBLIC_DATADOG_APPLICATION_ID,
clientToken: process.env.NEXT_PUBLIC_DATADOG_CLIENT_TOKEN,
site: "us5.datadoghq.com",
service: "testnet-interface",
env: "testnet",
service: `${process.env.NEXT_PUBLIC_DD_ENV}-interface`,
env: process.env.NEXT_PUBLIC_DD_ENV,
version: "1.0.0",
sessionSampleRate: 100,
sessionReplaySampleRate: 100,
Expand All @@ -40,8 +40,8 @@ export function LazyDatadog() {
datadogLogs.init({
clientToken: process.env.NEXT_PUBLIC_DATADOG_CLIENT_TOKEN,
site: "us5.datadoghq.com",
service: "testnet-interface",
env: "testnet",
service: `${process.env.NEXT_PUBLIC_DD_ENV}-interface`,
env: process.env.NEXT_PUBLIC_DD_ENV,
forwardErrorsToLogs: true,
forwardConsoleLogs: "all",
sessionSampleRate: 100,
Expand Down
23 changes: 23 additions & 0 deletions components/dialogs/transfer/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { LiFiStep } from "@lifi/sdk"
import { Token } from "@renegade-fi/react"
import { QueryClient } from "@tanstack/react-query"
import { formatUnits } from "viem"
Expand Down Expand Up @@ -128,3 +129,25 @@ export function getExplorerLink(
}
return `${explorerUrl}/tx/${txHash}`
}

export function formatQuoteToEventParams(quote?: LiFiStep) {
if (!quote) return {}
const { action, estimate } = quote
return {
fromChainId: action.fromChainId,
fromTokenMint: action.fromToken.address,
fromTokenTicker: action.fromToken.symbol,
fromTokenAmount: formatUnits(
BigInt(estimate.fromAmount ?? 0),
action.fromToken.decimals ?? 0,
),
toChainId: action.toChainId,
toTokenMint: action.toToken.address,
toTokenTicker: action.toToken.symbol,
toTokenAmount: formatUnits(
BigInt(estimate.toAmount ?? 0),
action.toToken.decimals ?? 0,
),
tool: quote.tool,
}
}
Loading
Loading