@daimo/pay 0.3.13 → 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 (27) hide show
  1. package/build/index.es.js +927 -939
  2. package/build/index.es.js.map +1 -1
  3. package/build/packages/paykit/packages/connectkit/src/assets/chains.d.ts +12 -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 +16 -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/Solana/ConnectSolana/index.d.ts +3 -0
  9. package/build/packages/paykit/packages/connectkit/src/components/Pages/Solana/ConnectorSolana/index.d.ts +3 -0
  10. package/build/packages/paykit/packages/connectkit/src/components/Pages/Solana/PayWithSolanaToken/index.d.ts +3 -0
  11. package/build/packages/paykit/packages/connectkit/src/components/Pages/Solana/SelectSolanaToken/index.d.ts +3 -0
  12. package/build/packages/paykit/packages/connectkit/src/components/Pages/WaitingDepositAddress/index.d.ts +3 -0
  13. package/build/packages/paykit/packages/connectkit/src/components/Spinners/CircleSpinner/index.d.ts +2 -2
  14. package/build/packages/paykit/packages/connectkit/src/components/Spinners/SquircleSpinner/index.d.ts +2 -2
  15. package/build/packages/paykit/packages/connectkit/src/components/contexts/solana/index.d.ts +6 -0
  16. package/build/packages/paykit/packages/connectkit/src/defaultConfig.d.ts +5 -1
  17. package/build/packages/paykit/packages/connectkit/src/defaultConnectors.d.ts +1 -1
  18. package/build/packages/paykit/packages/connectkit/src/hooks/useDepositAddressOptions.d.ts +7 -0
  19. package/build/packages/paykit/packages/connectkit/src/hooks/useModal.d.ts +0 -1
  20. package/build/packages/paykit/packages/connectkit/src/hooks/usePayWithSolanaToken.d.ts +4 -0
  21. package/build/packages/paykit/packages/connectkit/src/hooks/usePaymentInfo.d.ts +11 -1
  22. package/build/packages/paykit/packages/connectkit/src/hooks/useSolanaPaymentOptions.d.ts +9 -0
  23. package/build/packages/paykit/packages/connectkit/src/index.d.ts +0 -1
  24. package/package.json +8 -3
  25. package/build/packages/paykit/packages/connectkit/src/components/Pages/Profile/index.d.ts +0 -5
  26. package/build/packages/paykit/packages/connectkit/src/components/Pages/Profile/styles.d.ts +0 -6
  27. package/build/packages/paykit/packages/connectkit/src/components/Pages/WaitingOther/styles.d.ts +0 -9
