Skip to content

Commit 417e772

Browse files
ci(release): publish latest release
1 parent f597735 commit 417e772

5 files changed

Lines changed: 151 additions & 30 deletions

File tree

RELEASE

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
IPFS hash of the deployment:
2-
- CIDv0: `QmaAPxGWx578fPij3zJxixZffLaJViSqns2BkKMjyHXYw1`
3-
- CIDv1: `bafybeifpvpacimasf7mlsdlvo3wngmzk4q6fh5mlat5yxwthv5lkzvryza`
2+
- CIDv0: `QmR6p18nhEFKM7Rn3SgY16Z9LpzTY3JWdLaoMEdAGTZJSZ`
3+
- CIDv1: `bafybeibja5ybbbxkredjdylxbrewrauqm6vyxfe3vhyyh3rrkuapywhzny`
44

55
The latest release is always mirrored at [app.uniswap.org](https://app.uniswap.org).
66

@@ -10,5 +10,5 @@ You can also access the Uniswap Interface from an IPFS gateway.
1010
Your Uniswap settings are never remembered across different URLs.
1111

1212
IPFS gateways:
13-
- https://bafybeifpvpacimasf7mlsdlvo3wngmzk4q6fh5mlat5yxwthv5lkzvryza.ipfs.dweb.link/
14-
- [ipfs://QmaAPxGWx578fPij3zJxixZffLaJViSqns2BkKMjyHXYw1/](ipfs://QmaAPxGWx578fPij3zJxixZffLaJViSqns2BkKMjyHXYw1/)
13+
- https://bafybeibja5ybbbxkredjdylxbrewrauqm6vyxfe3vhyyh3rrkuapywhzny.ipfs.dweb.link/
14+
- [ipfs://QmR6p18nhEFKM7Rn3SgY16Z9LpzTY3JWdLaoMEdAGTZJSZ/](ipfs://QmR6p18nhEFKM7Rn3SgY16Z9LpzTY3JWdLaoMEdAGTZJSZ/)

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
web/5.148.5
1+
web/5.148.6

packages/uniswap/src/features/search/SearchModal/analytics/analytics.test.ts

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Token } from '@uniswap/sdk-core'
22
import {
3+
MultichainTokenOption,
34
OnchainItemListOptionType,
45
TokenOption,
56
UnitagOption,
@@ -55,6 +56,48 @@ const MOCK_TOKEN2: TokenOption = {
5556
balanceUSD: undefined,
5657
}
5758

59+
const MOCK_MULTICHAIN_TOKEN: MultichainTokenOption = {
60+
type: OnchainItemListOptionType.MultichainToken,
61+
multichainResult: {
62+
id: 'usdc',
63+
name: 'USD Coin',
64+
symbol: 'USDC',
65+
logoUrl: 'https://example.com/usdc.png',
66+
tokens: [
67+
{
68+
currency: {
69+
chainId: 1,
70+
address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
71+
name: 'USD Coin',
72+
decimals: 6,
73+
} as Token,
74+
currencyId: '1_0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
75+
logoUrl: 'https://example.com/usdc.png',
76+
},
77+
{
78+
currency: {
79+
chainId: 130,
80+
address: '0x345',
81+
name: 'USD Coin',
82+
decimals: 6,
83+
} as Token,
84+
currencyId: '130_0x345',
85+
logoUrl: 'https://example.com/usdc.png',
86+
},
87+
],
88+
},
89+
primaryCurrencyInfo: {
90+
currency: {
91+
chainId: 1,
92+
address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
93+
name: 'USD Coin',
94+
decimals: 6,
95+
} as Token,
96+
currencyId: '1_0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
97+
logoUrl: 'https://example.com/usdc.png',
98+
},
99+
}
100+
58101
describe('sendSearchOptionItemClickedAnalytics', () => {
59102
const mockSendAnalyticsEvent = sendAnalyticsEvent as Mock
60103

@@ -130,6 +173,7 @@ describe('sendSearchOptionItemClickedAnalytics', () => {
130173
query: 'test',
131174
chainId: 1,
132175
suggestion_type: 'token-suggestion',
176+
token_type: 'token',
133177
total_suggestions: 2,
134178
query_text: 'test',
135179
selected_search_result_name: 'Test Token 1',
@@ -139,6 +183,46 @@ describe('sendSearchOptionItemClickedAnalytics', () => {
139183
})
140184
})
141185

186+
it('sends multichain token analytics event on web', () => {
187+
mockPlatformState.isMobileApp = false
188+
189+
const mockSection: OnchainItemSection<MultichainTokenOption> = {
190+
sectionKey: OnchainItemSectionName.Tokens,
191+
data: [MOCK_MULTICHAIN_TOKEN],
192+
}
193+
const mockSearchFilters: SearchFilterContext = {
194+
query: 'usdc',
195+
searchChainFilter: null,
196+
searchTabFilter: SearchTab.Tokens,
197+
}
198+
199+
sendSearchOptionItemClickedAnalytics({
200+
item: MOCK_MULTICHAIN_TOKEN,
201+
section: mockSection,
202+
rowIndex: 1,
203+
sectionIndex: 0,
204+
searchFilters: mockSearchFilters,
205+
})
206+
207+
expect(mockSendAnalyticsEvent).toHaveBeenCalledWith(InterfaceEventName.NavbarResultSelected, {
208+
category: OnchainItemSectionName.Tokens,
209+
isHistory: false,
210+
position: 1,
211+
sectionPosition: 1,
212+
suggestionCount: 1,
213+
query: 'usdc',
214+
chainId: 1,
215+
suggestion_type: 'token-suggestion',
216+
token_type: 'multichain_token',
217+
total_suggestions: 1,
218+
query_text: 'usdc',
219+
selected_search_result_name: 'USD Coin',
220+
selected_search_result_address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48',
221+
searchChainFilter: null,
222+
searchTabFilter: SearchTab.Tokens,
223+
})
224+
})
225+
142226
it('sends wallet address analytics event', () => {
143227
mockPlatformState.isMobileApp = true
144228
const mockWallet: UnitagOption = {

packages/uniswap/src/features/search/SearchModal/analytics/analytics.ts

Lines changed: 57 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ProtocolVersion } from '@uniswap/client-data-api/dist/data/v1/poolTypes_pb'
2+
import { Currency } from '@uniswap/sdk-core'
23
import { isMobileApp } from '@universe/environment'
34
import { OnchainItemListOptionType, SearchModalOption } from 'uniswap/src/components/lists/items/types'
45
import { extractDomain } from 'uniswap/src/components/lists/items/wallets/utils'
@@ -32,33 +33,31 @@ export function sendSearchOptionItemClickedAnalytics({
3233
}
3334

3435
switch (item.type) {
35-
case OnchainItemListOptionType.Token: {
36-
const currency = item.currencyInfo.currency
37-
if (isMobileApp) {
38-
sendAnalyticsEvent(MobileEventName.ExploreSearchResultClicked, {
39-
...searchContext,
40-
name: currency.name ?? '',
41-
chain: currency.chainId,
42-
address: currency.isNative ? 'NATIVE' : currency.address,
43-
type: 'token',
44-
})
36+
case OnchainItemListOptionType.MultichainToken: {
37+
const firstCurrency = item.multichainResult.tokens[0]?.currency
38+
39+
if (firstCurrency === undefined) {
40+
logger.warn(
41+
'SearchModal/analytics.ts',
42+
'sendSearchOptionItemClickedAnalytics',
43+
'First currency is undefined in multichain result, skipping analytics',
44+
{ item },
45+
)
46+
return
47+
}
48+
49+
if (item.multichainResult.tokens.length === 1) {
50+
sendTokenAnalyticsEvent({ searchContext, currency: firstCurrency })
4551
} else {
46-
sendAnalyticsEvent(InterfaceEventName.NavbarResultSelected, {
47-
...searchContext,
48-
chainId: currency.chainId,
49-
suggestion_type: searchContext.isHistory
50-
? NavBarSearchTypes.RecentSearch
51-
: searchContext.query && searchContext.query.length > 0
52-
? NavBarSearchTypes.TokenSuggestion
53-
: NavBarSearchTypes.TokenTrending,
54-
total_suggestions: searchContext.suggestionCount,
55-
query_text: searchContext.query ?? '',
56-
selected_search_result_name: currency.name ?? '',
57-
selected_search_result_address: currency.isNative ? 'NATIVE' : currency.address,
58-
})
52+
sendTokenAnalyticsEvent({ searchContext, currency: firstCurrency, multichain: true })
5953
}
6054
return
6155
}
56+
case OnchainItemListOptionType.Token: {
57+
const currency = item.currencyInfo.currency
58+
sendTokenAnalyticsEvent({ searchContext, currency })
59+
return
60+
}
6261
case OnchainItemListOptionType.Pool: {
6362
sendAnalyticsEvent(InterfaceEventName.NavbarResultSelected, {
6463
...searchContext,
@@ -110,3 +109,38 @@ export function sendSearchOptionItemClickedAnalytics({
110109
})
111110
}
112111
}
112+
113+
function sendTokenAnalyticsEvent({
114+
searchContext,
115+
currency,
116+
multichain = false,
117+
}: {
118+
searchContext: SearchContext
119+
currency: Currency
120+
multichain?: boolean
121+
}): void {
122+
if (isMobileApp) {
123+
sendAnalyticsEvent(MobileEventName.ExploreSearchResultClicked, {
124+
...searchContext,
125+
name: currency.name ?? '',
126+
chain: currency.chainId,
127+
address: currency.isNative ? 'NATIVE' : currency.address,
128+
type: multichain ? 'multichain_token' : 'token',
129+
})
130+
} else {
131+
sendAnalyticsEvent(InterfaceEventName.NavbarResultSelected, {
132+
...searchContext,
133+
chainId: currency.chainId,
134+
suggestion_type: searchContext.isHistory
135+
? NavBarSearchTypes.RecentSearch
136+
: searchContext.query && searchContext.query.length > 0
137+
? NavBarSearchTypes.TokenSuggestion
138+
: NavBarSearchTypes.TokenTrending,
139+
total_suggestions: searchContext.suggestionCount,
140+
query_text: searchContext.query ?? '',
141+
selected_search_result_name: currency.name ?? '',
142+
selected_search_result_address: currency.isNative ? 'NATIVE' : currency.address,
143+
token_type: multichain ? 'multichain_token' : 'token',
144+
})
145+
}
146+
}

packages/uniswap/src/features/telemetry/types.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export type PendingTransactionTimeoutProperties = {
121121
export type AssetDetailsBaseProperties = {
122122
name?: string
123123
domain?: string
124-
address: string
124+
address?: string
125125
chain?: number
126126
}
127127

@@ -359,6 +359,9 @@ type InterfaceSearchResultSelectionProperties = {
359359
protocol_version?: string
360360
fee_tier?: number
361361
hook_address?: string
362+
363+
// Token specific properties
364+
token_type?: 'token' | 'multichain_token'
362365
} & ITraceContext
363366

364367
type WrapProperties = {
@@ -896,7 +899,7 @@ export type UniverseEventProperties = {
896899
}
897900
[MobileEventName.ExploreSearchResultClicked]: SearchResultContextProperties &
898901
AssetDetailsBaseProperties & {
899-
type: 'collection' | 'token' | 'address'
902+
type: 'collection' | 'token' | 'address' | 'multichain_token'
900903
}
901904
[MobileEventName.ExploreTokenItemSelected]: AssetDetailsBaseProperties & {
902905
position: number

0 commit comments

Comments
 (0)