Skip to content

Commit 9a16f24

Browse files
ci(release): publish latest release
1 parent aa1efb7 commit 9a16f24

File tree

663 files changed

+33060
-17205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

663 files changed

+33060
-17205
lines changed
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
diff --git a/dist/esm/Popover.mjs b/dist/esm/Popover.mjs
2+
index ed2dc72f632ed2adab30a9b7c25e79d955ffac5d..6c4f2046942c45908b8f37f66c2e56ef2af1238d 100644
3+
--- a/dist/esm/Popover.mjs
4+
+++ b/dist/esm/Popover.mjs
5+
@@ -10,12 +10,11 @@ import { FloatingOverrideContext } from "@tamagui/floating";
6+
import { FocusScope } from "@tamagui/focus-scope";
7+
import { composeEventHandlers, withStaticProperties } from "@tamagui/helpers";
8+
import { Popper, PopperAnchor, PopperArrow, PopperContent, PopperContentFrame, PopperContext, usePopperContext } from "@tamagui/popper";
9+
-import { Portal, resolveViewZIndex } from "@tamagui/portal";
10+
+import { Portal } from "@tamagui/portal";
11+
import { RemoveScroll } from "@tamagui/remove-scroll";
12+
import { Sheet, SheetController } from "@tamagui/sheet";
13+
import { YStack } from "@tamagui/stacks";
14+
import { useControllableState } from "@tamagui/use-controllable-state";
15+
-import { StackZIndexContext } from "@tamagui/z-index-stack";
16+
import * as React from "react";
17+
import { Platform, ScrollView } from "react-native-web";
18+
import { useFloatingContext } from "./useFloatingContext.mjs";
19+
@@ -49,14 +48,13 @@ const POPOVER_SCOPE = "PopoverScope",
20+
composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
21+
if (!props.children) return null;
22+
const trigger = /* @__PURE__ */jsx(View, {
23+
- "aria-expanded": context.open,
24+
- "data-state": getState(context.open),
25+
- ...rest,
26+
- ref: composedTriggerRef,
27+
- onPress: composeEventHandlers(props.onPress, context.onOpenToggle)
28+
- });
29+
- if (anchorTo) {
30+
- const virtualRef = {
31+
+ "aria-expanded": context.open,
32+
+ "data-state": getState(context.open),
33+
+ ...rest,
34+
+ ref: composedTriggerRef,
35+
+ onPress: composeEventHandlers(props.onPress, context.onOpenToggle)
36+
+ }),
37+
+ virtualRef = React.useMemo(() => anchorTo ? {
38+
current: {
39+
getBoundingClientRect: () => isWeb ? DOMRect.fromRect(anchorTo) : anchorTo,
40+
...(!isWeb && {
41+
@@ -64,16 +62,13 @@ const POPOVER_SCOPE = "PopoverScope",
42+
measureInWindow: c => c(anchorTo?.x, anchorTo?.y, anchorTo?.width, anchorTo?.height)
43+
})
44+
}
45+
- };
46+
- return /* @__PURE__ */jsx(PopperAnchor, {
47+
- virtualRef,
48+
- __scopePopper: __scopePopover || POPOVER_SCOPE,
49+
- children: trigger
50+
- });
51+
- }
52+
+ } : null, [context.anchorTo, anchorTo?.x, anchorTo?.y, anchorTo?.x, anchorTo?.height, anchorTo?.width]);
53+
return context.hasCustomAnchor ? trigger : /* @__PURE__ */jsx(PopperAnchor, {
54+
+ ...(virtualRef && {
55+
+ virtualRef
56+
+ }),
57+
__scopePopper: __scopePopover || POPOVER_SCOPE,
58+
- asChild: !0,
59+
+ asChild: rest.asChild,
60+
children: trigger
61+
});
62+
}),
63+
@@ -143,7 +138,7 @@ function PopoverContentPortal(props) {
64+
const {
65+
__scopePopover
66+
} = props,
67+
- zIndex = props.zIndex,
68+
+ zIndex = props.zIndex ?? 15e4,
69+
context = usePopoverContext(__scopePopover),
70+
popperContext = usePopperContext(__scopePopover || POPOVER_SCOPE),
71+
themeName = useThemeName(),
72+
@@ -156,7 +151,6 @@ function PopoverContentPortal(props) {
73+
adaptContext,
74+
children: props.children
75+
})), /* @__PURE__ */jsx(Portal, {
76+
- stackZIndex: !0,
77+
zIndex,
78+
children: /* @__PURE__ */jsxs(Theme, {
79+
forceClassName: !0,
80+
@@ -164,10 +158,7 @@ function PopoverContentPortal(props) {
81+
children: [!!context.open && !context.breakpointActive && /* @__PURE__ */jsx(YStack, {
82+
fullscreen: !0,
83+
onPress: composeEventHandlers(props.onPress, context.onOpenToggle)
84+
- }), /* @__PURE__ */jsx(StackZIndexContext, {
85+
- zIndex: resolveViewZIndex(zIndex),
86+
- children: contents
87+
- })]
88+
+ }), contents]
89+
})
90+
});
91+
}
92+
@@ -395,4 +386,4 @@ const PopoverSheetController = ({
93+
return context.open === !1 ? !1 : isAdapted;
94+
};
95+
export { Popover, PopoverAnchor, PopoverArrow, PopoverClose, PopoverContent, PopoverContext, PopoverTrigger, usePopoverContext };
96+
-//# sourceMappingURL=Popover.mjs.map
97+
+
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
diff --git a/dist/esm/useStackedZIndex.mjs b/dist/esm/useStackedZIndex.mjs
2+
index a78e5c3ef76034648d57483eb7fabd944815e466..4935bcfcdc35c8e7a494a79c6d507aa526672819 100644
3+
--- a/dist/esm/useStackedZIndex.mjs
4+
+++ b/dist/esm/useStackedZIndex.mjs
5+
@@ -1,31 +1,23 @@
6+
-import { useContext, useEffect, useId, useMemo } from "react";
7+
-import { ZIndexHardcodedContext, ZIndexStackContext } from "./context.mjs";
8+
-const ZIndicesByContext = {},
9+
+import { useEffect, useId, useMemo } from "react";
10+
+const CurrentPortalZIndices = {},
11+
useStackedZIndex = props => {
12+
const {
13+
stackZIndex,
14+
- zIndex: zIndexProp
15+
+ zIndex: zIndexProp = 1e3
16+
} = props,
17+
id = useId(),
18+
- stackingContextLevel = useContext(ZIndexStackContext),
19+
- hardcoded = useContext(ZIndexHardcodedContext);
20+
- ZIndicesByContext[stackingContextLevel] ||= {};
21+
- const stackContext = ZIndicesByContext[stackingContextLevel],
22+
zIndex = useMemo(() => {
23+
- if (typeof zIndexProp == "number") return zIndexProp;
24+
if (stackZIndex) {
25+
- if (hardcoded) return hardcoded + 1;
26+
- const highest = Object.values(stackContext).reduce((acc, cur) => Math.max(acc, cur), 0),
27+
- found = stackingContextLevel * 5e3 + highest + 1;
28+
- return typeof stackZIndex == "number" ? stackZIndex + found : found;
29+
+ const highest = Object.values(CurrentPortalZIndices).reduce((acc, cur) => Math.max(acc, cur), 0);
30+
+ return typeof stackZIndex == "number" ? Math.max(stackZIndex, highest + 1) : highest + 1;
31+
}
32+
- return 1;
33+
- }, [stackingContextLevel, zIndexProp, stackZIndex]);
34+
+ if (zIndexProp) return zIndexProp;
35+
+ }, [stackZIndex]);
36+
return useEffect(() => {
37+
- if (stackZIndex) return stackContext[id] = zIndex, () => {
38+
- delete stackContext[id];
39+
+ if (typeof stackZIndex == "number") return CurrentPortalZIndices[id] = stackZIndex, () => {
40+
+ delete CurrentPortalZIndices[id];
41+
};
42+
- }, [zIndex]), zIndex;
43+
+ }, [stackZIndex]), zIndex;
44+
};
45+
export { useStackedZIndex };
46+
//# sourceMappingURL=useStackedZIndex.mjs.map
47+
diff --git a/dist/esm/useStackedZIndex.mjs.map b/dist/esm/useStackedZIndex.mjs.map
48+
index 655e7d2cc4a905722f7f54eb9bd53c2a2e50a4c2..d41e5caa0cbd0ece2b5e15aa5ab65f178a6e4e57 100644
49+
--- a/dist/esm/useStackedZIndex.mjs.map
50+
+++ b/dist/esm/useStackedZIndex.mjs.map
51+
@@ -1 +1 @@
52+
-{"version":3,"names":["useContext","useEffect","useId","useMemo","ZIndexHardcodedContext","ZIndexStackContext","ZIndicesByContext","useStackedZIndex","props","stackZIndex","zIndex","zIndexProp","id","stackingContextLevel","hardcoded","stackContext","highest","Object","values","reduce","acc","cur","Math","max","found"],"sources":["../../src/useStackedZIndex.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,UAAA,EAAYC,SAAA,EAAWC,KAAA,EAAOC,OAAA,QAAe;AACtD,SAASC,sBAAA,EAAwBC,kBAAA,QAA0B;AAG3D,MAAMC,iBAAA,GAA4D,CAAC;EAEtDC,gBAAA,GAAoBC,KAAA,IAG3B;IACJ,MAAM;QAAEC,WAAA;QAAaC,MAAA,EAAQC;MAAW,IAAIH,KAAA;MACtCI,EAAA,GAAKV,KAAA,CAAM;MACXW,oBAAA,GAAuBb,UAAA,CAAWK,kBAAkB;MACpDS,SAAA,GAAYd,UAAA,CAAWI,sBAAsB;IAEnDE,iBAAA,CAAkBO,oBAAoB,MAAM,CAAC;IAC7C,MAAME,YAAA,GAAeT,iBAAA,CAAkBO,oBAAoB;MAErDH,MAAA,GAASP,OAAA,CAAQ,MAAM;QAC3B,IAAI,OAAOQ,UAAA,IAAe,UACxB,OAAOA,UAAA;QAET,IAAIF,WAAA,EAAa;UACf,IAAIK,SAAA,EACF,OAAOA,SAAA,GAAY;UAGrB,MAAME,OAAA,GAAUC,MAAA,CAAOC,MAAA,CAAOH,YAAY,EAAEI,MAAA,CAC1C,CAACC,GAAA,EAAKC,GAAA,KAAQC,IAAA,CAAKC,GAAA,CAAIH,GAAA,EAAKC,GAAG,GAC/B,CACF;YAGMG,KAAA,GAAQX,oBAAA,GAAuB,MAAOG,OAAA,GAAU;UAGtD,OAAO,OAAOP,WAAA,IAAgB,WAAWA,WAAA,GAAce,KAAA,GAAQA,KAAA;QACjE;QAEA,OAAO;MACT,GAAG,CAACX,oBAAA,EAAsBF,UAAA,EAAYF,WAAW,CAAC;IAElD,OAAAR,SAAA,CAAU,MAAM;MACd,IAAIQ,WAAA,EACF,OAAAM,YAAA,CAAaH,EAAE,IAAIF,MAAA,EACZ,MAAM;QACX,OAAOK,YAAA,CAAaH,EAAE;MACxB;IAEJ,GAAG,CAACF,MAAM,CAAC,GAEJA,MAAA;EACT","ignoreList":[]}
53+
\ No newline at end of file
54+
+{"version":3,"names":["useEffect","useId","useMemo","CurrentPortalZIndices","useStackedZIndex","props","stackZIndex","zIndex","zIndexProp","id","highest","Object","values","reduce","acc","cur","Math","max"],"sources":["../../src/useStackedZIndex.tsx"],"sourcesContent":[null],"mappings":"AAAA,SAASA,SAAA,EAAWC,KAAA,EAAOC,OAAA,QAAe;AAE1C,MAAMC,qBAAA,GAAgD,CAAC;EAE1CC,gBAAA,GAAoBC,KAAA,IAG3B;IACJ,MAAM;QAAEC,WAAA;QAAaC,MAAA,EAAQC,UAAA,GAAa;MAAK,IAAIH,KAAA;MAC7CI,EAAA,GAAKR,KAAA,CAAM;MAEXM,MAAA,GAASL,OAAA,CAAQ,MAAM;QAC3B,IAAII,WAAA,EAAa;UACf,MAAMI,OAAA,GAAUC,MAAA,CAAOC,MAAA,CAAOT,qBAAqB,EAAEU,MAAA,CACnD,CAACC,GAAA,EAAKC,GAAA,KAAQC,IAAA,CAAKC,GAAA,CAAIH,GAAA,EAAKC,GAAG,GAC/B,CACF;UACA,OAAI,OAAOT,WAAA,IAAgB,WAClBU,IAAA,CAAKC,GAAA,CAAIX,WAAA,EAAaI,OAAA,GAAU,CAAC,IAGnCA,OAAA,GAAU;QACnB;QACA,IAAIF,UAAA,EACF,OAAOA,UAAA;MAEX,GAAG,CAACF,WAAW,CAAC;IAEhB,OAAAN,SAAA,CAAU,MAAM;MACd,IAAI,OAAOM,WAAA,IAAgB,UACzB,OAAAH,qBAAA,CAAsBM,EAAE,IAAIH,WAAA,EACrB,MAAM;QACX,OAAOH,qBAAA,CAAsBM,EAAE;MACjC;IAEJ,GAAG,CAACH,WAAW,CAAC,GAETC,MAAA;EACT","ignoreList":[]}

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @uniswap/web-admins

RELEASE

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
1-
We are back with some new updates! Here’s the latest:
1+
IPFS hash of the deployment:
2+
- CIDv0: `Qmb2Gd1x82BBWBGVASZiryc8pFJWiJm4rSddWExnKHpkka`
3+
- CIDv1: `bafybeif4okadgppbk3up2camp6aughhbr6gievbj3wskn6s57vzmoxf4im`
24

3-
Honeypot Detection: Using Blockaid’s data, we now identify potentially malicious honeypot tokens and show users a token warning when interacting with them.
5+
The latest release is always mirrored at [app.uniswap.org](https://app.uniswap.org).
46

5-
New pink!: Our accent pink color has been updated across the app for better accessibility and better vibes.
7+
You can also access the Uniswap Interface from an IPFS gateway.
8+
**BEWARE**: The Uniswap interface uses [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) to remember your settings, such as which tokens you have imported.
9+
**You should always use an IPFS gateway that enforces origin separation**, or our hosted deployment of the latest release at [app.uniswap.org](https://app.uniswap.org).
10+
Your Uniswap settings are never remembered across different URLs.
11+
12+
IPFS gateways:
13+
- https://bafybeif4okadgppbk3up2camp6aughhbr6gievbj3wskn6s57vzmoxf4im.ipfs.dweb.link/
14+
- [ipfs://Qmb2Gd1x82BBWBGVASZiryc8pFJWiJm4rSddWExnKHpkka/](ipfs://Qmb2Gd1x82BBWBGVASZiryc8pFJWiJm4rSddWExnKHpkka/)
15+
16+
### 5.79.3 (2025-04-23)
617

7-
Other changes:
818

9-
- Removed balances from spam tokens, to clean up the portfolio view
10-
- Various bug fixes and performance improvements

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
mobile/1.49
1+
web/5.79.3

apps/extension/package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
"@tamagui/core": "1.125.17",
1616
"@types/uuid": "9.0.1",
1717
"@uniswap/analytics-events": "2.42.0",
18-
"@uniswap/uniswapx-sdk": "3.0.0-beta.3",
18+
"@uniswap/client-embeddedwallet": "0.0.16",
19+
"@uniswap/uniswapx-sdk": "3.0.0-beta.7",
1920
"@uniswap/universal-router-sdk": "4.19.5",
2021
"@uniswap/v3-sdk": "3.25.2",
2122
"@uniswap/v4-sdk": "1.21.2",
2223
"dotenv-webpack": "8.0.1",
2324
"eslint-plugin-rulesdir": "0.2.2",
2425
"ethers": "5.7.2",
2526
"eventemitter3": "5.0.1",
26-
"framer-motion": "10.17.6",
2727
"i18next": "23.10.0",
2828
"node-polyfill-webpack-plugin": "2.0.1",
2929
"react": "18.3.1",
@@ -56,7 +56,7 @@
5656
"@pmmmwh/react-refresh-webpack-plugin": "0.5.11",
5757
"@testing-library/dom": "10.4.0",
5858
"@testing-library/react": "16.1.0",
59-
"@types/chrome": "0.0.254",
59+
"@types/chrome": "0.0.304",
6060
"@types/jest": "29.5.14",
6161
"@types/react": "18.3.18",
6262
"@types/react-dom": "18.3.1",
@@ -78,7 +78,6 @@
7878
"mini-css-extract-plugin": "2.9.1",
7979
"react-refresh": "0.14.0",
8080
"serve": "14.2.4",
81-
"statsig-js": "4.41.0",
8281
"style-loader": "3.3.2",
8382
"swc-loader": "0.2.6",
8483
"tamagui-loader": "1.125.17",

apps/extension/src/app/Global.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,15 @@ html {
3131
-webkit-mask-position: -50%;
3232
}
3333
}
34+
35+
@keyframes cloud-float-animation {
36+
0% {
37+
transform: translateY(-8px);
38+
}
39+
50% {
40+
transform: translateY(8px);
41+
}
42+
100% {
43+
transform: translateY(-8px);
44+
}
45+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
import { Suspense, lazy } from 'react'
2+
import { Flex } from 'ui/src'
3+
import { Flag } from 'ui/src/components/icons/Flag'
4+
import { Modal } from 'uniswap/src/components/modals/Modal'
5+
import { ModalName } from 'uniswap/src/features/telemetry/constants'
6+
import { useBooleanState } from 'utilities/src/react/useBooleanState'
7+
8+
const DevMenuScreen = lazy(() =>
9+
import('src/app/features/settings/DevMenuScreen').then((module) => ({ default: module.DevMenuScreen })),
10+
)
11+
12+
export function DevMenuModal(): JSX.Element {
13+
const { value: isOpen, setTrue: openModal, setFalse: closeModal } = useBooleanState(false)
14+
15+
return (
16+
<>
17+
<Flex
18+
$platform-web={{
19+
position: 'fixed',
20+
}}
21+
bottom="$spacing24"
22+
p="$spacing4"
23+
left="$spacing24"
24+
zIndex={Number.MAX_SAFE_INTEGER}
25+
borderWidth={1}
26+
borderColor="$neutral2"
27+
borderRadius="$rounded4"
28+
cursor="pointer"
29+
backgroundColor="$surface1"
30+
hoverStyle={{
31+
backgroundColor: '$surface1Hovered',
32+
}}
33+
onPress={openModal}
34+
>
35+
<Flag size="$icon.24" color="$neutral2" />
36+
</Flex>
37+
38+
{isOpen && (
39+
<Modal name={ModalName.FeatureFlags} onClose={closeModal}>
40+
<Suspense>
41+
<DevMenuScreen />
42+
</Suspense>
43+
</Modal>
44+
)}
45+
</>
46+
)
47+
}

apps/extension/src/app/core/OnboardingApp.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { Complete } from 'src/app/features/onboarding/Complete'
1313
import {
1414
CreateOnboardingSteps,
1515
ImportOnboardingSteps,
16+
ImportPasskeySteps,
1617
OnboardingStepsProvider,
1718
ResetSteps,
1819
ScanOnboardingSteps,
@@ -25,6 +26,7 @@ import { PasswordCreate } from 'src/app/features/onboarding/create/PasswordCreat
2526
import { TestMnemonic } from 'src/app/features/onboarding/create/TestMnemonic'
2627
import { ViewMnemonic } from 'src/app/features/onboarding/create/ViewMnemonic'
2728
import { ImportMnemonic } from 'src/app/features/onboarding/import/ImportMnemonic'
29+
import { InitiatePasskeyAuth } from 'src/app/features/onboarding/import/InitiatePasskeyAuth'
2830
import { SelectImportMethod } from 'src/app/features/onboarding/import/SelectImportMethod'
2931
import { SelectWallets } from 'src/app/features/onboarding/import/SelectWallets'
3032
import { IntroScreen } from 'src/app/features/onboarding/intro/IntroScreen'
@@ -101,6 +103,21 @@ const allRoutes = [
101103
/>
102104
),
103105
},
106+
{
107+
path: OnboardingRoutes.ImportPasskey,
108+
element: (
109+
<OnboardingStepsProvider
110+
key={OnboardingRoutes.ImportPasskey}
111+
steps={{
112+
[ImportPasskeySteps.InitiatePasskeyAuth]: <InitiatePasskeyAuth />,
113+
// TODO(WALL-6383): modify this flow to ask user to verify their seed phrase.
114+
[ImportOnboardingSteps.Password]: <PasswordImport flow={ExtensionOnboardingFlow.Import} />,
115+
[ImportOnboardingSteps.Select]: <SelectWallets flow={ExtensionOnboardingFlow.Import} />,
116+
[ImportOnboardingSteps.Complete]: <Complete flow={ExtensionOnboardingFlow.Import} />,
117+
}}
118+
/>
119+
),
120+
},
104121
{
105122
path: OnboardingRoutes.Import,
106123
element: (
Lines changed: 15 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { useEffect, useState } from 'react'
2-
import { getStatsigEnvironmentTier } from 'src/app/version'
3-
import Statsig from 'statsig-js' // Use JS package for browser
42
import { config } from 'uniswap/src/config'
5-
import { uniswapUrls } from 'uniswap/src/constants/urls'
3+
import { StatsigProviderWrapper } from 'uniswap/src/features/gating/StatsigProviderWrapper'
64
import { StatsigCustomAppValue } from 'uniswap/src/features/gating/constants'
7-
import { StatsigOptions, StatsigProvider, StatsigUser } from 'uniswap/src/features/gating/sdk/statsig'
5+
import { StatsigClient, StatsigUser } from 'uniswap/src/features/gating/sdk/statsig'
6+
import { statsigBaseConfig } from 'uniswap/src/features/gating/statsigBaseConfig'
87
import { initializeDatadog } from 'uniswap/src/utils/datadog'
98
import { getUniqueId } from 'utilities/src/device/getUniqueId'
9+
import { logger } from 'utilities/src/logger/logger'
1010
import { useAsyncData } from 'utilities/src/react/hooks'
1111

1212
async function getStatsigUser(): Promise<StatsigUser> {
@@ -27,46 +27,38 @@ export function ExtensionStatsigProvider({
2727
appName: string
2828
}): JSX.Element {
2929
const { data: storedUser } = useAsyncData(getStatsigUser)
30+
const [initFinished, setInitFinished] = useState(false)
3031
const [user, setUser] = useState<StatsigUser>({
3132
userID: undefined,
3233
custom: {
3334
app: StatsigCustomAppValue.Extension,
3435
},
3536
appVersion: process.env.VERSION,
3637
})
37-
const [initFinished, setInitFinished] = useState(false)
3838

3939
useEffect(() => {
4040
if (storedUser && initFinished) {
4141
setUser(storedUser)
4242
}
4343
}, [storedUser, initFinished])
4444

45-
const options: StatsigOptions = {
46-
environment: {
47-
tier: getStatsigEnvironmentTier(),
48-
},
49-
api: uniswapUrls.statsigProxyUrl,
50-
disableAutoMetricsLogging: true,
51-
disableErrorLogging: true,
52-
initCompletionCallback: () => {
53-
setInitFinished(true)
54-
initializeDatadog(appName).catch(() => undefined)
55-
},
45+
const onStatsigInit = (): void => {
46+
setInitFinished(true)
47+
initializeDatadog(appName).catch(() => undefined)
5648
}
5749

5850
return (
59-
<StatsigProvider options={options} sdkKey={config.statsigApiKey} user={user} waitForInitialization={false}>
51+
<StatsigProviderWrapper user={user} onInit={onStatsigInit}>
6052
{children}
61-
</StatsigProvider>
53+
</StatsigProviderWrapper>
6254
)
6355
}
6456

6557
export async function initStatSigForBrowserScripts(): Promise<void> {
66-
await Statsig.initialize(config.statsigApiKey, await getStatsigUser(), {
67-
api: uniswapUrls.statsigProxyUrl,
68-
environment: {
69-
tier: getStatsigEnvironmentTier(),
70-
},
58+
const statsigClient = new StatsigClient(config.statsigApiKey, await getStatsigUser(), statsigBaseConfig)
59+
await statsigClient.initializeAsync().catch((error) => {
60+
logger.error(error, {
61+
tags: { file: 'StatsigProvider.tsx', function: 'initStatSigForBrowserScripts' },
62+
})
7163
})
7264
}

0 commit comments

Comments
 (0)