thirdweb 5.88.6-nightly-b182302f590e75c9881cebd0ca1cc8b1425d50b8-20250218000338 → 5.88.7

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.
Files changed (34) hide show
  1. package/dist/cjs/adapters/viem.js +110 -0
  2. package/dist/cjs/adapters/viem.js.map +1 -1
  3. package/dist/cjs/chains/chain-definitions/arbitrum-nova.js +1 -1
  4. package/dist/cjs/chains/chain-definitions/arbitrum-nova.js.map +1 -1
  5. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +6 -15
  6. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  7. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js +36 -5
  8. package/dist/cjs/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js.map +1 -1
  9. package/dist/cjs/version.js +1 -1
  10. package/dist/cjs/version.js.map +1 -1
  11. package/dist/esm/adapters/viem.js +110 -0
  12. package/dist/esm/adapters/viem.js.map +1 -1
  13. package/dist/esm/chains/chain-definitions/arbitrum-nova.js +1 -1
  14. package/dist/esm/chains/chain-definitions/arbitrum-nova.js.map +1 -1
  15. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js +6 -15
  16. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.js.map +1 -1
  17. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js +36 -5
  18. package/dist/esm/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.js.map +1 -1
  19. package/dist/esm/version.js +1 -1
  20. package/dist/esm/version.js.map +1 -1
  21. package/dist/types/adapters/viem.d.ts +65 -1
  22. package/dist/types/adapters/viem.d.ts.map +1 -1
  23. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.d.ts +1 -0
  24. package/dist/types/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.d.ts.map +1 -1
  25. package/dist/types/version.d.ts +1 -1
  26. package/dist/types/version.d.ts.map +1 -1
  27. package/package.json +1 -1
  28. package/src/adapters/viem-legacy.test.ts +159 -0
  29. package/src/adapters/viem.test.ts +30 -14
  30. package/src/adapters/viem.ts +132 -1
  31. package/src/chains/chain-definitions/arbitrum-nova.ts +1 -1
  32. package/src/react/web/ui/ConnectWallet/screens/Buy/BuyScreen.tsx +7 -21
  33. package/src/react/web/ui/ConnectWallet/screens/Buy/swap/TokenSelectorScreen.tsx +96 -31
  34. package/src/version.ts +1 -1