package/build/index.es.js CHANGED
@@ -1,15 +1,17 @@
1
- import { http, useConfig, useAccountEffect, useConnectors as useConnectors$1, useAccount, useEnsName, useWriteContract, useSendTransaction, 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';
5
5
  import { detect } from 'detect-browser';
6
6
  import React, { useEffect, useState, useCallback, useRef, useLayoutEffect, useMemo, createContext, createElement } from 'react';
7
7
  import { Buffer } from 'buffer';
8
- import { ExternalPaymentOptions, readDaimoPayOrderID, assert, assertNotNull, DaimoPayOrderMode, DaimoPayOrderStatusDest, getAddressContraction, capitalize, getDisplayPrice, DaimoPayOrderStatusSource, DaimoPayIntentStatus, retryBackoff, debugJson, writeDaimoPayOrderID } from '@daimo/common';
8
+ import { ExternalPaymentOptions, assertNotNull, readDaimoPayOrderID, assert, DaimoPayOrderMode, DaimoPayOrderStatusDest, getAddressContraction, capitalize, getDisplayPrice, DaimoPayOrderStatusSource, DaimoPayIntentStatus, retryBackoff, debugJson, writeDaimoPayOrderID } from '@daimo/common';
9
9
  import styled$1, { css, keyframes, ThemeProvider } from 'styled-components';
10
10
  import { ethereum, erc20Abi, getChainName, arbitrum as arbitrum$1, base as base$2, optimism as optimism$1, polygon as polygon$1, ethereumSepolia, baseSepolia as baseSepolia$1, linea as linea$1, bsc as bsc$1, getChainExplorerTxUrl } from '@daimo/contract';
11
- import { zeroAddress, parseUnits } from 'viem';
11
+ import { hexToBytes, zeroAddress, getAddress, parseUnits } from 'viem';
12
+ import { useConnection, useWallet as useWallet$1, ConnectionProvider, WalletProvider } from '@solana/wallet-adapter-react';
12
13
  import { createTRPCClient, httpBatchLink } from '@trpc/client';
14
+ import { VersionedTransaction } from '@solana/web3.js';
13
15
  import { motion, AnimatePresence, MotionConfig } from 'framer-motion';
14
16
  import { createPortal } from 'react-dom';
15
17
  import { useTransition } from 'react-transition-state';
@@ -17,6 +19,7 @@ import ResizeObserver from 'resize-observer-polyfill';
17
19
  import useMeasure from 'react-use-measure';
18
20
  import QRCodeUtil from 'qrcode';
19
21
  import { walletConnect as walletConnect$1 } from 'wagmi/connectors';
22
+ import { WalletSignTransactionError } from '@solana/wallet-adapter-base';
20
23
  import { normalize } from 'viem/ens';
21
24
 
22
25
  const defaultConnectors = ({ app, walletConnectProjectId, coinbaseWalletPreference, }) => {
@@ -36,20 +39,18 @@ const defaultConnectors = ({ app, walletConnectProjectId, coinbaseWalletPreferen
36
39
  overrideIsMetaMask: false,
37
40
  preference: coinbaseWalletPreference,
38
41
  }));
39
- if (walletConnectProjectId) {
40
- connectors.push(walletConnect({
41
- showQrModal: false,
42
- projectId: walletConnectProjectId,
43
- metadata: hasAllAppData
44
- ? {
45
- name: app.name,
46
- description: app.description,
47
- url: app.url,
48
- icons: [app.icon],
49
- }
50
- : undefined,
51
- }));
52
- }
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
+ }));
53
54
  /*
54
55
  connectors.push(
55
56
  injected({
@@ -100,7 +101,7 @@ const defaultConfig = ({ appName = "Daimo Pay", appIcon, appDescription, appUrl,
100
101
  description: appDescription,
101
102
  url: appUrl,
102
103
  },
103
- walletConnectProjectId,
104
+ walletConnectProjectId: walletConnectProjectId ?? "ea6c5b36001c18b96e06128f14c06f40",
104
105
  coinbaseWalletPreference,
105
106
  });
106
107
  const config = {
@@ -263,29 +264,6 @@ const truncateEthAddress = (address, separator = "••••") => {
263
264
  return address;
264
265
  return `${match[1]}${separator}${match[2]}`;
265
266
  };
266
- const nFormatter = (num, digits = 2) => {
267
- if (num < 10000)
268
- return num.toFixed(2);
269
- const lookup = [
270
- { value: 1, symbol: "" },
271
- { value: 1e3, symbol: "k" },
272
- { value: 1e6, symbol: "m" },
273
- { value: 1e9, symbol: "g" },
274
- { value: 1e12, symbol: "t" },
275
- { value: 1e15, symbol: "p" },
276
- { value: 1e18, symbol: "e" },
277
- ];
278
- const rx = /\.0+$|(\.[0-9]*[1-9])0+$/;
279
- var item = lookup
280
- .slice()
281
- .reverse()
282
- .find(function (item) {
283
- return num >= item.value;
284
- });
285
- return item
286
- ? (num / item.value).toFixed(digits).replace(rx, "$1") + item.symbol
287
- : "0";
288
- };
289
267
  const detectBrowser = () => {
290
268
  const browser = detect();
291
269
  return browser?.name ?? "";
@@ -816,31 +794,6 @@ const useConnectCallback = ({ onConnect, onDisconnect, }) => {
816
794
  });
817
795
  };
818
796
 
819
- function useConnectors() {
820
- const connectors = useConnectors$1();
821
- return connectors ?? [];
822
- }
823
- function useConnector(id, uuid) {
824
- const connectors = useConnectors();
825
- if (id === "injected" && uuid) {
826
- return connectors.find((c) => c.id === id && c.name === uuid);
827
- }
828
- else if (id === "injected") {
829
- return connectors.find((c) => c.id === id && c.name.includes("Injected"));
830
- }
831
- return connectors.find((c) => c.id === id);
832
- }
833
- function useWalletConnectConnector() {
834
- /*
835
- options: {
836
- qrcode: false,
837
- // or
838
- showQrModal: false,
839
- }
840
- */
841
- return useConnector("walletConnect");
842
- }
843
-
844
797
  function useGoogleFont(font) {
845
798
  useEffect(() => {
846
799
  if (!font)
@@ -901,6 +854,30 @@ const trpc = createTRPCClient({
901
854
  ],
902
855
  });
903
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
+
904
881
  const DEFAULT_EXTERNAL_PAYMENT_OPTIONS = [
905
882
  ExternalPaymentOptions.Coinbase,
906
883
  ExternalPaymentOptions.Binance,
@@ -942,11 +919,89 @@ function useExternalPaymentOptions({ filterIds, usdRequired, platform, }) {
942
919
  };
943
920
  }
944
921
 
922
+ function usePayWithSolanaToken(orderId, setDaimoPayOrder, chosenFinalTokenAmount, platform) {
923
+ const { connection } = useConnection();
924
+ const wallet = useWallet$1();
925
+ const payWithSolanaToken = async (inputToken) => {
926
+ if (!wallet.publicKey || !orderId || !chosenFinalTokenAmount || !platform) {
927
+ throw new Error("Invalid parameters");
928
+ }
929
+ const { hydratedOrder } = await trpc.hydrateOrder.query({
930
+ id: orderId.toString(),
931
+ chosenFinalTokenAmount,
932
+ platform,
933
+ });
934
+ const txHash = await (async () => {
935
+ try {
936
+ const serializedTx = await trpc.getSolanaSwapAndBurnTx.query({
937
+ orderId: orderId.toString(),
938
+ userPublicKey: assertNotNull(wallet.publicKey).toString(),
939
+ inputTokenMint: inputToken,
940
+ });
941
+ const tx = VersionedTransaction.deserialize(hexToBytes(serializedTx));
942
+ const txHash = await wallet.sendTransaction(tx, connection);
943
+ return txHash;
944
+ }
945
+ catch (e) {
946
+ console.error(e);
947
+ setDaimoPayOrder(hydratedOrder);
948
+ throw e;
949
+ }
950
+ finally {
951
+ setDaimoPayOrder(hydratedOrder);
952
+ }
953
+ })();
954
+ trpc.processSolanaSourcePayment.mutate({
955
+ orderId: orderId.toString(),
956
+ startIntentTxHash: txHash,
957
+ amount: chosenFinalTokenAmount,
958
+ token: inputToken,
959
+ });
960
+ return txHash;
961
+ };
962
+ return { payWithSolanaToken };
963
+ }
964
+
965
+ function useSolanaPaymentOptions({ address, usdRequired, }) {
966
+ const [options, setOptions] = useState(null);
967
+ const [isLoading, setIsLoading] = useState(false);
968
+ useEffect(() => {
969
+ const refreshWalletPaymentOptions = async () => {
970
+ if (!address || !usdRequired)
971
+ return;
972
+ setOptions(null);
973
+ setIsLoading(true);
974
+ try {
975
+ const newOptions = await trpc.getSolanaPaymentOptions.query({
976
+ pubKey: address,
977
+ usdRequired,
978
+ });
979
+ setOptions(newOptions);
980
+ }
981
+ catch (error) {
982
+ console.error(error);
983
+ }
984
+ finally {
985
+ setIsLoading(false);
986
+ }
987
+ };
988
+ if (address && usdRequired != null) {
989
+ refreshWalletPaymentOptions();
990
+ }
991
+ }, [address, usdRequired]);
992
+ return {
993
+ options,
994
+ isLoading,
995
+ };
996
+ }
997
+
945
998
  function useWalletPaymentOptions({ address, usdRequired, destChainId, }) {
946
999
  const [options, setOptions] = useState(null);
947
1000
  const [isLoading, setIsLoading] = useState(false);
948
1001
  useEffect(() => {
949
1002
  const refreshWalletPaymentOptions = async () => {
1003
+ if (!address || !usdRequired || !destChainId)
1004
+ return;
950
1005
  setOptions(null);
951
1006
  setIsLoading(true);
952
1007
  try {
@@ -964,8 +1019,6 @@ function useWalletPaymentOptions({ address, usdRequired, destChainId, }) {
964
1019
  setIsLoading(false);
965
1020
  }
966
1021
  };
967
- if (!address || !usdRequired || !destChainId)
968
- return;
969
1022
  if (address && usdRequired != null && destChainId) {
970
1023
  refreshWalletPaymentOptions();
971
1024
  }
@@ -990,6 +1043,9 @@ function usePaymentInfo({ daimoPayOrder, setDaimoPayOrder, setOpen, log, }) {
990
1043
  });
991
1044
  const { writeContractAsync } = useWriteContract();
992
1045
  const { sendTransactionAsync } = useSendTransaction();
1046
+ // Solana wallet state.
1047
+ const solanaWallet = useWallet$1();
1048
+ const solanaPubKey = solanaWallet.publicKey?.toBase58();
993
1049
  // Daimo Pay order state.
994
1050
  const [paymentWaitingMessage, setPaymentWaitingMessage] = useState();
995
1051
  // Payment UI config.
@@ -1005,8 +1061,18 @@ function usePaymentInfo({ daimoPayOrder, setDaimoPayOrder, setOpen, log, }) {
1005
1061
  usdRequired: daimoPayOrder?.destFinalCallTokenAmount.usd,
1006
1062
  destChainId: daimoPayOrder?.destFinalCallTokenAmount.token.chainId,
1007
1063
  });
1064
+ const solanaPaymentOptions = useSolanaPaymentOptions({
1065
+ address: solanaPubKey,
1066
+ usdRequired: daimoPayOrder?.destFinalCallTokenAmount.usd,
1067
+ });
1068
+ const depositAddressOptions = useDepositAddressOptions({
1069
+ usdRequired: daimoPayOrder?.destFinalCallTokenAmount.usd ?? 0,
1070
+ });
1071
+ const { payWithSolanaToken } = usePayWithSolanaToken(daimoPayOrder?.id ?? undefined, setDaimoPayOrder, daimoPayOrder?.destFinalCallTokenAmount.amount ?? undefined, platform);
1008
1072
  const [selectedExternalOption, setSelectedExternalOption] = useState();
1009
1073
  const [selectedTokenOption, setSelectedTokenOption] = useState();
1074
+ const [selectedSolanaTokenOption, setSelectedSolanaTokenOption] = useState();
1075
+ const [selectedDepositAddressOption, setSelectedDepositAddressOption] = useState();
1010
1076
  const payWithToken = async (tokenAmount) => {
1011
1077
  assert(!!daimoPayOrder && !!platform);
1012
1078
  const { hydratedOrder } = await trpc.hydrateOrder.query({
@@ -1027,7 +1093,7 @@ function usePaymentInfo({ daimoPayOrder, setDaimoPayOrder, setOpen, log, }) {
1027
1093
  else {
1028
1094
  return await writeContractAsync({
1029
1095
  abi: erc20Abi,
1030
- address: tokenAmount.token.token,
1096
+ address: getAddress(tokenAmount.token.token),
1031
1097
  functionName: "transfer",
1032
1098
  args: [hydratedOrder.intentAddr, BigInt(tokenAmount.amount)],
1033
1099
  });
@@ -1066,6 +1132,21 @@ function usePaymentInfo({ daimoPayOrder, setDaimoPayOrder, setOpen, log, }) {
1066
1132
  setDaimoPayOrder(hydratedOrder);
1067
1133
  return externalPaymentOptionData.url;
1068
1134
  };
1135
+ const payWithDepositAddress = async (option) => {
1136
+ assert(!!daimoPayOrder && !!platform);
1137
+ const { hydratedOrder } = await trpc.hydrateOrder.query({
1138
+ id: daimoPayOrder.id.toString(),
1139
+ chosenFinalTokenAmount: daimoPayOrder.destFinalCallTokenAmount.amount,
1140
+ platform,
1141
+ });
1142
+ setDaimoPayOrder(hydratedOrder);
1143
+ const depositAddressOption = await trpc.getDepositAddressOptionData.query({
1144
+ input: option,
1145
+ usdRequired: daimoPayOrder.destFinalCallTokenAmount.usd,
1146
+ toAddress: assertNotNull(hydratedOrder.intentAddr),
1147
+ });
1148
+ return depositAddressOption;
1149
+ };
1069
1150
  const refreshOrder = useCallback(async () => {
1070
1151
  const id = daimoPayOrder?.id?.toString();
1071
1152
  if (!id)
@@ -1120,13 +1201,21 @@ function usePaymentInfo({ daimoPayOrder, setDaimoPayOrder, setOpen, log, }) {
1120
1201
  paymentWaitingMessage,
1121
1202
  selectedExternalOption,
1122
1203
  selectedTokenOption,
1204
+ selectedSolanaTokenOption,
1123
1205
  externalPaymentOptions,
1124
1206
  walletPaymentOptions,
1207
+ solanaPaymentOptions,
1208
+ depositAddressOptions,
1209
+ selectedDepositAddressOption,
1210
+ setSelectedDepositAddressOption,
1125
1211
  setSelectedExternalOption,
1126
1212
  setSelectedTokenOption,
1213
+ setSelectedSolanaTokenOption,
1127
1214
  setChosenUsd,
1128
1215
  payWithToken,
1129
1216
  payWithExternal,
1217
+ payWithDepositAddress,
1218
+ payWithSolanaToken,
1130
1219
  refreshOrder,
1131
1220
  onSuccess,
1132
1221
  senderEnsName: senderEnsName ?? undefined,
@@ -2274,7 +2363,7 @@ const ResetContainer = styled(motion.div) `
2274
2363
  `;
2275
2364
 
2276
2365
  var name = "@daimo/pay";
2277
- var version = "0.3.13";
2366
+ var version = "0.3.15";
2278
2367
  var author = "Daimo";
2279
2368
  var homepage = "https://pay.daimo.com";
2280
2369
  var license = "BSD-2-Clause license";
@@ -2313,13 +2402,18 @@ var keywords = [
2313
2402
  "crypto"
2314
2403
  ];
2315
2404
  var dependencies = {
2316
- "@daimo/common": "0.3.11",
2317
- "@daimo/contract": "0.3.11",
2405
+ "@daimo/common": "0.3.15",
2406
+ "@daimo/contract": "0.3.15",
2407
+ "@solana/wallet-adapter-base": "^0.9.23",
2408
+ "@solana/wallet-adapter-react": "^0.15.35",
2409
+ "@solana/web3.js": "^1.95.4",
2318
2410
  "@trpc/client": "^11.0.0-next-beta.318",
2319
2411
  "@trpc/server": "^11.0.0-next-beta.318",
2320
2412
  buffer: "^6.0.3",
2321
2413
  "detect-browser": "^5.3.0",
2414
+ encoding: "^0.1.13",
2322
2415
  "framer-motion": "^11.11.4",
2416
+ "pino-pretty": "^13.0.0",
2323
2417
  qrcode: "^1.5.0",
2324
2418
  "react-transition-state": "^1.1.4",
2325
2419
  "react-use-measure": "^2.1.1",
@@ -2875,7 +2969,7 @@ const InfoButton = styled(motion.button) `
2875
2969
  }
2876
2970
  }
2877
2971
  `;
2878
- const Container$6 = styled(motion.div) `
2972
+ const Container$5 = styled(motion.div) `
2879
2973
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
2880
2974
  --duration: 200ms;
2881
2975
  --transition: height var(--duration) var(--ease),
@@ -4498,6 +4592,31 @@ function usePrevious(value, initial) {
4498
4592
  return ref.current.previous;
4499
4593
  }
4500
4594
 
4595
+ function useConnectors() {
4596
+ const connectors = useConnectors$1();
4597
+ return connectors ?? [];
4598
+ }
4599
+ function useConnector(id, uuid) {
4600
+ const connectors = useConnectors();
4601
+ if (id === "injected" && uuid) {
4602
+ return connectors.find((c) => c.id === id && c.name === uuid);
4603
+ }
4604
+ else if (id === "injected") {
4605
+ return connectors.find((c) => c.id === id && c.name.includes("Injected"));
4606
+ }
4607
+ return connectors.find((c) => c.id === id);
4608
+ }
4609
+ function useWalletConnectConnector() {
4610
+ /*
4611
+ options: {
4612
+ qrcode: false,
4613
+ // or
4614
+ showQrModal: false,
4615
+ }
4616
+ */
4617
+ return useConnector("walletConnect");
4618
+ }
4619
+
4501
4620
  const useWallet = (id) => {
4502
4621
  const wallets = useWallets();
4503
4622
  const wallet = wallets.find((c) => c.id === id);
@@ -4792,7 +4911,7 @@ const Modal = ({ open, pages, pageId, positionInside, inline, demo, onClose, onB
4792
4911
  const context = useContext();
4793
4912
  const themeContext = useThemeContext();
4794
4913
  const mobile = isMobile();
4795
- const { daimoPayOrder, selectedExternalOption, selectedTokenOption } = context.paymentInfo;
4914
+ const { daimoPayOrder, selectedExternalOption, selectedTokenOption, selectedSolanaTokenOption, selectedDepositAddressOption, } = context.paymentInfo;
4796
4915
  const wallet = useWallet(context.connector?.id);
4797
4916
  const walletInfo = {
4798
4917
  name: wallet?.name,
@@ -4902,6 +5021,10 @@ const Modal = ({ open, pages, pageId, positionInside, inline, demo, onClose, onB
4902
5021
  else {
4903
5022
  return walletInfo?.name;
4904
5023
  }
5024
+ case ROUTES.SOLANA_CONNECT:
5025
+ return "Connect Solana Wallet";
5026
+ case ROUTES.SOLANA_CONNECTOR:
5027
+ return context.solanaConnector ?? "Solana Wallet";
4905
5028
  case ROUTES.CONNECTORS:
4906
5029
  return locales.connectorsScreen_heading;
4907
5030
  case ROUTES.MOBILECONNECTORS:
@@ -4910,16 +5033,24 @@ const Modal = ({ open, pages, pageId, positionInside, inline, demo, onClose, onB
4910
5033
  return locales.downloadAppScreen_heading;
4911
5034
  case ROUTES.ONBOARDING:
4912
5035
  return locales.onboardingScreen_heading;
4913
- case ROUTES.PROFILE:
4914
- return locales.profileScreen_heading;
4915
5036
  case ROUTES.SWITCHNETWORKS:
4916
5037
  return locales.switchNetworkScreen_heading;
4917
5038
  case ROUTES.SELECT_METHOD:
4918
- return daimoPayOrder?.metadata.intent;
4919
5039
  case ROUTES.SELECT_TOKEN:
5040
+ case ROUTES.SOLANA_SELECT_TOKEN:
4920
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}`;
4921
5046
  case ROUTES.WAITING_OTHER:
4922
5047
  return selectedExternalOption?.cta;
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}`;
4923
5054
  case ROUTES.PAY_WITH_TOKEN:
4924
5055
  if (!selectedTokenOption)
4925
5056
  return undefined;
@@ -4933,7 +5064,7 @@ const Modal = ({ open, pages, pageId, positionInside, inline, demo, onClose, onB
4933
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: {
4934
5065
  pointerEvents: rendered ? "auto" : "none",
4935
5066
  position: positionInside ? "absolute" : undefined,
4936
- }, 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: {
4937
5068
  pointerEvents: inTransition ? "all" : "none", // Block interaction while transitioning
4938
5069
  position: "absolute",
4939
5070
  top: 0,
@@ -6968,6 +7099,10 @@ const Evmos = ({ testnet, ...props }) => (jsx("svg", { ...props, "aria-hidden":
6968
7099
  : "#2D2A25",
6969
7100
  }, children: jsx("path", { d: "M18.4916 12.6668C12.9416 14.806 12.4332 20.2846 10.8418 22.8432C9.23155 25.4322 5.54251 26.8607 6.04698 28.1801C6.55143 29.4994 10.2449 28.0824 13.1669 28.9242C16.0543 29.7561 20.0831 33.4862 25.633 31.3469C28.4603 30.2573 30.5076 28.0143 31.449 25.3574C31.5502 25.0723 31.361 24.7673 31.0606 24.7391C30.874 24.7215 30.6948 24.8196 30.6106 24.9877C29.759 26.6908 28.2981 28.0934 26.3864 28.8301C23.2303 30.0465 19.777 29.0915 17.6562 26.6961C17.1746 26.1522 16.7626 25.533 16.4374 24.8487C16.348 24.6603 16.2629 24.4689 16.1875 24.2708C16.1117 24.0728 16.0473 23.8735 15.9881 23.6732C17.6562 22.8925 19.5812 22.0656 21.7635 21.2246C23.903 20.3999 25.8505 19.731 27.5841 19.1958C28.7571 18.8341 29.8322 18.5331 30.8029 18.2871C30.8732 18.2695 30.9423 18.2519 31.0112 18.2347C31.158 18.1982 31.3088 18.2769 31.363 18.4186L31.364 18.4213C31.396 18.5053 31.4236 18.5898 31.4535 18.6743C31.6453 19.2196 31.7892 19.7706 31.8841 20.3229C31.9258 20.5645 32.1888 20.6961 32.4044 20.5799C33.2014 20.1504 33.9302 19.7314 34.5814 19.3283C37.0083 17.8276 38.3538 16.5549 38.0776 15.8336C37.802 15.1119 35.9541 15.0705 33.1503 15.5854C32.2593 15.7491 31.2716 15.9691 30.207 16.2416C30.0229 16.2886 29.8365 16.3375 29.6481 16.3877C28.7522 16.6262 27.8073 16.8995 26.8234 17.2053C24.9936 17.7744 23.0305 18.4561 21.0038 19.2372C19.1078 19.9682 17.3109 20.726 15.6629 21.4812C15.6428 18.2761 17.5725 15.2461 20.7286 14.0297C22.6399 13.293 24.6605 13.3533 26.4285 14.0473C26.6029 14.116 26.8015 14.0684 26.9291 13.9298C27.1331 13.7076 27.0706 13.3537 26.8053 13.2094C24.3353 11.8685 21.319 11.5771 18.4916 12.6668Z", fill: "#FAF1E4" }) }));
6970
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" })] }) }));
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)" }) })] })] }));
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" })] }));
6971
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: {
6972
7107
  background: testnet
6973
7108
  ? "linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)"
@@ -7015,7 +7150,7 @@ const chainToLogo = {
7015
7150
  [linea$1.chainId]: jsx(Linea, {}),
7016
7151
  [bsc$1.chainId]: jsx(BinanceSmartChain, {}),
7017
7152
  };
7018
- var ChainIcons = {
7153
+ var Chains = {
7019
7154
  UnknownChain,
7020
7155
  Base,
7021
7156
  Ethereum,
@@ -7052,6 +7187,7 @@ const CoinLogos = ({ $size = 24 }) => {
7052
7187
  jsx(Arbitrum, {}),
7053
7188
  jsx(Base, {}),
7054
7189
  jsx(Polygon, {}),
7190
+ jsx(Solana, {}),
7055
7191
  ];
7056
7192
  const logoBlock = (element, index) => (jsx(LogoContainer$4, { "$marginLeft": index !== 0 ? -($size / 3) : 0, "$zIndex": logos.length - index, "$size": $size, transition: { duration: 0.5, ease: [0.175, 0.885, 0.32, 0.98] }, children: element }, index));
7057
7193
  return (jsx(Logos, { children: logos.map((element, index) => logoBlock(element, index)) }));
@@ -7280,7 +7416,7 @@ const QRCodeContent = styled(motion.div) `
7280
7416
  height: auto !important;
7281
7417
  }
7282
7418
  `;
7283
- const PlaceholderKeyframes$1 = keyframes `
7419
+ const PlaceholderKeyframes = keyframes `
7284
7420
  0%{ background-position: 100% 0; }
7285
7421
  100%{ background-position: -100% 0; }
7286
7422
  `;
@@ -7352,7 +7488,7 @@ const QRPlaceholder = styled(motion.div) `
7352
7488
  rgba(255, 255, 255, 0)
7353
7489
  );
7354
7490
  background-size: 200% 100%;
7355
- animation: ${PlaceholderKeyframes$1} 1000ms linear infinite both;
7491
+ animation: ${PlaceholderKeyframes} 1000ms linear infinite both;
7356
7492
  }
7357
7493
  `;
7358
7494
  const LogoContainer$3 = styled(motion.div) `
@@ -7588,7 +7724,7 @@ const generateMatrix = (value, errorCorrectionLevel) => {
7588
7724
  : rows[rows.length - 1].push(key)) && rows, []);
7589
7725
  };
7590
7726
  function QRCode({ ecl = "M", size: sizeProp = 200, uri, clearArea = false, image, imageBackground = "transparent", }) {
7591
- const logoSize = clearArea ? 76 : 0;
7727
+ const logoSize = clearArea ? 168 : 0;
7592
7728
  const size = sizeProp - 10 * 2;
7593
7729
  const dots = useMemo(() => {
7594
7730
  const dots = [];
@@ -7650,7 +7786,7 @@ function CustomQRCode({ value, image, imageBackground, imagePosition = "center",
7650
7786
  background: imagePosition === "center" ? imageBackground : undefined,
7651
7787
  }, children: Logo }) })), jsx(AnimatePresence, { initial: false, children: value ? (jsx(motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0, position: "absolute", inset: [0, 0] }, transition: {
7652
7788
  duration: 0.2,
7653
- }, children: jsx(QRCode, { uri: value, size: 288, ecl: "M", clearArea: !!(imagePosition === "center" && image) }) }, value)) : (jsxs(QRPlaceholder, { initial: { opacity: 0.1 }, animate: { opacity: 0.1 }, exit: { opacity: 0, position: "absolute", inset: [0, 0] }, transition: {
7789
+ }, children: jsx(QRCode, { uri: value, size: 576, ecl: "H", clearArea: !!(imagePosition === "center" && image) }) }, value)) : (jsxs(QRPlaceholder, { initial: { opacity: 0.1 }, animate: { opacity: 0.1 }, exit: { opacity: 0, position: "absolute", inset: [0, 0] }, transition: {
7654
7790
  duration: 0.2,
7655
7791
  }, children: [jsx("span", {}), jsx("span", {}), jsx("span", {}), jsx("div", {})] })) })] }) }));
7656
7792
  }
@@ -7735,7 +7871,7 @@ const WalletList = styled.div `
7735
7871
  }
7736
7872
  `}
7737
7873
  `;
7738
- const Container$5 = styled.div ``;
7874
+ const Container$4 = styled.div ``;
7739
7875
 
7740
7876
  function useWalletConnectModal() {
7741
7877
  const { log } = useContext();
@@ -7837,20 +7973,22 @@ const IconContainer$1 = styled(motion.div) `
7837
7973
  }
7838
7974
  `}
7839
7975
  `;
7840
- 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: {
7841
7977
  transform: small ? "scale(1)" : "translateX(3px) scale(1.5)",
7842
- opacity: small || copied ? 1 : 0.3,
7978
+ opacity: small || copied || dark ? 1 : 0.3,
7843
7979
  } }) }));
7844
7980
 
7845
- const Container$4 = styled.div `
7981
+ const Container$3 = styled.div `
7846
7982
  --color: var(--ck-copytoclipboard-stroke);
7847
7983
  --bg: var(--ck-body-background);
7848
7984
  transition: all 220ms cubic-bezier(0.175, 0.885, 0.32, 1.1);
7849
7985
 
7850
7986
  cursor: pointer;
7851
- display: inline-flex;
7987
+ display: flex;
7852
7988
  align-items: center;
7853
7989
  justify-content: center;
7990
+ margin-top: 4px;
7991
+ gap: 8px;
7854
7992
 
7855
7993
  ${(props) => props.$disabled
7856
7994
  ? css `
@@ -7863,19 +8001,6 @@ const Container$4 = styled.div `
7863
8001
  }
7864
8002
  `}
7865
8003
  `;
7866
- const OffsetContainer = styled.div `
7867
- display: block;
7868
- position: relative;
7869
- transition: inherit;
7870
- svg {
7871
- position: absolute;
7872
- left: 100%;
7873
- display: block;
7874
- top: -1px;
7875
- margin: 0;
7876
- margin-left: 4px;
7877
- }
7878
- `;
7879
8004
  const CopyToClipboard = ({ string, children, variant }) => {
7880
8005
  const [clipboard, setClipboard] = useState(false);
7881
8006
  let timeout;
@@ -7892,7 +8017,7 @@ const CopyToClipboard = ({ string, children, variant }) => {
7892
8017
  };
7893
8018
  if (variant === "button")
7894
8019
  return (jsx(Button, { disabled: !string, onClick: onCopy, icon: jsx(CopyToClipboardIcon, { copied: clipboard }), children: children }));
7895
- 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] }));
7896
8021
  };
