thirdweb 5.48.0-nightly-cbd6fd87d0120c6013ef354fe8ff22293e4c08e2-20240820000346 → 5.48.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/adapters/ethers5.js +87 -1
- package/dist/cjs/adapters/ethers5.js.map +1 -1
- package/dist/cjs/adapters/ethers6.js +85 -15
- package/dist/cjs/adapters/ethers6.js.map +1 -1
- package/dist/cjs/adapters/viem.js +117 -43
- package/dist/cjs/adapters/viem.js.map +1 -1
- package/dist/cjs/contract/actions/compiler-metadata.js.map +1 -1
- package/dist/cjs/react/core/design-system/index.js +1 -0
- package/dist/cjs/react/core/design-system/index.js.map +1 -1
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js +56 -8
- package/dist/cjs/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js +61 -52
- package/dist/cjs/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/MenuButton.js +0 -1
- package/dist/cjs/react/web/ui/ConnectWallet/MenuButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js +1 -2
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js +9 -9
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js +7 -1
- package/dist/cjs/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js.map +1 -1
- package/dist/cjs/react/web/ui/components/ChainIcon.js +3 -2
- package/dist/cjs/react/web/ui/components/ChainIcon.js.map +1 -1
- package/dist/cjs/react/web/ui/components/CopyAddress.js +22 -0
- package/dist/cjs/react/web/ui/components/CopyAddress.js.map +1 -0
- package/dist/cjs/react/web/ui/components/IconContainer.js +25 -0
- package/dist/cjs/react/web/ui/components/IconContainer.js.map +1 -0
- package/dist/cjs/react/web/ui/components/Modal.js +1 -1
- package/dist/cjs/react/web/ui/components/Modal.js.map +1 -1
- package/dist/cjs/react/web/ui/components/WalletImage.js +4 -11
- package/dist/cjs/react/web/ui/components/WalletImage.js.map +1 -1
- package/dist/cjs/react/web/ui/components/formElements.js +3 -3
- package/dist/cjs/react/web/ui/components/formElements.js.map +1 -1
- package/dist/cjs/react/web/wallets/in-app/CountrySelector.js +1 -3
- package/dist/cjs/react/web/wallets/in-app/CountrySelector.js.map +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/cjs/version.js.map +1 -1
- package/dist/cjs/wallets/custom/smart/image.js +1 -1
- package/dist/cjs/wallets/custom/smart/image.js.map +1 -1
- package/dist/esm/adapters/ethers5.js +87 -1
- package/dist/esm/adapters/ethers5.js.map +1 -1
- package/dist/esm/adapters/ethers6.js +85 -15
- package/dist/esm/adapters/ethers6.js.map +1 -1
- package/dist/esm/adapters/viem.js +117 -43
- package/dist/esm/adapters/viem.js.map +1 -1
- package/dist/esm/contract/actions/compiler-metadata.js.map +1 -1
- package/dist/esm/react/core/design-system/index.js +1 -0
- package/dist/esm/react/core/design-system/index.js.map +1 -1
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js +55 -8
- package/dist/esm/react/core/hooks/transaction/useSendTransaction.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/Details.js +63 -54
- package/dist/esm/react/web/ui/ConnectWallet/Details.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/MenuButton.js +0 -1
- package/dist/esm/react/web/ui/ConnectWallet/MenuButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js +1 -2
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js +9 -9
- package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.js.map +1 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js +7 -1
- package/dist/esm/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.js.map +1 -1
- package/dist/esm/react/web/ui/components/ChainIcon.js +3 -2
- package/dist/esm/react/web/ui/components/ChainIcon.js.map +1 -1
- package/dist/esm/react/web/ui/components/CopyAddress.js +18 -0
- package/dist/esm/react/web/ui/components/CopyAddress.js.map +1 -0
- package/dist/esm/react/web/ui/components/IconContainer.js +21 -0
- package/dist/esm/react/web/ui/components/IconContainer.js.map +1 -0
- package/dist/esm/react/web/ui/components/Modal.js +1 -1
- package/dist/esm/react/web/ui/components/Modal.js.map +1 -1
- package/dist/esm/react/web/ui/components/WalletImage.js +1 -8
- package/dist/esm/react/web/ui/components/WalletImage.js.map +1 -1
- package/dist/esm/react/web/ui/components/formElements.js +3 -3
- package/dist/esm/react/web/ui/components/formElements.js.map +1 -1
- package/dist/esm/react/web/wallets/in-app/CountrySelector.js +2 -4
- package/dist/esm/react/web/wallets/in-app/CountrySelector.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/esm/wallets/custom/smart/image.js +1 -1
- package/dist/esm/wallets/custom/smart/image.js.map +1 -1
- package/dist/types/adapters/ethers5.d.ts +87 -1
- package/dist/types/adapters/ethers5.d.ts.map +1 -1
- package/dist/types/adapters/ethers6.d.ts +85 -15
- package/dist/types/adapters/ethers6.d.ts.map +1 -1
- package/dist/types/adapters/viem.d.ts +117 -43
- package/dist/types/adapters/viem.d.ts.map +1 -1
- package/dist/types/contract/actions/compiler-metadata.d.ts +7 -1
- package/dist/types/contract/actions/compiler-metadata.d.ts.map +1 -1
- package/dist/types/react/core/design-system/index.d.ts +1 -0
- package/dist/types/react/core/design-system/index.d.ts.map +1 -1
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts +1 -0
- package/dist/types/react/core/hooks/transaction/useSendTransaction.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/Details.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/MenuButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.d.ts.map +1 -1
- package/dist/types/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/ChainIcon.d.ts.map +1 -1
- package/dist/types/react/web/ui/components/CopyAddress.d.ts +7 -0
- package/dist/types/react/web/ui/components/CopyAddress.d.ts.map +1 -0
- package/dist/types/react/web/ui/components/IconContainer.d.ts +10 -0
- package/dist/types/react/web/ui/components/IconContainer.d.ts.map +1 -0
- package/dist/types/react/web/ui/components/WalletImage.d.ts.map +1 -1
- package/dist/types/react/web/wallets/in-app/CountrySelector.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/dist/types/wallets/custom/smart/image.d.ts +1 -1
- package/dist/types/wallets/custom/smart/image.d.ts.map +1 -1
- package/dist/types/wallets/in-app/core/authentication/types.d.ts +1 -1
- package/dist/types/wallets/in-app/core/authentication/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adapters/ethers5.ts +87 -1
- package/src/adapters/ethers6.ts +85 -15
- package/src/adapters/viem.ts +117 -44
- package/src/contract/actions/compiler-metadata.ts +4 -2
- package/src/react/core/design-system/index.ts +1 -0
- package/src/react/core/hooks/transaction/useSendTransaction.ts +65 -8
- package/src/react/web/ui/ConnectWallet/Details.tsx +157 -157
- package/src/react/web/ui/ConnectWallet/MenuButton.tsx +0 -1
- package/src/react/web/ui/ConnectWallet/screens/Buy/WalletSelectorButton.tsx +0 -6
- package/src/react/web/ui/ConnectWallet/screens/Buy/fiat/FiatFlow.tsx +10 -10
- package/src/react/web/ui/ConnectWallet/screens/Details/WalletManagerScreen.tsx +5 -6
- package/src/react/web/ui/ConnectWallet/screens/LinkedProfilesScreen.tsx +21 -7
- package/src/react/web/ui/components/ChainIcon.tsx +4 -3
- package/src/react/web/ui/components/CopyAddress.tsx +34 -0
- package/src/react/web/ui/components/IconContainer.tsx +31 -0
- package/src/react/web/ui/components/Modal.tsx +1 -1
- package/src/react/web/ui/components/WalletImage.tsx +1 -8
- package/src/react/web/ui/components/formElements.tsx +3 -3
- package/src/react/web/wallets/in-app/CountrySelector.tsx +2 -8
- package/src/version.ts +1 -1
- package/src/wallets/custom/smart/image.ts +1 -1
- package/src/wallets/in-app/core/authentication/types.ts +1 -1
@@ -19,6 +19,7 @@ import type { SmartWalletOptions } from "../../../../wallets/smart/types.js";
|
|
19
19
|
import type { AppMetadata } from "../../../../wallets/types.js";
|
20
20
|
import {
|
21
21
|
CustomThemeProvider,
|
22
|
+
parseTheme,
|
22
23
|
useCustomTheme,
|
23
24
|
} from "../../../core/design-system/CustomThemeProvider.js";
|
24
25
|
import {
|
@@ -51,15 +52,20 @@ import type {
|
|
51
52
|
SupportedTokens,
|
52
53
|
} from "../../../core/utils/defaultTokens.js";
|
53
54
|
import { hasSmartAccount } from "../../../core/utils/isSmartWallet.js";
|
54
|
-
import {
|
55
|
+
import {
|
56
|
+
useConnectedWalletDetails,
|
57
|
+
useWalletInfo,
|
58
|
+
} from "../../../core/utils/wallet.js";
|
55
59
|
import { WalletUIStatesProvider } from "../../providers/wallet-ui-states-provider.js";
|
56
60
|
import { ChainIcon } from "../components/ChainIcon.js";
|
57
61
|
import { CopyIcon } from "../components/CopyIcon.js";
|
58
|
-
import {
|
62
|
+
import { IconContainer } from "../components/IconContainer.js";
|
59
63
|
import { Modal } from "../components/Modal.js";
|
60
64
|
import { Skeleton } from "../components/Skeleton.js";
|
61
65
|
import { Spacer } from "../components/Spacer.js";
|
62
66
|
import { Spinner } from "../components/Spinner.js";
|
67
|
+
import { ToolTip } from "../components/Tooltip.js";
|
68
|
+
import { WalletImage } from "../components/WalletImage.js";
|
63
69
|
import { Container, Line } from "../components/basic.js";
|
64
70
|
import { Button, IconButton } from "../components/buttons.js";
|
65
71
|
import { Link, Text } from "../components/text.js";
|
@@ -78,8 +84,6 @@ import { onModalUnmount } from "./constants.js";
|
|
78
84
|
import { CoinsIcon } from "./icons/CoinsIcon.js";
|
79
85
|
import { FundsIcon } from "./icons/FundsIcon.js";
|
80
86
|
import { OutlineWalletIcon } from "./icons/OutlineWalletIcon.js";
|
81
|
-
import { ShuffleIconLucide } from "./icons/ShuffleIconLucide.js";
|
82
|
-
import { SmartWalletBadgeIcon } from "./icons/SmartAccountBadgeIcon.js";
|
83
87
|
import { getConnectLocale } from "./locale/getConnectLocale.js";
|
84
88
|
import type { ConnectLocale } from "./locale/types.js";
|
85
89
|
import { LazyBuyScreen } from "./screens/Buy/LazyBuyScreen.js";
|
@@ -125,7 +129,6 @@ export const ConnectedWalletDetails: React.FC<{
|
|
125
129
|
const setRootEl = useContext(SetRootElementContext);
|
126
130
|
const activeAccount = useActiveAccount();
|
127
131
|
const walletChain = useActiveWalletChain();
|
128
|
-
const theme = useCustomTheme();
|
129
132
|
|
130
133
|
const { ensAvatarQuery, addressOrENS, balanceQuery } =
|
131
134
|
useConnectedWalletDetails(
|
@@ -191,36 +194,37 @@ export const ConnectedWalletDetails: React.FC<{
|
|
191
194
|
data-test="connected-wallet-details"
|
192
195
|
onClick={openModal}
|
193
196
|
>
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
197
|
+
<Container
|
198
|
+
style={{
|
199
|
+
borderRadius: "100%",
|
200
|
+
overflow: "hidden",
|
201
|
+
width: "35px",
|
202
|
+
height: "35px",
|
203
|
+
}}
|
204
|
+
>
|
205
|
+
{ensAvatarQuery.data ? (
|
206
|
+
<img
|
207
|
+
alt=""
|
208
|
+
src={ensAvatarQuery.data}
|
209
|
+
style={{
|
210
|
+
width: "100%",
|
211
|
+
height: "100%",
|
212
|
+
}}
|
213
|
+
/>
|
214
|
+
) : (
|
215
|
+
activeAccount && <Blobbie address={activeAccount.address} size={35} />
|
216
|
+
)}
|
217
|
+
</Container>
|
208
218
|
<Container
|
209
219
|
flex="column"
|
210
|
-
gap="
|
211
|
-
px="sm"
|
212
|
-
py="xs"
|
220
|
+
gap="4xs"
|
213
221
|
style={{
|
214
|
-
border: `1px solid ${theme.colors.borderColor}`,
|
215
222
|
textOverflow: "ellipsis",
|
216
|
-
minWidth: "115px",
|
217
|
-
height: "50px",
|
218
223
|
whiteSpace: "nowrap",
|
219
224
|
borderRadius: `0 ${radius.md} ${radius.md} 0`,
|
220
225
|
}}
|
221
226
|
>
|
222
227
|
{/* Address */}
|
223
|
-
|
224
228
|
{addressOrENS ? (
|
225
229
|
<Text
|
226
230
|
size="xs"
|
@@ -231,7 +235,7 @@ export const ConnectedWalletDetails: React.FC<{
|
|
231
235
|
{addressOrENS}
|
232
236
|
</Text>
|
233
237
|
) : (
|
234
|
-
<Skeleton height={fontSize.
|
238
|
+
<Skeleton height={fontSize.xs} width="80px" />
|
235
239
|
)}
|
236
240
|
|
237
241
|
{/* Balance */}
|
@@ -239,9 +243,12 @@ export const ConnectedWalletDetails: React.FC<{
|
|
239
243
|
<Text
|
240
244
|
className={`${TW_CONNECTED_WALLET}__balance`}
|
241
245
|
size="xs"
|
242
|
-
|
246
|
+
color="secondaryText"
|
247
|
+
weight={400}
|
243
248
|
>
|
244
|
-
{Number
|
249
|
+
{Number.parseFloat(
|
250
|
+
Number(balanceQuery.data.displayValue).toFixed(3),
|
251
|
+
)}{" "}
|
245
252
|
{balanceQuery.data.symbol}
|
246
253
|
</Text>
|
247
254
|
) : (
|
@@ -282,6 +289,7 @@ function DetailsModal(props: {
|
|
282
289
|
activeAccount,
|
283
290
|
props.displayBalanceToken,
|
284
291
|
);
|
292
|
+
const theme = parseTheme(props.theme);
|
285
293
|
|
286
294
|
const activeWallet = useActiveWallet();
|
287
295
|
const chainIconQuery = useChainIconUrl(walletChain);
|
@@ -340,8 +348,18 @@ function DetailsModal(props: {
|
|
340
348
|
{chainNameQuery.isLoading ? (
|
341
349
|
<Skeleton height={"16px"} width={"150px"} />
|
342
350
|
) : (
|
343
|
-
<Text color="primaryText" multiline>
|
351
|
+
<Text color="primaryText" size="md" multiline>
|
344
352
|
{chainNameQuery.name || `Unknown chain #${walletChain?.id}`}
|
353
|
+
<Text color="secondaryText" size="xs">
|
354
|
+
{balanceQuery.data ? (
|
355
|
+
Number.parseFloat(
|
356
|
+
Number(balanceQuery.data.displayValue).toFixed(3),
|
357
|
+
)
|
358
|
+
) : (
|
359
|
+
<Skeleton height="1em" width="100px" />
|
360
|
+
)}{" "}
|
361
|
+
{balanceQuery.data?.symbol}
|
362
|
+
</Text>
|
345
363
|
</Text>
|
346
364
|
)}
|
347
365
|
|
@@ -358,114 +376,103 @@ function DetailsModal(props: {
|
|
358
376
|
|
359
377
|
let content = (
|
360
378
|
<div>
|
361
|
-
<Spacer y="
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
display: "flex",
|
379
|
-
alignItems: "center",
|
380
|
-
justifyContent: "center",
|
381
|
-
}}
|
382
|
-
>
|
383
|
-
<ShuffleIconLucide size="20" />
|
384
|
-
</div>
|
385
|
-
</IconButton>
|
386
|
-
|
387
|
-
<Container px="lg" flex="column" center="x">
|
388
|
-
<Container
|
389
|
-
style={{
|
390
|
-
position: "relative",
|
391
|
-
height: `${iconSize.xxl}px`,
|
392
|
-
width: `${iconSize.xxl}px`,
|
393
|
-
overflow: "visible",
|
394
|
-
}}
|
395
|
-
>
|
396
|
-
{ensAvatarQuery.data ? (
|
397
|
-
<Img
|
398
|
-
src={ensAvatarQuery.data}
|
399
|
-
width={iconSize.xxl}
|
400
|
-
height={iconSize.xxl}
|
379
|
+
<Spacer y="xs" />
|
380
|
+
<Container p="lg" gap="sm" flex="row" center="y">
|
381
|
+
<ToolTip tip="Switch wallet">
|
382
|
+
<div
|
383
|
+
style={{
|
384
|
+
cursor: "pointer",
|
385
|
+
}}
|
386
|
+
onKeyDown={(e) => {
|
387
|
+
if (e.key === "w") {
|
388
|
+
setScreen("wallet-manager");
|
389
|
+
}
|
390
|
+
}}
|
391
|
+
onClick={() => {
|
392
|
+
setScreen("wallet-manager");
|
393
|
+
}}
|
394
|
+
>
|
395
|
+
<Container
|
401
396
|
style={{
|
402
|
-
|
397
|
+
position: "relative",
|
398
|
+
height: `${iconSize.xl}px`,
|
399
|
+
width: `${iconSize.xl}px`,
|
403
400
|
}}
|
404
|
-
|
405
|
-
/>
|
406
|
-
) : (
|
407
|
-
activeAccount && (
|
401
|
+
>
|
408
402
|
<Container
|
409
|
-
style={{
|
403
|
+
style={{
|
404
|
+
width: "100%",
|
405
|
+
height: "100%",
|
406
|
+
borderRadius: "100%",
|
407
|
+
overflow: "hidden",
|
408
|
+
}}
|
410
409
|
>
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
410
|
+
{ensAvatarQuery.data ? (
|
411
|
+
<img
|
412
|
+
src={ensAvatarQuery.data}
|
413
|
+
style={{
|
414
|
+
width: iconSize.xxl,
|
415
|
+
height: iconSize.xxl,
|
416
|
+
}}
|
417
|
+
alt=""
|
418
|
+
/>
|
419
|
+
) : (
|
420
|
+
activeAccount && (
|
421
|
+
<Blobbie
|
422
|
+
address={activeAccount.address}
|
423
|
+
size={Number(iconSize.xxl)}
|
424
|
+
/>
|
425
|
+
)
|
426
|
+
)}
|
415
427
|
</Container>
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
428
|
+
<Container
|
429
|
+
style={{
|
430
|
+
position: "absolute",
|
431
|
+
bottom: -2,
|
432
|
+
right: -2,
|
433
|
+
}}
|
434
|
+
>
|
435
|
+
<IconContainer
|
436
|
+
style={{
|
437
|
+
background: theme.colors.modalBg,
|
438
|
+
}}
|
439
|
+
padding="4px"
|
440
|
+
>
|
441
|
+
{activeWallet && (
|
442
|
+
<WalletImage
|
443
|
+
style={{ borderRadius: 0 }}
|
444
|
+
id={activeWallet.id}
|
445
|
+
client={client}
|
446
|
+
size="12"
|
447
|
+
/>
|
448
|
+
)}
|
449
|
+
</IconContainer>
|
450
|
+
</Container>
|
451
|
+
</Container>
|
452
|
+
</div>
|
453
|
+
</ToolTip>
|
427
454
|
|
428
|
-
|
429
|
-
|
430
|
-
style={{
|
431
|
-
display: "flex",
|
432
|
-
gap: spacing.xxs,
|
433
|
-
alignItems: "center",
|
434
|
-
transform: "translateX(10px)",
|
435
|
-
}}
|
436
|
-
data-test="connected-wallet-address"
|
437
|
-
data-address={activeAccount?.address}
|
438
|
-
>
|
439
|
-
<Text color="primaryText" weight={500} size="md">
|
440
|
-
{addressOrENS}
|
441
|
-
</Text>
|
442
|
-
<IconButton
|
455
|
+
<Container flex="column" gap="3xs">
|
456
|
+
<div
|
443
457
|
style={{
|
444
|
-
|
458
|
+
display: "flex",
|
459
|
+
gap: spacing.xxs,
|
460
|
+
alignItems: "center",
|
445
461
|
}}
|
446
|
-
data-test="copy-address"
|
447
462
|
>
|
448
|
-
<
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
{balanceQuery.data ? (
|
461
|
-
Number(balanceQuery.data.displayValue).toFixed(3)
|
462
|
-
) : (
|
463
|
-
<Skeleton height="1em" width="100px" />
|
464
|
-
)}{" "}
|
465
|
-
{balanceQuery.data?.symbol}{" "}
|
466
|
-
</Text>
|
463
|
+
<Text color="primaryText" weight={500} size="md">
|
464
|
+
{addressOrENS}
|
465
|
+
</Text>
|
466
|
+
<IconButton>
|
467
|
+
<CopyIcon
|
468
|
+
text={activeAccount?.address || ""}
|
469
|
+
tip={locale.copyAddress}
|
470
|
+
/>
|
471
|
+
</IconButton>
|
472
|
+
</div>
|
473
|
+
<InAppWalletUserInfo client={client} locale={locale} />
|
474
|
+
</Container>
|
467
475
|
</Container>
|
468
|
-
<Spacer y="lg" />
|
469
476
|
<Container px="lg">
|
470
477
|
{/* Send, Receive, Swap */}
|
471
478
|
<Container
|
@@ -911,10 +918,13 @@ const WalletInfoButton = /* @__PURE__ */ StyledButton((_) => {
|
|
911
918
|
borderRadius: radius.md,
|
912
919
|
cursor: "pointer",
|
913
920
|
display: "inline-flex",
|
921
|
+
gap: spacing.xs,
|
922
|
+
padding: spacing.xs,
|
914
923
|
alignItems: "center",
|
915
924
|
minWidth: "165px",
|
916
925
|
height: "50px",
|
917
926
|
boxSizing: "border-box",
|
927
|
+
border: `1px solid ${theme.colors.borderColor}`,
|
918
928
|
WebkitTapHighlightColor: "transparent",
|
919
929
|
lineHeight: "normal",
|
920
930
|
animation: `${fadeInAnimation} 300ms ease`,
|
@@ -963,20 +973,8 @@ function ConnectedToSmartWallet(props: {
|
|
963
973
|
}, [activeAccount, chain, client, isSmartWallet]);
|
964
974
|
|
965
975
|
const content = (
|
966
|
-
<Container
|
967
|
-
|
968
|
-
bg="secondaryButtonBg"
|
969
|
-
gap="xxs"
|
970
|
-
style={{
|
971
|
-
borderRadius: radius.md,
|
972
|
-
padding: `${spacing.xxs} ${spacing.sm} ${spacing.xxs} ${spacing.xs}`,
|
973
|
-
}}
|
974
|
-
center="y"
|
975
|
-
>
|
976
|
-
<Container flex="row" color="accentText" center="both">
|
977
|
-
<SmartWalletBadgeIcon size={iconSize.xs} />
|
978
|
-
</Container>
|
979
|
-
<Text size="xs" color="secondaryButtonText">
|
976
|
+
<Container flex="row" gap="3xs" center="y">
|
977
|
+
<Text size="xs" weight={400} color="secondaryText">
|
980
978
|
{locale.connectedToSmartWallet}
|
981
979
|
</Text>
|
982
980
|
</Container>
|
@@ -998,8 +996,6 @@ function ConnectedToSmartWallet(props: {
|
|
998
996
|
) : (
|
999
997
|
<Text size="sm"> {content}</Text>
|
1000
998
|
)}
|
1001
|
-
|
1002
|
-
<Spacer y="xs" />
|
1003
999
|
</>
|
1004
1000
|
);
|
1005
1001
|
}
|
@@ -1007,9 +1003,15 @@ function ConnectedToSmartWallet(props: {
|
|
1007
1003
|
return null;
|
1008
1004
|
}
|
1009
1005
|
|
1010
|
-
function InAppWalletUserInfo(props: {
|
1011
|
-
|
1006
|
+
function InAppWalletUserInfo(props: {
|
1007
|
+
client: ThirdwebClient;
|
1008
|
+
locale: ConnectLocale;
|
1009
|
+
}) {
|
1010
|
+
const { client, locale } = props;
|
1012
1011
|
const account = useActiveAccount();
|
1012
|
+
const activeWallet = useActiveWallet();
|
1013
|
+
const { data: walletInfo } = useWalletInfo(activeWallet?.id);
|
1014
|
+
const isSmartWallet = hasSmartAccount(activeWallet);
|
1013
1015
|
|
1014
1016
|
const userInfoQuery = useQuery({
|
1015
1017
|
queryKey: ["in-app-wallet-user", client, account?.address],
|
@@ -1031,21 +1033,19 @@ function InAppWalletUserInfo(props: { client: ThirdwebClient }) {
|
|
1031
1033
|
},
|
1032
1034
|
});
|
1033
1035
|
|
1034
|
-
if (
|
1036
|
+
if (isSmartWallet) {
|
1037
|
+
return <ConnectedToSmartWallet client={client} connectLocale={locale} />;
|
1038
|
+
}
|
1039
|
+
|
1040
|
+
if (userInfoQuery.data || walletInfo) {
|
1035
1041
|
return (
|
1036
|
-
<
|
1037
|
-
|
1038
|
-
|
1039
|
-
style={{
|
1040
|
-
paddingBottom: spacing.xs,
|
1041
|
-
}}
|
1042
|
-
>
|
1043
|
-
<Text size="sm">{userInfoQuery.data}</Text>
|
1044
|
-
</Container>
|
1042
|
+
<Text size="xs" weight={400}>
|
1043
|
+
{userInfoQuery.data || walletInfo?.name}
|
1044
|
+
</Text>
|
1045
1045
|
);
|
1046
1046
|
}
|
1047
1047
|
|
1048
|
-
return
|
1048
|
+
return <Skeleton width="50px" height="10px" />;
|
1049
1049
|
}
|
1050
1050
|
|
1051
1051
|
/**
|
@@ -28,7 +28,6 @@ export const MenuButton = /* @__PURE__ */ StyledButton((_) => {
|
|
28
28
|
transition: "background-color 200ms ease, transform 200ms ease",
|
29
29
|
"&:hover": {
|
30
30
|
backgroundColor: theme.colors.tertiaryBg,
|
31
|
-
transform: "scale(1.01)",
|
32
31
|
svg: {
|
33
32
|
color: theme.colors.accentText,
|
34
33
|
},
|
@@ -15,7 +15,6 @@ import { WalletImage } from "../../../components/WalletImage.js";
|
|
15
15
|
import { Container } from "../../../components/basic.js";
|
16
16
|
import { Button } from "../../../components/buttons.js";
|
17
17
|
import { Text } from "../../../components/text.js";
|
18
|
-
import { SmartWalletBadgeIcon } from "../../icons/SmartAccountBadgeIcon.js";
|
19
18
|
|
20
19
|
export function WalletSelectorButton(props: {
|
21
20
|
address: string;
|
@@ -107,11 +106,6 @@ export function WalletRow(props: {
|
|
107
106
|
<Text size="sm" color="primaryText">
|
108
107
|
{addressOrENS || shortenAddress(props.address)}
|
109
108
|
</Text>
|
110
|
-
{walletId === "smart" && (
|
111
|
-
<Container color="accentText" center="both">
|
112
|
-
<SmartWalletBadgeIcon size={iconSize.sm} />
|
113
|
-
</Container>
|
114
|
-
)}
|
115
109
|
</Container>
|
116
110
|
);
|
117
111
|
}
|
@@ -68,6 +68,16 @@ export function FiatFlow(props: {
|
|
68
68
|
props.openedWindow,
|
69
69
|
);
|
70
70
|
|
71
|
+
const onPostOnrampSuccess = useCallback(() => {
|
72
|
+
// report the status of fiat status instead of post onramp swap status when post onramp swap is successful
|
73
|
+
getBuyWithFiatStatus({
|
74
|
+
intentId: props.quote.intentId,
|
75
|
+
client: props.client,
|
76
|
+
}).then((status) => {
|
77
|
+
props.onSuccess(status);
|
78
|
+
});
|
79
|
+
}, [props.onSuccess, props.quote.intentId, props.client]);
|
80
|
+
|
71
81
|
if (screen.id === "step-1") {
|
72
82
|
return (
|
73
83
|
<FiatSteps
|
@@ -110,16 +120,6 @@ export function FiatFlow(props: {
|
|
110
120
|
);
|
111
121
|
}
|
112
122
|
|
113
|
-
const onPostOnrampSuccess = useCallback(() => {
|
114
|
-
// report the status of fiat status instead of post onramp swap status when post onramp swap is successful
|
115
|
-
getBuyWithFiatStatus({
|
116
|
-
intentId: props.quote.intentId,
|
117
|
-
client: props.client,
|
118
|
-
}).then((status) => {
|
119
|
-
props.onSuccess(status);
|
120
|
-
});
|
121
|
-
}, [props.onSuccess, props.quote.intentId, props.client]);
|
122
|
-
|
123
123
|
if (screen.id === "postonramp-swap") {
|
124
124
|
return (
|
125
125
|
<PostOnRampSwapFlow
|
@@ -148,20 +148,19 @@ function WalletManangerButton(props: {
|
|
148
148
|
justifyContent: "space-between",
|
149
149
|
}}
|
150
150
|
>
|
151
|
-
<Container flex="row" gap="
|
152
|
-
<WalletImage client={props.client} id={walletId} size={iconSize.
|
151
|
+
<Container flex="row" gap="md" center="y">
|
152
|
+
<WalletImage client={props.client} id={walletId} size={iconSize.lg} />
|
153
153
|
|
154
|
-
<
|
154
|
+
<Container flex="column" gap="4xs">
|
155
155
|
<Text color="primaryText">{shortenAddress(address || "")}</Text>
|
156
|
-
<Spacer y="xxs" />
|
157
156
|
{balanceQuery.data ? (
|
158
|
-
<Text size="
|
157
|
+
<Text size="xs" color="secondaryText" weight={400}>
|
159
158
|
{formatTokenBalance(balanceQuery.data)}
|
160
159
|
</Text>
|
161
160
|
) : (
|
162
161
|
<Skeleton width="100px" height={fontSize.sm} />
|
163
162
|
)}
|
164
|
-
</
|
163
|
+
</Container>
|
165
164
|
</Container>
|
166
165
|
</WalletButtonEl>
|
167
166
|
|
@@ -10,6 +10,7 @@ import { Img } from "../../components/Img.js";
|
|
10
10
|
import { Spacer } from "../../components/Spacer.js";
|
11
11
|
import { Container, Line, ModalHeader } from "../../components/basic.js";
|
12
12
|
import { Text } from "../../components/text.js";
|
13
|
+
import { Blobbie } from "../Blobbie.js";
|
13
14
|
import { MenuButton } from "../MenuButton.js";
|
14
15
|
import { AddUserIcon } from "../icons/AddUserIcon.js";
|
15
16
|
import type { ConnectLocale } from "../locale/types.js";
|
@@ -98,13 +99,26 @@ export function LinkedProfilesScreen(props: {
|
|
98
99
|
}}
|
99
100
|
disabled // disabled until we have more data to show on a dedicated profile screen
|
100
101
|
>
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
102
|
+
{profile.type === "wallet" && profile.details.address ? (
|
103
|
+
<Container
|
104
|
+
style={{
|
105
|
+
width: "24px",
|
106
|
+
height: "24px",
|
107
|
+
borderRadius: "100%",
|
108
|
+
overflow: "hidden",
|
109
|
+
}}
|
110
|
+
>
|
111
|
+
<Blobbie address={profile.details.address} size={24} />
|
112
|
+
</Container>
|
113
|
+
) : (
|
114
|
+
<Img
|
115
|
+
src={getWalletIcon(profile.type)}
|
116
|
+
width={iconSize.md}
|
117
|
+
height={iconSize.md}
|
118
|
+
loading="eager"
|
119
|
+
client={props.client}
|
120
|
+
/>
|
121
|
+
)}
|
108
122
|
<Text color="primaryText">
|
109
123
|
{getProfileDisplayName(profile)}
|
110
124
|
</Text>
|
@@ -2,6 +2,7 @@ import type { ThirdwebClient } from "../../../../client/client.js";
|
|
2
2
|
import { resolveScheme } from "../../../../utils/ipfs.js";
|
3
3
|
import { StyledDiv } from "../design-system/elements.js";
|
4
4
|
import { Img } from "./Img.js";
|
5
|
+
import { Container } from "./basic.js";
|
5
6
|
|
6
7
|
export const fallbackChainIcon =
|
7
8
|
"data:image/svg+xml;charset=UTF-8,%3csvg width='15' height='14' viewBox='0 0 15 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M7 8.04238e-07C5.1435 8.04238e-07 3.36301 0.737501 2.05025 2.05025C0.7375 3.36301 0 5.1435 0 7C0 7.225 -1.52737e-07 7.445 0.0349998 7.665C0.16385 9.0151 0.68213 10.2988 1.52686 11.3598C2.37158 12.4209 3.50637 13.2137 4.79326 13.642C6.0801 14.0702 7.4637 14.1153 8.7758 13.7719C10.0879 13.4285 11.2719 12.7113 12.184 11.7075C13.0961 10.7038 13.6969 9.4567 13.9135 8.1178C14.1301 6.7789 13.9531 5.406 13.4039 4.16587C12.8548 2.92574 11.9573 1.87184 10.8204 1.13228C9.6835 0.392721 8.3563 -0.000649196 7 8.04238e-07ZM7 1C8.581 1.00137 10.0975 1.62668 11.22 2.74V3.24C9.2438 2.55991 7.0956 2.56872 5.125 3.265C4.96758 3.1116 4.76997 3.00586 4.555 2.96H4.43C4.37 2.75 4.315 2.54 4.27 2.325C4.225 2.11 4.2 1.92 4.175 1.715C5.043 1.24658 6.0137 1.00091 7 1ZM5.5 3.935C7.3158 3.32693 9.2838 3.34984 11.085 4C10.8414 5.2703 10.3094 6.4677 9.53 7.5C9.312 7.4077 9.0707 7.3855 8.8395 7.4366C8.6083 7.4877 8.3988 7.6094 8.24 7.785C8.065 7.685 7.89 7.585 7.74 7.47C6.7307 6.7966 5.8877 5.9023 5.275 4.855C5.374 4.73221 5.4461 4.58996 5.4866 4.43749C5.5271 4.28502 5.5351 4.12575 5.51 3.97L5.5 3.935ZM3.5 2.135C3.5 2.24 3.53 2.35 3.55 2.455C3.595 2.675 3.655 2.89 3.715 3.105C3.52353 3.21838 3.36943 3.38531 3.2717 3.58522C3.17397 3.78513 3.13688 4.00927 3.165 4.23C2.37575 4.7454 1.67078 5.3795 1.075 6.11C1.19455 5.3189 1.47112 4.55966 1.88843 3.87701C2.30575 3.19437 2.85539 2.60208 3.505 2.135H3.5ZM3.5 9.99C3.30481 10.0555 3.13037 10.1714 2.9943 10.3259C2.85822 10.4804 2.76533 10.6681 2.725 10.87H2.405C1.59754 9.9069 1.1146 8.7136 1.025 7.46L1.08 7.365C1.70611 6.3942 2.52463 5.562 3.485 4.92C3.62899 5.0704 3.81094 5.179 4.01162 5.2345C4.2123 5.2899 4.42423 5.2901 4.625 5.235C5.2938 6.3652 6.208 7.3306 7.3 8.06C7.505 8.195 7.715 8.32 7.925 8.44C7.9082 8.6312 7.9391 8.8237 8.015 9C7.1 9.7266 6.0445 10.256 4.915 10.555C4.78401 10.3103 4.57028 10.1201 4.31199 10.0184C4.05369 9.9167 3.76766 9.9102 3.505 10L3.5 9.99ZM7 12.99C5.9831 12.9903 4.98307 12.7304 4.095 12.235L4.235 12.205C4.43397 12.1397 4.61176 12.0222 4.74984 11.8648C4.88792 11.7074 4.98122 11.5158 5.02 11.31C6.2985 10.984 7.4921 10.3872 8.52 9.56C8.7642 9.7027 9.0525 9.75 9.3295 9.6927C9.6064 9.6355 9.8524 9.4778 10.02 9.25C10.7254 9.4334 11.4511 9.5275 12.18 9.53H12.445C11.9626 10.5673 11.1938 11.4451 10.2291 12.0599C9.2643 12.6747 8.144 13.0009 7 13V12.99ZM10.255 8.54C10.2545 8.3304 10.1975 8.1249 10.09 7.945C10.9221 6.8581 11.5012 5.5991 11.785 4.26C12.035 4.37667 12.2817 4.50667 12.525 4.65C13.0749 5.9495 13.1493 7.4012 12.735 8.75C11.9049 8.8142 11.0698 8.7484 10.26 8.555L10.255 8.54Z' fill='%23646D7A'/%3e%3c/svg%3e";
|
@@ -33,7 +34,7 @@ export const ChainIcon: React.FC<{
|
|
33
34
|
};
|
34
35
|
|
35
36
|
return (
|
36
|
-
<
|
37
|
+
<Container
|
37
38
|
style={{
|
38
39
|
position: "relative",
|
39
40
|
display: "flex",
|
@@ -49,7 +50,7 @@ export const ChainIcon: React.FC<{
|
|
49
50
|
client={props.client}
|
50
51
|
/>
|
51
52
|
{props.active && <ActiveDot />}
|
52
|
-
</
|
53
|
+
</Container>
|
53
54
|
);
|
54
55
|
};
|
55
56
|
|
@@ -58,7 +59,7 @@ const ActiveDot = /* @__PURE__ */ StyledDiv({
|
|
58
59
|
height: "28%",
|
59
60
|
borderRadius: "50%",
|
60
61
|
position: "absolute",
|
61
|
-
|
62
|
+
bottom: 0,
|
62
63
|
right: 0,
|
63
64
|
backgroundColor: "#00d395",
|
64
65
|
boxShadow: "0 0 0 2px var(--bg)",
|
@@ -0,0 +1,34 @@
|
|
1
|
+
"use client";
|
2
|
+
import { spacing } from "../../../core/design-system/index.js";
|
3
|
+
import { useClipboard } from "../hooks/useCopyClipboard.js";
|
4
|
+
import { IconButton } from "./buttons.js";
|
5
|
+
import { Text } from "./text.js";
|
6
|
+
|
7
|
+
/**
|
8
|
+
* @internal
|
9
|
+
*/
|
10
|
+
export const CopyAddress: React.FC<{
|
11
|
+
addressOrEns: string;
|
12
|
+
}> = (props) => {
|
13
|
+
const { hasCopied, onCopy } = useClipboard(props.addressOrEns);
|
14
|
+
|
15
|
+
return (
|
16
|
+
<IconButton
|
17
|
+
onKeyDown={(e) => {
|
18
|
+
if (e.key === "Enter" || e.key === " ") {
|
19
|
+
onCopy();
|
20
|
+
}
|
21
|
+
}}
|
22
|
+
onClick={onCopy}
|
23
|
+
style={{ padding: `${spacing["4xs"]} ${spacing.xxs}` }}
|
24
|
+
>
|
25
|
+
<Text
|
26
|
+
color={hasCopied ? "primaryText" : "secondaryText"}
|
27
|
+
weight={400}
|
28
|
+
size="sm"
|
29
|
+
>
|
30
|
+
{hasCopied ? "Copied address!" : props.addressOrEns}
|
31
|
+
</Text>
|
32
|
+
</IconButton>
|
33
|
+
);
|
34
|
+
};
|