@@ -69,6 +69,7 @@ export function TokenSelectorScreen(props: {
69
69
  onSelectToken: (wallet: Wallet, token: TokenInfo, chain: Chain) => void;
70
70
  onConnect: () => void;
71
71
  onPayWithFiat: () => void;
72
+ fiatSupported: boolean;
72
73
  }) {
73
74
  const connectedWallets = useConnectedWallets();
74
75
  const activeAccount = useActiveAccount();
@@ -255,29 +256,31 @@ export function TokenSelectorScreen(props: {
255
256
  </Text>
256
257
  </Container>
257
258
  </Button>
258
- <Button
259
- variant="secondary"
260
- fullWidth
261
- onClick={props.onPayWithFiat}
262
- bg="tertiaryBg"
263
- style={{
264
- border: `1px solid ${theme.colors.borderColor}`,
265
- padding: spacing.sm,
266
- }}
267
- >
268
- <Container
269
- flex="row"
270
- gap="sm"
271
- center="y"
272
- expand
273
- color="secondaryIconColor"
259
+ {props.fiatSupported && (
260
+ <Button
261
+ variant="secondary"
262
+ fullWidth
263
+ onClick={props.onPayWithFiat}
264
+ bg="tertiaryBg"
265
+ style={{
266
+ border: `1px solid ${theme.colors.borderColor}`,
267
+ padding: spacing.sm,
268
+ }}
274
269
  >
275
- <CardStackIcon width={iconSize.md} height={iconSize.md} />
276
- <Text size="sm" color="primaryText">
277
- Pay with credit card
278
- </Text>
279
- </Container>
280
- </Button>
270
+ <Container
271
+ flex="row"
272
+ gap="sm"
273
+ center="y"
274
+ expand
275
+ color="secondaryIconColor"
276
+ >
277
+ <CardStackIcon width={iconSize.md} height={iconSize.md} />
278
+ <Text size="sm" color="primaryText">
279
+ Pay with credit card
280
+ </Text>
281
+ </Container>
282
+ </Button>
283
+ )}
281
284
  </Container>
282
285
  </Container>
283
286
  </Container>
@@ -381,33 +384,90 @@ function TokenBalanceRow(props: {
381
384
  <StyledButton
382
385
  onClick={() => onClick(tokenBalance.token, wallet)}
383
386
  variant="secondary"
384
- style={style}
387
+ style={{
388
+ ...style,
389
+ display: "flex",
390
+ justifyContent: "space-between",
391
+ minWidth: 0, // Needed for text truncation to work
392
+ }}
385
393
  >
386
- <Container flex="row" center="y" gap="sm">
394
+ <Container
395
+ flex="row"
396
+ center="y"
397
+ gap="sm"
398
+ style={{
399
+ flex: "1 1 50%",
400
+ minWidth: 0,
401
+ maxWidth: "50%",
402
+ overflow: "hidden",
403
+ flexWrap: "nowrap",
404
+ }}
405
+ >
387
406
  <TokenIcon
388
407
  token={tokenBalance.token}
389
408
  chain={tokenBalance.chain}
390
409
  size="md"
391
410
  client={client}
392
411
  />
393
- <Container flex="column" gap="4xs">
394
- <Text size="xs" color="primaryText">
412
+ <Container flex="column" gap="4xs" style={{ minWidth: 0 }}>
413
+ <Text
414
+ size="xs"
415
+ color="primaryText"
416
+ style={{
417
+ overflow: "hidden",
418
+ textOverflow: "ellipsis",
419
+ whiteSpace: "nowrap",
420
+ }}
421
+ >
395
422
  {tokenBalance.token.symbol}
396
423
  </Text>
397
- {chainInfo && <Text size="xs">{chainInfo.name}</Text>}
424
+ {chainInfo && (
425
+ <Text
426
+ size="xs"
427
+ style={{
428
+ overflow: "hidden",
429
+ textOverflow: "ellipsis",
430
+ whiteSpace: "nowrap",
431
+ }}
432
+ >
433
+ {chainInfo.name}
434
+ </Text>
435
+ )}
398
436
  </Container>
399
437
  </Container>
400
- <Container flex="row" center="y" gap="4xs" color="secondaryText">
438
+
439
+ <Container
440
+ flex="row"
441
+ center="y"
442
+ gap="4xs"
443
+ color="secondaryText"
444
+ style={{
445
+ flex: "1 1 50%",
446
+ maxWidth: "50%",
447
+ minWidth: 0,
448
+ justifyContent: "flex-end",
449
+ flexWrap: "nowrap",
450
+ }}
451
+ >
401
452
  <Container
402
453
  flex="column"
403
454
  color="secondaryText"
404
455
  gap="4xs"
405
456
  style={{
406
- justifyContent: "flex-end",
407
457
  alignItems: "flex-end",
458
+ minWidth: 0,
459
+ overflow: "hidden",
408
460
  }}
409
461
  >
410
- <Text size="xs" color="primaryText">
462
+ <Text
463
+ size="xs"
464
+ color="primaryText"
465
+ style={{
466
+ overflow: "hidden",
467
+ textOverflow: "ellipsis",
468
+ whiteSpace: "nowrap",
469
+ }}
470
+ >
411
471
  {formatTokenBalance(tokenBalance.balance, true, 2)}
412
472
  </Text>
413
473
  <FiatValue
@@ -418,7 +478,11 @@ function TokenBalanceRow(props: {
418
478
  size="xs"
419
479
  />
420
480
  </Container>
421
- <ChevronRightIcon width={iconSize.md} height={iconSize.md} />
481
+ <ChevronRightIcon
482
+ width={iconSize.md}
483
+ height={iconSize.md}
484
+ style={{ flexShrink: 0 }}
485
+ />
422
486
  </Container>
423
487
  </StyledButton>
424
488
  );
@@ -429,6 +493,7 @@ const StyledButton = /* @__PURE__ */ styled(Button)((props) => {
429
493
  return {
430
494
  background: "transparent",
431
495
  justifyContent: "space-between",
496
+ flexWrap: "nowrap",
432
497
  flexDirection: "row",
433
498
  padding: spacing.sm,
434
499
  paddingRight: spacing.xs,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "5.88.6-nightly-b182302f590e75c9881cebd0ca1cc8b1425d50b8-20250218000338";
1
+ export const version = "5.88.7";