7897
8022
 
7898
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" }) }));
@@ -7918,7 +8043,7 @@ const MobileConnectors = () => {
7918
8043
  window.location.href = uri;
7919
8044
  //if (uri) window.open(uri, '_blank');
7920
8045
  };
7921
- 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
7922
8047
  .sort(
7923
8048
  // sort by name
7924
8049
  (a, b) => {
@@ -8184,186 +8309,13 @@ const Introduction = () => {
8184
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 })] }));
8185
8310
  };
8186
8311
 
8187
- const AvatarContainer = styled(motion.div) `
8188
- padding: 18px 0 20px;
8189
- @media only screen and (max-width: ${defaultTheme.mobileWidth}px) {
8190
- padding: 16px 0 20px;
8191
- }
8192
- `;
8193
- const AvatarInner = styled(motion.div) `
8194
- position: relative;
8195
- display: inline-block;
8196
- `;
8197
- const ChainSelectorContainer = styled(motion.div) `
8198
- z-index: 3;
8199
- position: absolute;
8200
- bottom: 0px;
8201
- right: -16px;
8202
- `;
8203
- const BalanceContainer = styled(motion.div) `
8204
- position: relative;
8205
- `;
8206
- const Balance = styled(motion.div) `
8207
- position: relative;
8208
- `;
8209
- const PlaceholderKeyframes = keyframes `
8210
- 0%{ background-position: 100% 0; }
8211
- 100%{ background-position: -100% 0; }
8212
- `;
8213
- const LoadingBalance = styled(motion.div) `
8214
- width: 25%;
8215
- margin: 0 auto;
8216
- position: relative;
8217
- overflow: hidden;
8218
- border-radius: 10px;
8219
- background: var(--ck-body-background-secondary);
8220
- inset: 0;
8221
- &:before {
8222
- z-index: 4;
8223
- content: "";
8224
- position: absolute;
8225
- inset: 0;
8226
- background-image: linear-gradient(
8227
- 90deg,
8228
- var(--ck-body-background-transparent) 50%,
8229
- var(--ck-body-background),
8230
- var(--ck-body-background-transparent)
8231
- );
8232
- opacity: 0.75;
8233
- background-size: 200% 100%;
8234
- animation: ${PlaceholderKeyframes} 1000ms linear infinite both;
8235
- }
8236
- `;
8237
-
8238
- function addressToNumber(address) {
8239
- return ((address
8240
- .split("")
8241
- .map((l) => l.charCodeAt(0))
8242
- .reduce((a, b) => a + b) %
8243
- 100) /
8244
- 100);
8245
- }
8246
- const EnsAvatar = styled(motion.div) `
8247
- will-change: transform; // Needed for Safari
8248
- pointer-events: none;
8249
- user-select: none;
8250
- position: relative;
8251
- overflow: hidden;
8252
- margin: 0;
8253
- border-radius: ${(props) => `${props.$radius}px`};
8254
- width: ${(props) => `${props.$size}px`};
8255
- height: ${(props) => `${props.$size}px`};
8256
- box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
8257
- &:before {
8258
- content: "";
8259
- z-index: 1;
8260
- position: absolute;
8261
- inset: 0;
8262
- border-radius: inherit;
8263
- box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.02);
8264
- }
8265
- ${(props) => {
8266
- if (props.$seed) {
8267
- const id = Math.ceil(addressToNumber(props.$seed) * 8);
8268
- const ensColor = `0${id === 0 ? 1 : id}`; // No zero ID in ENS color list.. 🤷‍♀️
8269
- return css `
8270
- background: var(--ck-ens-${ensColor}-start);
8271
- background: linear-gradient(
8272
- 180deg,
8273
- var(--ck-ens-${ensColor}-start) 0%,
8274
- var(--ck-ens-${ensColor}-stop) 100%
8275
- );
8276
- `;
8277
- }
8278
- }}
8279
- `;
8280
- const ImageContainer = styled(motion.img) `
8281
- display: block;
8282
- position: relative;
8283
- width: 100%;
8284
- height: 100%;
8285
- opacity: ${(props) => (props.$loaded ? 1 : 0)};
8286
- will-change: opacity; // Needed for Safari
8287
- transition: opacity 500ms ease;
8288
- transform: scale(1.01); // fixes background color bleeding
8289
- `;
8290
-
8291
- const ensFallbackConfig = createConfig({
8292
- chains: [mainnet],
8293
- transports: {
8294
- [mainnet.id]: http(),
8295
- },
8296
- });
8297
- function useEnsFallbackConfig() {
8298
- return !useChainIsSupported(1) ? ensFallbackConfig : undefined;
8299
- }
8300
-
8301
- function useIsMounted() {
8302
- const [mounted, setMounted] = useState(false);
8303
- useEffect(() => setMounted(true), []);
8304
- return mounted;
8305
- }
8306
-
8307
- const Avatar = ({ address, name, size = 96, radius = 96 }) => {
8308
- const isMounted = useIsMounted();
8309
- const context = useContext();
8310
- const imageRef = useRef(null);
8311
- const [loaded, setLoaded] = useState(true);
8312
- const ensFallbackConfig = useEnsFallbackConfig();
8313
- const { data: ensAddress } = useEnsAddress({
8314
- chainId: 1,
8315
- name: name,
8316
- config: ensFallbackConfig,
8317
- });
8318
- const { data: ensName } = useEnsName({
8319
- chainId: 1,
8320
- address: address ?? ensAddress ?? undefined,
8321
- config: ensFallbackConfig,
8322
- });
8323
- const { data: ensAvatar } = useEnsAvatar({
8324
- chainId: 1,
8325
- name: normalize(ensName ?? ""),
8326
- config: ensFallbackConfig,
8327
- });
8328
- const ens = {
8329
- address: ensAddress ?? address,
8330
- name: ensName ?? name,
8331
- avatar: ensAvatar ?? undefined,
8332
- };
8333
- useEffect(() => {
8334
- if (!(imageRef.current &&
8335
- imageRef.current.complete &&
8336
- imageRef.current.naturalHeight !== 0)) {
8337
- setLoaded(false);
8338
- }
8339
- }, [ensAvatar]);
8340
- if (!isMounted)
8341
- return jsx("div", { style: { width: size, height: size, borderRadius: radius } });
8342
- if (context.options?.customAvatar)
8343
- return (jsx("div", { style: {
8344
- width: size,
8345
- height: size,
8346
- borderRadius: radius,
8347
- overflow: "hidden",
8348
- }, children: context.options?.customAvatar({
8349
- address: address ?? ens?.address,
8350
- ensName: name ?? ens?.name,
8351
- ensImage: ens?.avatar,
8352
- size,
8353
- radius,
8354
- }) }));
8355
- if (!ens.name || !ens.avatar)
8356
- return (jsx(ResetContainer, { style: { pointerEvents: "none" }, children: jsx(EnsAvatar, { "$size": size, "$seed": ens.address, "$radius": radius }) }));
8357
- 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 }) }) }));
8358
- };
8359
-
8360
8312
  // Note: these rpcUrls are incomplete, and are subject to change from their respective providers
8361
8313
  // More RPC URLs can be found: https://chainid.network/chains.json
