@daimo/pay 0.3.14 → 0.3.15

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 (18) hide show
  1. package/build/index.es.js +460 -830
  2. package/build/index.es.js.map +1 -1
  3. package/build/packages/paykit/packages/connectkit/src/assets/chains.d.ts +6 -0
  4. package/build/packages/paykit/packages/connectkit/src/components/Common/CopyToClipboard/CopyToClipboardIcon.d.ts +2 -1
  5. package/build/packages/paykit/packages/connectkit/src/components/Common/CopyToClipboard/index.d.ts +1 -1
  6. package/build/packages/paykit/packages/connectkit/src/components/DaimoPay.d.ts +2 -2
  7. package/build/packages/paykit/packages/connectkit/src/components/Pages/SelectDepositAddressChain/index.d.ts +3 -0
  8. package/build/packages/paykit/packages/connectkit/src/components/Pages/WaitingDepositAddress/index.d.ts +3 -0
  9. package/build/packages/paykit/packages/connectkit/src/defaultConfig.d.ts +5 -1
  10. package/build/packages/paykit/packages/connectkit/src/defaultConnectors.d.ts +1 -1
  11. package/build/packages/paykit/packages/connectkit/src/hooks/useDepositAddressOptions.d.ts +7 -0
  12. package/build/packages/paykit/packages/connectkit/src/hooks/useModal.d.ts +0 -1
  13. package/build/packages/paykit/packages/connectkit/src/hooks/usePaymentInfo.d.ts +6 -6
  14. package/build/packages/paykit/packages/connectkit/src/index.d.ts +0 -1
  15. package/package.json +5 -3
  16. package/build/packages/paykit/packages/connectkit/src/components/Pages/Profile/index.d.ts +0 -5
  17. package/build/packages/paykit/packages/connectkit/src/components/Pages/Profile/styles.d.ts +0 -6
  18. package/build/packages/paykit/packages/connectkit/src/components/Pages/WaitingBitcoin/index.d.ts +0 -3
package/build/index.es.js CHANGED
@@ -1,4 +1,4 @@
1
- import { http, useConfig, useAccountEffect, useAccount, useEnsName, useWriteContract, useSendTransaction, useConnectors as useConnectors$1, useSwitchChain, useConnect as useConnect$1, createConfig, useEnsAddress, useEnsAvatar, useDisconnect, useBalance, useChainId, WagmiContext } from 'wagmi';
1
+ import { http, useConfig, useAccountEffect, useAccount, useEnsName, useWriteContract, useSendTransaction, useConnectors as useConnectors$1, useSwitchChain, useConnect as useConnect$1, useDisconnect, useChainId, WagmiContext, createConfig, useEnsAddress, useEnsAvatar } from 'wagmi';
2
2
  import { mainnet, base as base$1, polygon, optimism, arbitrum, linea, bsc, sepolia, baseSepolia } from 'wagmi/chains';
3
3
  import { safe, injected, coinbaseWallet, walletConnect } from '@wagmi/connectors';
4
4
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
@@ -19,8 +19,8 @@ import ResizeObserver from 'resize-observer-polyfill';
19
19
  import useMeasure from 'react-use-measure';
20
20
  import QRCodeUtil from 'qrcode';
21
21
  import { walletConnect as walletConnect$1 } from 'wagmi/connectors';
22
- import { normalize } from 'viem/ens';
23
22
  import { WalletSignTransactionError } from '@solana/wallet-adapter-base';
23
+ import { normalize } from 'viem/ens';
24
24
 
25
25
  const defaultConnectors = ({ app, walletConnectProjectId, coinbaseWalletPreference, }) => {
26
26
  const hasAllAppData = app.name && app.icon && app.description && app.url;
@@ -39,20 +39,18 @@ const defaultConnectors = ({ app, walletConnectProjectId, coinbaseWalletPreferen
39
39
  overrideIsMetaMask: false,
40
40
  preference: coinbaseWalletPreference,
41
41
  }));
