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

chore(token-import): Adding analytics for the send flow #4901

Merged
merged 3 commits into from
Feb 14, 2024
Merged
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
2 changes: 2 additions & 0 deletions src/analytics/Properties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ interface SendEventsProperties {
networkId: NetworkId | null
tokenId: string
commentLength: number
isTokenManuallyImported: boolean
}

[SendEvents.send_secure_start]: {
Expand Down Expand Up @@ -598,6 +599,7 @@ interface SendEventsProperties {
tokenAddress: string | undefined
tokenId: string
networkId: string
isTokenManuallyImported: boolean
}
[SendEvents.send_tx_error]: {
error: string
Expand Down
1 change: 1 addition & 0 deletions src/send/SendConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ function SendConfirmation(props: Props) {
networkId: tokenInfo?.networkId ?? null,
tokenId,
commentLength: comment.length,
isTokenManuallyImported: !!tokenInfo?.isManuallyImported,
})

dispatch(
Expand Down
1 change: 1 addition & 0 deletions src/send/saga.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ describe(sendPaymentSaga, () => {
tokenAddress: '0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1'.toLowerCase(),
tokenId: mockCusdTokenId,
networkId: 'celo-alfajores',
isTokenManuallyImported: false,
})
})

Expand Down
1 change: 1 addition & 0 deletions src/send/saga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ function* sendPayment(
tokenAddress: tokenInfo.address ?? undefined,
tokenId: tokenInfo.tokenId,
networkId: tokenInfo.networkId,
isTokenManuallyImported: !!tokenInfo?.isManuallyImported,
})
} catch (err) {
const error = ensureError(err)
Expand Down
9 changes: 9 additions & 0 deletions src/tokens/saga.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ describe(fetchImportedTokenBalances, () => {
name: 'TestToken',
symbol: 'TT',
isManuallyImported: true,
priceUsd: null,
lastKnownPriceUsd: null,
},
[mockPoofTokenId]: {
address: mockPoofAddress,
Expand All @@ -374,6 +376,8 @@ describe(fetchImportedTokenBalances, () => {
name: 'PoofToken',
symbol: 'Poof',
isManuallyImported: true,
priceUsd: null,
lastKnownPriceUsd: null,
},
[mockUSDCTokenId]: {
address: mockUSDCAddress,
Expand All @@ -385,6 +389,8 @@ describe(fetchImportedTokenBalances, () => {
name: 'USD Coin',
symbol: 'USDC',
isManuallyImported: true,
priceUsd: null,
lastKnownPriceUsd: null,
},
}

Expand Down Expand Up @@ -416,14 +422,17 @@ describe(fetchImportedTokenBalances, () => {
[mockTestTokenTokenId]: {
...mockImportedTokens[mockTestTokenTokenId],
balance: new BigNumber(0.000000001).toFixed(),
priceUsd: undefined,
},
[mockPoofTokenId]: {
...mockImportedTokens[mockPoofTokenId],
balance: new BigNumber(0.0005).toFixed(),
priceUsd: undefined,
},
[mockUSDCTokenId]: {
...mockImportedTokens[mockUSDCTokenId],
balance: new BigNumber(10).toFixed(),
priceUsd: undefined,
},
})
})
Expand Down
Loading