8362
8314
  const chainConfigs = [
8363
8315
  {
8364
8316
  id: 1,
8365
8317
  name: "Ethereum",
8366
- logo: jsx(ChainIcons.Ethereum, {}),
8318
+ logo: jsx(Chains.Ethereum, {}),
8367
8319
  rpcUrls: {
8368
8320
  alchemy: {
8369
8321
  http: ["https://eth-mainnet.g.alchemy.com/v2"],
@@ -8378,68 +8330,68 @@ const chainConfigs = [
8378
8330
  {
8379
8331
  id: 3,
8380
8332
  name: "Rinkeby",
8381
- logo: jsx(ChainIcons.Ethereum, { testnet: true }),
8333
+ logo: jsx(Chains.Ethereum, { testnet: true }),
8382
8334
  rpcUrls: {},
8383
8335
  },
8384
8336
  {
8385
8337
  id: 4,
8386
8338
  name: "Ropsten",
8387
- logo: jsx(ChainIcons.Ethereum, { testnet: true }),
8339
+ logo: jsx(Chains.Ethereum, { testnet: true }),
8388
8340
  },
8389
8341
  {
8390
8342
  id: 5,
8391
8343
  name: "Görli",
8392
- logo: jsx(ChainIcons.Ethereum, { testnet: true }),
8344
+ logo: jsx(Chains.Ethereum, { testnet: true }),
8393
8345
  },
8394
8346
  {
8395
8347
  id: 42,
8396
8348
  name: "Kovan",
8397
- logo: jsx(ChainIcons.Ethereum, { testnet: true }),
8349
+ logo: jsx(Chains.Ethereum, { testnet: true }),
8398
8350
  },
8399
8351
  {
8400
8352
  id: 10,
8401
8353
  name: "Optimism",
8402
- logo: jsx(ChainIcons.Optimism, {}),
8354
+ logo: jsx(Chains.Optimism, {}),
8403
8355
  },
8404
8356
  {
8405
8357
  id: 69, // nice
8406
8358
  name: "Optimism Kovan",
8407
- logo: jsx(ChainIcons.Optimism, { testnet: true }),
8359
+ logo: jsx(Chains.Optimism, { testnet: true }),
8408
8360
  },
8409
8361
  {
8410
8362
  id: 420, // nice
8411
8363
  name: "Optimism Goerli",
8412
- logo: jsx(ChainIcons.Optimism, { testnet: true }),
8364
+ logo: jsx(Chains.Optimism, { testnet: true }),
8413
8365
  },
8414
8366
  {
8415
8367
  id: 11155420,
8416
8368
  name: "Optimism Sepolia",
8417
- logo: jsx(ChainIcons.Optimism, { testnet: true }),
8369
+ logo: jsx(Chains.Optimism, { testnet: true }),
8418
8370
  },
8419
8371
  {
8420
8372
  id: 137,
8421
8373
  name: "Polygon",
8422
- logo: jsx(ChainIcons.Polygon, {}),
8374
+ logo: jsx(Chains.Polygon, {}),
8423
8375
  },
8424
8376
  {
8425
8377
  id: 80001,
8426
8378
  name: "Polygon Mumbai",
8427
- logo: jsx(ChainIcons.Polygon, { testnet: true }),
8379
+ logo: jsx(Chains.Polygon, { testnet: true }),
8428
8380
  },
8429
8381
  {
8430
8382
  id: 31337,
8431
8383
  name: "Hardhat",
8432
- logo: jsx(ChainIcons.Ethereum, { testnet: true }),
8384
+ logo: jsx(Chains.Ethereum, { testnet: true }),
8433
8385
  },
8434
8386
  {
8435
8387
  id: 1337,
8436
8388
  name: "Localhost",
8437
- logo: jsx(ChainIcons.Ethereum, { testnet: true }),
8389
+ logo: jsx(Chains.Ethereum, { testnet: true }),
8438
8390
  },
8439
8391
  {
8440
8392
  id: 42161,
8441
8393
  name: "Arbitrum",
8442
- logo: jsx(ChainIcons.Arbitrum, {}),
8394
+ logo: jsx(Chains.Arbitrum, {}),
8443
8395
  rpcUrls: {
8444
8396
  alchemy: {
8445
8397
  http: ["https://arb-mainnet.g.alchemy.com/v2"],
@@ -8454,12 +8406,12 @@ const chainConfigs = [
8454
8406
  {
8455
8407
  id: 421611,
8456
8408
  name: "Arbitrum Rinkeby",
8457
- logo: jsx(ChainIcons.Arbitrum, { testnet: true }),
8409
+ logo: jsx(Chains.Arbitrum, { testnet: true }),
8458
8410
  },
8459
8411
  {
8460
8412
  id: 421613,
8461
8413
  name: "Arbitrum Goerli",
8462
- logo: jsx(ChainIcons.Arbitrum, { testnet: true }),
8414
+ logo: jsx(Chains.Arbitrum, { testnet: true }),
8463
8415
  rpcUrls: {
8464
8416
  alchemy: {
8465
8417
  http: ["https://arb-goerli.g.alchemy.com/v2"],
@@ -8474,292 +8426,190 @@ const chainConfigs = [
8474
8426
  {
8475
8427
  id: 40,
8476
8428
  name: "Telos",
8477
- logo: jsx(ChainIcons.Telos, {}),
8429
+ logo: jsx(Chains.Telos, {}),
8478
8430
  },
8479
8431
  {
8480
8432
  id: 41,
8481
8433
  name: "Telos Testnet",
8482
- logo: jsx(ChainIcons.Telos, { testnet: true }),
8434
+ logo: jsx(Chains.Telos, { testnet: true }),
8483
8435
  },
8484
8436
  {
8485
8437
  id: 1313161554,
8486
8438
  name: "Aurora",
8487
- logo: jsx(ChainIcons.Aurora, {}),
8439
+ logo: jsx(Chains.Aurora, {}),
8488
8440
  },
8489
8441
  {
8490
8442
  id: 1313161555,
8491
8443
  name: "Aurora Testnet",
8492
- logo: jsx(ChainIcons.Aurora, { testnet: true }),
8444
+ logo: jsx(Chains.Aurora, { testnet: true }),
8493
8445
  },
8494
8446
  {
8495
8447
  id: 43_114,
8496
8448
  name: "Avalanche",
8497
- logo: jsx(ChainIcons.Avalanche, {}),
8449
+ logo: jsx(Chains.Avalanche, {}),
8498
8450
  },
8499
8451
  {
8500
8452
  id: 43_113,
8501
8453
  name: "Avalanche Fuji",
8502
- logo: jsx(ChainIcons.Avalanche, { testnet: true }),
8454
+ logo: jsx(Chains.Avalanche, { testnet: true }),
8503
8455
  },
8504
8456
  {
8505
8457
  id: 31337,
8506
8458
  name: "Foundry",
8507
- logo: jsx(ChainIcons.Foundry, { testnet: true }),
8459
+ logo: jsx(Chains.Foundry, { testnet: true }),
8508
8460
  },
8509
8461
  {
8510
8462
  id: 100,
8511
8463
  name: "Gnosis",
8512
- logo: jsx(ChainIcons.Gnosis, {}),
8464
+ logo: jsx(Chains.Gnosis, {}),
8513
8465
  },
8514
8466
  {
8515
8467
  id: 9001,
8516
8468
  name: "Evmos",
8517
- logo: jsx(ChainIcons.Evmos, {}),
8469
+ logo: jsx(Chains.Evmos, {}),
8518
8470
  },
8519
8471
  {
8520
8472
  id: 9000,
8521
8473
  name: "Evmos Testnet",
8522
- logo: jsx(ChainIcons.Evmos, { testnet: true }),
8474
+ logo: jsx(Chains.Evmos, { testnet: true }),
8523
8475
  },
8524
8476
  {
8525
8477
  id: 56,
8526
8478
  name: "BNB Smart Chain",
8527
- logo: jsx(ChainIcons.BinanceSmartChain, {}),
8479
+ logo: jsx(Chains.BinanceSmartChain, {}),
8528
8480
  },
8529
8481
  {
8530
8482
  id: 97,
8531
8483
  name: "Binance Smart Chain Testnet",
8532
- logo: jsx(ChainIcons.BinanceSmartChain, { testnet: true }),
8484
+ logo: jsx(Chains.BinanceSmartChain, { testnet: true }),
8533
8485
  },
8534
8486
  {
8535
8487
  id: 11155111,
8536
8488
  name: "Sepolia",
8537
- logo: jsx(ChainIcons.Sepolia, {}),
8489
+ logo: jsx(Chains.Sepolia, {}),
8538
8490
  },
8539
8491
  {
8540
8492
  id: 841,
8541
8493
  name: "Taraxa",
8542
- logo: jsx(ChainIcons.Taraxa, {}),
8494
+ logo: jsx(Chains.Taraxa, {}),
8543
8495
  },
8544
8496
  {
8545
8497
  id: 842,
8546
8498
  name: "Taraxa Testnet",
8547
- logo: jsx(ChainIcons.Taraxa, { testnet: true }),
8499
+ logo: jsx(Chains.Taraxa, { testnet: true }),
8548
8500
  },
8549
8501
  {
8550
8502
  id: 324,
8551
8503
  name: "zkSync",
8552
- logo: jsx(ChainIcons.zkSync, {}),
8504
+ logo: jsx(Chains.zkSync, {}),
8553
8505
  },
8554
8506
  {
8555
8507
  id: 280,
8556
8508
  name: "zkSync Testnet",
8557
- logo: jsx(ChainIcons.zkSync, { testnet: true }),
8509
+ logo: jsx(Chains.zkSync, { testnet: true }),
8558
8510
  },
8559
8511
  {
8560
8512
  id: 42_220,
8561
8513
  name: "Celo",
8562
- logo: jsx(ChainIcons.Celo, {}),
8514
+ logo: jsx(Chains.Celo, {}),
8563
8515
  },
8564
8516
  {
8565
8517
  id: 44_787,
8566
8518
  name: "Celo Alfajores",
8567
- logo: jsx(ChainIcons.Celo, { testnet: true }),
8519
+ logo: jsx(Chains.Celo, { testnet: true }),
8568
8520
  },
8569
8521
  {
8570
8522
  id: 7_700,
8571
8523
  name: "Canto",
8572
- logo: jsx(ChainIcons.Canto, {}),
8524
+ logo: jsx(Chains.Canto, {}),
8573
8525
  },
8574
8526
  {
8575
8527
  id: 250,
8576
8528
  name: "Fantom",
8577
- logo: jsx(ChainIcons.Fantom, {}),
8529
+ logo: jsx(Chains.Fantom, {}),
8578
8530
  },
8579
8531
  {
8580
8532
  id: 4_002,
8581
8533
  name: "Fantom Testnet",
8582
- logo: jsx(ChainIcons.Fantom, { testnet: true }),
8534
+ logo: jsx(Chains.Fantom, { testnet: true }),
8583
8535
  },
8584
8536
  {
8585
8537
  id: 14,
8586
8538
  name: "Flare",
8587
- logo: jsx(ChainIcons.Flare, {}),
8539
+ logo: jsx(Chains.Flare, {}),
8588
8540
  },
8589
8541
  {
8590
8542
  id: 114,
8591
8543
  name: "Coston2",
8592
- logo: jsx(ChainIcons.Flare, {}),
8544
+ logo: jsx(Chains.Flare, {}),
8593
8545
  },
8594
8546
  {
8595
8547
  id: 314,
8596
8548
  name: "Filecoin",
8597
- logo: jsx(ChainIcons.Filecoin, {}),
8549
+ logo: jsx(Chains.Filecoin, {}),
8598
8550
  },
8599
8551
  {
8600
8552
  id: 314_1,
8601
8553
  name: "Filecoin Hyperspace",
8602
- logo: jsx(ChainIcons.Filecoin, { testnet: true }),
8554
+ logo: jsx(Chains.Filecoin, { testnet: true }),
8603
8555
  },
8604
8556
  {
8605
8557
  id: 314_159,
8606
8558
  name: "Filecoin Calibration",
8607
- logo: jsx(ChainIcons.Filecoin, { testnet: true }),
8559
+ logo: jsx(Chains.Filecoin, { testnet: true }),
8608
8560
  },
8609
8561
  {
8610
8562
  id: 1_088,
8611
8563
  name: "Metis",
8612
- logo: jsx(ChainIcons.Metis, {}),
8564
+ logo: jsx(Chains.Metis, {}),
8613
8565
  },
8614
8566
  {
8615
8567
  id: 599,
8616
8568
  name: "Metis Goerli",
8617
- logo: jsx(ChainIcons.Metis, { testnet: true }),
8569
+ logo: jsx(Chains.Metis, { testnet: true }),
8618
8570
  },
8619
8571
  {
8620
8572
  id: 4_689,
8621
8573
  name: "IoTeX",
8622
- logo: jsx(ChainIcons.IoTeX, {}),
8574
+ logo: jsx(Chains.IoTeX, {}),
8623
8575
  },
8624
8576
  {
8625
8577
  id: 4_690,
8626
8578
  name: "IoTeX Testnet",
8627
- logo: jsx(ChainIcons.IoTeX, { testnet: true }),
8579
+ logo: jsx(Chains.IoTeX, { testnet: true }),
8628
8580
  },
8629
8581
  {
8630
8582
  id: 8_453,
8631
8583
  name: "Base",
8632
- logo: jsx(ChainIcons.Base, {}),
8584
+ logo: jsx(Chains.Base, {}),
8633
8585
  },
8634
8586
  {
8635
8587
  id: 84_531,
8636
8588
  name: "Base Goerli",
8637
- logo: jsx(ChainIcons.Base, { testnet: true }),
8589
+ logo: jsx(Chains.Base, { testnet: true }),
8638
8590
  },
8639
8591
  {
8640
8592
  id: 84_532,
8641
8593
  name: "Base Sepolia",
8642
- logo: jsx(ChainIcons.Base, { testnet: true }),
8594
+ logo: jsx(Chains.Base, { testnet: true }),
8643
8595
  },
8644
8596
  {
8645
8597
  id: 7777777,
8646
8598
  name: "Zora",
8647
- logo: jsx(ChainIcons.Zora, {}),
8599
+ logo: jsx(Chains.Zora, {}),
8648
8600
  },
8649
8601
  {
8650
8602
  id: 999999999,
8651
8603
  name: "Zora Sepolia",
8652
- logo: jsx(ChainIcons.Zora, { testnet: true }),
8604
+ logo: jsx(Chains.Zora, { testnet: true }),
8653
8605
  },
8654
8606
  {
8655
8607
  id: 999,
8656
8608
  name: "Zora Goerli Testnet",
8657
- logo: jsx(ChainIcons.Zora, { testnet: true }),
8609
+ logo: jsx(Chains.Zora, { testnet: true }),
8658
8610
  },
8659
8611
  ];
8660
8612
 
8661
- const ChainContainer$1 = styled.div `
8662
- --bg: transparent;
8663
- --color: #333;
8664
- ${(props) => typeof props.size === "string"
8665
- ? css `
8666
- --width: ${props.size};
8667
- --height: ${props.size};
8668
- `
8669
- : css `
8670
- --width: ${props.size >= 0 ? `${props.size}px` : "24px"};
8671
- --height: ${props.size >= 0 ? `${props.size}px` : "24px"};
8672
- `};
8673
- ${(props) => typeof props.radius === "string"
8674
- ? css `
8675
- --radius: ${props.radius};
8676
- `
8677
- : css `
8678
- --radius: ${props.radius >= 0 ? `${props.radius}px` : "24px"};
8679
- `};
8680
- display: block;
8681
- position: relative;
8682
- width: var(--width);
8683
- height: var(--height);
8684
- min-width: var(--width);
8685
- min-height: var(--height);
8686
- border-radius: var(--radius);
8687
- background: var(--ck-body-background-secondary);
8688
- pointer-events: none;
8689
- user-select: none;
8690
- svg {
8691
- display: block;
8692
- width: 100%;
8693
- height: auto;
8694
- }
8695
- > div {
8696
- display: flex;
8697
- align-items: center;
8698
- justify-content: center;
8699
- }
8700
- `;
8701
- const LogoContainer$2 = styled(motion.div) `
8702
- display: block;
8703
- position: absolute;
8704
- inset: 0;
8705
- overflow: hidden;
8706
- border-radius: inherit;
8707
- user-select: none;
8708
- display: flex;
8709
- align-items: center;
8710
- justify-content: center;
8711
- svg {
8712
- display: block;
8713
- width: 100%;
8714
- height: auto;
8715
- }
8716
- `;
8717
- const Spin = keyframes `
8718
- 0%{ transform: rotate(0deg); }
8719
- 100%{ transform: rotate(360deg); }
8720
- `;
8721
- const LoadingContainer$2 = styled(motion.div) `
8722
- position: absolute;
8723
- inset: 0;
8724
- animation: ${Spin} 1s linear infinite;
8725
- svg {
8726
- display: block;
8727
- position: absolute;
8728
- inset: 0;
8729
- }
8730
- `;
8731
- const Unsupported = styled(motion.div) `
8732
- z-index: 2;
8733
- position: absolute;
8734
- top: 0;
8735
- right: 0;
8736
- width: 40%;
8737
- height: 40%;
8738
- min-width: 13px;
8739
- min-height: 13px;
8740
- color: var(--ck-body-color-danger, red);
8741
- svg {
8742
- display: block;
8743
- position: relative;
8744
- top: -30%;
8745
- right: -30%;
8746
- }
8747
- `;
8748
-
8749
- 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" })] }) })] }));
8750
- const Chain = ({ id, unsupported: controlledUnsupported, radius = "50%", size = 24, }) => {
8751
- const isChainSupported = useChainIsSupported(id);
8752
- const unsupported = controlledUnsupported ?? !isChainSupported;
8753
- const chain = chainConfigs.find((c) => c.id === id);
8754
- const isMounted = useIsMounted();
8755
- if (!isMounted)
8756
- return (jsx("div", { style: {
8757
- width: size,
8758
- height: size,
8759
- } }));
8760
- 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$2, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.3 }, children: Spinner$4 }, "loading"))] }) }));
8761
- };
8762
-
8763
8613
  const SwitchNetworksContainer = styled.div `
8764
8614
  display: flex;
8765
8615
  flex-direction: column;
@@ -8981,7 +8831,7 @@ const ChainButtonBg = styled(motion.div) `
8981
8831
  }
8982
8832
  `;
8983
8833
 
8984
- 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" })] }) })] }));
8985
8835
  const ChainSelectList = ({ variant, }) => {
8986
8836
  const { connector, chain } = useAccount();
8987
8837
  const { chains, isPending, switchChain, error } = useSwitchChain();
@@ -9010,422 +8860,68 @@ const ChainSelectList = ({ variant, }) => {
9010
8860
  justifyContent: "flex-start",
9011
8861
  gap: 12,
9012
8862
  color: ch.id === chain?.id
9013
- ? "var(--ck-dropdown-active-color, inherit)"
9014
- : "inherit",
9015
- }, children: [jsxs(ChainLogoContainer$1, { children: [jsx(ChainLogoSpinner, { initial: { opacity: 0 }, animate: {
9016
- opacity: isPending && pendingChainId === ch.id ? 1 : 0,
9017
- }, transition: {
9018
- ease: [0.76, 0, 0.24, 1],
9019
- duration: 0.15,
9020
- delay: 0.1,
9021
- }, children: jsx(motion.div, { animate:
9022
- // UI fix for Coinbase Wallet on mobile does not remove isPending on rejection event
9023
- mobile &&
9024
- isCoinbaseWalletConnector(connector?.id) &&
9025
- isPending &&
9026
- pendingChainId === ch.id
9027
- ? {
9028
- opacity: [1, 0],
9029
- transition: { delay: 4, duration: 3 },
9030
- }
9031
- : { 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: {
9032
- color: "var(--ck-dropdown-active-color, var(--ck-focus-color))",
9033
- display: "block",
9034
- position: "relative",
9035
- }, initial: { opacity: 0, x: -4 }, animate: { opacity: 1, x: 0 }, exit: {
9036
- opacity: 0,
9037
- x: 4,
9038
- transition: { duration: 0.1, delay: 0 },
9039
- }, transition: {
9040
- ease: [0.76, 0, 0.24, 1],
9041
- duration: 0.3,
9042
- delay: 0.2,
9043
- }, children: locales.connected }, "connectedText")), isPending && pendingChainId === ch.id && (jsx(motion.span, { style: {
9044
- color: "var(--ck-dropdown-pending-color, inherit)",
9045
- display: "block",
9046
- position: "relative",
9047
- }, initial: {
9048
- opacity: 0,
9049
- x: -4,
9050
- }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: 4 }, transition: {
9051
- ease: [0.76, 0, 0.24, 1],
9052
- duration: 0.3,
9053
- delay: 0.1,
9054
- }, children: jsx(motion.span, { animate:
9055
- // UI fix for Coinbase Wallet on mobile does not remove isLoading on rejection event
9056
- mobile &&
9057
- isCoinbaseWalletConnector(connector?.id) && {
9058
- opacity: [1, 0],
9059
- transition: { delay: 4, duration: 4 },
9060
- }, children: locales.approveInWallet }) }, "approveText"))] }) })), variant === "secondary" ? (jsx(ChainButtonBg, { initial: false, animate: {
9061
- opacity: ch.id === chain?.id ? 1 : 0,
9062
- }, transition: {
9063
- duration: 0.3,
9064
- ease: "easeOut",
9065
- } })) : (
9066
- //hover === ch.name && (
9067
- ch.id === chain?.id && (jsx(ChainButtonBg, { layoutId: "activeChain", layout: "position", transition: {
9068
- duration: 0.3,
9069
- ease: "easeOut",
9070
- } })))] }, `${ch?.id}-${ch?.name}`));
9071
- }) }) }), jsx(AnimatePresence, { children: isError && (jsx(motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: {
9072
- ease: [0.76, 0, 0.24, 1],
9073
- duration: 0.3,
9074
- }, onAnimationStart: triggerResize, onAnimationComplete: triggerResize, children: jsx("div", { style: { paddingTop: 10, paddingBottom: 8 }, children: jsxs(Alert, { children: [locales.warnings_walletSwitchingUnsupported, " ", locales.warnings_walletSwitchingUnsupportedResolve] }) }) })) })] }));
9075
- };
9076
-
9077
- const DropdownWindow = styled(motion.div) `
9078
- z-index: 2147483647;
9079
- position: fixed;
9080
- inset: 0;
9081
- `;
9082
- const DropdownOverlay = styled(motion.div) `
9083
- position: absolute;
9084
- inset: 0;
9085
- `;
9086
- const DropdownContainer = styled(motion.div) `
9087
- --shadow: 0px 2px 15px rgba(0, 0, 0, 0.15);
9088
- --background: var(--ck-dropdown-background, var(--ck-tooltip-background));
9089
- --border-radius: var(
9090
- --ck-dropdown-border-radius,
9091
- var(--ck-tooltip-border-radius, 12px)
9092
- );
9093
-
9094
- pointer-events: auto;
9095
- z-index: 2147483647;
9096
- position: absolute;
9097
- top: 0;
9098
- left: 0;
9099
- width: 100%;
9100
- max-width: fit-content;
9101
- padding: 14px 16px 16px;
9102
- color: var(--ck-dropdown-color, var(--ck-tooltip-color));
9103
- background: var(--background);
9104
- box-shadow: var(
9105
- --ck-dropdown-box-shadow,
9106
- var(--ck-tooltip-shadow, var(--shadow))
9107
- );
9108
- border-radius: var(--border-radius);
9109
- `;
9110
- const DropdownHeading = styled(motion.div) `
9111
- padding: 0 0 6px;
9112
- font-size: 14px;
9113
- line-height: 20px;
9114
- font-weight: 400;
9115
- user-select: none;
9116
- color: var(--ck-dropdown-color, var(--ck-tooltip-color));
9117
- `;
9118
-
9119
- const ChainSelectDropdown = ({ children, open, onClose, offsetX = 0, offsetY = 8 }) => {
9120
- const context = useContext();
9121
- const themeContext = useThemeContext();
9122
- const locales = useLocales();
9123
- const [offset, setOffset] = useState({ x: 0, y: 0 });
9124
- useLockBodyScroll(open);
9125
- const contentRef = useRef(null);
9126
- useEffect(() => {
9127
- const listener = (e) => {
9128
- if (!open)
9129
- return;
9130
- if (e.key === "Escape")
9131
- onClose();
9132
- if (e.key === "ArrowDown" || e.key === "ArrowUp") {
9133
- if (!contentRef.current)
9134
- return;
9135
- e.preventDefault();
9136
- const focusableEls = contentRef.current?.querySelectorAll(`
9137
- a[href]:not(:disabled),
9138
- button:not(:disabled),
9139
- textarea:not(:disabled),
9140
- input[type="text"]:not(:disabled),
9141
- input[type="radio"]:not(:disabled),
9142
- input[type="checkbox"]:not(:disabled),
9143
- select:not(:disabled)
9144
- `), firstFocusableEl = focusableEls[0], lastFocusableEl = focusableEls[focusableEls.length - 1];
9145
- if (e.key === "ArrowUp") {
9146
- if (document.activeElement === firstFocusableEl) {
9147
- lastFocusableEl.focus();
9148
- }
9149
- else {
9150
- let focusItem = document?.activeElement?.previousSibling;
9151
- if (!focusItem)
9152
- focusItem = lastFocusableEl;
9153
- while (focusItem.disabled)
9154
- focusItem = focusItem.previousSibling;
9155
- focusItem.focus();
9156
- }
9157
- }
9158
- else {
9159
- if (document.activeElement === lastFocusableEl) {
9160
- firstFocusableEl.focus();
9161
- }
9162
- else {
9163
- let focusItem = document?.activeElement?.nextSibling;
9164
- if (!focusItem)
9165
- focusItem = firstFocusableEl;
9166
- while (focusItem.disabled)
9167
- focusItem = focusItem.nextSibling;
9168
- focusItem.focus();
9169
- }
9170
- }
9171
- }
9172
- };
9173
- document.addEventListener("keydown", listener);
9174
- return () => {
9175
- document.removeEventListener("keydown", listener);
9176
- };
9177
- }, [open]);
9178
- const targetRef = useRef(null);
9179
- const innerRef = useCallback((node) => {
9180
- if (!node)
9181
- return;
9182
- targetRef.current = node;
9183
- refresh();
9184
- }, [open]);
9185
- const [ref, bounds] = useMeasure({
9186
- debounce: 120, // waits until modal transition has finished before measuring
9187
- offsetSize: true,
9188
- scroll: true,
9189
- });
9190
- const refresh = () => {
9191
- if (!targetRef.current ||
9192
- bounds.top +
9193
- bounds.bottom +
9194
- bounds.left +
9195
- bounds.right +
9196
- bounds.height +
9197
- bounds.width ===
9198
- 0) {
9199
- return;
9200
- }
9201
- let x = bounds.left + offsetX;
9202
- let y = bounds.top + bounds.height + offsetY;
9203
- targetRef.current.style.left = `${x}px`;
9204
- targetRef.current.style.top = `${y}px`;
9205
- /*
9206
- const contentRect = targetRef.current.getBoundingClientRect();
9207
-
9208
- const w = contentRect.width;
9209
- const h = contentRect.height;
9210
-
9211
- if (x + w > window.innerWidth) {
9212
- x = bounds.left + bounds.width - contentRect.width - offsetX;
9213
- }
9214
- if (y + h > window.innerHeight - 24) {
9215
- y = bounds.top - contentRect.height - offsetY;
9216
- }
9217
-
9218
- setOffset({
9219
- x: x,
9220
- y: y,
9221
- });
9222
- */
9223
- };
9224
- const useIsomorphicLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
9225
- useIsomorphicLayoutEffect(refresh, [targetRef.current, bounds, open]);
9226
- useEffect(refresh, [open, targetRef.current]);
9227
- const onScroll = onClose;
9228
- const onResize = onClose;
9229
- useEffect(() => {
9230
- refresh();
9231
- window.addEventListener("scroll", onScroll);
9232
- window.addEventListener("resize", onResize);
9233
- return () => {
9234
- window.removeEventListener("scroll", onScroll);
9235
- window.removeEventListener("resize", onResize);
9236
- };
9237
- }, []);
9238
- 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: {
9239
- left: offset.x,
9240
- top: offset.y,
9241
- }, initial: "collapsed", animate: "open", exit: "collapsed", variants: {
9242
- collapsed: {
9243
- transformOrigin: "0 0",
9244
- opacity: 0,
9245
- scale: 0.96,
9246
- z: 0.01,
9247
- y: -4,
9248
- x: 0,
9249
- transition: {
9250
- duration: 0.1,
9251
- },
9252
- },
9253
- open: {
9254
- transformOrigin: "0 0",
9255
- willChange: "opacity,transform",
9256
- opacity: 1,
9257
- scale: 1,
9258
- z: 0.01,
9259
- y: 0,
9260
- x: 0,
9261
- transition: {
9262
- ease: [0.76, 0, 0.24, 1],
9263
- duration: 0.15,
9264
- },
9265
- },
9266
- }, children: [jsx(DropdownHeading, { children: locales.switchNetworks }), jsx(ChainSelectList, {})] })] }) }) }) })) })] }));
9267
- };
9268
-
9269
- const Container$3 = styled(motion.div) ``;
9270
- const SwitchChainButton = styled(motion.button) `
9271
- --color: var(
9272
- --ck-dropdown-button-color,
9273
- var(--ck-button-primary-color, var(--ck-body-color))
9274
- );
9275
- --background: var(
9276
- --ck-dropdown-button-background,
9277
- var(--ck-secondary-button-background, var(--ck-body-background-secondary))
9278
- );
9279
- --box-shadow: var(
9280
- --ck-dropdown-button-box-shadow,
9281
- var(
9282
- --ck-secondary-button-box-shadow,
9283
- var(--ck-button-primary-box-shadow),
9284
- none
9285
- )
9286
- );
9287
-
9288
- --hover-color: var(--ck-dropdown-button-hover-color, var(--color));
9289
- --hover-background: var(
9290
- --ck-dropdown-button-hover-background,
9291
- var(--background)
9292
- );
9293
- --hover-box-shadow: var(
9294
- --ck-dropdown-button-hover-box-shadow,
9295
- var(--box-shadow)
9296
- );
9297
-
9298
- --active-color: var(--ck-dropdown-button-active-color, var(--hover-color));
9299
- --active-background: var(
9300
- --ck-dropdown-button-active-background,
9301
- var(--hover-background)
9302
- );
9303
- --active-box-shadow: var(
9304
- --ck-dropdown-button-active-box-shadow,
9305
- var(--hover-box-shadow)
9306
- );
9307
-
9308
- appearance: none;
9309
- user-select: none;
9310
- position: relative;
9311
- display: flex;
9312
- align-items: center;
9313
- justify-content: space-between;
9314
- border-radius: 15px;
9315
- width: 52px;
9316
- height: 30px;
9317
- padding: 2px 6px 2px 3px;
9318
- font-size: 16px;
9319
- line-height: 19px;
9320
- font-weight: 500;
9321
- text-decoration: none;
9322
- white-space: nowrap;
9323
- transform: translateZ(0px);
9324
-
9325
- transition: 100ms ease;
9326
- transition-property: transform, background-color, box-shadow, color;
9327
-
9328
- color: var(--color);
9329
- background: var(--background);
9330
- box-shadow: var(--box-shadow);
9331
-
9332
- svg {
9333
- position: relative;
9334
- display: block;
9335
- }
9336
-
9337
- ${(props) => props.disabled
9338
- ? css `
9339
- width: auto;
9340
- padding: 3px;
9341
- position: relative;
9342
- left: -22px;
9343
- `
9344
- : css `
9345
- cursor: pointer;
9346
-
9347
- @media only screen and (min-width: ${defaultTheme.mobileWidth +
9348
- 1}px) {
9349
- &:hover,
9350
- &:focus-visible {
9351
- color: var(--hover-color);
9352
- background: var(--hover-background);
9353
- box-shadow: var(--hover-box-shadow);
9354
- }
9355
- &:active {
9356
- color: var(--active-color);
9357
- background: var(--active-background);
9358
- box-shadow: var(--active-box-shadow);
9359
- }
9360
- }
9361
- `}
9362
- `;
9363
- 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" }) }));
9364
- const ChainSelector = () => {
9365
- const context = useContext();
9366
- const [isOpen, setIsOpen] = useState(false);
9367
- const { chain } = useAccount();
9368
- const { chains } = useSwitchChain();
9369
- const locales = useLocales({
9370
- CHAIN: chain?.name,
9371
- });
9372
- const mobile = isMobile() || window?.innerWidth < defaultTheme.mobileWidth;
9373
- useEffect(() => {
9374
- if (!context.open)
9375
- setIsOpen(false);
9376
- }, [context.open]);
9377
- const disabled = chains.length <= 1;
9378
- 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: () => {
9379
- if (mobile) {
9380
- context.setRoute(ROUTES.SWITCHNETWORKS);
9381
- }
9382
- else {
9383
- setIsOpen(!isOpen);
9384
- }
9385
- }, 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 } })] }) }) }) }));
9386
- };
9387
-
9388
- const Profile = ({ closeModal }) => {
9389
- const context = useContext();
9390
- const themeContext = useThemeContext();
9391
- const locales = useLocales();
9392
- const { reset } = useConnect$1();
9393
- const { disconnect } = useDisconnect();
9394
- const { address, isConnected, connector, chain } = useAccount();
9395
- const ensFallbackConfig = useEnsFallbackConfig();
9396
- const { data: ensName } = useEnsName({
9397
- chainId: 1,
9398
- address: address,
9399
- config: ensFallbackConfig,
9400
- });
9401
- const { data: balance } = useBalance({
9402
- address,
9403
- //watch: true,
9404
- });
9405
- const [shouldDisconnect, setShouldDisconnect] = useState(false);
9406
- useEffect(() => {
9407
- if (!isConnected)
9408
- context.setOpen(false);
9409
- }, [isConnected]);
9410
- useEffect(() => {
9411
- if (!shouldDisconnect)
9412
- return;
9413
- // Close before disconnecting to avoid layout shifting while modal is still open
9414
- if (closeModal) {
9415
- closeModal();
9416
- }
9417
- else {
9418
- context.setOpen(false);
9419
- }
9420
- return () => {
9421
- disconnect();
9422
- reset();
9423
- };
9424
- }, [shouldDisconnect, disconnect, reset]);
9425
- const separator = ["web95", "rounded", "minimal"].includes(themeContext.theme ?? context.theme ?? "")
9426
- ? "...."
9427
- : undefined;
9428
- 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 }))] }));
8863
+ ? "var(--ck-dropdown-active-color, inherit)"
8864
+ : "inherit",
8865
+ }, children: [jsxs(ChainLogoContainer$1, { children: [jsx(ChainLogoSpinner, { initial: { opacity: 0 }, animate: {
8866
+ opacity: isPending && pendingChainId === ch.id ? 1 : 0,
8867
+ }, transition: {
8868
+ ease: [0.76, 0, 0.24, 1],
8869
+ duration: 0.15,
8870
+ delay: 0.1,
8871
+ }, children: jsx(motion.div, { animate:
8872
+ // UI fix for Coinbase Wallet on mobile does not remove isPending on rejection event
8873
+ mobile &&
8874
+ isCoinbaseWalletConnector(connector?.id) &&
8875
+ isPending &&
8876
+ pendingChainId === ch.id
8877
+ ? {
8878
+ opacity: [1, 0],
8879
+ transition: { delay: 4, duration: 3 },
8880
+ }
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: {
8882
+ color: "var(--ck-dropdown-active-color, var(--ck-focus-color))",
8883
+ display: "block",
8884
+ position: "relative",
8885
+ }, initial: { opacity: 0, x: -4 }, animate: { opacity: 1, x: 0 }, exit: {
8886
+ opacity: 0,
8887
+ x: 4,
8888
+ transition: { duration: 0.1, delay: 0 },
8889
+ }, transition: {
8890
+ ease: [0.76, 0, 0.24, 1],
8891
+ duration: 0.3,
8892
+ delay: 0.2,
8893
+ }, children: locales.connected }, "connectedText")), isPending && pendingChainId === ch.id && (jsx(motion.span, { style: {
8894
+ color: "var(--ck-dropdown-pending-color, inherit)",
8895
+ display: "block",
8896
+ position: "relative",
8897
+ }, initial: {
8898
+ opacity: 0,
8899
+ x: -4,
8900
+ }, animate: { opacity: 1, x: 0 }, exit: { opacity: 0, x: 4 }, transition: {
8901
+ ease: [0.76, 0, 0.24, 1],
8902
+ duration: 0.3,
8903
+ delay: 0.1,
8904
+ }, children: jsx(motion.span, { animate:
8905
+ // UI fix for Coinbase Wallet on mobile does not remove isLoading on rejection event
8906
+ mobile &&
8907
+ isCoinbaseWalletConnector(connector?.id) && {
8908
+ opacity: [1, 0],
8909
+ transition: { delay: 4, duration: 4 },
8910
+ }, children: locales.approveInWallet }) }, "approveText"))] }) })), variant === "secondary" ? (jsx(ChainButtonBg, { initial: false, animate: {
8911
+ opacity: ch.id === chain?.id ? 1 : 0,
8912
+ }, transition: {
8913
+ duration: 0.3,
8914
+ ease: "easeOut",
8915
+ } })) : (
8916
+ //hover === ch.name && (
8917
+ ch.id === chain?.id && (jsx(ChainButtonBg, { layoutId: "activeChain", layout: "position", transition: {
8918
+ duration: 0.3,
8919
+ ease: "easeOut",
8920
+ } })))] }, `${ch?.id}-${ch?.name}`));
8921
+ }) }) }), jsx(AnimatePresence, { children: isError && (jsx(motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: {
8922
+ ease: [0.76, 0, 0.24, 1],
8923
+ duration: 0.3,
8924
+ }, onAnimationStart: triggerResize, onAnimationComplete: triggerResize, children: jsx("div", { style: { paddingTop: 10, paddingBottom: 8 }, children: jsxs(Alert, { children: [locales.warnings_walletSwitchingUnsupported, " ", locales.warnings_walletSwitchingUnsupportedResolve] }) }) })) })] }));
9429
8925
  };
9430
8926
 
9431
8927
  const SwitchNetworks = () => {
@@ -9567,7 +9063,7 @@ const RetryIconContainer = styled(motion.div) `
9567
9063
  }