42
- if (walletConnectProjectId) {
43
- connectors.push(walletConnect({
44
- showQrModal: false,
45
- projectId: walletConnectProjectId,
46
- metadata: hasAllAppData
47
- ? {
48
- name: app.name,
49
- description: app.description,
50
- url: app.url,
51
- icons: [app.icon],
52
- }
53
- : undefined,
54
- }));
55
- }
42
+ connectors.push(walletConnect({
43
+ showQrModal: false,
44
+ projectId: walletConnectProjectId,
45
+ metadata: hasAllAppData
46
+ ? {
47
+ name: app.name,
48
+ description: app.description,
49
+ url: app.url,
50
+ icons: [app.icon],
51
+ }
52
+ : undefined,
53
+ }));
56
54
  /*
57
55
  connectors.push(
58
56
  injected({
@@ -103,7 +101,7 @@ const defaultConfig = ({ appName = "Daimo Pay", appIcon, appDescription, appUrl,
103
101
  description: appDescription,
104
102
  url: appUrl,
105
103
  },
106
- walletConnectProjectId,
104
+ walletConnectProjectId: walletConnectProjectId ?? "ea6c5b36001c18b96e06128f14c06f40",
107
105
  coinbaseWalletPreference,
108
106
  });
109
107
  const config = {
@@ -266,29 +264,6 @@ const truncateEthAddress = (address, separator = "••••") => {
266
264
  return address;
267
265
  return `${match[1]}${separator}${match[2]}`;
268
266
  };
269
- const nFormatter = (num, digits = 2) => {
270
- if (num < 10000)
271
- return num.toFixed(2);
272
- const lookup = [
273
- { value: 1, symbol: "" },
274
- { value: 1e3, symbol: "k" },
275
- { value: 1e6, symbol: "m" },
276
- { value: 1e9, symbol: "g" },
277
- { value: 1e12, symbol: "t" },
278
- { value: 1e15, symbol: "p" },
279
- { value: 1e18, symbol: "e" },
280
- ];
281
- const rx = /\.0+$|(\.[0-9]*[1-9])0+$/;
282
- var item = lookup
283
- .slice()
284
- .reverse()
285
- .find(function (item) {
286
- return num >= item.value;
287
- });
288
- return item
289
- ? (num / item.value).toFixed(digits).replace(rx, "$1") + item.symbol
290
- : "0";
291
- };
292
267
  const detectBrowser = () => {
293
268
  const browser = detect();
294
269
  return browser?.name ?? "";
@@ -879,6 +854,30 @@ const trpc = createTRPCClient({
879
854
  ],
880
855
  });
881
856
 
857
+ function useDepositAddressOptions({ usdRequired, }) {
858
+ const [options, setOptions] = useState([]);
859
+ const [loading, setLoading] = useState(false);
860
+ useEffect(() => {
861
+ const refreshDepositAddressOptions = async () => {
862
+ setLoading(true);
863
+ try {
864
+ const options = await trpc.getDepositAddressOptions.query({
865
+ usdRequired,
866
+ });
867
+ setOptions(options);
868
+ }
869
+ catch (e) {
870
+ console.error(e);
871
+ }
872
+ finally {
873
+ setLoading(false);
874
+ }
875
+ };
876
+ refreshDepositAddressOptions();
877
+ }, [usdRequired]);
878
+ return { options, loading };
879
+ }
880
+
882
881
  const DEFAULT_EXTERNAL_PAYMENT_OPTIONS = [
883
882
  ExternalPaymentOptions.Coinbase,
884
883
  ExternalPaymentOptions.Binance,
@@ -1066,10 +1065,14 @@ function usePaymentInfo({ daimoPayOrder, setDaimoPayOrder, setOpen, log, }) {
1066
1065
  address: solanaPubKey,
1067
1066
  usdRequired: daimoPayOrder?.destFinalCallTokenAmount.usd,
1068
1067
  });
1068
+ const depositAddressOptions = useDepositAddressOptions({
1069
+ usdRequired: daimoPayOrder?.destFinalCallTokenAmount.usd ?? 0,
1070
+ });
1069
1071
  const { payWithSolanaToken } = usePayWithSolanaToken(daimoPayOrder?.id ?? undefined, setDaimoPayOrder, daimoPayOrder?.destFinalCallTokenAmount.amount ?? undefined, platform);
1070
1072
  const [selectedExternalOption, setSelectedExternalOption] = useState();
1071
1073
  const [selectedTokenOption, setSelectedTokenOption] = useState();
1072
1074
  const [selectedSolanaTokenOption, setSelectedSolanaTokenOption] = useState();
1075
+ const [selectedDepositAddressOption, setSelectedDepositAddressOption] = useState();
1073
1076
  const payWithToken = async (tokenAmount) => {
1074
1077
  assert(!!daimoPayOrder && !!platform);
1075
1078
  const { hydratedOrder } = await trpc.hydrateOrder.query({
@@ -1129,7 +1132,7 @@ function usePaymentInfo({ daimoPayOrder, setDaimoPayOrder, setOpen, log, }) {
1129
1132
  setDaimoPayOrder(hydratedOrder);
1130
1133
  return externalPaymentOptionData.url;
1131
1134
  };
1132
- const payWithBitcoin = async () => {
1135
+ const payWithDepositAddress = async (option) => {
1133
1136
  assert(!!daimoPayOrder && !!platform);
1134
1137
  const { hydratedOrder } = await trpc.hydrateOrder.query({
1135
1138
  id: daimoPayOrder.id.toString(),
@@ -1137,11 +1140,12 @@ function usePaymentInfo({ daimoPayOrder, setDaimoPayOrder, setOpen, log, }) {
1137
1140
  platform,
1138
1141
  });
1139
1142
  setDaimoPayOrder(hydratedOrder);
1140
- const bitcoinOption = await trpc.getBitcoinOption.query({
1143
+ const depositAddressOption = await trpc.getDepositAddressOptionData.query({
1144
+ input: option,
1141
1145
  usdRequired: daimoPayOrder.destFinalCallTokenAmount.usd,
1142
1146
  toAddress: assertNotNull(hydratedOrder.intentAddr),
1143
1147
  });
1144
- return bitcoinOption;
1148
+ return depositAddressOption;
1145
1149
  };
1146
1150
  const refreshOrder = useCallback(async () => {
1147
1151
  const id = daimoPayOrder?.id?.toString();
@@ -1201,13 +1205,16 @@ function usePaymentInfo({ daimoPayOrder, setDaimoPayOrder, setOpen, log, }) {
1201
1205
  externalPaymentOptions,
1202
1206
  walletPaymentOptions,
1203
1207
  solanaPaymentOptions,
1208
+ depositAddressOptions,
1209
+ selectedDepositAddressOption,
1210
+ setSelectedDepositAddressOption,
1204
1211
  setSelectedExternalOption,
1205
1212
  setSelectedTokenOption,
1206
1213
  setSelectedSolanaTokenOption,
1207
1214
  setChosenUsd,
1208
1215
  payWithToken,
1209
1216
  payWithExternal,
1210
- payWithBitcoin,
1217
+ payWithDepositAddress,
1211
1218
  payWithSolanaToken,
1212
1219
  refreshOrder,
1213
1220
  onSuccess,
@@ -2356,7 +2363,7 @@ const ResetContainer = styled(motion.div) `
2356
2363
  `;
2357
2364
 
2358
2365
  var name = "@daimo/pay";
2359
- var version = "0.3.14";
2366
+ var version = "0.3.15";
2360
2367
  var author = "Daimo";
2361
2368
  var homepage = "https://pay.daimo.com";
2362
2369
  var license = "BSD-2-Clause license";
@@ -2395,8 +2402,8 @@ var keywords = [
2395
2402
  "crypto"
2396
2403
  ];
2397
2404
  var dependencies = {
2398
- "@daimo/common": "0.3.14",
2399
- "@daimo/contract": "0.3.14",
2405
+ "@daimo/common": "0.3.15",
2406
+ "@daimo/contract": "0.3.15",
2400
2407
  "@solana/wallet-adapter-base": "^0.9.23",
2401
2408
  "@solana/wallet-adapter-react": "^0.15.35",
2402
2409
  "@solana/web3.js": "^1.95.4",
@@ -2404,7 +2411,9 @@ var dependencies = {
2404
2411
  "@trpc/server": "^11.0.0-next-beta.318",
2405
2412
  buffer: "^6.0.3",
2406
2413
  "detect-browser": "^5.3.0",
2414
+ encoding: "^0.1.13",
2407
2415
  "framer-motion": "^11.11.4",
2416
+ "pino-pretty": "^13.0.0",
2408
2417
  qrcode: "^1.5.0",
2409
2418
  "react-transition-state": "^1.1.4",
2410
2419
  "react-use-measure": "^2.1.1",
@@ -2960,7 +2969,7 @@ const InfoButton = styled(motion.button) `
2960
2969
  }
2961
2970
  }
2962
2971
  `;
2963
- const Container$6 = styled(motion.div) `
2972
+ const Container$5 = styled(motion.div) `
2964
2973
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
2965
2974
  --duration: 200ms;
2966
2975
  --transition: height var(--duration) var(--ease),
@@ -4902,7 +4911,7 @@ const Modal = ({ open, pages, pageId, positionInside, inline, demo, onClose, onB
4902
4911
  const context = useContext();
4903
4912
  const themeContext = useThemeContext();
4904
4913
  const mobile = isMobile();
4905
- const { daimoPayOrder, selectedExternalOption, selectedTokenOption } = context.paymentInfo;
4914
+ const { daimoPayOrder, selectedExternalOption, selectedTokenOption, selectedSolanaTokenOption, selectedDepositAddressOption, } = context.paymentInfo;
4906
4915
  const wallet = useWallet(context.connector?.id);
4907
4916
  const walletInfo = {
4908
4917
  name: wallet?.name,
@@ -5024,18 +5033,24 @@ const Modal = ({ open, pages, pageId, positionInside, inline, demo, onClose, onB
5024
5033
  return locales.downloadAppScreen_heading;
5025
5034
  case ROUTES.ONBOARDING:
5026
5035
  return locales.onboardingScreen_heading;
5027
- case ROUTES.PROFILE:
5028
- return locales.profileScreen_heading;
5029
5036
  case ROUTES.SWITCHNETWORKS:
5030
5037
  return locales.switchNetworkScreen_heading;
5031
5038
  case ROUTES.SELECT_METHOD:
5032
5039
  case ROUTES.SELECT_TOKEN:
5033
5040
  case ROUTES.SOLANA_SELECT_TOKEN:
5034
5041
  return daimoPayOrder?.metadata.intent;
5042
+ case ROUTES.SOLANA_PAY_WITH_TOKEN:
5043
+ if (!selectedSolanaTokenOption)
5044
+ return undefined;
5045
+ return `Pay with ${selectedSolanaTokenOption.required.token.symbol}`;
5035
5046
  case ROUTES.WAITING_OTHER:
5036
5047
  return selectedExternalOption?.cta;
5037
- case ROUTES.WAITING_BITCOIN:
5038
- return "Pay with Bitcoin";
5048
+ case ROUTES.SELECT_DEPOSIT_ADDRESS_CHAIN:
5049
+ return "Select Chain";
5050
+ case ROUTES.WAITING_DEPOSIT_ADDRESS:
5051
+ if (!selectedDepositAddressOption)
5052
+ return undefined;
5053
+ return `Pay with ${selectedDepositAddressOption.id}`;
5039
5054
  case ROUTES.PAY_WITH_TOKEN:
5040
5055
  if (!selectedTokenOption)
5041
5056
  return undefined;
@@ -5049,7 +5064,7 @@ const Modal = ({ open, pages, pageId, positionInside, inline, demo, onClose, onB
5049
5064
  const Content = (jsx(ResetContainer, { "$useTheme": demo?.theme ?? themeContext.theme, "$useMode": demo?.mode ?? themeContext.mode, "$customTheme": demo?.customTheme ?? themeContext.customTheme, children: jsxs(ModalContainer, { role: "dialog", style: {
5050
5065
  pointerEvents: rendered ? "auto" : "none",
5051
5066
  position: positionInside ? "absolute" : undefined,
5052
- }, children: [!inline && (jsx(BackgroundOverlay, { "$active": rendered, onClick: onClose, "$blur": context.options?.overlayBlur })), jsxs(Container$6, { style: dimensionsCSS, initial: false, children: [jsx("div", { style: {
5067
+ }, children: [!inline && (jsx(BackgroundOverlay, { "$active": rendered, onClick: onClose, "$blur": context.options?.overlayBlur })), jsxs(Container$5, { style: dimensionsCSS, initial: false, children: [jsx("div", { style: {
5053
5068
  pointerEvents: inTransition ? "all" : "none", // Block interaction while transitioning
5054
5069
  position: "absolute",
5055
5070
  top: 0,
@@ -7086,6 +7101,8 @@ const Evmos = ({ testnet, ...props }) => (jsx("svg", { ...props, "aria-hidden":
7086
7101
  const BinanceSmartChain = ({ testnet, ...props }) => (jsx("svg", { ...props, "aria-hidden": "true", width: "44", height: "44", version: "1.1", fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 2496 2496", children: jsxs("g", { children: [jsx("path", { style: { fillRule: "evenodd", clipRule: "evenodd", fill: "#F0B90B" }, d: "M1248,0c689.3,0,1248,558.7,1248,1248s-558.7,1248-1248,1248\n\t\tS0,1937.3,0,1248S558.7,0,1248,0L1248,0z" }), jsx("path", { style: { fill: "#FFFFFF" }, d: "M685.9,1248l0.9,330l280.4,165v193.2l-444.5-260.7v-524L685.9,1248L685.9,1248z M685.9,918v192.3\n\t\tl-163.3-96.6V821.4l163.3-96.6l164.1,96.6L685.9,918L685.9,918z M1084.3,821.4l163.3-96.6l164.1,96.6L1247.6,918L1084.3,821.4\n\t\tL1084.3,821.4z" }), jsx("path", { style: { fill: "#FFFFFF" }, d: "M803.9,1509.6v-193.2l163.3,96.6v192.3L803.9,1509.6L803.9,1509.6z M1084.3,1812.2l163.3,96.6\n\t\tl164.1-96.6v192.3l-164.1,96.6l-163.3-96.6V1812.2L1084.3,1812.2z M1645.9,821.4l163.3-96.6l164.1,96.6v192.3l-164.1,96.6V918\n\t\tL1645.9,821.4L1645.9,821.4L1645.9,821.4z M1809.2,1578l0.9-330l163.3-96.6v524l-444.5,260.7v-193.2L1809.2,1578L1809.2,1578\n\t\tL1809.2,1578z" }), jsx("polygon", { style: { fill: "#FFFFFF" }, points: "1692.1,1509.6 1528.8,1605.3 1528.8,1413 1692.1,1316.4 1692.1,1509.6 \t" }), jsx("path", { style: { fill: "#FFFFFF" }, d: "M1692.1,986.4l0.9,193.2l-281.2,165v330.8l-163.3,95.7l-163.3-95.7v-330.8l-281.2-165V986.4\n\t\tL968,889.8l279.5,165.8l281.2-165.8l164.1,96.6H1692.1L1692.1,986.4z M803.9,656.5l443.7-261.6l444.5,261.6l-163.3,96.6\n\t\tl-281.2-165.8L967.2,753.1L803.9,656.5L803.9,656.5z" })] }) }));
7087
7102
  const Solana = ({ testnet, ...props }) => (jsxs("svg", { ...props, "aria-hidden": "true", width: "44", height: "44", viewBox: "0 0 200 200", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { width: "200", height: "200", rx: "100", fill: "#121212" }), jsx("g", { clipPath: "url(#clip0_295_42)", children: jsx("path", { d: "M149.48 125.382L132.807 142.801C132.444 143.18 132.006 143.482 131.519 143.688C131.031 143.894 130.505 144 129.974 144H50.9356C50.5585 144 50.1896 143.893 49.8742 143.691C49.5588 143.49 49.3107 143.203 49.1604 142.866C49.0101 142.529 48.9641 142.157 49.028 141.795C49.092 141.432 49.2631 141.096 49.5204 140.828L66.2061 123.408C66.5676 123.031 67.0047 122.729 67.4904 122.523C67.9762 122.317 68.5002 122.21 69.0301 122.21H148.064C148.441 122.21 148.81 122.317 149.126 122.518C149.441 122.72 149.689 123.007 149.84 123.344C149.99 123.681 150.036 124.053 149.972 124.415C149.908 124.777 149.737 125.113 149.48 125.382ZM132.807 90.3032C132.444 89.9248 132.006 89.6231 131.519 89.4169C131.031 89.2108 130.505 89.1045 129.974 89.1048H50.9356C50.5585 89.1048 50.1896 89.2121 49.8742 89.4136C49.5588 89.6151 49.3107 89.9019 49.1604 90.2388C49.0101 90.5758 48.9641 90.9482 49.028 91.3103C49.092 91.6723 49.2631 92.0083 49.5204 92.277L66.2061 109.697C66.5676 110.074 67.0047 110.375 67.4904 110.581C67.9762 110.788 68.5002 110.894 69.0301 110.895H148.064C148.441 110.895 148.81 110.788 149.126 110.586C149.441 110.385 149.689 110.098 149.84 109.761C149.99 109.424 150.036 109.052 149.972 108.69C149.908 108.328 149.737 107.992 149.48 107.723L132.807 90.3032ZM50.9356 77.7905H129.974C130.505 77.7907 131.031 77.6845 131.519 77.4783C132.006 77.2721 132.444 76.9704 132.807 76.592L149.48 59.1722C149.737 58.9036 149.908 58.5676 149.972 58.2055C150.036 57.8434 149.99 57.471 149.84 57.1341C149.689 56.7971 149.441 56.5103 149.126 56.3088C148.81 56.1073 148.441 56 148.064 56H69.0301C68.5002 56.0009 67.9762 56.1077 67.4904 56.3138C67.0047 56.52 66.5676 56.8211 66.2061 57.1985L49.5247 74.6183C49.2677 74.8866 49.0966 75.2223 49.0325 75.5839C48.9684 75.9456 49.0141 76.3177 49.1639 76.6545C49.3136 76.9913 49.5611 77.2781 49.8758 77.4799C50.1905 77.6817 50.5589 77.7896 50.9356 77.7905Z", fill: "url(#paint0_linear_295_42)" }) }), jsxs("defs", { children: [jsxs("linearGradient", { id: "paint0_linear_295_42", x1: "57.5256", y1: "146.097", x2: "137.993", y2: "52.9838", gradientUnits: "userSpaceOnUse", children: [jsx("stop", { offset: "0.08", stopColor: "#9945FF" }), jsx("stop", { offset: "0.3", stopColor: "#8752F3" }), jsx("stop", { offset: "0.5", stopColor: "#5497D5" }), jsx("stop", { offset: "0.6", stopColor: "#43B4CA" }), jsx("stop", { offset: "0.72", stopColor: "#28E0B9" }), jsx("stop", { offset: "0.97", stopColor: "#19FB9B" })] }), jsx("clipPath", { id: "clip0_295_42", children: jsx("rect", { width: "101", height: "88", fill: "white", transform: "translate(49 56)" }) })] })] }));
7088
7103
  const Bitcoin = ({ testnet, ...props }) => (jsxs("svg", { ...props, "aria-hidden": "true", width: "44", height: "44", viewBox: "0 0 44 44", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { d: "M43.3388 27.3219C40.4005 39.1077 28.4634 46.2804 16.6762 43.3413C4.89383 40.4029 -2.27886 28.4652 0.660895 16.68C3.59789 4.89286 15.535 -2.28052 27.3187 0.657859C39.1052 3.59623 46.2772 15.5354 43.3388 27.3219Z", fill: "#F7931A" }), jsx("path", { d: "M31.6992 18.8656C32.1371 15.9382 29.9082 14.3645 26.8605 13.3147L27.8492 9.34922L25.4353 8.74765L24.4728 12.6087C23.8383 12.4505 23.1865 12.3013 22.5389 12.1535L23.5083 8.26709L21.0958 7.66553L20.1065 11.6297C19.5813 11.51 19.0657 11.3918 18.5652 11.2673L18.5679 11.255L15.239 10.4238L14.5969 13.0019C14.5969 13.0019 16.3878 13.4123 16.35 13.4378C17.3277 13.6818 17.5043 14.3288 17.4748 14.8417L16.3487 19.3592C16.416 19.3764 16.5033 19.4012 16.5996 19.4397C16.5192 19.4197 16.4332 19.3977 16.3445 19.3764L14.766 25.7048C14.6464 26.0018 14.3432 26.4473 13.6598 26.2782C13.6839 26.3133 11.9053 25.8403 11.9053 25.8403L10.707 28.6033L13.8482 29.3864C14.4326 29.5328 15.0053 29.6862 15.569 29.8305L14.5701 33.8414L16.9812 34.443L17.9705 30.4747C18.6291 30.6535 19.2685 30.8185 19.8941 30.9738L18.9082 34.9235L21.322 35.5251L22.321 31.5218C26.437 32.3007 29.5322 31.9865 30.835 28.2637C31.8848 25.2662 30.7827 23.5372 28.6171 22.4097C30.1942 22.046 31.3822 21.0085 31.6992 18.8656ZM26.184 26.5993C25.4381 29.5968 20.3912 27.9763 18.7549 27.57L20.0804 22.2563C21.7167 22.6647 26.9637 23.4732 26.184 26.5993ZM26.9307 18.8223C26.25 21.5489 22.0494 20.1636 20.6868 19.824L21.8885 15.0046C23.2512 15.3442 27.6395 15.9781 26.9307 18.8223Z", fill: "white" })] }));
7104
+ const Tron = ({ testnet, ...props }) => (jsxs("svg", { ...props, "aria-hidden": "true", width: "44", height: "44", viewBox: "0 0 44 44", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsxs("g", { "clip-path": "url(#clip0_450_171)", children: [jsx("path", { d: "M43.3388 27.3219C40.4005 39.1077 28.4634 46.2804 16.6762 43.3413C4.89383 40.4029 -2.27886 28.4652 0.660896 16.68C3.59789 4.89286 15.535 -2.28052 27.3187 0.65786C39.1052 3.59623 46.2772 15.5354 43.3388 27.3219Z", fill: "#FF060A" }), jsx("path", { d: "M36.3975 17.2381C35.0196 16.0232 33.1057 14.1724 31.5555 12.8625L31.4598 12.8056C31.3067 12.6917 31.1344 12.5968 30.9526 12.5303C27.2015 11.8659 9.74716 8.76218 9.41224 8.80015C9.31654 8.80964 9.22085 8.84761 9.1443 8.89507L9.05817 8.96151C8.95291 9.06591 8.86679 9.1893 8.81894 9.33167L8.7998 9.38862V9.70184V9.7493C10.7615 14.9507 18.5222 31.9785 20.0532 35.9839C20.1489 36.2591 20.3212 36.7717 20.6465 36.8001H20.7231C20.8953 36.8001 21.6417 35.8605 21.6417 35.8605C21.6417 35.8605 34.9717 20.5032 36.321 18.8707C36.4932 18.6713 36.6463 18.453 36.7803 18.2252C36.8186 18.0449 36.7994 17.8646 36.7324 17.6937C36.6655 17.5229 36.5411 17.3615 36.3975 17.2381ZM25.0484 19.032L30.7325 14.552L34.0722 17.4754L25.0484 19.032ZM22.8379 18.7378L13.0486 11.1066L28.8952 13.8876L22.8379 18.7378ZM23.7183 20.731L33.7373 19.1934L22.2829 32.3202L23.7183 20.731ZM11.7184 11.8754L22.0245 20.1805L20.5317 32.3296L11.7184 11.8754Z", fill: "white" })] }), jsx("defs", { children: jsx("clipPath", { id: "clip0_450_171", children: jsx("rect", { width: "44", height: "44", fill: "white" }) }) })] }));
7105
+ const Zcash = ({ testnet, ...props }) => (jsxs("svg", { ...props, "aria-hidden": "true", width: "44", height: "44", viewBox: "0 0 44 44", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { d: "M43.3415 27.3221C40.4029 39.1078 28.4645 46.2804 16.676 43.3413C4.8924 40.403 -2.28106 28.4654 0.659014 16.6803C3.59632 4.8933 15.5347 -2.28001 27.3197 0.658341C39.1074 3.59668 46.2802 15.5357 43.3415 27.3221Z", fill: "white" }), jsx("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M0 22C0 9.86741 9.86741 0 22 0C34.1326 0 44 9.86741 44 22C44 34.1326 34.1326 44 22 44C9.86741 44 0 34.1326 0 22ZM29.8475 11.7904V15.1384L20.5358 27.7681H29.8475V32.2088H23.8447V35.8885H20.1553V32.2088H14.1525V28.8607L23.4544 16.2311H14.1525V11.7904H20.1553V8.10089H23.8447V11.7904H29.8475Z", fill: "#F4B728" })] }));
7089
7106
  const Canto = ({ testnet, ...props }) => (jsx("svg", { ...props, "aria-hidden": "true", width: "44", height: "44", viewBox: "0 0 44 44", fill: "none", xmlns: "http://www.w3.org/2000/svg", style: {
7090
7107
  background: testnet
7091
7108
  ? "linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)"
@@ -7133,7 +7150,7 @@ const chainToLogo = {
7133
7150
  [linea$1.chainId]: jsx(Linea, {}),
7134
7151
  [bsc$1.chainId]: jsx(BinanceSmartChain, {}),
7135
7152
  };
7136
- var ChainIcons = {
7153
+ var Chains = {
7137
7154
  UnknownChain,
7138
7155
  Base,
7139
7156
  Ethereum,
@@ -7399,7 +7416,7 @@ const QRCodeContent = styled(motion.div) `
7399
7416
  height: auto !important;
7400
7417
  }
7401
7418
  `;
7402
- const PlaceholderKeyframes$1 = keyframes `
7419
+ const PlaceholderKeyframes = keyframes `
7403
7420
  0%{ background-position: 100% 0; }
7404
7421
  100%{ background-position: -100% 0; }
7405
7422
  `;
@@ -7471,7 +7488,7 @@ const QRPlaceholder = styled(motion.div) `
7471
7488
  rgba(255, 255, 255, 0)
7472
7489
  );
7473
7490
  background-size: 200% 100%;
7474
- animation: ${PlaceholderKeyframes$1} 1000ms linear infinite both;
7491
+ animation: ${PlaceholderKeyframes} 1000ms linear infinite both;
7475
7492
  }
7476
7493
  `;
7477
7494
  const LogoContainer$3 = styled(motion.div) `
@@ -7854,7 +7871,7 @@ const WalletList = styled.div `
7854
7871
  }
7855
7872
  `}
7856
7873
  `;
7857
- const Container$5 = styled.div ``;
7874
+ const Container$4 = styled.div ``;
7858
7875
 
7859
7876
  function useWalletConnectModal() {
7860
7877
  const { log } = useContext();
@@ -7956,20 +7973,22 @@ const IconContainer$1 = styled(motion.div) `
7956
7973
  }
7957
7974
  `}
7958
7975
  `;
7959
- const CopyToClipboardIcon = ({ copied, small, }) => (jsx(IconContainer$1, { "$clipboard": copied, children: jsx(CopyToClipboardIcon$1, { style: {
7976
+ const CopyToClipboardIcon = ({ copied, small, dark, }) => (jsx(IconContainer$1, { "$clipboard": copied, children: jsx(CopyToClipboardIcon$1, { style: {
7960
7977
  transform: small ? "scale(1)" : "translateX(3px) scale(1.5)",
7961
- opacity: small || copied ? 1 : 0.3,
7978
+ opacity: small || copied || dark ? 1 : 0.3,
7962
7979
  } }) }));
7963
7980
 
7964
- const Container$4 = styled.div `
7981
+ const Container$3 = styled.div `
7965
7982
  --color: var(--ck-copytoclipboard-stroke);
7966
7983
  --bg: var(--ck-body-background);
7967
7984
  transition: all 220ms cubic-bezier(0.175, 0.885, 0.32, 1.1);
7968
7985
 
7969
7986
  cursor: pointer;
7970
- display: inline-flex;
7987
+ display: flex;
7971
7988
  align-items: center;
7972
7989
  justify-content: center;
7990
+ margin-top: 4px;
7991
+ gap: 8px;
7973
7992
 
7974
7993
  ${(props) => props.$disabled
7975
7994
  ? css `
@@ -7982,19 +8001,6 @@ const Container$4 = styled.div `
7982
8001
  }
7983
8002
  `}
7984
8003
  `;
7985
- const OffsetContainer = styled.div `
7986
- display: block;
7987
- position: relative;
7988
- transition: inherit;
7989
- svg {
7990
- position: absolute;
7991
- left: 100%;
7992
- display: block;
7993
- top: -1px;
7994
- margin: 0;
7995
- margin-left: 4px;
7996
- }
7997
- `;
7998
8004
  const CopyToClipboard = ({ string, children, variant }) => {
7999
8005
  const [clipboard, setClipboard] = useState(false);
8000
8006
  let timeout;
@@ -8011,7 +8017,7 @@ const CopyToClipboard = ({ string, children, variant }) => {
8011
8017
  };
8012
8018
  if (variant === "button")
8013
8019
  return (jsx(Button, { disabled: !string, onClick: onCopy, icon: jsx(CopyToClipboardIcon, { copied: clipboard }), children: children }));
8014
- return (jsx(Container$4, { onClick: onCopy, "$disabled": !string, children: jsxs(OffsetContainer, { children: [children, jsx(CopyToClipboardIcon, { copied: clipboard, small: true })] }) }));
8020
+ return (jsxs(Container$3, { onClick: onCopy, "$disabled": !string, children: [jsx(CopyToClipboardIcon, { copied: clipboard, dark: true }), children] }));
8015
8021
  };
8016
8022
 
8017
8023
  const MoreIcon = (jsx("svg", { width: "60", height: "60", viewBox: "0 0 60 60", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M30 42V19M19 30.5H42", stroke: "var(--ck-body-color-muted)", strokeWidth: "3", strokeLinecap: "round" }) }));
@@ -8037,7 +8043,7 @@ const MobileConnectors = () => {
8037
8043
  window.location.href = uri;
8038
8044
  //if (uri) window.open(uri, '_blank');
8039
8045
  };
8040
- return (jsx(PageContent, { style: { width: 312 }, children: jsxs(Container$5, { children: [jsx(ModalContent, { style: { paddingBottom: 0 }, children: jsx(ScrollArea, { height: 340, children: jsxs(WalletList, { "$disabled": !wcUri, children: [walletsIdsToDisplay
8046
+ return (jsx(PageContent, { style: { width: 312 }, children: jsxs(Container$4, { children: [jsx(ModalContent, { style: { paddingBottom: 0 }, children: jsx(ScrollArea, { height: 340, children: jsxs(WalletList, { "$disabled": !wcUri, children: [walletsIdsToDisplay
8041
8047
  .sort(
8042
8048
  // sort by name
8043
8049
  (a, b) => {
@@ -8303,186 +8309,13 @@ const Introduction = () => {
8303
8309
  return (jsxs(PageContent, { children: [jsxs(Graphic, { children: [jsxs(LogoGroup, { children: [jsx(Logo$2, { children: jsx(LogoPosition, { children: jsx(LogoInner, { children: jsx(FloatWrapper, { children: jsx(RotateWrapper, { children: jsx(LogoGraphic, { children: jsx(Logos$1.Coinbase, { background: true }) }) }) }) }) }) }), jsx(Logo$2, { children: jsx(LogoPosition, { children: jsx(LogoInner, { children: jsx(FloatWrapper, { children: jsx(RotateWrapper, { children: jsx(LogoGraphic, { children: jsx(Logos$1.MetaMask, { background: true }) }) }) }) }) }) }), jsx(Logo$2, { children: jsx(LogoPosition, { children: jsx(LogoInner, { children: jsx(FloatWrapper, { children: jsx(RotateWrapper, { children: jsx(LogoGraphic, { children: jsx(Logos$1.Trust, {}) }) }) }) }) }) }), jsx(Logo$2, { children: jsx(LogoPosition, { children: jsx(LogoInner, { children: jsx(FloatWrapper, { children: jsx(RotateWrapper, { children: jsx(LogoGraphic, { children: jsx(Logos$1.Argent, {}) }) }) }) }) }) }), jsx(Logo$2, { children: jsx(LogoPosition, { children: jsx(LogoInner, { children: jsx(FloatWrapper, { children: jsx(RotateWrapper, { children: jsx(LogoGraphic, { children: jsx(Logos$1.ImToken, {}) }) }) }) }) }) })] }), jsx(GraphicBackground, { children: wave })] }), jsxs(ModalContent, { style: { paddingBottom: 18 }, children: [jsx(ModalH1, { "$small": true, children: locales.onboardingScreen_h1 }), jsx(ModalBody, { children: locales.onboardingScreen_p })] }), jsx(Button, { href: ctaUrl, arrow: true, children: locales.onboardingScreen_ctaText })] }));
8304
8310
  };
8305
8311
 
8306
- const AvatarContainer = styled(motion.div) `
8307
- padding: 18px 0 20px;
8308
- @media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
8309
- padding: 16px 0 20px;
8310
- }
8311
- `;
8312
- const AvatarInner = styled(motion.div) `
8313
- position: relative;
8314
- display: inline-block;
8315
- `;
8316
- const ChainSelectorContainer = styled(motion.div) `
8317
- z-index: 3;
8318
- position: absolute;
8319
- bottom: 0px;
8320
- right: -16px;
8321
- `;
8322
- const BalanceContainer = styled(motion.div) `
8323
- position: relative;
8324
- `;
8325
- const Balance = styled(motion.div) `
8326
- position: relative;
8327
- `;
8328
- const PlaceholderKeyframes = keyframes `
8329
- 0%{ background-position: 100% 0; }
8330
- 100%{ background-position: -100% 0; }
8331
- `;
8332
- const LoadingBalance = styled(motion.div) `
8333
- width: 25%;
8334
- margin: 0 auto;
8335
- position: relative;
8336
- overflow: hidden;
8337
- border-radius: 10px;
8338
- background: var(--ck-body-background-secondary);
8339
- inset: 0;
8340
- &:before {
8341
- z-index: 4;
8342
- content: "";
8343
- position: absolute;
8344
- inset: 0;
8345
- background-image: linear-gradient(
8346
- 90deg,
8347
- var(--ck-body-background-transparent) 50%,
8348
- var(--ck-body-background),
8349
- var(--ck-body-background-transparent)
8350
- );
8351
- opacity: 0.75;
8352
- background-size: 200% 100%;
8353
- animation: ${PlaceholderKeyframes} 1000ms linear infinite both;
8354
- }
8355
- `;
8356
-
8357
- function addressToNumber(address) {
8358
- return ((address
8359
- .split("")
8360
- .map((l) => l.charCodeAt(0))
8361
- .reduce((a, b) => a + b) %
8362
- 100) /
8363
- 100);
8364
- }
8365
- const EnsAvatar = styled(motion.div) `
8366
- will-change: transform; // Needed for Safari
8367
- pointer-events: none;
8368
- user-select: none;
8369
- position: relative;
8370
- overflow: hidden;
8371
- margin: 0;
8372
- border-radius: ${(props) => `${props.$radius}px`};
8373
- width: ${(props) => `${props.$size}px`};
8374
- height: ${(props) => `${props.$size}px`};
8375
- box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
8376
- &:before {
8377
- content: "";
8378
- z-index: 1;
8379
- position: absolute;
8380
- inset: 0;
8381
- border-radius: inherit;
8382
- box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02);
8383
- }
8384
- ${(props) => {
8385
- if (props.$seed) {
8386
- const id = Math.ceil(addressToNumber(props.$seed) * 8);
8387
- const ensColor = `0${id === 0 ? 1 : id}`; // No zero ID in ENS color list.. 🤷‍♀️
8388
- return css `
8389
- background: var(--ck-ens-${ensColor}-start);
8390
- background: linear-gradient(
8391
- 180deg,
8392
- var(--ck-ens-${ensColor}-start) 0%,
8393
- var(--ck-ens-${ensColor}-stop) 100%
8394
- );
8395
- `;
8396
- }
8397
- }}
8398
- `;
8399
- const ImageContainer = styled(motion.img) `
8400
- display: block;
8401
- position: relative;
8402
- width: 100%;
8403
- height: 100%;
8404
- opacity: ${(props) => (props.$loaded ? 1 : 0)};
8405
- will-change: opacity; // Needed for Safari
8406
- transition: opacity 500ms ease;
8407
- transform: scale(1.01); // fixes background color bleeding
8408
- `;
8409
-
8410
- const ensFallbackConfig = createConfig({
8411
- chains: [mainnet],
8412
- transports: {
8413
- [mainnet.id]: http(),
8414
- },
8415
- });
8416
- function useEnsFallbackConfig() {
8417
- return !useChainIsSupported(1) ? ensFallbackConfig : undefined;
8418
- }
8419
-
8420
- function useIsMounted() {
8421
- const [mounted, setMounted] = useState(false);
8422
- useEffect(() => setMounted(true), []);
8423
- return mounted;
8424
- }
8425
-
8426
- const Avatar = ({ address, name, size = 96, radius = 96 }) => {
8427
- const isMounted = useIsMounted();
8428
- const context = useContext();
8429
- const imageRef = useRef(null);
8430
- const [loaded, setLoaded] = useState(true);
8431
- const ensFallbackConfig = useEnsFallbackConfig();
8432
- const { data: ensAddress } = useEnsAddress({
8433
- chainId: 1,
8434
- name: name,
8435
- config: ensFallbackConfig,
8436
- });
8437
- const { data: ensName } = useEnsName({
8438
- chainId: 1,
8439
- address: address ?? ensAddress ?? undefined,
8440
- config: ensFallbackConfig,
8441
- });
8442
- const { data: ensAvatar } = useEnsAvatar({
8443
- chainId: 1,
8444
- name: normalize(ensName ?? ""),
8445
- config: ensFallbackConfig,
8446
- });
8447
- const ens = {
8448
- address: ensAddress ?? address,
8449
- name: ensName ?? name,
8450
- avatar: ensAvatar ?? undefined,
8451
- };
8452
- useEffect(() => {
8453
- if (!(imageRef.current &&
8454
- imageRef.current.complete &&
8455
- imageRef.current.naturalHeight !== 0)) {
8456
- setLoaded(false);
8457
- }
8458
- }, [ensAvatar]);
8459
- if (!isMounted)
8460
- return jsx("div", { style: { width: size, height: size, borderRadius: radius } });
8461
- if (context.options?.customAvatar)
8462
- return (jsx("div", { style: {
8463
- width: size,
8464
- height: size,
8465
- borderRadius: radius,
8466
- overflow: "hidden",
8467
- }, children: context.options?.customAvatar({
8468
- address: address ?? ens?.address,
8469
- ensName: name ?? ens?.name,
8470
- ensImage: ens?.avatar,
8471
- size,
8472
- radius,
8473
- }) }));
8474
- if (!ens.name || !ens.avatar)
8475
- return (jsx(ResetContainer, { style: { pointerEvents: "none" }, children: jsx(EnsAvatar, { "$size": size, "$seed": ens.address, "$radius": radius }) }));
8476
- return (jsx(ResetContainer, { style: { pointerEvents: "none" }, children: jsx(EnsAvatar, { "$size": size, "$seed": ens.address, "$radius": radius, children: jsx(ImageContainer, { ref: imageRef, src: ens.avatar, alt: ens.name, onLoad: () => setLoaded(true), "$loaded": loaded }) }) }));
8477
- };
8478
-
8479
8312
  // Note: these rpcUrls are incomplete, and are subject to change from their respective providers
8480
8313
  // More RPC URLs can be found: https://chainid.network/chains.json
8481
8314
  const chainConfigs = [
8482
8315
  {
8483
8316
  id: 1,
8484
8317
  name: "Ethereum",
8485
- logo: jsx(ChainIcons.Ethereum, {}),
8318
+ logo: jsx(Chains.Ethereum, {}),
8486
8319
  rpcUrls: {
8487
8320
  alchemy: {
8488
8321
  http: ["https://eth-mainnet.g.alchemy.com/v2"],
@@ -8497,68 +8330,68 @@ const chainConfigs = [
8497
8330
  {
8498
8331
  id: 3,
8499
8332
  name: "Rinkeby",
8500
- logo: jsx(ChainIcons.Ethereum, { testnet: true }),
8333
+ logo: jsx(Chains.Ethereum, { testnet: true }),
8501
8334
  rpcUrls: {},
8502
8335
  },
8503
8336
  {
8504
8337
  id: 4,
8505
8338
  name: "Ropsten",
8506
- logo: jsx(ChainIcons.Ethereum, { testnet: true }),
8339
+ logo: jsx(Chains.Ethereum, { testnet: true }),
8507
8340
  },
8508
8341
  {
8509
8342
  id: 5,
8510
8343
  name: "Görli",
8511
- logo: jsx(ChainIcons.Ethereum, { testnet: true }),
8344
+ logo: jsx(Chains.Ethereum, { testnet: true }),
8512
8345
  },
8513
8346
  {
8514
8347
  id: 42,
8515
8348
  name: "Kovan",
8516
- logo: jsx(ChainIcons.Ethereum, { testnet: true }),
8349
+ logo: jsx(Chains.Ethereum, { testnet: true }),
8517
8350
  },
8518
8351
  {
8519
8352
  id: 10,
8520
8353
  name: "Optimism",
8521
- logo: jsx(ChainIcons.Optimism, {}),
8354
+ logo: jsx(Chains.Optimism, {}),
8522
8355
  },
8523
8356
  {
8524
8357
  id: 69, // nice
8525
8358
  name: "Optimism Kovan",
8526
- logo: jsx(ChainIcons.Optimism, { testnet: true }),
8359
+ logo: jsx(Chains.Optimism, { testnet: true }),
8527
8360
  },
8528
8361
  {
8529
8362
  id: 420, // nice
8530
8363
  name: "Optimism Goerli",
8531
- logo: jsx(ChainIcons.Optimism, { testnet: true }),
8364
+ logo: jsx(Chains.Optimism, { testnet: true }),
8532
8365
  },
8533
8366
  {
8534
8367
  id: 11155420,
8535
8368
  name: "Optimism Sepolia",
8536
- logo: jsx(ChainIcons.Optimism, { testnet: true }),
8369
+ logo: jsx(Chains.Optimism, { testnet: true }),
8537
8370
  },
8538
8371
  {
8539
8372
  id: 137,
8540
8373
  name: "Polygon",
8541
- logo: jsx(ChainIcons.Polygon, {}),
8374
+ logo: jsx(Chains.Polygon, {}),
8542
8375
  },
8543
8376
  {
8544
8377
  id: 80001,
8545
8378
  name: "Polygon Mumbai",
8546
- logo: jsx(ChainIcons.Polygon, { testnet: true }),
8379
+ logo: jsx(Chains.Polygon, { testnet: true }),
8547
8380
  },
8548
8381
  {
8549
8382
  id: 31337,
8550
8383
  name: "Hardhat",
8551
- logo: jsx(ChainIcons.Ethereum, { testnet: true }),
8384
+ logo: jsx(Chains.Ethereum, { testnet: true }),
8552
8385
  },
8553
8386
  {
8554
8387
  id: 1337,
8555
8388
  name: "Localhost",
8556
- logo: jsx(ChainIcons.Ethereum, { testnet: true }),
8389
+ logo: jsx(Chains.Ethereum, { testnet: true }),
8557
8390
  },
8558
8391
  {
8559
8392
  id: 42161,
8560
8393
  name: "Arbitrum",
8561
- logo: jsx(ChainIcons.Arbitrum, {}),
8394
+ logo: jsx(Chains.Arbitrum, {}),
8562
8395
  rpcUrls: {
8563
8396
  alchemy: {
8564
8397
  http: ["https://arb-mainnet.g.alchemy.com/v2"],
@@ -8573,12 +8406,12 @@ const chainConfigs = [
8573
8406
  {
8574
8407
  id: 421611,
8575
8408
  name: "Arbitrum Rinkeby",
8576
- logo: jsx(ChainIcons.Arbitrum, { testnet: true }),
8409
+ logo: jsx(Chains.Arbitrum, { testnet: true }),
8577
8410
  },
8578
8411
  {
8579
8412
  id: 421613,
8580
8413
  name: "Arbitrum Goerli",
8581
- logo: jsx(ChainIcons.Arbitrum, { testnet: true }),
8414
+ logo: jsx(Chains.Arbitrum, { testnet: true }),
8582
8415
  rpcUrls: {
8583
8416
  alchemy: {
8584
8417
  http: ["https://arb-goerli.g.alchemy.com/v2"],
@@ -8593,315 +8426,213 @@ const chainConfigs = [
8593
8426
  {
8594
8427
  id: 40,
8595
8428
  name: "Telos",
8596
- logo: jsx(ChainIcons.Telos, {}),
8429
+ logo: jsx(Chains.Telos, {}),
8597
8430
  },
8598
8431
  {
8599
8432
  id: 41,
8600
8433
  name: "Telos Testnet",
8601
- logo: jsx(ChainIcons.Telos, { testnet: true }),
8434
+ logo: jsx(Chains.Telos, { testnet: true }),
8602
8435
  },
8603
8436
  {
8604
8437
  id: 1313161554,
8605
8438
  name: "Aurora",
8606
- logo: jsx(ChainIcons.Aurora, {}),
8439
+ logo: jsx(Chains.Aurora, {}),
8607
8440
  },
8608
8441
  {
8609
8442
  id: 1313161555,
8610
8443
  name: "Aurora Testnet",
8611
- logo: jsx(ChainIcons.Aurora, { testnet: true }),
8444
+ logo: jsx(Chains.Aurora, { testnet: true }),
8612
8445
  },
8613
8446
  {
8614
8447
  id: 43_114,
8615
8448
  name: "Avalanche",
8616
- logo: jsx(ChainIcons.Avalanche, {}),
8449
+ logo: jsx(Chains.Avalanche, {}),
8617
8450
  },
8618
8451
  {
8619
8452
  id: 43_113,
8620
8453
  name: "Avalanche Fuji",
8621
- logo: jsx(ChainIcons.Avalanche, { testnet: true }),
8454
+ logo: jsx(Chains.Avalanche, { testnet: true }),
8622
8455
  },
8623
8456
  {
8624
8457
  id: 31337,
8625
8458
  name: "Foundry",
8626
- logo: jsx(ChainIcons.Foundry, { testnet: true }),
8459
+ logo: jsx(Chains.Foundry, { testnet: true }),
8627
8460
  },
8628
8461
  {
8629
8462
  id: 100,
8630
8463
  name: "Gnosis",
8631
- logo: jsx(ChainIcons.Gnosis, {}),
8464
+ logo: jsx(Chains.Gnosis, {}),
8632
8465
  },
8633
8466
  {
8634
8467
  id: 9001,
8635
8468
  name: "Evmos",
8636
- logo: jsx(ChainIcons.Evmos, {}),
8469
+ logo: jsx(Chains.Evmos, {}),
8637
8470
  },
8638
8471
  {
8639
8472
  id: 9000,
8640
8473
  name: "Evmos Testnet",
8641
- logo: jsx(ChainIcons.Evmos, { testnet: true }),
8474
+ logo: jsx(Chains.Evmos, { testnet: true }),
8642
8475
  },
8643
8476
  {
8644
8477
  id: 56,
8645
8478
  name: "BNB Smart Chain",
8646
- logo: jsx(ChainIcons.BinanceSmartChain, {}),
8479
+ logo: jsx(Chains.BinanceSmartChain, {}),
8647
8480
  },
8648
8481
  {
8649
8482
  id: 97,
8650
8483
  name: "Binance Smart Chain Testnet",
8651
- logo: jsx(ChainIcons.BinanceSmartChain, { testnet: true }),
8484
+ logo: jsx(Chains.BinanceSmartChain, { testnet: true }),
8652
8485
  },
8653
8486
  {
8654
8487
  id: 11155111,
8655
8488
  name: "Sepolia",
8656
- logo: jsx(ChainIcons.Sepolia, {}),
8489
+ logo: jsx(Chains.Sepolia, {}),
8657
8490
  },
8658
8491
  {
8659
8492
  id: 841,
8660
8493
  name: "Taraxa",
8661
- logo: jsx(ChainIcons.Taraxa, {}),
8494
+ logo: jsx(Chains.Taraxa, {}),
8662
8495
  },
8663
8496
  {
8664
8497
  id: 842,
8665
8498
  name: "Taraxa Testnet",
8666
- logo: jsx(ChainIcons.Taraxa, { testnet: true }),
8499
+ logo: jsx(Chains.Taraxa, { testnet: true }),
8667
8500
  },
8668
8501
  {
8669
8502
  id: 324,
8670
8503
  name: "zkSync",
8671
- logo: jsx(ChainIcons.zkSync, {}),
8504
+ logo: jsx(Chains.zkSync, {}),
8672
8505
  },
8673
8506
  {
8674
8507
  id: 280,
8675
8508
  name: "zkSync Testnet",
8676
- logo: jsx(ChainIcons.zkSync, { testnet: true }),
8509
+ logo: jsx(Chains.zkSync, { testnet: true }),
8677
8510
  },
8678
8511
  {
8679
8512
  id: 42_220,
8680
8513
  name: "Celo",
8681
- logo: jsx(ChainIcons.Celo, {}),
8514
+ logo: jsx(Chains.Celo, {}),
8682
8515
  },
8683
8516
  {
8684
8517
  id: 44_787,
8685
8518
  name: "Celo Alfajores",
8686
- logo: jsx(ChainIcons.Celo, { testnet: true }),
8519
+ logo: jsx(Chains.Celo, { testnet: true }),
8687
8520
  },
8688
8521
  {
8689
8522
  id: 7_700,
8690
8523
  name: "Canto",
8691
- logo: jsx(ChainIcons.Canto, {}),
8524
+ logo: jsx(Chains.Canto, {}),
8692
8525
  },
8693
8526
  {
8694
8527
  id: 250,
8695
8528
  name: "Fantom",
8696
- logo: jsx(ChainIcons.Fantom, {}),
8529
+ logo: jsx(Chains.Fantom, {}),
8697
8530
  },
8698
8531
  {
8699
8532
  id: 4_002,
8700
8533
  name: "Fantom Testnet",
8701
- logo: jsx(ChainIcons.Fantom, { testnet: true }),
8534
+ logo: jsx(Chains.Fantom, { testnet: true }),
8702
8535
  },
8703
8536
  {
8704
8537
  id: 14,
8705
8538
  name: "Flare",
8706
- logo: jsx(ChainIcons.Flare, {}),
8539
+ logo: jsx(Chains.Flare, {}),
8707
8540
  },
8708
8541
  {
8709
8542
  id: 114,
8710
8543
  name: "Coston2",
8711
- logo: jsx(ChainIcons.Flare, {}),
8544
+ logo: jsx(Chains.Flare, {}),
8712
8545
  },
8713
8546
  {
8714
8547
  id: 314,
8715
8548
  name: "Filecoin",
8716
- logo: jsx(ChainIcons.Filecoin, {}),
8549
+ logo: jsx(Chains.Filecoin, {}),
8717
8550
  },
8718
8551
  {
8719
8552
  id: 314_1,
8720
8553
  name: "Filecoin Hyperspace",
8721
- logo: jsx(ChainIcons.Filecoin, { testnet: true }),
8554
+ logo: jsx(Chains.Filecoin, { testnet: true }),
8722
8555
  },
8723
8556
  {
8724
8557
  id: 314_159,
8725
8558
  name: "Filecoin Calibration",
8726
- logo: jsx(ChainIcons.Filecoin, { testnet: true }),
8559
+ logo: jsx(Chains.Filecoin, { testnet: true }),
8727
8560
  },
8728
8561
  {
8729
8562
  id: 1_088,
8730
8563
  name: "Metis",
8731
- logo: jsx(ChainIcons.Metis, {}),
8564
+ logo: jsx(Chains.Metis, {}),
8732
8565
  },
8733
8566
  {
8734
8567
  id: 599,
8735
8568
  name: "Metis Goerli",
8736
- logo: jsx(ChainIcons.Metis, { testnet: true }),
8569
+ logo: jsx(Chains.Metis, { testnet: true }),
8737
8570
  },
8738
8571
  {
8739
8572
  id: 4_689,
8740
8573
  name: "IoTeX",
8741
- logo: jsx(ChainIcons.IoTeX, {}),
8574
+ logo: jsx(Chains.IoTeX, {}),
8742
8575
  },
8743
8576
  {
8744
8577
  id: 4_690,
8745
8578
  name: "IoTeX Testnet",
8746
- logo: jsx(ChainIcons.IoTeX, { testnet: true }),
8579
+ logo: jsx(Chains.IoTeX, { testnet: true }),
8747
8580
  },
8748
8581
  {
8749
8582
  id: 8_453,
8750
8583
  name: "Base",
8751
- logo: jsx(ChainIcons.Base, {}),
8584
+ logo: jsx(Chains.Base, {}),
8752
8585
  },
8753
8586
  {
8754
8587
  id: 84_531,
8755
8588
  name: "Base Goerli",
8756
- logo: jsx(ChainIcons.Base, { testnet: true }),
8589
+ logo: jsx(Chains.Base, { testnet: true }),
8757
8590
  },
8758
8591
  {
8759
8592
  id: 84_532,
8760
8593
  name: "Base Sepolia",
8761
- logo: jsx(ChainIcons.Base, { testnet: true }),
8594
+ logo: jsx(Chains.Base, { testnet: true }),
8762
8595
  },
8763
8596
  {
8764
8597
  id: 7777777,
8765
8598
  name: "Zora",
8766
- logo: jsx(ChainIcons.Zora, {}),
8599
+ logo: jsx(Chains.Zora, {}),
8767
8600
  },
8768
8601
  {
8769
8602
  id: 999999999,
8770
8603
  name: "Zora Sepolia",
8771
- logo: jsx(ChainIcons.Zora, { testnet: true }),
8604
+ logo: jsx(Chains.Zora, { testnet: true }),
8772
8605
  },
8773
8606
  {
8774
8607
  id: 999,
8775
8608
  name: "Zora Goerli Testnet",
8776
- logo: jsx(ChainIcons.Zora, { testnet: true }),
8609
+ logo: jsx(Chains.Zora, { testnet: true }),
8777
8610
  },
8778
8611
  ];
8779
8612
 
8780
- const ChainContainer$1 = styled.div `
8781
- --bg: transparent;
8782
- --color: #333;
8783
- ${(props) => typeof props.size === "string"
8784
- ? css `
8785
- --width: ${props.size};
8786
- --height: ${props.size};
8787
- `
8788
- : css `
8789
- --width: ${props.size >= 0 ? `${props.size}px` : "24px"};
8790
- --height: ${props.size >= 0 ? `${props.size}px` : "24px"};
8791
- `};
8792
- ${(props) => typeof props.radius === "string"
8793
- ? css `
8794
- --radius: ${props.radius};
8795
- `
8796
- : css `
8797
- --radius: ${props.radius >= 0 ? `${props.radius}px` : "24px"};
8798
- `};
8613
+ const SwitchNetworksContainer = styled.div `
8614
+ display: flex;
8615
+ flex-direction: column;
8616
+
8617
+ @media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
8618
+ flex-direction: column-reverse;
8619
+ }
8620
+ `;
8621
+ const ChainIcon = styled(motion.div) `
8799
8622
  display: block;
8800
8623
  position: relative;
8801
- width: var(--width);
8802
- height: var(--height);
8803
- min-width: var(--width);
8804
- min-height: var(--height);
8805
- border-radius: var(--radius);
8806
- background: var(--ck-body-background-secondary);
8807
- pointer-events: none;
8808
- user-select: none;
8624
+ border-radius: 12px;
8625
+ overflow: hidden;
8626
+ width: 24px;
8627
+ height: 24px;
8628
+ min-width: 24px;
8629
+ min-height: 24px;
8630
+ background: var(--ck-body-background);
8809
8631
  svg {
8632
+ border-radius: inherit;
8810
8633
  display: block;
8811
- width: 100%;
8812
- height: auto;
8813
- }
8814
- > div {
8815
- display: flex;
8816
- align-items: center;
8817
- justify-content: center;
8818
- }
8819
- `;
8820
- const LogoContainer$2 = styled(motion.div) `
8821
- display: block;
8822
- position: absolute;
8823
- inset: 0;
8824
- overflow: hidden;
8825
- border-radius: inherit;
8826
- user-select: none;
8827
- display: flex;
8828
- align-items: center;
8829
- justify-content: center;
8830
- svg {
8831
- display: block;
8832
- width: 100%;
8833
- height: auto;
8834
- }
8835
- `;
8836
- const Spin = keyframes `
8837
- 0%{ transform: rotate(0deg); }
8838
- 100%{ transform: rotate(360deg); }
8839
- `;
8840
- const LoadingContainer$3 = styled(motion.div) `
8841
- position: absolute;
8842
- inset: 0;
8843
- animation: ${Spin} 1s linear infinite;
8844
- svg {
8845
- display: block;
8846
- position: absolute;
8847
- inset: 0;
8848
- }
8849
- `;
8850
- const Unsupported = styled(motion.div) `
8851
- z-index: 2;
8852
- position: absolute;
8853
- top: 0;
8854
- right: 0;
8855
- width: 40%;
8856
- height: 40%;
8857
- min-width: 13px;
8858
- min-height: 13px;
8859
- color: var(--ck-body-color-danger, red);
8860
- svg {
8861
- display: block;
8862
- position: relative;
8863
- top: -30%;
8864
- right: -30%;
8865
- }
8866
- `;
8867
-
8868
- const Spinner$4 = (jsxs("svg", { "aria-hidden": "true", width: "36", height: "36", viewBox: "0 0 36 36", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.3592 30.1654C10.0472 29.4491 8.85718 28.524 7.83713 27.424C6.81708 26.324 5.98425 25.0677 5.36889 23.7054C5.20157 23.335 5.05033 22.9567 4.91578 22.5717C4.51465 21.4237 4.26735 20.2308 4.17794 19.0239C4.16599 18.8626 4.13894 18.7041 4.09809 18.5507C3.85023 17.6197 3.09399 16.8738 2.11531 16.7999C0.975331 16.7138 -0.0310983 17.5702 0.0141657 18.7125C0.0223289 18.9185 0.0340286 19.1243 0.049253 19.3298C0.165374 20.8971 0.486545 22.4464 1.00749 23.9373C1.10424 24.2142 1.20764 24.4884 1.31755 24.7596C2.13617 26.7799 3.31595 28.6371 4.80146 30.239C6.28696 31.841 8.04998 33.1573 10.0029 34.1258C10.2651 34.2558 10.5307 34.3796 10.7995 34.4969C12.247 35.1287 13.7676 35.5656 15.3217 35.7995C15.5255 35.8301 15.7298 35.8573 15.9346 35.881C17.0703 36.0122 18.0001 35.0731 18.0001 33.9299C18.0001 32.9484 17.3133 32.1381 16.4036 31.8208C16.2537 31.7685 16.0977 31.7296 15.9377 31.7056C14.7411 31.5255 13.5702 31.1891 12.4556 30.7026C12.0818 30.5394 11.716 30.3601 11.3592 30.1654Z", fill: "url(#paint0_linear_1288_1870)" }), jsx("defs", { children: jsxs("linearGradient", { id: "paint0_linear_1288_1870", x1: "2", y1: "19.4884", x2: "16.8752", y2: "33.7485", gradientUnits: "userSpaceOnUse", children: [jsx("stop", { stopColor: "var(--ck-connectbutton-balance-color,currentColor)", stopOpacity: "0.7" }), jsx("stop", { offset: "1", stopColor: "var(--ck-connectbutton-balance-color,currentColor)", stopOpacity: "0" })] }) })] }));
8869
- const Chain = ({ id, unsupported: controlledUnsupported, radius = "50%", size = 24, }) => {
8870
- const isChainSupported = useChainIsSupported(id);
8871
- const unsupported = controlledUnsupported ?? !isChainSupported;
8872
- const chain = chainConfigs.find((c) => c.id === id);
8873
- const isMounted = useIsMounted();
8874
- if (!isMounted)
8875
- return (jsx("div", { style: {
8876
- width: size,
8877
- height: size,
8878
- } }));
8879
- return (jsx(ChainContainer$1, { size: size, radius: radius, children: jsxs(AnimatePresence, { initial: false, children: [unsupported && (jsx(Unsupported, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, children: jsxs("svg", { width: "13", height: "12", viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { d: "M2.61317 11.2501H9.46246C10.6009 11.2501 11.3256 10.3506 11.3256 9.3549C11.3256 9.05145 11.255 8.73244 11.0881 8.43303L7.65903 2.14708C7.659 2.14702 7.65897 2.14696 7.65893 2.1469C7.65889 2.14682 7.65884 2.14673 7.65879 2.14664C7.31045 1.50746 6.6741 1.17871 6.04 1.17871C5.41478 1.17871 4.763 1.50043 4.41518 2.14968L0.993416 8.43476C0.828865 8.72426 0.75 9.04297 0.75 9.3549C0.75 10.3506 1.47471 11.2501 2.61317 11.2501Z", fill: "currentColor", stroke: "var(--ck-body-background, #fff)", strokeWidth: "1.5" }), jsx("path", { d: "M6.03258 7.43916C5.77502 7.43916 5.63096 7.29153 5.62223 7.02311L5.55675 4.96973C5.54802 4.69684 5.74446 4.5 6.02821 4.5C6.3076 4.5 6.51277 4.70131 6.50404 4.9742L6.43856 7.01864C6.42546 7.29153 6.2814 7.43916 6.03258 7.43916ZM6.03258 9.11676C5.7401 9.11676 5.5 8.9065 5.5 8.60677C5.5 8.30704 5.7401 8.09678 6.03258 8.09678C6.32506 8.09678 6.56515 8.30256 6.56515 8.60677C6.56515 8.91097 6.32069 9.11676 6.03258 9.11676Z", fill: "white" })] }) })), id ? (jsx(LogoContainer$2, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.3 }, children: chain?.logo ?? jsx(ChainIcons.UnknownChain, {}) }, `${chain?.id}-${chain?.name}-${id}`)) : (jsx(LoadingContainer$3, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.3 }, children: Spinner$4 }, "loading"))] }) }));
8880
- };
8881
-
8882
- const SwitchNetworksContainer = styled.div `
8883
- display: flex;
8884
- flex-direction: column;
8885
-
8886
- @media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
8887
- flex-direction: column-reverse;
8888
- }
8889
- `;
8890
- const ChainIcon = styled(motion.div) `
8891
- display: block;
8892
- position: relative;
8893
- border-radius: 12px;
8894
- overflow: hidden;
8895
- width: 24px;
8896
- height: 24px;
8897
- min-width: 24px;
8898
- min-height: 24px;
8899
- background: var(--ck-body-background);
8900
- svg {
8901
- border-radius: inherit;
8902
- display: block;
8903
- position: relative;
8904
- transform: translate3d(0, 0, 0);
8634
+ position: relative;
8635
+ transform: translate3d(0, 0, 0);
8905
8636
  width: 100%;
8906
8637
  height: auto;
8907
8638
  }
@@ -9100,7 +8831,7 @@ const ChainButtonBg = styled(motion.div) `
9100
8831
  }
9101
8832
  `;
9102
8833
 
9103
- const Spinner$3 = (jsxs("svg", { "aria-hidden": "true", width: "36", height: "36", viewBox: "0 0 36 36", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2 16.75C2.69036 16.75 3.25 17.3096 3.25 18V19C3.25 26.5939 9.40609 32.75 17 32.75V35.25C8.02537 35.25 0.75 27.9746 0.75 19V18C0.75 17.3096 1.30964 16.75 2 16.75Z", fill: "url(#paint0_linear_1288_18701)" }), jsx("defs", { children: jsxs("linearGradient", { id: "paint0_linear_1288_18701", x1: "2", y1: "19.4884", x2: "16.8752", y2: "33.7485", gradientUnits: "userSpaceOnUse", children: [jsx("stop", { stopColor: "var(--ck-spinner-color)" }), jsx("stop", { offset: "1", stopColor: "var(--ck-spinner-color)", stopOpacity: "0" })] }) })] }));
8834
+ const Spinner$4 = (jsxs("svg", { "aria-hidden": "true", width: "36", height: "36", viewBox: "0 0 36 36", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M2 16.75C2.69036 16.75 3.25 17.3096 3.25 18V19C3.25 26.5939 9.40609 32.75 17 32.75V35.25C8.02537 35.25 0.75 27.9746 0.75 19V18C0.75 17.3096 1.30964 16.75 2 16.75Z", fill: "url(#paint0_linear_1288_18701)" }), jsx("defs", { children: jsxs("linearGradient", { id: "paint0_linear_1288_18701", x1: "2", y1: "19.4884", x2: "16.8752", y2: "33.7485", gradientUnits: "userSpaceOnUse", children: [jsx("stop", { stopColor: "var(--ck-spinner-color)" }), jsx("stop", { offset: "1", stopColor: "var(--ck-spinner-color)", stopOpacity: "0" })] }) })] }));
9104
8835
  const ChainSelectList = ({ variant, }) => {
9105
8836
  const { connector, chain } = useAccount();
9106
8837
  const { chains, isPending, switchChain, error } = useSwitchChain();
@@ -9147,7 +8878,7 @@ const ChainSelectList = ({ variant, }) => {
9147
8878
  opacity: [1, 0],
9148
8879
  transition: { delay: 4, duration: 3 },
9149
8880
  }
9150
- : { opacity: 1 }, children: Spinner$3 }, `${ch?.id}-${ch?.name}`) }), jsx(ChainIcon, { children: ch.logo ?? jsx(ChainIcons.UnknownChain, {}) })] }), ch.name] }), variant !== "secondary" && (jsx(ChainButtonStatus, { children: jsxs(AnimatePresence, { initial: false, exitBeforeEnter: true, children: [ch.id === chain?.id && (jsx(motion.span, { style: {
8881
+ : { opacity: 1 }, children: Spinner$4 }, `${ch?.id}-${ch?.name}`) }), jsx(ChainIcon, { children: ch.logo ?? jsx(Chains.UnknownChain, {}) })] }), ch.name] }), variant !== "secondary" && (jsx(ChainButtonStatus, { children: jsxs(AnimatePresence, { initial: false, exitBeforeEnter: true, children: [ch.id === chain?.id && (jsx(motion.span, { style: {
9151
8882
  color: "var(--ck-dropdown-active-color, var(--ck-focus-color))",
9152
8883
  display: "block",
9153
8884
  position: "relative",
@@ -9193,360 +8924,6 @@ const ChainSelectList = ({ variant, }) => {
9193
8924
  }, onAnimationStart: triggerResize, onAnimationComplete: triggerResize, children: jsx("div", { style: { paddingTop: 10, paddingBottom: 8 }, children: jsxs(Alert, { children: [locales.warnings_walletSwitchingUnsupported, " ", locales.warnings_walletSwitchingUnsupportedResolve] }) }) })) })] }));
9194
8925
  };
9195
8926
 
9196
- const DropdownWindow = styled(motion.div) `
9197
- z-index: 2147483647;
9198
- position: fixed;
9199
- inset: 0;
9200
- `;
9201
- const DropdownOverlay = styled(motion.div) `
9202
- position: absolute;
9203
- inset: 0;
9204
- `;
9205
- const DropdownContainer = styled(motion.div) `
9206
- --shadow: 0px 2px 15px rgba(0, 0, 0, 0.15);
9207
- --background: var(--ck-dropdown-background, var(--ck-tooltip-background));
9208
- --border-radius: var(
9209
- --ck-dropdown-border-radius,
9210
- var(--ck-tooltip-border-radius, 12px)
9211
- );
9212
-
9213
- pointer-events: auto;
9214
- z-index: 2147483647;
9215
- position: absolute;
9216
- top: 0;
9217
- left: 0;
9218
- width: 100%;
9219
- max-width: fit-content;
9220
- padding: 14px 16px 16px;
9221
- color: var(--ck-dropdown-color, var(--ck-tooltip-color));
9222
- background: var(--background);
9223
- box-shadow: var(
9224
- --ck-dropdown-box-shadow,
9225
- var(--ck-tooltip-shadow, var(--shadow))
9226
- );
9227
- border-radius: var(--border-radius);
9228
- `;
9229
- const DropdownHeading = styled(motion.div) `
9230
- padding: 0 0 6px;
9231
- font-size: 14px;
9232
- line-height: 20px;
9233
- font-weight: 400;
9234
- user-select: none;
9235
- color: var(--ck-dropdown-color, var(--ck-tooltip-color));
9236
- `;
9237
-
9238
- const ChainSelectDropdown = ({ children, open, onClose, offsetX = 0, offsetY = 8 }) => {
9239
- const context = useContext();
9240
- const themeContext = useThemeContext();
9241
- const locales = useLocales();
9242
- const [offset, setOffset] = useState({ x: 0, y: 0 });
9243
- useLockBodyScroll(open);
9244
- const contentRef = useRef(null);
9245
- useEffect(() => {
9246
- const listener = (e) => {
9247
- if (!open)
9248
- return;
9249
- if (e.key === "Escape")
9250
- onClose();
9251
- if (e.key === "ArrowDown" || e.key === "ArrowUp") {
9252
- if (!contentRef.current)
9253
- return;
9254
- e.preventDefault();
9255
- const focusableEls = contentRef.current?.querySelectorAll(`
9256
- a[href]:not(:disabled),
9257
- button:not(:disabled),
9258
- textarea:not(:disabled),
9259
- input[type="text"]:not(:disabled),
9260
- input[type="radio"]:not(:disabled),
9261
- input[type="checkbox"]:not(:disabled),
9262
- select:not(:disabled)
9263
- `), firstFocusableEl = focusableEls[0], lastFocusableEl = focusableEls[focusableEls.length - 1];
9264
- if (e.key === "ArrowUp") {
9265
- if (document.activeElement === firstFocusableEl) {
9266
- lastFocusableEl.focus();
9267
- }
9268
- else {
9269
- let focusItem = document?.activeElement?.previousSibling;
9270
- if (!focusItem)
9271
- focusItem = lastFocusableEl;
9272
- while (focusItem.disabled)
9273
- focusItem = focusItem.previousSibling;
9274
- focusItem.focus();
9275
- }
9276
- }
9277
- else {
9278
- if (document.activeElement === lastFocusableEl) {
9279
- firstFocusableEl.focus();
9280
- }
9281
- else {
9282
- let focusItem = document?.activeElement?.nextSibling;
9283
- if (!focusItem)
9284
- focusItem = firstFocusableEl;
9285
- while (focusItem.disabled)
9286
- focusItem = focusItem.nextSibling;
9287
- focusItem.focus();
9288
- }
9289
- }
9290
- }
9291
- };
9292
- document.addEventListener("keydown", listener);
9293
- return () => {
9294
- document.removeEventListener("keydown", listener);
9295
- };
9296
- }, [open]);
9297
- const targetRef = useRef(null);
9298
- const innerRef = useCallback((node) => {
9299
- if (!node)
9300
- return;
9301
- targetRef.current = node;
9302
- refresh();
9303
- }, [open]);
9304
- const [ref, bounds] = useMeasure({
9305
- debounce: 120, // waits until modal transition has finished before measuring
9306
- offsetSize: true,
9307
- scroll: true,
9308
- });
9309
- const refresh = () => {
9310
- if (!targetRef.current ||
9311
- bounds.top +
9312
- bounds.bottom +
9313
- bounds.left +
9314
- bounds.right +
9315
- bounds.height +
9316
- bounds.width ===
9317
- 0) {
9318
- return;
9319
- }
9320
- let x = bounds.left + offsetX;
9321
- let y = bounds.top + bounds.height + offsetY;
9322
- targetRef.current.style.left = `${x}px`;
9323
- targetRef.current.style.top = `${y}px`;
9324
- /*
9325
- const contentRect = targetRef.current.getBoundingClientRect();
9326
-
9327
- const w = contentRect.width;
9328
- const h = contentRect.height;
9329
-
9330
- if (x + w > window.innerWidth) {
9331
- x = bounds.left + bounds.width - contentRect.width - offsetX;
9332
- }
9333
- if (y + h > window.innerHeight - 24) {
9334
- y = bounds.top - contentRect.height - offsetY;
9335
- }
9336
-
9337
- setOffset({
9338
- x: x,
9339
- y: y,
9340
- });
9341
- */
9342
- };
9343
- const useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
9344
- useIsomorphicLayoutEffect(refresh, [targetRef.current, bounds, open]);
9345
- useEffect(refresh, [open, targetRef.current]);
9346
- const onScroll = onClose;
9347
- const onResize = onClose;
9348
- useEffect(() => {
9349
- refresh();
9350
- window.addEventListener("scroll", onScroll);
9351
- window.addEventListener("resize", onResize);
9352
- return () => {
9353
- window.removeEventListener("scroll", onScroll);
9354
- window.removeEventListener("resize", onResize);
9355
- };
9356
- }, []);
9357
- return (jsxs(Fragment, { children: [jsx("div", { ref: ref, children: children }), jsx(AnimatePresence, { children: open && (jsx(Portal, { children: jsx(ResetContainer, { "$useTheme": themeContext.theme ?? context.theme, "$useMode": themeContext.mode ?? context.mode, "$customTheme": themeContext.customTheme ?? context.customTheme, children: jsx(FocusTrap, { children: jsxs(DropdownWindow, { ref: contentRef, children: [jsx(DropdownOverlay, { onClick: onClose }), jsxs(DropdownContainer, { ref: innerRef, style: {
9358
- left: offset.x,
9359
- top: offset.y,
9360
- }, initial: "collapsed", animate: "open", exit: "collapsed", variants: {
9361
- collapsed: {
9362
- transformOrigin: "0 0",
9363
- opacity: 0,
9364
- scale: 0.96,
9365
- z: 0.01,
9366
- y: -4,
9367
- x: 0,
9368
- transition: {
9369
- duration: 0.1,
9370
- },
9371
- },
9372
- open: {
9373
- transformOrigin: "0 0",
9374
- willChange: "opacity,transform",
9375
- opacity: 1,
9376
- scale: 1,
9377
- z: 0.01,
9378
- y: 0,
9379
- x: 0,
9380
- transition: {
9381
- ease: [0.76, 0, 0.24, 1],
9382
- duration: 0.15,
9383
- },
9384
- },
9385
- }, children: [jsx(DropdownHeading, { children: locales.switchNetworks }), jsx(ChainSelectList, {})] })] }) }) }) })) })] }));
9386
- };
9387
-
9388
- const Container$3 = styled(motion.div) ``;
9389
- const SwitchChainButton = styled(motion.button) `
9390
- --color: var(
9391
- --ck-dropdown-button-color,
9392
- var(--ck-button-primary-color, var(--ck-body-color))
9393
- );
9394
- --background: var(
9395
- --ck-dropdown-button-background,
9396
- var(--ck-secondary-button-background, var(--ck-body-background-secondary))
9397
- );
9398
- --box-shadow: var(
9399
- --ck-dropdown-button-box-shadow,
9400
- var(
9401
- --ck-secondary-button-box-shadow,
9402
- var(--ck-button-primary-box-shadow),
9403
- none
9404
- )
9405
- );
9406
-
9407
- --hover-color: var(--ck-dropdown-button-hover-color, var(--color));
9408
- --hover-background: var(
9409
- --ck-dropdown-button-hover-background,
9410
- var(--background)
9411
- );
9412
- --hover-box-shadow: var(
9413
- --ck-dropdown-button-hover-box-shadow,
9414
- var(--box-shadow)
9415
- );
9416
-
9417
- --active-color: var(--ck-dropdown-button-active-color, var(--hover-color));
9418
- --active-background: var(
9419
- --ck-dropdown-button-active-background,
9420
- var(--hover-background)
9421
- );
9422
- --active-box-shadow: var(
9423
- --ck-dropdown-button-active-box-shadow,
9424
- var(--hover-box-shadow)
9425
- );
9426
-
9427
- appearance: none;
9428
- user-select: none;
9429
- position: relative;
9430
- display: flex;
9431
- align-items: center;
9432
- justify-content: space-between;
9433
- border-radius: 15px;
9434
- width: 52px;
9435
- height: 30px;
9436
- padding: 2px 6px 2px 3px;
9437
- font-size: 16px;
9438
- line-height: 19px;
9439
- font-weight: 500;
9440
- text-decoration: none;
9441
- white-space: nowrap;
9442
- transform: translateZ(0px);
9443
-
9444
- transition: 100ms ease;
9445
- transition-property: transform, background-color, box-shadow, color;
9446
-
9447
- color: var(--color);
9448
- background: var(--background);
9449
- box-shadow: var(--box-shadow);
9450
-
9451
- svg {
9452
- position: relative;
9453
- display: block;
9454
- }
9455
-
9456
- ${(props) => props.disabled
9457
- ? css `
9458
- width: auto;
9459
- padding: 3px;
9460
- position: relative;
9461
- left: -22px;
9462
- `
9463
- : css `
9464
- cursor: pointer;
9465
-
9466
- @media only screen and (min-width: ${defaultTheme.mobileWidth +
9467
- 1}px) {
9468
- &:hover,
9469
- &:focus-visible {
9470
- color: var(--hover-color);
9471
- background: var(--hover-background);
9472
- box-shadow: var(--hover-box-shadow);
9473
- }
9474
- &:active {
9475
- color: var(--active-color);
9476
- background: var(--active-background);
9477
- box-shadow: var(--active-box-shadow);
9478
- }
9479
- }
9480
- `}
9481
- `;
9482
- const ChevronDown = ({ ...props }) => (jsx("svg", { "aria-hidden": "true", width: "11", height: "6", viewBox: "0 0 11 6", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: jsx("path", { d: "M1.5 1L5.5 5L9.5 1", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }));
9483
- const ChainSelector = () => {
9484
- const context = useContext();
9485
- const [isOpen, setIsOpen] = useState(false);
9486
- const { chain } = useAccount();
9487
- const { chains } = useSwitchChain();
9488
- const locales = useLocales({
9489
- CHAIN: chain?.name,
9490
- });
9491
- const mobile = isMobile() || window?.innerWidth < defaultTheme.mobileWidth;
9492
- useEffect(() => {
9493
- if (!context.open)
9494
- setIsOpen(false);
9495
- }, [context.open]);
9496
- const disabled = chains.length <= 1;
9497
- return (jsx(Fragment, { children: jsx(Container$3, { children: jsx(ChainSelectDropdown, { offsetX: -12, open: !mobile && isOpen, onClose: () => setIsOpen(false), children: jsxs(SwitchChainButton, { "aria-label": flattenChildren(locales.switchNetworks).toString(), disabled: disabled, onClick: () => {
9498
- if (mobile) {
9499
- context.setRoute(ROUTES.SWITCHNETWORKS);
9500
- }
9501
- else {
9502
- setIsOpen(!isOpen);
9503
- }
9504
- }, children: [disabled ? (jsx(Tooltip, { message: locales.chainNetwork, xOffset: -6, delay: 0.01, children: jsx(Chain, { id: chain?.id }) })) : (jsx(Chain, { id: chain?.id })), !disabled && jsx(ChevronDown, { style: { top: 1, left: -3 } })] }) }) }) }));
9505
- };
9506
-
9507
- const Profile = ({ closeModal }) => {
9508
- const context = useContext();
9509
- const themeContext = useThemeContext();
9510
- const locales = useLocales();
9511
- const { reset } = useConnect$1();
9512
- const { disconnect } = useDisconnect();
9513
- const { address, isConnected, connector, chain } = useAccount();
9514
- const ensFallbackConfig = useEnsFallbackConfig();
9515
- const { data: ensName } = useEnsName({
9516
- chainId: 1,
9517
- address: address,
9518
- config: ensFallbackConfig,
9519
- });
9520
- const { data: balance } = useBalance({
9521
- address,
9522
- //watch: true,
9523
- });
9524
- const [shouldDisconnect, setShouldDisconnect] = useState(false);
9525
- useEffect(() => {
9526
- if (!isConnected)
9527
- context.setOpen(false);
9528
- }, [isConnected]);
9529
- useEffect(() => {
9530
- if (!shouldDisconnect)
9531
- return;
9532
- // Close before disconnecting to avoid layout shifting while modal is still open
9533
- if (closeModal) {
9534
- closeModal();
9535
- }
9536
- else {
9537
- context.setOpen(false);
9538
- }
9539
- return () => {
9540
- disconnect();
9541
- reset();
9542
- };
9543
- }, [shouldDisconnect, disconnect, reset]);
9544
- const separator = ["web95", "rounded", "minimal"].includes(themeContext.theme ?? context.theme ?? "")
9545
- ? "...."
9546
- : undefined;
9547
- return (jsxs(PageContent, { children: [jsxs(ModalContent, { style: { paddingBottom: 22, gap: 6 }, children: [jsx(AvatarContainer, { children: jsxs(AvatarInner, { children: [jsx(ChainSelectorContainer, { children: jsx(ChainSelector, {}) }), jsx(Avatar, { address: address })] }) }), jsx(ModalH1, { children: jsx(CopyToClipboard, { string: address, children: ensName ?? truncateEthAddress(address, separator) }) }), context?.options?.hideBalance ? null : (jsx(ModalBody, { children: jsx(BalanceContainer, { children: jsxs(AnimatePresence, { exitBeforeEnter: true, initial: false, children: [balance && (jsxs(Balance, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.2 }, children: [nFormatter(Number(balance?.formatted)), ` `, balance?.symbol] }, `chain-${chain?.id}`)), !balance && (jsx(LoadingBalance, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.2 }, children: "\u00A0" }))] }) }) }))] }), !isSafeConnector(connector?.id) && (jsx(Button, { onClick: () => setShouldDisconnect(true), icon: jsx(DisconnectIcon, {}), children: locales.disconnect }))] }));
9548
- };
9549
-
9550
8927
  const SwitchNetworks = () => {
9551
8928
  const { reset } = useConnect$1();
9552
8929
  const { disconnect } = useDisconnect();
@@ -9686,7 +9063,7 @@ const RetryIconContainer = styled(motion.div) `
9686
9063
  }
9687
9064
  `;
9688
9065
 
9689
- const LogoContainer$1 = styled(motion.div) `
9066
+ const LogoContainer$2 = styled(motion.div) `
9690
9067
  z-index: 4;
9691
9068
  position: relative;
9692
9069
  overflow: hidden;
@@ -9716,7 +9093,7 @@ const SpinnerContainer$1 = styled(motion.div) `
9716
9093
  inset: 1px;
9717
9094
  overflow: hidden;
9718
9095
  `;
9719
- const Spinner$2 = styled(motion.div) `
9096
+ const Spinner$3 = styled(motion.div) `
9720
9097
  pointer-events: none;
9721
9098
  user-select: none;
9722
9099
  z-index: 1;
@@ -9748,7 +9125,7 @@ const Spinner$2 = styled(motion.div) `
9748
9125
  `;
9749
9126
 
9750
9127
  const SquircleSpinner = ({ logo, loading = true, }) => {
9751
- return (jsxs(LogoContainer$1, { transition: { duration: 0.5, ease: [0.175, 0.885, 0.32, 0.98] }, children: [jsx(Logo$1, { children: logo }), jsx(SpinnerContainer$1, { children: jsx(AnimatePresence, { children: loading && (jsx(Spinner$2, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: {
9128
+ return (jsxs(LogoContainer$2, { transition: { duration: 0.5, ease: [0.175, 0.885, 0.32, 0.98] }, children: [jsx(Logo$1, { children: logo }), jsx(SpinnerContainer$1, { children: jsx(AnimatePresence, { children: loading && (jsx(Spinner$3, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: {
9752
9129
  opacity: 0,
9753
9130
  transition: {
9754
9131
  duration: 0,
@@ -9800,7 +9177,7 @@ const BrowserIcon = React.forwardRef(({ browser }, ref) => {
9800
9177
  });
9801
9178
  BrowserIcon.displayName = "BrowserIcon";
9802
9179
 
9803
- const LogoContainer = styled(motion.div) `
9180
+ const LogoContainer$1 = styled(motion.div) `
9804
9181
  z-index: 4;
9805
9182
  position: relative;
9806
9183
  width: 100px;
@@ -9887,7 +9264,7 @@ const ExpiringSpinner = styled(motion.div) `
9887
9264
  }
9888
9265
  }
9889
9266
  `;
9890
- const Spinner$1 = styled(motion.div) `
9267
+ const Spinner$2 = styled(motion.div) `
9891
9268
  pointer-events: none;
9892
9269
  user-select: none;
9893
9270
  z-index: 1;
@@ -9913,7 +9290,7 @@ const Spinner$1 = styled(motion.div) `
9913
9290
  `;
9914
9291
 
9915
9292
  const CircleSpinner = ({ logo, smallLogo, loading = true, unavailable = false, countdown = false, }) => {
9916
- return (jsxs(LogoContainer, { transition: { duration: 0.5, ease: [0.175, 0.885, 0.32, 0.98] }, children: [jsx(Logo, { "$small": !unavailable && smallLogo, style: unavailable ? { borderRadius: 0 } : undefined, children: logo }), jsx(SpinnerContainer, { children: jsxs(AnimatePresence, { children: [loading && (jsx(Spinner$1, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: {
9293
+ return (jsxs(LogoContainer$1, { transition: { duration: 0.5, ease: [0.175, 0.885, 0.32, 0.98] }, children: [jsx(Logo, { "$small": !unavailable && smallLogo, style: unavailable ? { borderRadius: 0 } : undefined, children: logo }), jsx(SpinnerContainer, { children: jsxs(AnimatePresence, { children: [loading && (jsx(Spinner$2, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: {
9917
9294
  opacity: 0,
9918
9295
  transition: {
9919
9296
  duration: countdown ? 1 : 0,
@@ -10297,7 +9674,7 @@ const Confirmation = () => {
10297
9674
  justifyContent: "center",
10298
9675
  alignItems: "center",
10299
9676
  paddingBottom: 0,
10300
- }, children: [jsx(AnimationContainer$4, { children: jsxs(InsetContainer, { children: [jsx(Spinner, { "$status": done }), jsx(SuccessIcon, { "$status": done })] }) }), !done ? (jsx(ModalH1, { children: "Confirming..." })) : (jsx(ModalH1, { children: jsx(Link, { href: txURL, target: "_blank", rel: "noopener noreferrer", children: "Payment completed" }) })), jsx(PoweredByFooter, {})] }) }));
9677
+ }, children: [jsx(AnimationContainer$4, { children: jsxs(InsetContainer, { children: [jsx(Spinner$1, { "$status": done }), jsx(SuccessIcon, { "$status": done })] }) }), !done ? (jsx(ModalH1, { children: "Confirming..." })) : (jsx(ModalH1, { children: jsx(Link, { href: txURL, target: "_blank", rel: "noopener noreferrer", children: "Payment completed" }) })), jsx(PoweredByFooter, {})] }) }));
10301
9678
  };
10302
9679
  const AnimationContainer$4 = styled(motion.div) `
10303
9680
  position: relative;
@@ -10338,7 +9715,7 @@ const SuccessIcon = styled(TickIcon) `
10338
9715
  opacity: ${(props) => (props.$status ? 1 : 0)};
10339
9716
  transform: ${(props) => (props.$status ? "scale(1)" : "scale(0.5)")};
10340
9717
  `;
10341
- const Spinner = styled(LoadingCircleIcon) `
9718
+ const Spinner$1 = styled(LoadingCircleIcon) `
10342
9719
  position: absolute;
10343
9720
  transition: all 0.2s ease-in-out;
10344
9721
  animation: rotateSpinner 400ms linear infinite;
@@ -10440,10 +9817,10 @@ const PayWithToken = () => {
10440
9817
  useEffect(() => {
10441
9818
  triggerResize();
10442
9819
  }, [payState]);
10443
- return (jsxs(PageContent, { children: [jsx(LoadingContainer$2, { children: jsx(AnimationContainer$3, { "$circle": true, children: jsxs(AnimatePresence, { children: [jsx(ChainLogoContainer, { children: selectedTokenOption &&
9820
+ return (jsxs(PageContent, { children: [jsx(LoadingContainer$3, { children: jsx(AnimationContainer$3, { "$circle": true, children: jsxs(AnimatePresence, { children: [jsx(ChainLogoContainer, { children: selectedTokenOption &&
10444
9821
  chainToLogo[selectedTokenOption.required.token.chainId] }, "ChainLogoContainer"), jsx(CircleSpinner, { logo: jsx("img", { src: selectedTokenOption?.required.token.logoURI, alt: selectedTokenOption?.required.token.symbol }, selectedTokenOption?.required.token.logoURI), loading: true, unavailable: false }, "CircleSpinner")] }) }) }), jsxs(ModalContent, { style: { paddingBottom: 0 }, children: [jsx(ModalH1, { children: payState }), payState === PayState$1.RequestCancelled && (jsx(Button, { onClick: () => selectedTokenOption ? handleTransfer(selectedTokenOption) : null, children: "Retry Payment" }))] })] }));
10445
9822
  };
10446
- const LoadingContainer$2 = styled(motion.div) `
9823
+ const LoadingContainer$3 = styled(motion.div) `
10447
9824
  display: flex;
10448
9825
  align-items: center;
10449
9826
  justify-content: center;
@@ -10760,6 +10137,29 @@ const IconStackItem = styled(motion.div) `
10760
10137
  border-radius: 22.5%;
10761
10138
  `;
10762
10139
 
10140
+ const SelectDepositAddressChain = () => {
10141
+ const { setRoute, paymentInfo } = useContext();
10142
+ const { setSelectedDepositAddressOption, depositAddressOptions } = paymentInfo;
10143
+ return (jsxs(PageContent, { children: [jsx(OrderHeader, { minified: true }), !depositAddressOptions.loading &&
10144
+ depositAddressOptions.options?.length === 0 && (jsxs(ModalContent, { style: {
10145
+ display: "flex",
10146
+ alignItems: "center",
10147
+ justifyContent: "center",
10148
+ paddingTop: 16,
10149
+ paddingBottom: 16,
10150
+ }, children: [jsx(ModalH1, { children: "Chains unavailable." }), jsx(Button, { onClick: () => setRoute(ROUTES.SELECT_METHOD), children: "Select Another Method" })] })), jsx(OptionsList, { requiredSkeletons: 4, isLoading: depositAddressOptions.loading, options: depositAddressOptions.options?.map((option) => {
10151
+ return {
10152
+ id: option.id,
10153
+ title: option.id,
10154
+ icons: [option.logoURI],
10155
+ onClick: () => {
10156
+ setSelectedDepositAddressOption(option);
10157
+ setRoute(ROUTES.WAITING_DEPOSIT_ADDRESS);
10158
+ },
10159
+ };
10160
+ }) ?? [] })] }));
10161
+ };
10162
+
10763
10163
  // Get 3 icons, skipping the one that is already connected
10764
10164
  function getBestUnconnectedWalletIcons(connector) {
10765
10165
  const icons = [];
@@ -10793,16 +10193,19 @@ function getSolanaOption() {
10793
10193
  },
10794
10194
  };
10795
10195
  }
10796
- function getBitcoinOption(usdRequired) {
10196
+ function getDepositAddressOption(depositAddressOptions) {
10797
10197
  const { setRoute } = useContext();
10798
- if (usdRequired < 20)
10198
+ console.log(`[SELECT_METHOD] depositAddressOptions: ${JSON.stringify(depositAddressOptions)}`);
10199
+ if (!depositAddressOptions.loading &&
10200
+ depositAddressOptions.options.length === 0)
10799
10201
  return null;
10800
10202
  return {
10801
- id: "bitcoin",
10802
- title: "Pay with Bitcoin",
10803
- icons: [jsx(Bitcoin, {})],
10203
+ id: "depositAddress",
10204
+ title: "Pay on another chain",
10205
+ subtitle: "Bitcoin, Tron, Zcash...",
10206
+ icons: [jsx(Bitcoin, {}), jsx(Tron, {}), jsx(Zcash, {})],
10804
10207
  onClick: () => {
10805
- setRoute(ROUTES.WAITING_BITCOIN);
10208
+ setRoute(ROUTES.SELECT_DEPOSIT_ADDRESS_CHAIN);
10806
10209
  },
10807
10210
  };
10808
10211
  }
@@ -10811,7 +10214,7 @@ const SelectMethod = () => {
10811
10214
  const { address, isConnected, connector } = useAccount();
10812
10215
  const { disconnectAsync } = useDisconnect();
10813
10216
  const { setRoute, paymentInfo, log } = useContext();
10814
- const { daimoPayOrder, setSelectedExternalOption, externalPaymentOptions, senderEnsName, } = paymentInfo;
10217
+ const { setSelectedExternalOption, externalPaymentOptions, depositAddressOptions, senderEnsName, } = paymentInfo;
10815
10218
  const displayName = senderEnsName ?? (address ? getAddressContraction(address) : "wallet");
10816
10219
  const connectedWalletOption = isConnected
10817
10220
  ? {
@@ -10837,7 +10240,7 @@ const SelectMethod = () => {
10837
10240
  : [unconnectedWalletOption];
10838
10241
  log(`[SELECT_METHOD] loading: ${externalPaymentOptions.loading}, options: ${JSON.stringify(externalPaymentOptions.options)}`);
10839
10242
  const solanaOption = getSolanaOption();
10840
- const bitcoinOption = getBitcoinOption(daimoPayOrder?.destFinalCallTokenAmount.usd ?? 0);
10243
+ const depositAddressOption = getDepositAddressOption(depositAddressOptions);
10841
10244
  const options = [
10842
10245
  ...walletOptions,
10843
10246
  ...(solanaOption ? [solanaOption] : []),
@@ -10850,7 +10253,7 @@ const SelectMethod = () => {
10850
10253
  setRoute(ROUTES.WAITING_OTHER);
10851
10254
  },
10852
10255
  })),
10853
- ...(bitcoinOption ? [bitcoinOption] : []),
10256
+ ...(depositAddressOption ? [depositAddressOption] : []),
10854
10257
  ];
10855
10258
  return (jsxs(PageContent, { children: [jsx(OrderHeader, {}), jsx(OptionsList, { requiredSkeletons: isMobile ? 4 : 3, isLoading: externalPaymentOptions.loading, options: externalPaymentOptions.loading ? [] : options }), jsx(PoweredByFooter, {})] }));
10856
10259
  };
@@ -10859,13 +10262,13 @@ function getDaimoTokenKey(token) {
10859
10262
  return `${token.chainId}-${token.token}`;
10860
10263
  }
10861
10264
  const TokenChainLogo = ({ token }) => {
10862
- return (jsxs(TokenChainContainer, { children: [jsx("img", { src: token.logoURI, alt: token.symbol, style: { borderRadius: 9999 } }), jsx(ChainContainer, { children: chainToLogo[token.chainId] })] }));
10265
+ return (jsxs(TokenChainContainer, { children: [jsx("img", { src: token.logoURI, alt: token.symbol, style: { borderRadius: 9999 } }), jsx(ChainContainer$1, { children: chainToLogo[token.chainId] })] }));
10863
10266
  };
10864
10267
  const TokenChainContainer = styled(motion.div) `
10865
10268
  width: 100%;
10866
10269
  height: 100%;
10867
10270
  `;
10868
- const ChainContainer = styled(motion.div) `
10271
+ const ChainContainer$1 = styled(motion.div) `
10869
10272
  position: absolute;
10870
10273
  width: 16px;
10871
10274
  height: 16px;
@@ -10946,12 +10349,12 @@ const WaitingOther = () => {
10946
10349
  return (jsx(SquircleSpinner, { logo: jsx("img", { src: selectedExternalOption.logoURI }), loading: true }));
10947
10350
  }
10948
10351
  })();
10949
- return (jsxs(PageContent, { children: [jsx(LoadingContainer$1, { children: jsx(AnimationContainer$2, { "$circle": selectedExternalOption.logoShape === "circle", children: jsx(AnimatePresence, { children: optionSpinner }) }) }), jsxs(ModalContent, { style: { marginLeft: 24, marginRight: 24 }, children: [jsx(ModalH1, { children: "Waiting for Payment" }), paymentWaitingMessage && (jsx(ModalBody, { style: { marginTop: 12, marginBottom: 12 }, children: paymentWaitingMessage })), jsx(Button, { icon: jsx(ExternalLinkIcon, {}), onClick: () => {
10352
+ return (jsxs(PageContent, { children: [jsx(LoadingContainer$2, { children: jsx(AnimationContainer$2, { "$circle": selectedExternalOption.logoShape === "circle", children: jsx(AnimatePresence, { children: optionSpinner }) }) }), jsxs(ModalContent, { style: { marginLeft: 24, marginRight: 24 }, children: [jsx(ModalH1, { children: "Waiting for Payment" }), paymentWaitingMessage && (jsx(ModalBody, { style: { marginTop: 12, marginBottom: 12 }, children: paymentWaitingMessage })), jsx(Button, { icon: jsx(ExternalLinkIcon, {}), onClick: () => {
10950
10353
  if (externalURL)
10951
10354
  window.open(externalURL, "_blank");
10952
10355
  }, children: "Open in New Tab" })] })] }));
10953
10356
  };
10954
- const LoadingContainer$1 = styled(motion.div) `
10357
+ const LoadingContainer$2 = styled(motion.div) `
10955
10358
  display: flex;
10956
10359
  align-items: center;
10957
10360
  justify-content: center;
@@ -10996,7 +10399,7 @@ const ConnectSolana$1 = () => {
10996
10399
  }, [isConnected]);
10997
10400
  if (!solanaConnector)
10998
10401
  return null;
10999
- return (jsxs(PageContent, { children: [jsx(LoadingContainer$1, { children: jsx(AnimationContainer$1, { children: jsx(AnimatePresence, { children: jsx(SquircleSpinner, { logo: jsx("div", { style: { borderRadius: "22.5%", overflow: "hidden" }, children: jsx("img", { src: selectedWallet?.adapter.icon, alt: selectedWallet?.adapter.name }) }), loading: true }) }) }) }), jsx(ModalContent, { style: { paddingBottom: 0 }, children: isConnected ? (jsx(ModalH1, { children: "Connected" })) : (jsxs(Fragment, { children: [jsx(ModalH1, { children: "Requesting Connection" }), jsxs(ModalBody, { children: ["Open ", selectedWallet?.adapter.name, " to continue."] })] })) })] }));
10402
+ return (jsxs(PageContent, { children: [jsx(LoadingContainer$2, { children: jsx(AnimationContainer$1, { children: jsx(AnimatePresence, { children: jsx(SquircleSpinner, { logo: jsx("div", { style: { borderRadius: "22.5%", overflow: "hidden" }, children: jsx("img", { src: selectedWallet?.adapter.icon, alt: selectedWallet?.adapter.name }) }), loading: true }) }) }) }), jsx(ModalContent, { style: { paddingBottom: 0 }, children: isConnected ? (jsx(ModalH1, { children: "Connected" })) : (jsxs(Fragment, { children: [jsx(ModalH1, { children: "Requesting Connection" }), jsxs(ModalBody, { children: ["Open ", selectedWallet?.adapter.name, " to continue."] })] })) })] }));
11000
10403
  };
11001
10404
  const AnimationContainer$1 = styled(motion.div) `
11002
10405
  user-select: none;
@@ -11080,9 +10483,9 @@ const PayWithSolanaToken = () => {
11080
10483
  useEffect(() => {
11081
10484
  triggerResize();
11082
10485
  }, [payState]);
11083
- return (jsxs(PageContent, { children: [jsx(LoadingContainer, { children: jsx(AnimationContainer, { "$circle": true, children: jsx(AnimatePresence, { children: jsx(CircleSpinner, { logo: jsx("img", { src: selectedSolanaTokenOption?.required.token.logoURI, alt: selectedSolanaTokenOption?.required.token.symbol }, selectedSolanaTokenOption?.required.token.logoURI), loading: true, unavailable: false }, "CircleSpinner") }) }) }), jsxs(ModalContent, { style: { paddingBottom: 0 }, children: [jsx(ModalH1, { children: payState }), payState === PayState.RequestCancelled && (jsx(Button, { onClick: handleTransfer, children: "Retry Payment" })), payState === PayState.RequestFailed && (jsx(Button, { onClick: () => setRoute(ROUTES.SELECT_METHOD), children: "Select Another Method" }))] })] }));
10486
+ return (jsxs(PageContent, { children: [jsx(LoadingContainer$1, { children: jsx(AnimationContainer, { "$circle": true, children: jsx(AnimatePresence, { children: jsx(CircleSpinner, { logo: jsx("img", { src: selectedSolanaTokenOption?.required.token.logoURI, alt: selectedSolanaTokenOption?.required.token.symbol }, selectedSolanaTokenOption?.required.token.logoURI), loading: true, unavailable: false }, "CircleSpinner") }) }) }), jsxs(ModalContent, { style: { paddingBottom: 0 }, children: [jsx(ModalH1, { children: payState }), payState === PayState.RequestCancelled && (jsx(Button, { onClick: handleTransfer, children: "Retry Payment" })), payState === PayState.RequestFailed && (jsx(Button, { onClick: () => setRoute(ROUTES.SELECT_METHOD), children: "Select Another Method" }))] })] }));
11084
10487
  };
11085
- const LoadingContainer = styled(motion.div) `
10488
+ const LoadingContainer$1 = styled(motion.div) `
11086
10489
  display: flex;
11087
10490
  align-items: center;
11088
10491
  justify-content: center;
@@ -11137,12 +10540,12 @@ const SelectSolanaToken = () => {
11137
10540
  }) ?? [] })] }));
11138
10541
  };
11139
10542
 
11140
- const WaitingBitcoin = () => {
10543
+ const WaitingDepositAddress = () => {
11141
10544
  const { triggerResize, paymentInfo, setRoute } = useContext();
11142
- const { daimoPayOrder, payWithBitcoin } = paymentInfo;
10545
+ const { daimoPayOrder, payWithDepositAddress, selectedDepositAddressOption } = paymentInfo;
11143
10546
  useEffect(() => {
11144
10547
  const checkForSourcePayment = async () => {
11145
- if (!daimoPayOrder)
10548
+ if (!daimoPayOrder || !selectedDepositAddressOption)
11146
10549
  return;
11147
10550
  const found = await trpc.findSourcePayment.query({
11148
10551
  orderId: daimoPayOrder.id.toString(),
@@ -11155,26 +10558,28 @@ const WaitingBitcoin = () => {
11155
10558
  const interval = setInterval(checkForSourcePayment, 10000);
11156
10559
  return () => clearInterval(interval);
11157
10560
  }, [daimoPayOrder?.id]);
11158
- const [option, setOption] = useState();
10561
+ const [details, setDetails] = useState();
11159
10562
  const [failed, setFailed] = useState(false);
11160
10563
  useEffect(() => {
11161
- payWithBitcoin().then((option) => {
11162
- if (!option)
10564
+ if (!selectedDepositAddressOption)
10565
+ return;
10566
+ payWithDepositAddress(selectedDepositAddressOption.id).then((details) => {
10567
+ if (!details)
11163
10568
  setFailed(true);
11164
10569
  else
11165
- setOption(option);
10570
+ setDetails(details);
11166
10571
  });
11167
- }, []);
10572
+ }, [selectedDepositAddressOption]);
11168
10573
  useEffect(() => {
11169
10574
  triggerResize();
11170
- }, [option]);
11171
- return (jsx(PageContent, { children: failed ? (jsxs(ModalContent, { style: { marginLeft: 24, marginRight: 24 }, children: [jsx(ModalH1, { children: "Bitcoin unavailable" }), jsx(ModalBody, { children: "We're unable to process Bitcoin payments at this time. Please select another payment method." }), jsx(Button, { onClick: () => setRoute(ROUTES.SELECT_METHOD), children: "Select Another Method" })] })) : (jsxs(ModalContent, { children: [jsx(CustomQRCode, { value: option?.uri, image: jsx(Bitcoin, {}), tooltipMessage: jsxs(Fragment, { children: [jsx(ScanIconWithLogos, { logo: jsx(Bitcoin, {}) }), jsx("span", { children: "Use a Bitcoin wallet to scan" })] }) }), option && (jsxs(Fragment, { children: [jsx(OrDivider, {}), jsxs(ModalBody, { children: ["Send exactly ", option.amount, " BTC to", " ", getAddressContraction(option?.address), " and return to this page. Confirmation should appear in a few minutes."] }), jsx(CopyToClipboard, { variant: "button", string: option.address, children: "Copy Address to Clipboard" })] }))] })) }));
10575
+ }, [details]);
10576
+ return (jsx(PageContent, { children: failed ? (jsxs(ModalContent, { style: { marginLeft: 24, marginRight: 24 }, children: [jsxs(ModalH1, { children: [selectedDepositAddressOption?.id, " unavailable"] }), jsxs(ModalBody, { children: ["We're unable to process ", selectedDepositAddressOption?.id, " payments at this time. Please select another payment method."] }), jsx(Button, { onClick: () => setRoute(ROUTES.SELECT_METHOD), children: "Select Another Method" })] })) : (jsxs(ModalContent, { children: [jsx(CustomQRCode, { value: details?.uri, image: jsx("img", { src: selectedDepositAddressOption?.logoURI, width: "100%", height: "100%" }), tooltipMessage: jsxs(Fragment, { children: [jsx(ScanIconWithLogos, { logo: jsx("img", { src: selectedDepositAddressOption?.logoURI }) }), jsxs("span", { children: ["Use a ", selectedDepositAddressOption?.id, " wallet to scan"] })] }) }), details && (jsxs(Fragment, { children: [jsx(OrDivider, {}), jsxs(ModalBody, { children: ["Send exactly ", details.amount, " ", details.suffix, " to", " ", getAddressContraction(details.address), " and return to this page. Confirmation should appear in a few minutes."] }), jsx(CopyToClipboard, { variant: "button", string: details.address, children: "Copy Address" }), jsx(CopyToClipboard, { variant: "left", string: details.amount, children: "Copy Amount" })] }))] })) }));
11172
10577
  };
11173
10578
 
11174
10579
  const customThemeDefault = {};
11175
10580
  const DaimoPayModal = ({ mode = "auto", theme = "auto", customTheme = customThemeDefault, lang = "en-US", }) => {
11176
10581
  const context = useContext();
11177
- const { setSelectedExternalOption, setSelectedTokenOption } = context.paymentInfo;
10582
+ const { setSelectedExternalOption, setSelectedTokenOption, setSelectedDepositAddressOption, setSelectedSolanaTokenOption, } = context.paymentInfo;
11178
10583
  const { isConnected, chain } = useAccount();
11179
10584
  const chainIsSupported = useChainIsSupported(chain?.id);
11180
10585
  //if chain is unsupported we enforce a "switch chain" prompt
@@ -11182,15 +10587,10 @@ const DaimoPayModal = ({ mode = "auto", theme = "auto", customTheme = customThem
11182
10587
  isConnected &&
11183
10588
  !chainIsSupported);
11184
10589
  const showBackButton = closeable &&
11185
- context.route !== ROUTES.PROFILE &&
11186
10590
  context.route !== ROUTES.SELECT_METHOD &&
11187
10591
  context.route !== ROUTES.CONFIRMATION;
11188
- closeable && context.route !== ROUTES.PROFILE;
11189
10592
  const onBack = () => {
11190
- if (context.route === ROUTES.SWITCHNETWORKS) {
11191
- context.setRoute(ROUTES.PROFILE);
11192
- }
11193
- else if (context.route === ROUTES.DOWNLOAD) {
10593
+ if (context.route === ROUTES.DOWNLOAD) {
11194
10594
  context.setRoute(ROUTES.CONNECT);
11195
10595
  }
11196
10596
  else if (context.route === ROUTES.CONNECTORS) {
@@ -11210,6 +10610,14 @@ const DaimoPayModal = ({ mode = "auto", theme = "auto", customTheme = customThem
11210
10610
  else if (context.route === ROUTES.ONBOARDING) {
11211
10611
  context.setRoute(ROUTES.CONNECTORS);
11212
10612
  }
10613
+ else if (context.route === ROUTES.WAITING_DEPOSIT_ADDRESS) {
10614
+ setSelectedDepositAddressOption(undefined);
10615
+ context.setRoute(ROUTES.SELECT_DEPOSIT_ADDRESS_CHAIN);
10616
+ }
10617
+ else if (context.route === ROUTES.SOLANA_PAY_WITH_TOKEN) {
10618
+ setSelectedSolanaTokenOption(undefined);
10619
+ context.setRoute(ROUTES.SOLANA_SELECT_TOKEN);
10620
+ }
11213
10621
  else {
11214
10622
  context.setRoute(ROUTES.SELECT_METHOD);
11215
10623
  }
@@ -11218,7 +10626,8 @@ const DaimoPayModal = ({ mode = "auto", theme = "auto", customTheme = customThem
11218
10626
  daimoPaySelectMethod: jsx(SelectMethod, {}),
11219
10627
  daimoPaySelectToken: jsx(SelectToken, {}),
11220
10628
  daimoPayWaitingOther: jsx(WaitingOther, {}),
11221
- daimoPayWaitingBitcoin: jsx(WaitingBitcoin, {}),
10629
+ daimoPaySelectDepositAddressChain: jsx(SelectDepositAddressChain, {}),
10630
+ daimoPayWaitingDepositAddress: jsx(WaitingDepositAddress, {}),
11222
10631
  daimoPayConfirmation: jsx(Confirmation, {}),
11223
10632
  daimoPayPayWithToken: jsx(PayWithToken, {}),
11224
10633
  daimoPaySolanaConnect: jsx(ConnectSolana, {}),
@@ -11231,7 +10640,6 @@ const DaimoPayModal = ({ mode = "auto", theme = "auto", customTheme = customThem
11231
10640
  connectors: jsx(Wallets, {}),
11232
10641
  mobileConnectors: jsx(MobileConnectors, {}),
11233
10642
  connect: jsx(ConnectUsing, {}),
11234
- profile: jsx(Profile, {}),
11235
10643
  switchNetworks: jsx(SwitchNetworks, {}),
11236
10644
  };
11237
10645
  function hide() {
@@ -11287,7 +10695,8 @@ var ROUTES;
11287
10695
  ROUTES["SELECT_METHOD"] = "daimoPaySelectMethod";
11288
10696
  ROUTES["SELECT_TOKEN"] = "daimoPaySelectToken";
11289
10697
  ROUTES["WAITING_OTHER"] = "daimoPayWaitingOther";
11290
- ROUTES["WAITING_BITCOIN"] = "daimoPayWaitingBitcoin";
10698
+ ROUTES["SELECT_DEPOSIT_ADDRESS_CHAIN"] = "daimoPaySelectDepositAddressChain";
10699
+ ROUTES["WAITING_DEPOSIT_ADDRESS"] = "daimoPayWaitingDepositAddress";
11291
10700
  ROUTES["PAY_WITH_TOKEN"] = "daimoPayPayWithToken";
11292
10701
  ROUTES["CONFIRMATION"] = "daimoPayConfirmation";
11293
10702
  ROUTES["SOLANA_CONNECT"] = "daimoPaySolanaConnect";
@@ -11300,7 +10709,6 @@ var ROUTES;
11300
10709
  ROUTES["MOBILECONNECTORS"] = "mobileConnectors";
11301
10710
  ROUTES["CONNECT"] = "connect";
11302
10711
  ROUTES["DOWNLOAD"] = "download";
11303
- ROUTES["PROFILE"] = "profile";
11304
10712
  ROUTES["SWITCHNETWORKS"] = "switchNetworks";
11305
10713
  })(ROUTES || (ROUTES = {}));
11306
10714
  const Context = createContext(null);
@@ -11484,6 +10892,12 @@ const useContext = () => {
11484
10892
  return context;
11485
10893
  };
11486
10894
 
10895
+ function useIsMounted() {
10896
+ const [mounted, setMounted] = useState(false);
10897
+ useEffect(() => setMounted(true), []);
10898
+ return mounted;
10899
+ }
10900
+
11487
10901
  const TextContainer = styled(motion.div) `
11488
10902
  top: 0;
11489
10903
  bottom: 0;
@@ -11814,12 +11228,228 @@ const useModal = ({ onConnect, onDisconnect } = {}) => {
11814
11228
  // Disconnected Routes
11815
11229
  openAbout: () => gotoAndOpen(ROUTES.ABOUT),
11816
11230
  openOnboarding: () => gotoAndOpen(ROUTES.ONBOARDING),
11817
- // Connected Routes
11818
- openProfile: () => gotoAndOpen(ROUTES.PROFILE),
11819
11231
  openSwitchNetworks: () => gotoAndOpen(ROUTES.SWITCHNETWORKS),
11820
11232
  };
11821
11233
  };
11822
11234
 
11235
+ function addressToNumber(address) {
11236
+ return ((address
11237
+ .split("")
11238
+ .map((l) => l.charCodeAt(0))
11239
+ .reduce((a, b) => a + b) %
11240
+ 100) /
11241
+ 100);
11242
+ }
11243
+ const EnsAvatar = styled(motion.div) `
11244
+ will-change: transform; // Needed for Safari
11245
+ pointer-events: none;
11246
+ user-select: none;
11247
+ position: relative;
11248
+ overflow: hidden;
11249
+ margin: 0;
11250
+ border-radius: ${(props) => `${props.$radius}px`};
11251
+ width: ${(props) => `${props.$size}px`};
11252
+ height: ${(props) => `${props.$size}px`};
11253
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
11254
+ &:before {
11255
+ content: "";
11256
+ z-index: 1;
11257
+ position: absolute;
11258
+ inset: 0;
11259
+ border-radius: inherit;
11260
+ box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02);
11261
+ }
11262
+ ${(props) => {
11263
+ if (props.$seed) {
11264
+ const id = Math.ceil(addressToNumber(props.$seed) * 8);
11265
+ const ensColor = `0${id === 0 ? 1 : id}`; // No zero ID in ENS color list.. 🤷‍♀️
11266
+ return css `
11267
+ background: var(--ck-ens-${ensColor}-start);
11268
+ background: linear-gradient(
11269
+ 180deg,
11270
+ var(--ck-ens-${ensColor}-start) 0%,
11271
+ var(--ck-ens-${ensColor}-stop) 100%
11272
+ );
11273
+ `;
11274
+ }
11275
+ }}
11276
+ `;
11277
+ const ImageContainer = styled(motion.img) `
11278
+ display: block;
11279
+ position: relative;
11280
+ width: 100%;
11281
+ height: 100%;
11282
+ opacity: ${(props) => (props.$loaded ? 1 : 0)};
11283
+ will-change: opacity; // Needed for Safari
11284
+ transition: opacity 500ms ease;
11285
+ transform: scale(1.01); // fixes background color bleeding
11286
+ `;
11287
+
11288
+ const ensFallbackConfig = createConfig({
11289
+ chains: [mainnet],
11290
+ transports: {
11291
+ [mainnet.id]: http(),
11292
+ },
11293
+ });
11294
+ function useEnsFallbackConfig() {
11295
+ return !useChainIsSupported(1) ? ensFallbackConfig : undefined;
11296
+ }
11297
+
11298
+ const Avatar = ({ address, name, size = 96, radius = 96 }) => {
11299
+ const isMounted = useIsMounted();
11300
+ const context = useContext();
11301
+ const imageRef = useRef(null);
11302
+ const [loaded, setLoaded] = useState(true);
11303
+ const ensFallbackConfig = useEnsFallbackConfig();
11304
+ const { data: ensAddress } = useEnsAddress({
11305
+ chainId: 1,
11306
+ name: name,
11307
+ config: ensFallbackConfig,
11308
+ });
11309
+ const { data: ensName } = useEnsName({
11310
+ chainId: 1,
11311
+ address: address ?? ensAddress ?? undefined,
11312
+ config: ensFallbackConfig,
11313
+ });
11314
+ const { data: ensAvatar } = useEnsAvatar({
11315
+ chainId: 1,
11316
+ name: normalize(ensName ?? ""),
11317
+ config: ensFallbackConfig,
11318
+ });
11319
+ const ens = {
11320
+ address: ensAddress ?? address,
11321
+ name: ensName ?? name,
11322
+ avatar: ensAvatar ?? undefined,
11323
+ };
11324
+ useEffect(() => {
11325
+ if (!(imageRef.current &&
11326
+ imageRef.current.complete &&
11327
+ imageRef.current.naturalHeight !== 0)) {
11328
+ setLoaded(false);
11329
+ }
11330
+ }, [ensAvatar]);
11331
+ if (!isMounted)
11332
+ return jsx("div", { style: { width: size, height: size, borderRadius: radius } });
11333
+ if (context.options?.customAvatar)
11334
+ return (jsx("div", { style: {
11335
+ width: size,
11336
+ height: size,
11337
+ borderRadius: radius,
11338
+ overflow: "hidden",
11339
+ }, children: context.options?.customAvatar({
11340
+ address: address ?? ens?.address,
11341
+ ensName: name ?? ens?.name,
11342
+ ensImage: ens?.avatar,
11343
+ size,
11344
+ radius,
11345
+ }) }));
11346
+ if (!ens.name || !ens.avatar)
11347
+ return (jsx(ResetContainer, { style: { pointerEvents: "none" }, children: jsx(EnsAvatar, { "$size": size, "$seed": ens.address, "$radius": radius }) }));
11348
+ return (jsx(ResetContainer, { style: { pointerEvents: "none" }, children: jsx(EnsAvatar, { "$size": size, "$seed": ens.address, "$radius": radius, children: jsx(ImageContainer, { ref: imageRef, src: ens.avatar, alt: ens.name, onLoad: () => setLoaded(true), "$loaded": loaded }) }) }));
11349
+ };
11350
+
11351
+ const ChainContainer = styled.div `
11352
+ --bg: transparent;
11353
+ --color: #333;
11354
+ ${(props) => typeof props.size === "string"
11355
+ ? css `
11356
+ --width: ${props.size};
11357
+ --height: ${props.size};
11358
+ `
11359
+ : css `
11360
+ --width: ${props.size >= 0 ? `${props.size}px` : "24px"};
11361
+ --height: ${props.size >= 0 ? `${props.size}px` : "24px"};
11362
+ `};
11363
+ ${(props) => typeof props.radius === "string"
11364
+ ? css `
11365
+ --radius: ${props.radius};
11366
+ `
11367
+ : css `
11368
+ --radius: ${props.radius >= 0 ? `${props.radius}px` : "24px"};
11369
+ `};
11370
+ display: block;
11371
+ position: relative;
11372
+ width: var(--width);
11373
+ height: var(--height);
11374
+ min-width: var(--width);
11375
+ min-height: var(--height);
11376
+ border-radius: var(--radius);
11377
+ background: var(--ck-body-background-secondary);
11378
+ pointer-events: none;
11379
+ user-select: none;
11380
+ svg {
11381
+ display: block;
11382
+ width: 100%;
11383
+ height: auto;
11384
+ }
11385
+ > div {
11386
+ display: flex;
11387
+ align-items: center;
11388
+ justify-content: center;
11389
+ }
11390
+ `;
11391
+ const LogoContainer = styled(motion.div) `
11392
+ display: block;
11393
+ position: absolute;
11394
+ inset: 0;
11395
+ overflow: hidden;
11396
+ border-radius: inherit;
11397
+ user-select: none;
11398
+ display: flex;
11399
+ align-items: center;
11400
+ justify-content: center;
11401
+ svg {
11402
+ display: block;
11403
+ width: 100%;
11404
+ height: auto;
11405
+ }
11406
+ `;
11407
+ const Spin = keyframes `
11408
+ 0%{ transform: rotate(0deg); }
11409
+ 100%{ transform: rotate(360deg); }
11410
+ `;
11411
+ const LoadingContainer = styled(motion.div) `
11412
+ position: absolute;
11413
+ inset: 0;
11414
+ animation: ${Spin} 1s linear infinite;
11415
+ svg {
11416
+ display: block;
11417
+ position: absolute;
11418
+ inset: 0;
11419
+ }
11420
+ `;
11421
+ const Unsupported = styled(motion.div) `
11422
+ z-index: 2;
11423
+ position: absolute;
11424
+ top: 0;
11425
+ right: 0;
11426
+ width: 40%;
11427
+ height: 40%;
11428
+ min-width: 13px;
11429
+ min-height: 13px;
11430
+ color: var(--ck-body-color-danger, red);
11431
+ svg {
11432
+ display: block;
11433
+ position: relative;
11434
+ top: -30%;
11435
+ right: -30%;
11436
+ }
11437
+ `;
11438
+
11439
+ const Spinner = (jsxs("svg", { "aria-hidden": "true", width: "36", height: "36", viewBox: "0 0 36 36", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M11.3592 30.1654C10.0472 29.4491 8.85718 28.524 7.83713 27.424C6.81708 26.324 5.98425 25.0677 5.36889 23.7054C5.20157 23.335 5.05033 22.9567 4.91578 22.5717C4.51465 21.4237 4.26735 20.2308 4.17794 19.0239C4.16599 18.8626 4.13894 18.7041 4.09809 18.5507C3.85023 17.6197 3.09399 16.8738 2.11531 16.7999C0.975331 16.7138 -0.0310983 17.5702 0.0141657 18.7125C0.0223289 18.9185 0.0340286 19.1243 0.049253 19.3298C0.165374 20.8971 0.486545 22.4464 1.00749 23.9373C1.10424 24.2142 1.20764 24.4884 1.31755 24.7596C2.13617 26.7799 3.31595 28.6371 4.80146 30.239C6.28696 31.841 8.04998 33.1573 10.0029 34.1258C10.2651 34.2558 10.5307 34.3796 10.7995 34.4969C12.247 35.1287 13.7676 35.5656 15.3217 35.7995C15.5255 35.8301 15.7298 35.8573 15.9346 35.881C17.0703 36.0122 18.0001 35.0731 18.0001 33.9299C18.0001 32.9484 17.3133 32.1381 16.4036 31.8208C16.2537 31.7685 16.0977 31.7296 15.9377 31.7056C14.7411 31.5255 13.5702 31.1891 12.4556 30.7026C12.0818 30.5394 11.716 30.3601 11.3592 30.1654Z", fill: "url(#paint0_linear_1288_1870)" }), jsx("defs", { children: jsxs("linearGradient", { id: "paint0_linear_1288_1870", x1: "2", y1: "19.4884", x2: "16.8752", y2: "33.7485", gradientUnits: "userSpaceOnUse", children: [jsx("stop", { stopColor: "var(--ck-connectbutton-balance-color,currentColor)", stopOpacity: "0.7" }), jsx("stop", { offset: "1", stopColor: "var(--ck-connectbutton-balance-color,currentColor)", stopOpacity: "0" })] }) })] }));
11440
+ const Chain = ({ id, unsupported: controlledUnsupported, radius = "50%", size = 24, }) => {
11441
+ const isChainSupported = useChainIsSupported(id);
11442
+ const unsupported = controlledUnsupported ?? !isChainSupported;
11443
+ const chain = chainConfigs.find((c) => c.id === id);
11444
+ const isMounted = useIsMounted();
11445
+ if (!isMounted)
11446
+ return (jsx("div", { style: {
11447
+ width: size,
11448
+ height: size,
11449
+ } }));
11450
+ return (jsx(ChainContainer, { size: size, radius: radius, children: jsxs(AnimatePresence, { initial: false, children: [unsupported && (jsx(Unsupported, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, children: jsxs("svg", { width: "13", height: "12", viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { d: "M2.61317 11.2501H9.46246C10.6009 11.2501 11.3256 10.3506 11.3256 9.3549C11.3256 9.05145 11.255 8.73244 11.0881 8.43303L7.65903 2.14708C7.659 2.14702 7.65897 2.14696 7.65893 2.1469C7.65889 2.14682 7.65884 2.14673 7.65879 2.14664C7.31045 1.50746 6.6741 1.17871 6.04 1.17871C5.41478 1.17871 4.763 1.50043 4.41518 2.14968L0.993416 8.43476C0.828865 8.72426 0.75 9.04297 0.75 9.3549C0.75 10.3506 1.47471 11.2501 2.61317 11.2501Z", fill: "currentColor", stroke: "var(--ck-body-background, #fff)", strokeWidth: "1.5" }), jsx("path", { d: "M6.03258 7.43916C5.77502 7.43916 5.63096 7.29153 5.62223 7.02311L5.55675 4.96973C5.54802 4.69684 5.74446 4.5 6.02821 4.5C6.3076 4.5 6.51277 4.70131 6.50404 4.9742L6.43856 7.01864C6.42546 7.29153 6.2814 7.43916 6.03258 7.43916ZM6.03258 9.11676C5.7401 9.11676 5.5 8.9065 5.5 8.60677C5.5 8.30704 5.7401 8.09678 6.03258 8.09678C6.32506 8.09678 6.56515 8.30256 6.56515 8.60677C6.56515 8.91097 6.32069 9.11676 6.03258 9.11676Z", fill: "white" })] }) })), id ? (jsx(LogoContainer, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.3 }, children: chain?.logo ?? jsx(Chains.UnknownChain, {}) }, `${chain?.id}-${chain?.name}-${id}`)) : (jsx(LoadingContainer, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.3 }, children: Spinner }, "loading"))] }) }));
11451
+ };
11452
+
11823
11453
  function useDaimoPayStatus() {
11824
11454
  const { paymentInfo } = useContext();
11825
11455
  const status = (() => {
@@ -11851,5 +11481,5 @@ function useDaimoPayStatus() {
11851
11481
  return status;
11852
11482
  }
11853
11483
 
11854
- export { Avatar, Chain as ChainIcon, Context, DaimoPayButton, DaimoPayProvider, types$1 as Types, defaultConfig as getDefaultConfig, defaultConnectors as getDefaultConnectors, useChainIsSupported, useChains, useDaimoPayStatus, useIsMounted, useModal, wallets };
11484
+ export { Avatar, Chain as ChainIcon, Context, DaimoPayButton, DaimoPayProvider, types$1 as Types, defaultConfig as getDefaultConfig, useChainIsSupported, useChains, useDaimoPayStatus, useIsMounted, useModal, wallets };
11855
11485
  //# sourceMappingURL=index.es.js.map