9568
9064
  `;
9569
9065
 
9570
- const LogoContainer$1 = styled(motion.div) `
9066
+ const LogoContainer$2 = styled(motion.div) `
9571
9067
  z-index: 4;
9572
9068
  position: relative;
9573
9069
  overflow: hidden;
@@ -9597,7 +9093,7 @@ const SpinnerContainer$1 = styled(motion.div) `
9597
9093
  inset: 1px;
9598
9094
  overflow: hidden;
9599
9095
  `;
9600
- const Spinner$2 = styled(motion.div) `
9096
+ const Spinner$3 = styled(motion.div) `
9601
9097
  pointer-events: none;
9602
9098
  user-select: none;
9603
9099
  z-index: 1;
@@ -9628,8 +9124,8 @@ const Spinner$2 = styled(motion.div) `
9628
9124
  }
9629
9125
  `;
9630
9126
 
9631
- const SquircleSpinner = ({ logo, connecting = true, }) => {
9632
- 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: connecting && (jsx(Spinner$2, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: {
9127
+ const SquircleSpinner = ({ logo, loading = true, }) => {
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: {
9633
9129
  opacity: 0,
9634
9130
  transition: {
9635
9131
  duration: 0,
@@ -9681,7 +9177,7 @@ const BrowserIcon = React.forwardRef(({ browser }, ref) => {
9681
9177
  });
9682
9178
  BrowserIcon.displayName = "BrowserIcon";
9683
9179
 
9684
- const LogoContainer = styled(motion.div) `
9180
+ const LogoContainer$1 = styled(motion.div) `
9685
9181
  z-index: 4;
9686
9182
  position: relative;
9687
9183
  width: 100px;
@@ -9768,7 +9264,7 @@ const ExpiringSpinner = styled(motion.div) `
9768
9264
  }
9769
9265
  }
9770
9266
  `;
9771
- const Spinner$1 = styled(motion.div) `
9267
+ const Spinner$2 = styled(motion.div) `
9772
9268
  pointer-events: none;
9773
9269
  user-select: none;
9774
9270
  z-index: 1;
@@ -9793,8 +9289,8 @@ const Spinner$1 = styled(motion.div) `
9793
9289
  }
9794
9290
  `;
9795
9291
 
9796
- const CircleSpinner = ({ logo, smallLogo, connecting = true, unavailable = false, countdown = false, }) => {
9797
- 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: [connecting && (jsx(Spinner$1, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: {
9292
+ const CircleSpinner = ({ logo, smallLogo, loading = true, unavailable = false, countdown = false, }) => {
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: {
9798
9294
  opacity: 0,
9799
9295
  transition: {
9800
9296
  duration: countdown ? 1 : 0,
@@ -9973,11 +9469,11 @@ const ConnectWithInjector = ({ switchConnectMethod, forceState }) => {
9973
9469
  transform: "scale(1.14)",
9974
9470
  position: "relative",
9975
9471
  width: "100%",
9976
- }, children: walletInfo.icon })) : (jsx(Fragment, { children: walletInfo.icon })), smallLogo: walletInfo.iconShouldShrink, connecting: status === states$1.CONNECTING, unavailable: status === states$1.UNAVAILABLE })) : (jsx(SquircleSpinner, { logo: status === states$1.UNAVAILABLE ? (jsx("div", { style: {
9472
+ }, children: walletInfo.icon })) : (jsx(Fragment, { children: walletInfo.icon })), smallLogo: walletInfo.iconShouldShrink, loading: status === states$1.CONNECTING, unavailable: status === states$1.UNAVAILABLE })) : (jsx(SquircleSpinner, { logo: status === states$1.UNAVAILABLE ? (jsx("div", { style: {
9977
9473
  transform: "scale(1.14)",
9978
9474
  position: "relative",
9979
9475
  width: "100%",
9980
- }, children: walletInfo.icon })) : (jsx(Fragment, { children: walletInfo.icon })), connecting: status === states$1.CONNECTING }))] }) }), jsx(ModalContentContainer, { children: jsxs(AnimatePresence, { initial: false, children: [status === states$1.FAILED && (jsx(Content, { initial: "initial", animate: "animate", exit: "exit", variants: contentVariants$1, children: jsxs(ModalContent, { children: [jsxs(ModalH1, { "$error": true, children: [jsx(AlertIcon, {}), locales.injectionScreen_failed_h1] }), jsx(ModalBody, { children: locales.injectionScreen_failed_p })] }) }, states$1.FAILED)), status === states$1.REJECTED && (jsx(Content, { initial: "initial", animate: "animate", exit: "exit", variants: contentVariants$1, children: jsxs(ModalContent, { style: { paddingBottom: 28 }, children: [jsx(ModalH1, { children: locales.injectionScreen_rejected_h1 }), jsx(ModalBody, { children: locales.injectionScreen_rejected_p })] }) }, states$1.REJECTED)), (status === states$1.CONNECTING || status === states$1.EXPIRING) && (jsx(Content, { initial: "initial", animate: "animate", exit: "exit", variants: contentVariants$1, children: jsxs(ModalContent, { style: { paddingBottom: 28 }, children: [jsx(ModalH1, { children: wallet.connector.id === "injected"
9476
+ }, children: walletInfo.icon })) : (jsx(Fragment, { children: walletInfo.icon })), loading: status === states$1.CONNECTING }))] }) }), jsx(ModalContentContainer, { children: jsxs(AnimatePresence, { initial: false, children: [status === states$1.FAILED && (jsx(Content, { initial: "initial", animate: "animate", exit: "exit", variants: contentVariants$1, children: jsxs(ModalContent, { children: [jsxs(ModalH1, { "$error": true, children: [jsx(AlertIcon, {}), locales.injectionScreen_failed_h1] }), jsx(ModalBody, { children: locales.injectionScreen_failed_p })] }) }, states$1.FAILED)), status === states$1.REJECTED && (jsx(Content, { initial: "initial", animate: "animate", exit: "exit", variants: contentVariants$1, children: jsxs(ModalContent, { style: { paddingBottom: 28 }, children: [jsx(ModalH1, { children: locales.injectionScreen_rejected_h1 }), jsx(ModalBody, { children: locales.injectionScreen_rejected_p })] }) }, states$1.REJECTED)), (status === states$1.CONNECTING || status === states$1.EXPIRING) && (jsx(Content, { initial: "initial", animate: "animate", exit: "exit", variants: contentVariants$1, children: jsxs(ModalContent, { style: { paddingBottom: 28 }, children: [jsx(ModalH1, { children: wallet.connector.id === "injected"
9981
9477
  ? locales.injectionScreen_connecting_injected_h1
9982
9478
  : locales.injectionScreen_connecting_h1 }), jsx(ModalBody, { children: wallet.connector.id === "injected"
9983
9479
  ? locales.injectionScreen_connecting_injected_p
@@ -10178,9 +9674,9 @@ const Confirmation = () => {
10178
9674
  justifyContent: "center",
10179
9675
  alignItems: "center",
10180
9676
  paddingBottom: 0,
10181
- }, children: [jsx(AnimationContainer$2, { 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, {})] }) }));
10182
9678
  };
10183
- const AnimationContainer$2 = styled(motion.div) `
9679
+ const AnimationContainer$4 = styled(motion.div) `
10184
9680
  position: relative;
10185
9681
  width: 100px;
10186
9682
  height: 100px;
@@ -10219,7 +9715,7 @@ const SuccessIcon = styled(TickIcon) `
10219
9715
  opacity: ${(props) => (props.$status ? 1 : 0)};
10220
9716
  transform: ${(props) => (props.$status ? "scale(1)" : "scale(0.5)")};
10221
9717
  `;
10222
- const Spinner = styled(LoadingCircleIcon) `
9718
+ const Spinner$1 = styled(LoadingCircleIcon) `
10223
9719
  position: absolute;
10224
9720
  transition: all 0.2s ease-in-out;
10225
9721
  animation: rotateSpinner 400ms linear infinite;
@@ -10236,17 +9732,17 @@ const Spinner = styled(LoadingCircleIcon) `
10236
9732
  }
10237
9733
  `;
10238
9734
 
10239
- var PayState;
9735
+ var PayState$1;
10240
9736
  (function (PayState) {
10241
9737
  PayState["RequestingPayment"] = "Requesting Payment";
10242
9738
  PayState["SwitchingChain"] = "Switching Chain";
10243
9739
  PayState["RequestCancelled"] = "Payment Cancelled";
10244
9740
  PayState["RequestSuccessful"] = "Payment Successful";
10245
- })(PayState || (PayState = {}));
9741
+ })(PayState$1 || (PayState$1 = {}));
10246
9742
  const PayWithToken = () => {
10247
9743
  const { triggerResize, paymentInfo, setRoute, log } = useContext();
10248
9744
  const { selectedTokenOption, payWithToken } = paymentInfo;
10249
- const [payState, setPayState] = useState(PayState.RequestingPayment);
9745
+ const [payState, setPayState] = useState(PayState$1.RequestingPayment);
10250
9746
  const walletChainId = useChainId();
10251
9747
  const { switchChainAsync } = useSwitchChain();
10252
9748
  const trySwitchingChain = async (option, forceSwitch = false) => {
@@ -10270,17 +9766,17 @@ const PayWithToken = () => {
10270
9766
  };
10271
9767
  const handleTransfer = async (option) => {
10272
9768
  // Switch chain if necessary
10273
- setPayState(PayState.SwitchingChain);
9769
+ setPayState(PayState$1.SwitchingChain);
10274
9770
  const switchChain = await trySwitchingChain(option);
10275
9771
  if (!switchChain) {
10276
9772
  console.error("Switching chain failed");
10277
- setPayState(PayState.RequestCancelled);
9773
+ setPayState(PayState$1.RequestCancelled);
10278
9774
  return;
10279
9775
  }
10280
- setPayState(PayState.RequestingPayment);
9776
+ setPayState(PayState$1.RequestingPayment);
10281
9777
  try {
10282
9778
  await payWithToken(option.required);
10283
- setPayState(PayState.RequestSuccessful);
9779
+ setPayState(PayState$1.RequestSuccessful);
10284
9780
  setTimeout(() => {
10285
9781
  setRoute(ROUTES.CONFIRMATION);
10286
9782
  }, 200);
@@ -10302,7 +9798,7 @@ const PayWithToken = () => {
10302
9798
  }
10303
9799
  }
10304
9800
  }
10305
- setPayState(PayState.RequestCancelled);
9801
+ setPayState(PayState$1.RequestCancelled);
10306
9802
  console.error("Failed to pay with token", e);
10307
9803
  }
10308
9804
  };
@@ -10321,17 +9817,17 @@ const PayWithToken = () => {
10321
9817
  useEffect(() => {
10322
9818
  triggerResize();
10323
9819
  }, [payState]);
10324
- return (jsxs(PageContent, { children: [jsx(LoadingContainer$1, { children: jsx(AnimationContainer$1, { "$circle": true, children: jsxs(AnimatePresence, { children: [jsx(ChainLogoContainer, { children: selectedTokenOption &&
10325
- 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), connecting: true, unavailable: false }, "CircleSpinner")] }) }) }), jsxs(ModalContent, { style: { paddingBottom: 0 }, children: [jsx(ModalH1, { children: payState }), payState === PayState.RequestCancelled && (jsx(Button, { onClick: () => selectedTokenOption ? handleTransfer(selectedTokenOption) : null, children: "Retry Payment" }))] })] }));
9820
+ return (jsxs(PageContent, { children: [jsx(LoadingContainer$3, { children: jsx(AnimationContainer$3, { "$circle": true, children: jsxs(AnimatePresence, { children: [jsx(ChainLogoContainer, { children: selectedTokenOption &&
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" }))] })] }));
10326
9822
  };
10327
- const LoadingContainer$1 = styled(motion.div) `
9823
+ const LoadingContainer$3 = styled(motion.div) `
10328
9824
  display: flex;
10329
9825
  align-items: center;
10330
9826
  justify-content: center;
10331
9827
  margin: 10px auto 16px;
10332
9828
  height: 120px;
10333
9829
  `;
10334
- const AnimationContainer$1 = styled(motion.div) `
9830
+ const AnimationContainer$3 = styled(motion.div) `
10335
9831
  user-select: none;
10336
9832
  position: relative;
10337
9833
  --spinner-error-opacity: 0;
@@ -10641,6 +10137,29 @@ const IconStackItem = styled(motion.div) `
10641
10137
  border-radius: 22.5%;
10642
10138
  `;
10643
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
+
10644
10163
  // Get 3 icons, skipping the one that is already connected
10645
10164
  function getBestUnconnectedWalletIcons(connector) {
10646
10165
  const icons = [];
@@ -10660,12 +10179,42 @@ function getBestUnconnectedWalletIcons(connector) {
10660
10179
  icons.push(jsx(Rabby, {}));
10661
10180
  return icons;
10662
10181
  }
10182
+ function getSolanaOption() {
10183
+ const { wallets } = useWallet$1();
10184
+ const { setRoute } = useContext();
10185
+ if (wallets.length === 0)
10186
+ return null;
10187
+ return {
10188
+ id: "solana",
10189
+ title: "Pay on Solana",
10190
+ icons: [jsx(Solana, {})],
10191
+ onClick: () => {
10192
+ setRoute(ROUTES.SOLANA_CONNECT);
10193
+ },
10194
+ };
10195
+ }
10196
+ function getDepositAddressOption(depositAddressOptions) {
10197
+ const { setRoute } = useContext();
10198
+ console.log(`[SELECT_METHOD] depositAddressOptions: ${JSON.stringify(depositAddressOptions)}`);
10199
+ if (!depositAddressOptions.loading &&
10200
+ depositAddressOptions.options.length === 0)
10201
+ return null;
10202
+ return {
10203
+ id: "depositAddress",
10204
+ title: "Pay on another chain",
10205
+ subtitle: "Bitcoin, Tron, Zcash...",
10206
+ icons: [jsx(Bitcoin, {}), jsx(Tron, {}), jsx(Zcash, {})],
10207
+ onClick: () => {
10208
+ setRoute(ROUTES.SELECT_DEPOSIT_ADDRESS_CHAIN);
10209
+ },
10210
+ };
10211
+ }
10663
10212
  const SelectMethod = () => {
10664
10213
  const isMobile = useIsMobile();
10665
10214
  const { address, isConnected, connector } = useAccount();
10666
10215
  const { disconnectAsync } = useDisconnect();
10667
10216
  const { setRoute, paymentInfo, log } = useContext();
10668
- const { setSelectedExternalOption, externalPaymentOptions, senderEnsName } = paymentInfo;
10217
+ const { setSelectedExternalOption, externalPaymentOptions, depositAddressOptions, senderEnsName, } = paymentInfo;
10669
10218
  const displayName = senderEnsName ?? (address ? getAddressContraction(address) : "wallet");
10670
10219
  const connectedWalletOption = isConnected
10671
10220
  ? {
@@ -10690,31 +10239,36 @@ const SelectMethod = () => {
10690
10239
  ? [connectedWalletOption, unconnectedWalletOption]
10691
10240
  : [unconnectedWalletOption];
10692
10241
  log(`[SELECT_METHOD] loading: ${externalPaymentOptions.loading}, options: ${JSON.stringify(externalPaymentOptions.options)}`);
10693
- return (jsxs(PageContent, { children: [jsx(OrderHeader, {}), jsx(OptionsList, { requiredSkeletons: isMobile ? 4 : 3, isLoading: externalPaymentOptions.loading, options: [
10694
- ...walletOptions,
10695
- ...(externalPaymentOptions.options ?? []).map((option) => ({
10696
- id: option.id,
10697
- title: option.cta,
10698
- icons: [option.logoURI],
10699
- onClick: () => {
10700
- setSelectedExternalOption(option);
10701
- setRoute(ROUTES.WAITING_OTHER);
10702
- },
10703
- })),
10704
- ] }), jsx(PoweredByFooter, {})] }));
10242
+ const solanaOption = getSolanaOption();
10243
+ const depositAddressOption = getDepositAddressOption(depositAddressOptions);
10244
+ const options = [
10245
+ ...walletOptions,
10246
+ ...(solanaOption ? [solanaOption] : []),
10247
+ ...(externalPaymentOptions.options ?? []).map((option) => ({
10248
+ id: option.id,
10249
+ title: option.cta,
10250
+ icons: [option.logoURI],
10251
+ onClick: () => {
10252
+ setSelectedExternalOption(option);
10253
+ setRoute(ROUTES.WAITING_OTHER);
10254
+ },
10255
+ })),
10256
+ ...(depositAddressOption ? [depositAddressOption] : []),
10257
+ ];
10258
+ return (jsxs(PageContent, { children: [jsx(OrderHeader, {}), jsx(OptionsList, { requiredSkeletons: isMobile ? 4 : 3, isLoading: externalPaymentOptions.loading, options: externalPaymentOptions.loading ? [] : options }), jsx(PoweredByFooter, {})] }));
10705
10259
  };
10706
10260
 
10707
10261
  function getDaimoTokenKey(token) {
10708
10262
  return `${token.chainId}-${token.token}`;
10709
10263
  }
10710
10264
  const TokenChainLogo = ({ token }) => {
10711
- 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] })] }));
10712
10266
  };
10713
10267
  const TokenChainContainer = styled(motion.div) `
10714
10268
  width: 100%;
10715
10269
  height: 100%;
10716
10270
  `;
10717
- const ChainContainer = styled(motion.div) `
10271
+ const ChainContainer$1 = styled(motion.div) `
10718
10272
  position: absolute;
10719
10273
  width: 16px;
10720
10274
  height: 16px;
@@ -10733,7 +10287,7 @@ const SelectToken = () => {
10733
10287
  justifyContent: "center",
10734
10288
  paddingTop: 16,
10735
10289
  paddingBottom: 16,
10736
- }, children: [jsx(ModalH1, { children: "Insufficient balance. Please select an alternative payment method." }), jsx(Button, { onClick: () => setRoute(ROUTES.SELECT_METHOD), children: "Select Another Method" })] })), jsx(OptionsList, { requiredSkeletons: 4, isLoading: walletPaymentOptions.isLoading, options: walletPaymentOptions.options?.map((option) => {
10290
+ }, children: [jsx(ModalH1, { children: "Insufficient balance." }), jsx(Button, { onClick: () => setRoute(ROUTES.SELECT_METHOD), children: "Select Another Method" })] })), jsx(OptionsList, { requiredSkeletons: 4, isLoading: walletPaymentOptions.isLoading, options: walletPaymentOptions.options?.map((option) => {
10737
10291
  const capitalizedChainName = capitalize(getChainName(option.required.token.chainId));
10738
10292
  const title = `${getDisplayPrice(option.required)} ${option.required.token.symbol} on ${capitalizedChainName}`;
10739
10293
  const subtitle = `Balance: ${getDisplayPrice(option.balance)} ${option.balance.token.symbol}`;
@@ -10789,48 +10343,243 @@ const WaitingOther = () => {
10789
10343
  }
10790
10344
  const optionSpinner = (() => {
10791
10345
  if (selectedExternalOption.logoShape === "circle") {
10792
- return (jsx(CircleSpinner, { logo: jsx("img", { src: selectedExternalOption.logoURI }), connecting: true, unavailable: false }));
10346
+ return (jsx(CircleSpinner, { logo: jsx("img", { src: selectedExternalOption.logoURI }), loading: true, unavailable: false }));
10793
10347
  }
10794
10348
  else {
10795
- return (jsx(SquircleSpinner, { logo: jsx("img", { src: selectedExternalOption.logoURI }), connecting: true }));
10349
+ return (jsx(SquircleSpinner, { logo: jsx("img", { src: selectedExternalOption.logoURI }), loading: true }));
10796
10350
  }
10797
10351
  })();
10798
- return (jsxs(PageContent, { children: [jsx(LoadingContainer, { children: jsx(AnimationContainer, { "$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: () => {
10799
10353
  if (externalURL)
10800
10354
  window.open(externalURL, "_blank");
10801
10355
  }, children: "Open in New Tab" })] })] }));
10802
10356
  };
10803
- const LoadingContainer = styled(motion.div) `
10804
- display: flex;
10805
- align-items: center;
10806
- justify-content: center;
10807
- margin: 10px auto 16px;
10808
- height: 120px;
10809
- `;
10810
- const AnimationContainer = styled(motion.div) `
10811
- user-select: none;
10812
- position: relative;
10813
- --spinner-error-opacity: 0;
10814
- &:before {
10815
- content: "";
10816
- position: absolute;
10817
- inset: 1px;
10818
- opacity: 0;
10819
- background: var(--ck-body-color-danger);
10820
- ${(props) => props.$circle &&
10821
- css `
10822
- inset: -5px;
10823
- border-radius: 50%;
10824
- background: none;
10825
- box-shadow: inset 0 0 0 3.5px var(--ck-body-color-danger);
10826
- `}
10827
- }
10828
- `;
10357
+ const LoadingContainer$2 = styled(motion.div) `
10358
+ display: flex;
10359
+ align-items: center;
10360
+ justify-content: center;
10361
+ margin: 10px auto 16px;
10362
+ height: 120px;
10363
+ `;
10364
+ const AnimationContainer$2 = styled(motion.div) `
10365
+ user-select: none;
10366
+ position: relative;
10367
+ --spinner-error-opacity: 0;
10368
+ &:before {
10369
+ content: "";
10370
+ position: absolute;
10371
+ inset: 1px;
10372
+ opacity: 0;
10373
+ background: var(--ck-body-color-danger);
10374
+ ${(props) => props.$circle &&
10375
+ css `
10376
+ inset: -5px;
10377
+ border-radius: 50%;
10378
+ background: none;
10379
+ box-shadow: inset 0 0 0 3.5px var(--ck-body-color-danger);
10380
+ `}
10381
+ }
10382
+ `;
10383
+
10384
+ const ConnectSolana$1 = () => {
10385
+ const solanaWallets = useWallet$1();
10386
+ const isConnected = solanaWallets.connected;
10387
+ const { solanaConnector, setRoute } = useContext();
10388
+ const selectedWallet = solanaWallets.wallets.find((wallet) => wallet.adapter.name === solanaConnector);
10389
+ useEffect(() => {
10390
+ if (!solanaConnector)
10391
+ return;
10392
+ solanaWallets.select(solanaConnector);
10393
+ }, [solanaConnector]);
10394
+ useEffect(() => {
10395
+ if (isConnected) {
10396
+ // Wait so user can see it's connected
10397
+ setTimeout(() => setRoute(ROUTES.SOLANA_SELECT_TOKEN), 500);
10398
+ }
10399
+ }, [isConnected]);
10400
+ if (!solanaConnector)
10401
+ return null;
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."] })] })) })] }));
10403
+ };
10404
+ const AnimationContainer$1 = styled(motion.div) `
10405
+ user-select: none;
10406
+ position: relative;
10407
+ --spinner-error-opacity: 0;
10408
+ &:before {
10409
+ content: "";
10410
+ position: absolute;
10411
+ inset: 1px;
10412
+ opacity: 0;
10413
+ background: var(--ck-body-color-danger);
10414
+ }
10415
+ `;
10416
+
10417
+ const ConnectSolana = () => {
10418
+ const { setSolanaConnector, setRoute } = useContext();
10419
+ const solanaWallets = useWallet$1();
10420
+ const options = solanaWallets.wallets.map((wallet) => ({
10421
+ id: wallet.adapter.name,
10422
+ title: `${wallet.adapter.name}`,
10423
+ icons: [
10424
+ jsx(SquircleIcon, { icon: wallet.adapter.icon, alt: wallet.adapter.name }),
10425
+ ],
10426
+ onClick: async () => {
10427
+ setSolanaConnector(wallet.adapter.name);
10428
+ if (solanaWallets.connected) {
10429
+ await solanaWallets.disconnect();
10430
+ }
10431
+ setRoute(ROUTES.SOLANA_CONNECTOR);
10432
+ },
10433
+ }));
10434
+ return (jsxs(PageContent, { children: [jsx(OrderHeader, { minified: true }), solanaWallets.wallets.length === 0 && (jsxs(ModalContent, { style: {
10435
+ display: "flex",
10436
+ alignItems: "center",
10437
+ justifyContent: "center",
10438
+ paddingTop: 16,
10439
+ paddingBottom: 16,
10440
+ }, children: [jsx(ModalH1, { children: "No Solana wallets detected." }), jsx(Button, { onClick: () => setRoute(ROUTES.SELECT_METHOD), children: "Select Another Method" })] })), jsx(OptionsList, { options: options })] }));
10441
+ };
10442
+ const SquircleIcon = ({ icon, alt }) => (jsx("div", { style: { borderRadius: "22.5%", overflow: "hidden" }, children: jsx("img", { src: icon, alt: alt }) }));
10443
+
10444
+ var PayState;
10445
+ (function (PayState) {
10446
+ PayState["RequestingPayment"] = "Requesting Payment";
10447
+ PayState["RequestCancelled"] = "Payment Cancelled";
10448
+ PayState["RequestFailed"] = "Payment Failed";
10449
+ PayState["RequestSuccessful"] = "Payment Successful";
10450
+ })(PayState || (PayState = {}));
10451
+ const PayWithSolanaToken = () => {
10452
+ const { triggerResize, paymentInfo, setRoute } = useContext();
10453
+ const { selectedSolanaTokenOption, payWithSolanaToken } = paymentInfo;
10454
+ const [payState, setPayState] = useState(PayState.RequestingPayment);
10455
+ const handleTransfer = async () => {
10456
+ try {
10457
+ setPayState(PayState.RequestingPayment);
10458
+ assert(!!selectedSolanaTokenOption, "No token option selected");
10459
+ await payWithSolanaToken(selectedSolanaTokenOption.required.token.token);
10460
+ setPayState(PayState.RequestSuccessful);
10461
+ setTimeout(() => {
10462
+ setRoute(ROUTES.CONFIRMATION);
10463
+ }, 200);
10464
+ }
10465
+ catch (error) {
10466
+ console.error(error);
10467
+ if (error instanceof WalletSignTransactionError) {
10468
+ setPayState(PayState.RequestCancelled);
10469
+ }
10470
+ else {
10471
+ setPayState(PayState.RequestFailed);
10472
+ }
10473
+ }
10474
+ };
10475
+ let transferTimeout; // Prevent double-triggering in React dev strict mode.
10476
+ useEffect(() => {
10477
+ if (!selectedSolanaTokenOption)
10478
+ return;
10479
+ // Give user time to see the UI before opening
10480
+ transferTimeout = setTimeout(handleTransfer, 100);
10481
+ return () => clearTimeout(transferTimeout);
10482
+ }, []);
10483
+ useEffect(() => {
10484
+ triggerResize();
10485
+ }, [payState]);
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" }))] })] }));
10487
+ };
10488
+ const LoadingContainer$1 = styled(motion.div) `
10489
+ display: flex;
10490
+ align-items: center;
10491
+ justify-content: center;
10492
+ margin: 10px auto 16px;
10493
+ height: 120px;
10494
+ `;
10495
+ const AnimationContainer = styled(motion.div) `
10496
+ user-select: none;
10497
+ position: relative;
10498
+ --spinner-error-opacity: 0;
10499
+ &:before {
10500
+ content: "";
10501
+ position: absolute;
10502
+ inset: 1px;
10503
+ opacity: 0;
10504
+ background: var(--ck-body-color-danger);
10505
+ ${(props) => props.$circle &&
10506
+ css `
10507
+ inset: -5px;
10508
+ border-radius: 50%;
10509
+ background: none;
10510
+ box-shadow: inset 0 0 0 3.5px var(--ck-body-color-danger);
10511
+ `}
10512
+ }
10513
+ `;
10514
+
10515
+ const SelectSolanaToken = () => {
10516
+ const { paymentInfo, setRoute } = useContext();
10517
+ const { solanaPaymentOptions, setSelectedSolanaTokenOption } = paymentInfo;
10518
+ return (jsxs(PageContent, { children: [jsx(OrderHeader, { minified: true }), !solanaPaymentOptions.isLoading &&
10519
+ solanaPaymentOptions.options?.length === 0 && (jsxs(ModalContent, { style: {
10520
+ display: "flex",
10521
+ alignItems: "center",
10522
+ justifyContent: "center",
10523
+ paddingTop: 16,
10524
+ paddingBottom: 16,
10525
+ }, children: [jsx(ModalH1, { children: "Insufficient balance." }), jsx(Button, { onClick: () => setRoute(ROUTES.SELECT_METHOD), children: "Select Another Method" })] })), jsx(OptionsList, { requiredSkeletons: 4, isLoading: solanaPaymentOptions.isLoading, options: solanaPaymentOptions.options?.map((option) => {
10526
+ const title = `${getDisplayPrice(option.required)} ${option.required.token.symbol}`;
10527
+ const subtitle = `Balance: ${getDisplayPrice(option.balance)} ${option.balance.token.symbol}`;
10528
+ return {
10529
+ id: `${option.required.token.token}-${option.required.token.symbol}`,
10530
+ title,
10531
+ subtitle,
10532
+ icons: [
10533
+ jsx("img", { src: option.required.token.logoURI, alt: option.required.token.symbol, style: { borderRadius: 9999 } }),
10534
+ ],
10535
+ onClick: () => {
10536
+ setSelectedSolanaTokenOption(option);
10537
+ setRoute(ROUTES.SOLANA_PAY_WITH_TOKEN);
10538
+ },
10539
+ };
10540
+ }) ?? [] })] }));
10541
+ };
10542
+
10543
+ const WaitingDepositAddress = () => {
10544
+ const { triggerResize, paymentInfo, setRoute } = useContext();
10545
+ const { daimoPayOrder, payWithDepositAddress, selectedDepositAddressOption } = paymentInfo;
10546
+ useEffect(() => {
10547
+ const checkForSourcePayment = async () => {
10548
+ if (!daimoPayOrder || !selectedDepositAddressOption)
10549
+ return;
10550
+ const found = await trpc.findSourcePayment.query({
10551
+ orderId: daimoPayOrder.id.toString(),
10552
+ });
10553
+ if (found) {
10554
+ setRoute(ROUTES.CONFIRMATION);
10555
+ }
10556
+ };
10557
+ // Check every 10 seconds, bitcoin takes a while
10558
+ const interval = setInterval(checkForSourcePayment, 10000);
10559
+ return () => clearInterval(interval);
10560
+ }, [daimoPayOrder?.id]);
10561
+ const [details, setDetails] = useState();
10562
+ const [failed, setFailed] = useState(false);
10563
+ useEffect(() => {
10564
+ if (!selectedDepositAddressOption)
10565
+ return;
10566
+ payWithDepositAddress(selectedDepositAddressOption.id).then((details) => {
10567
+ if (!details)
10568
+ setFailed(true);
10569
+ else
10570
+ setDetails(details);
10571
+ });
10572
+ }, [selectedDepositAddressOption]);
10573
+ useEffect(() => {
10574
+ triggerResize();
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" })] }))] })) }));
10577
+ };
10829
10578
 
10830
10579
  const customThemeDefault = {};
10831
10580
  const DaimoPayModal = ({ mode = "auto", theme = "auto", customTheme = customThemeDefault, lang = "en-US", }) => {
10832
10581
  const context = useContext();
10833
- const { setSelectedExternalOption, setSelectedTokenOption } = context.paymentInfo;
10582
+ const { setSelectedExternalOption, setSelectedTokenOption, setSelectedDepositAddressOption, setSelectedSolanaTokenOption, } = context.paymentInfo;
10834
10583
  const { isConnected, chain } = useAccount();
10835
10584
  const chainIsSupported = useChainIsSupported(chain?.id);
10836
10585
  //if chain is unsupported we enforce a "switch chain" prompt
@@ -10838,15 +10587,10 @@ const DaimoPayModal = ({ mode = "auto", theme = "auto", customTheme = customThem
10838
10587
  isConnected &&
10839
10588
  !chainIsSupported);
10840
10589
  const showBackButton = closeable &&
10841
- context.route !== ROUTES.PROFILE &&
10842
10590
  context.route !== ROUTES.SELECT_METHOD &&
10843
10591
  context.route !== ROUTES.CONFIRMATION;
10844
- closeable && context.route !== ROUTES.PROFILE;
10845
10592
  const onBack = () => {
10846
- if (context.route === ROUTES.SWITCHNETWORKS) {
10847
- context.setRoute(ROUTES.PROFILE);
10848
- }
10849
- else if (context.route === ROUTES.DOWNLOAD) {
10593
+ if (context.route === ROUTES.DOWNLOAD) {
10850
10594
  context.setRoute(ROUTES.CONNECT);
10851
10595
  }
10852
10596
  else if (context.route === ROUTES.CONNECTORS) {
@@ -10866,6 +10610,14 @@ const DaimoPayModal = ({ mode = "auto", theme = "auto", customTheme = customThem
10866
10610
  else if (context.route === ROUTES.ONBOARDING) {
10867
10611
  context.setRoute(ROUTES.CONNECTORS);
10868
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
+ }
10869
10621
  else {
10870
10622
  context.setRoute(ROUTES.SELECT_METHOD);
10871
10623
  }
@@ -10874,15 +10626,20 @@ const DaimoPayModal = ({ mode = "auto", theme = "auto", customTheme = customThem
10874
10626
  daimoPaySelectMethod: jsx(SelectMethod, {}),
10875
10627
  daimoPaySelectToken: jsx(SelectToken, {}),
10876
10628
  daimoPayWaitingOther: jsx(WaitingOther, {}),
10629
+ daimoPaySelectDepositAddressChain: jsx(SelectDepositAddressChain, {}),
10630
+ daimoPayWaitingDepositAddress: jsx(WaitingDepositAddress, {}),
10877
10631
  daimoPayConfirmation: jsx(Confirmation, {}),
10878
10632
  daimoPayPayWithToken: jsx(PayWithToken, {}),
10633
+ daimoPaySolanaConnect: jsx(ConnectSolana, {}),
10634
+ daimoPaySolanaConnector: jsx(ConnectSolana$1, {}),
10635
+ daimoPaySolanaSelectToken: jsx(SelectSolanaToken, {}),
10636
+ daimoPaySolanaPayWithToken: jsx(PayWithSolanaToken, {}),
10879
10637
  onboarding: jsx(Introduction, {}),
10880
10638
  about: jsx(About, {}),
10881
10639
  download: jsx(DownloadApp, {}),
10882
10640
  connectors: jsx(Wallets, {}),
10883
10641
  mobileConnectors: jsx(MobileConnectors, {}),
10884
10642
  connect: jsx(ConnectUsing, {}),
10885
- profile: jsx(Profile, {}),
10886
10643
  switchNetworks: jsx(SwitchNetworks, {}),
10887
10644
  };
10888
10645
  function hide() {
@@ -10927,24 +10684,35 @@ const DaimoPayModal = ({ mode = "auto", theme = "auto", customTheme = customThem
10927
10684
  return (jsx(DaimoPayThemeProvider, { theme: theme, customTheme: customTheme, mode: mode, children: jsx(Modal, { open: context.open, pages: pages, pageId: context.route, onClose: closeable ? hide : undefined, onInfo: undefined, onBack: showBackButton ? onBack : undefined }) }));
10928
10685
  };
10929
10686
 
10687
+ const DEFAULT_SOLANA_RPC_URL = "https://nameless-thrilling-spring.solana-mainnet.quiknode.pro/71d5c9acbf54c7cf00584cf6fab7fc37e844415f/";
10688
+ const SolanaContextProvider = ({ children, solanaRpcUrl, }) => {
10689
+ const endpoint = solanaRpcUrl ?? DEFAULT_SOLANA_RPC_URL;
10690
+ return (jsx(ConnectionProvider, { endpoint: endpoint, children: jsx(WalletProvider, { wallets: [], autoConnect: true, children: children }) }));
10691
+ };
10692
+
10930
10693
  var ROUTES;
10931
10694
  (function (ROUTES) {
10932
10695
  ROUTES["SELECT_METHOD"] = "daimoPaySelectMethod";
10933
10696
  ROUTES["SELECT_TOKEN"] = "daimoPaySelectToken";
10934
10697
  ROUTES["WAITING_OTHER"] = "daimoPayWaitingOther";
10698
+ ROUTES["SELECT_DEPOSIT_ADDRESS_CHAIN"] = "daimoPaySelectDepositAddressChain";
10699
+ ROUTES["WAITING_DEPOSIT_ADDRESS"] = "daimoPayWaitingDepositAddress";
10935
10700
  ROUTES["PAY_WITH_TOKEN"] = "daimoPayPayWithToken";
10936
10701
  ROUTES["CONFIRMATION"] = "daimoPayConfirmation";
10702
+ ROUTES["SOLANA_CONNECT"] = "daimoPaySolanaConnect";
10703
+ ROUTES["SOLANA_CONNECTOR"] = "daimoPaySolanaConnector";
10704
+ ROUTES["SOLANA_SELECT_TOKEN"] = "daimoPaySolanaSelectToken";
10705
+ ROUTES["SOLANA_PAY_WITH_TOKEN"] = "daimoPaySolanaPayWithToken";
10937
10706
  ROUTES["ONBOARDING"] = "onboarding";
10938
10707
  ROUTES["ABOUT"] = "about";
10939
10708
  ROUTES["CONNECTORS"] = "connectors";
10940
10709
  ROUTES["MOBILECONNECTORS"] = "mobileConnectors";
10941
10710
  ROUTES["CONNECT"] = "connect";
10942
10711
  ROUTES["DOWNLOAD"] = "download";
10943
- ROUTES["PROFILE"] = "profile";
10944
10712
  ROUTES["SWITCHNETWORKS"] = "switchNetworks";
10945
10713
  })(ROUTES || (ROUTES = {}));
10946
10714
  const Context = createContext(null);
10947
- const DaimoPayProvider = ({ children, theme = "auto", mode = "auto", customTheme, options, onConnect, onDisconnect, debugMode = false, }) => {
10715
+ const DaimoPayProviderWithoutSolana = ({ children, theme = "auto", mode = "auto", customTheme, options, onConnect, onDisconnect, debugMode = false, }) => {
10948
10716
  // DaimoPayProvider must be within a WagmiProvider
10949
10717
  if (!React.useContext(WagmiContext)) {
10950
10718
  throw Error("DaimoPayProvider must be within a WagmiProvider");
@@ -10964,7 +10732,6 @@ const DaimoPayProvider = ({ children, theme = "auto", mode = "auto", customTheme
10964
10732
  throw new Error(`Daimo Pay requires chains ${REQUIRED_CHAINS.map((c) => c.name).join(", ")}. Use \`getDefaultConfig\` to automatically configure required chains.`);
10965
10733
  }
10966
10734
  }
10967
- const injectedConnector = useConnector("injected");
10968
10735
  // Default config options
10969
10736
  const defaultOptions = {
10970
10737
  language: "en-US",
@@ -11008,6 +10775,7 @@ const DaimoPayProvider = ({ children, theme = "auto", mode = "auto", customTheme
11008
10775
  const [connector, setConnector] = useState({
11009
10776
  id: "",
11010
10777
  });
10778
+ const [solanaConnector, setSolanaConnector] = useState();
11011
10779
  const [route, setRoute] = useState(ROUTES.SELECT_METHOD);
11012
10780
  const [errorMessage, setErrorMessage] = useState("");
11013
10781
  const [resize, onResize] = useState(0);
@@ -11027,13 +10795,6 @@ const DaimoPayProvider = ({ children, theme = "auto", mode = "auto", customTheme
11027
10795
  setRoute(ROUTES.SWITCHNETWORKS);
11028
10796
  }
11029
10797
  }, [isConnected, isChainSupported, chain, route, open]);
11030
- // Autoconnect to Family wallet if available
11031
- // TODO: Does this work for all injected providers?
11032
- useEffect(() => {
11033
- if (isFamily()) {
11034
- injectedConnector?.connect();
11035
- }
11036
- }, [injectedConnector]);
11037
10798
  const log = debugMode ? console.log : () => { };
11038
10799
  // PaymentInfo is a second, inner context object containing a DaimoPayOrder
11039
10800
  // plus all associated status and callbacks. In order for useContext() and
@@ -11096,6 +10857,8 @@ const DaimoPayProvider = ({ children, theme = "auto", mode = "auto", customTheme
11096
10857
  setRoute,
11097
10858
  connector,
11098
10859
  setConnector,
10860
+ solanaConnector,
10861
+ setSolanaConnector,
11099
10862
  onConnect,
11100
10863
  // Other configuration
11101
10864
  options: opts,
@@ -11119,6 +10882,9 @@ const DaimoPayProvider = ({ children, theme = "auto", mode = "auto", customTheme
11119
10882
  };
11120
10883
  return createElement(Context.Provider, { value }, jsx(Web3ContextProvider, { enabled: open, children: jsxs(ThemeProvider, { theme: defaultTheme$1, children: [children, jsx(DaimoPayModal, { lang: ckLang, theme: ckTheme, mode: mode, customTheme: ckCustomTheme })] }) }));
11121
10884
  };
10885
+ const DaimoPayProvider = (props) => {
10886
+ return (jsx(SolanaContextProvider, { solanaRpcUrl: props.solanaRpcUrl, children: jsx(DaimoPayProviderWithoutSolana, { ...props }) }));
10887
+ };
11122
10888
  const useContext = () => {
11123
10889
  const context = React.useContext(Context);
11124
10890
  if (!context)
@@ -11126,6 +10892,12 @@ const useContext = () => {
11126
10892
  return context;
11127
10893
  };
11128
10894
 
10895
+ function useIsMounted() {
10896
+ const [mounted, setMounted] = useState(false);
10897
+ useEffect(() => setMounted(true), []);
10898
+ return mounted;
10899
+ }
10900
+
11129
10901
  const TextContainer = styled(motion.div) `
11130
10902
  top: 0;
11131
10903
  bottom: 0;
@@ -11456,12 +11228,228 @@ const useModal = ({ onConnect, onDisconnect } = {}) => {
11456
11228
  // Disconnected Routes
11457
11229
  openAbout: () => gotoAndOpen(ROUTES.ABOUT),
11458
11230
  openOnboarding: () => gotoAndOpen(ROUTES.ONBOARDING),
11459
- // Connected Routes
11460
- openProfile: () => gotoAndOpen(ROUTES.PROFILE),
11461
11231
  openSwitchNetworks: () => gotoAndOpen(ROUTES.SWITCHNETWORKS),
11462
11232
  };
11463
11233
  };
11464
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
+
11465
11453
  function useDaimoPayStatus() {
11466
11454
  const { paymentInfo } = useContext();
11467
11455
  const status = (() => {
@@ -11493,5 +11481,5 @@ function useDaimoPayStatus() {
11493
11481
  return status;
11494
11482
  }
11495
11483
 
11496
- 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 };
11497
11485
  //# sourceMappingURL=index.es.js.map