@daimo/pay 0.3.13 → 0.3.14

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 (17) hide show
  1. package/build/index.es.js +443 -85
  2. package/build/index.es.js.map +1 -1
  3. package/build/packages/paykit/packages/connectkit/src/assets/chains.d.ts +6 -0
  4. package/build/packages/paykit/packages/connectkit/src/components/DaimoPay.d.ts +15 -1
  5. package/build/packages/paykit/packages/connectkit/src/components/Pages/Solana/ConnectSolana/index.d.ts +3 -0
  6. package/build/packages/paykit/packages/connectkit/src/components/Pages/Solana/ConnectorSolana/index.d.ts +3 -0
  7. package/build/packages/paykit/packages/connectkit/src/components/Pages/Solana/PayWithSolanaToken/index.d.ts +3 -0
  8. package/build/packages/paykit/packages/connectkit/src/components/Pages/Solana/SelectSolanaToken/index.d.ts +3 -0
  9. package/build/packages/paykit/packages/connectkit/src/components/Pages/WaitingBitcoin/index.d.ts +3 -0
  10. package/build/packages/paykit/packages/connectkit/src/components/Spinners/CircleSpinner/index.d.ts +2 -2
  11. package/build/packages/paykit/packages/connectkit/src/components/Spinners/SquircleSpinner/index.d.ts +2 -2
  12. package/build/packages/paykit/packages/connectkit/src/components/contexts/solana/index.d.ts +6 -0
  13. package/build/packages/paykit/packages/connectkit/src/hooks/usePayWithSolanaToken.d.ts +4 -0
  14. package/build/packages/paykit/packages/connectkit/src/hooks/usePaymentInfo.d.ts +11 -1
  15. package/build/packages/paykit/packages/connectkit/src/hooks/useSolanaPaymentOptions.d.ts +9 -0
  16. package/package.json +6 -3
  17. 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, createConfig, useEnsAddress, useEnsAvatar, useDisconnect, useBalance, useChainId, WagmiContext } 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';
@@ -18,6 +20,7 @@ import useMeasure from 'react-use-measure';
18
20
  import QRCodeUtil from 'qrcode';
19
21
  import { walletConnect as walletConnect$1 } from 'wagmi/connectors';
20
22
  import { normalize } from 'viem/ens';
23
+ import { WalletSignTransactionError } from '@solana/wallet-adapter-base';
21
24
 
22
25
  const defaultConnectors = ({ app, walletConnectProjectId, coinbaseWalletPreference, }) => {
23
26
  const hasAllAppData = app.name && app.icon && app.description && app.url;
@@ -816,31 +819,6 @@ const useConnectCallback = ({ onConnect, onDisconnect, }) => {
816
819
  });
817
820
  };
818
821
 
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
822
  function useGoogleFont(font) {
845
823
  useEffect(() => {
846
824
  if (!font)
@@ -942,11 +920,89 @@ function useExternalPaymentOptions({ filterIds, usdRequired, platform, }) {
942
920
  };
943
921
  }
944
922
 
923
+ function usePayWithSolanaToken(orderId, setDaimoPayOrder, chosenFinalTokenAmount, platform) {
924
+ const { connection } = useConnection();
925
+ const wallet = useWallet$1();
926
+ const payWithSolanaToken = async (inputToken) => {
927
+ if (!wallet.publicKey || !orderId || !chosenFinalTokenAmount || !platform) {
928
+ throw new Error("Invalid parameters");
929
+ }
930
+ const { hydratedOrder } = await trpc.hydrateOrder.query({
931
+ id: orderId.toString(),
932
+ chosenFinalTokenAmount,
933
+ platform,
934
+ });
935
+ const txHash = await (async () => {
936
+ try {
937
+ const serializedTx = await trpc.getSolanaSwapAndBurnTx.query({
938
+ orderId: orderId.toString(),
939
+ userPublicKey: assertNotNull(wallet.publicKey).toString(),
940
+ inputTokenMint: inputToken,
941
+ });
942
+ const tx = VersionedTransaction.deserialize(hexToBytes(serializedTx));
943
+ const txHash = await wallet.sendTransaction(tx, connection);
944
+ return txHash;
945
+ }
946
+ catch (e) {
947
+ console.error(e);
948
+ setDaimoPayOrder(hydratedOrder);
949
+ throw e;
950
+ }
951
+ finally {
952
+ setDaimoPayOrder(hydratedOrder);
953
+ }
954
+ })();
955
+ trpc.processSolanaSourcePayment.mutate({
956
+ orderId: orderId.toString(),
957
+ startIntentTxHash: txHash,
958
+ amount: chosenFinalTokenAmount,
959
+ token: inputToken,
960
+ });
961
+ return txHash;
962
+ };
963
+ return { payWithSolanaToken };
964
+ }
965
+
966
+ function useSolanaPaymentOptions({ address, usdRequired, }) {
967
+ const [options, setOptions] = useState(null);
968
+ const [isLoading, setIsLoading] = useState(false);
969
+ useEffect(() => {
970
+ const refreshWalletPaymentOptions = async () => {
971
+ if (!address || !usdRequired)
972
+ return;
973
+ setOptions(null);
974
+ setIsLoading(true);
975
+ try {
976
+ const newOptions = await trpc.getSolanaPaymentOptions.query({
977
+ pubKey: address,
978
+ usdRequired,
979
+ });
980
+ setOptions(newOptions);
981
+ }
982
+ catch (error) {
983
+ console.error(error);
984
+ }
985
+ finally {
986
+ setIsLoading(false);
987
+ }
988
+ };
989
+ if (address && usdRequired != null) {
990
+ refreshWalletPaymentOptions();
991
+ }
992
+ }, [address, usdRequired]);
993
+ return {
994
+ options,
995
+ isLoading,
996
+ };
997
+ }
998
+
945
999
  function useWalletPaymentOptions({ address, usdRequired, destChainId, }) {
946
1000
  const [options, setOptions] = useState(null);
947
1001
  const [isLoading, setIsLoading] = useState(false);
948
1002
  useEffect(() => {
949
1003
  const refreshWalletPaymentOptions = async () => {
1004
+ if (!address || !usdRequired || !destChainId)
1005
+ return;
950
1006
  setOptions(null);
951
1007
  setIsLoading(true);
952
1008
  try {
@@ -964,8 +1020,6 @@ function useWalletPaymentOptions({ address, usdRequired, destChainId, }) {
964
1020
  setIsLoading(false);
965
1021
  }
966
1022
  };
967
- if (!address || !usdRequired || !destChainId)
968
- return;
969
1023
  if (address && usdRequired != null && destChainId) {
970
1024
  refreshWalletPaymentOptions();
971
1025
  }
@@ -990,6 +1044,9 @@ function usePaymentInfo({ daimoPayOrder, setDaimoPayOrder, setOpen, log, }) {
990
1044
  });
991
1045
  const { writeContractAsync } = useWriteContract();
992
1046
  const { sendTransactionAsync } = useSendTransaction();
1047
+ // Solana wallet state.
1048
+ const solanaWallet = useWallet$1();
1049
+ const solanaPubKey = solanaWallet.publicKey?.toBase58();
993
1050
  // Daimo Pay order state.
994
1051
  const [paymentWaitingMessage, setPaymentWaitingMessage] = useState();
995
1052
  // Payment UI config.
@@ -1005,8 +1062,14 @@ function usePaymentInfo({ daimoPayOrder, setDaimoPayOrder, setOpen, log, }) {
1005
1062
  usdRequired: daimoPayOrder?.destFinalCallTokenAmount.usd,
1006
1063
  destChainId: daimoPayOrder?.destFinalCallTokenAmount.token.chainId,
1007
1064
  });
1065
+ const solanaPaymentOptions = useSolanaPaymentOptions({
1066
+ address: solanaPubKey,
1067
+ usdRequired: daimoPayOrder?.destFinalCallTokenAmount.usd,
1068
+ });
1069
+ const { payWithSolanaToken } = usePayWithSolanaToken(daimoPayOrder?.id ?? undefined, setDaimoPayOrder, daimoPayOrder?.destFinalCallTokenAmount.amount ?? undefined, platform);
1008
1070
  const [selectedExternalOption, setSelectedExternalOption] = useState();
1009
1071
  const [selectedTokenOption, setSelectedTokenOption] = useState();
1072
+ const [selectedSolanaTokenOption, setSelectedSolanaTokenOption] = useState();
1010
1073
  const payWithToken = async (tokenAmount) => {
1011
1074
  assert(!!daimoPayOrder && !!platform);
1012
1075
  const { hydratedOrder } = await trpc.hydrateOrder.query({
@@ -1027,7 +1090,7 @@ function usePaymentInfo({ daimoPayOrder, setDaimoPayOrder, setOpen, log, }) {
1027
1090
  else {
1028
1091
  return await writeContractAsync({
1029
1092
  abi: erc20Abi,
1030
- address: tokenAmount.token.token,
1093
+ address: getAddress(tokenAmount.token.token),
1031
1094
  functionName: "transfer",
1032
1095
  args: [hydratedOrder.intentAddr, BigInt(tokenAmount.amount)],
1033
1096
  });
@@ -1066,6 +1129,20 @@ function usePaymentInfo({ daimoPayOrder, setDaimoPayOrder, setOpen, log, }) {
1066
1129
  setDaimoPayOrder(hydratedOrder);
1067
1130
  return externalPaymentOptionData.url;
1068
1131
  };
1132
+ const payWithBitcoin = async () => {
1133
+ assert(!!daimoPayOrder && !!platform);
1134
+ const { hydratedOrder } = await trpc.hydrateOrder.query({
1135
+ id: daimoPayOrder.id.toString(),
1136
+ chosenFinalTokenAmount: daimoPayOrder.destFinalCallTokenAmount.amount,
1137
+ platform,
1138
+ });
1139
+ setDaimoPayOrder(hydratedOrder);
1140
+ const bitcoinOption = await trpc.getBitcoinOption.query({
1141
+ usdRequired: daimoPayOrder.destFinalCallTokenAmount.usd,
1142
+ toAddress: assertNotNull(hydratedOrder.intentAddr),
1143
+ });
1144
+ return bitcoinOption;
1145
+ };
1069
1146
  const refreshOrder = useCallback(async () => {
1070
1147
  const id = daimoPayOrder?.id?.toString();
1071
1148
  if (!id)
@@ -1120,13 +1197,18 @@ function usePaymentInfo({ daimoPayOrder, setDaimoPayOrder, setOpen, log, }) {
1120
1197
  paymentWaitingMessage,
1121
1198
  selectedExternalOption,
1122
1199
  selectedTokenOption,
1200
+ selectedSolanaTokenOption,
1123
1201
  externalPaymentOptions,
1124
1202
  walletPaymentOptions,
1203
+ solanaPaymentOptions,
1125
1204
  setSelectedExternalOption,
1126
1205
  setSelectedTokenOption,
1206
+ setSelectedSolanaTokenOption,
1127
1207
  setChosenUsd,
1128
1208
  payWithToken,
1129
1209
  payWithExternal,
1210
+ payWithBitcoin,
1211
+ payWithSolanaToken,
1130
1212
  refreshOrder,
1131
1213
  onSuccess,
1132
1214
  senderEnsName: senderEnsName ?? undefined,
@@ -2274,7 +2356,7 @@ const ResetContainer = styled(motion.div) `
2274
2356
  `;
2275
2357
 
2276
2358
  var name = "@daimo/pay";
2277
- var version = "0.3.13";
2359
+ var version = "0.3.14";
2278
2360
  var author = "Daimo";
2279
2361
  var homepage = "https://pay.daimo.com";
2280
2362
  var license = "BSD-2-Clause license";
@@ -2313,8 +2395,11 @@ var keywords = [
2313
2395
  "crypto"
2314
2396
  ];
2315
2397
  var dependencies = {
2316
- "@daimo/common": "0.3.11",
2317
- "@daimo/contract": "0.3.11",
2398
+ "@daimo/common": "0.3.14",
2399
+ "@daimo/contract": "0.3.14",
2400
+ "@solana/wallet-adapter-base": "^0.9.23",
2401
+ "@solana/wallet-adapter-react": "^0.15.35",
2402
+ "@solana/web3.js": "^1.95.4",
2318
2403
  "@trpc/client": "^11.0.0-next-beta.318",
2319
2404
  "@trpc/server": "^11.0.0-next-beta.318",
2320
2405
  buffer: "^6.0.3",
@@ -4498,6 +4583,31 @@ function usePrevious(value, initial) {
4498
4583
  return ref.current.previous;
4499
4584
  }
4500
4585
 
4586
+ function useConnectors() {
4587
+ const connectors = useConnectors$1();
4588
+ return connectors ?? [];
4589
+ }
4590
+ function useConnector(id, uuid) {
4591
+ const connectors = useConnectors();
4592
+ if (id === "injected" && uuid) {
4593
+ return connectors.find((c) => c.id === id && c.name === uuid);
4594
+ }
4595
+ else if (id === "injected") {
4596
+ return connectors.find((c) => c.id === id && c.name.includes("Injected"));
4597
+ }
4598
+ return connectors.find((c) => c.id === id);
4599
+ }
4600
+ function useWalletConnectConnector() {
4601
+ /*
4602
+ options: {
4603
+ qrcode: false,
4604
+ // or
4605
+ showQrModal: false,
4606
+ }
4607
+ */
4608
+ return useConnector("walletConnect");
4609
+ }
4610
+
4501
4611
  const useWallet = (id) => {
4502
4612
  const wallets = useWallets();
4503
4613
  const wallet = wallets.find((c) => c.id === id);
@@ -4902,6 +5012,10 @@ const Modal = ({ open, pages, pageId, positionInside, inline, demo, onClose, onB
4902
5012
  else {
4903
5013
  return walletInfo?.name;
4904
5014
  }
5015
+ case ROUTES.SOLANA_CONNECT:
5016
+ return "Connect Solana Wallet";
5017
+ case ROUTES.SOLANA_CONNECTOR:
5018
+ return context.solanaConnector ?? "Solana Wallet";
4905
5019
  case ROUTES.CONNECTORS:
4906
5020
  return locales.connectorsScreen_heading;
4907
5021
  case ROUTES.MOBILECONNECTORS:
@@ -4915,11 +5029,13 @@ const Modal = ({ open, pages, pageId, positionInside, inline, demo, onClose, onB
4915
5029
  case ROUTES.SWITCHNETWORKS:
4916
5030
  return locales.switchNetworkScreen_heading;
4917
5031
  case ROUTES.SELECT_METHOD:
4918
- return daimoPayOrder?.metadata.intent;
4919
5032
  case ROUTES.SELECT_TOKEN:
5033
+ case ROUTES.SOLANA_SELECT_TOKEN:
4920
5034
  return daimoPayOrder?.metadata.intent;
4921
5035
  case ROUTES.WAITING_OTHER:
4922
5036
  return selectedExternalOption?.cta;
5037
+ case ROUTES.WAITING_BITCOIN:
5038
+ return "Pay with Bitcoin";
4923
5039
  case ROUTES.PAY_WITH_TOKEN:
4924
5040
  if (!selectedTokenOption)
4925
5041
  return undefined;
@@ -6968,6 +7084,8 @@ const Evmos = ({ testnet, ...props }) => (jsx("svg", { ...props, "aria-hidden":
6968
7084
  : "#2D2A25",
6969
7085
  }, 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
7086
  const BinanceSmartChain = ({ testnet, ...props }) => (jsx("svg", { ...props, "aria-hidden": "true", width: "44", height: "44", version: "1.1", fill: "none", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 2496 2496", children: jsxs("g", { children: [jsx("path", { style: { fillRule: "evenodd", clipRule: "evenodd", fill: "#F0B90B" }, d: "M1248,0c689.3,0,1248,558.7,1248,1248s-558.7,1248-1248,1248\n\t\tS0,1937.3,0,1248S558.7,0,1248,0L1248,0z" }), jsx("path", { style: { fill: "#FFFFFF" }, d: "M685.9,1248l0.9,330l280.4,165v193.2l-444.5-260.7v-524L685.9,1248L685.9,1248z M685.9,918v192.3\n\t\tl-163.3-96.6V821.4l163.3-96.6l164.1,96.6L685.9,918L685.9,918z M1084.3,821.4l163.3-96.6l164.1,96.6L1247.6,918L1084.3,821.4\n\t\tL1084.3,821.4z" }), jsx("path", { style: { fill: "#FFFFFF" }, d: "M803.9,1509.6v-193.2l163.3,96.6v192.3L803.9,1509.6L803.9,1509.6z M1084.3,1812.2l163.3,96.6\n\t\tl164.1-96.6v192.3l-164.1,96.6l-163.3-96.6V1812.2L1084.3,1812.2z M1645.9,821.4l163.3-96.6l164.1,96.6v192.3l-164.1,96.6V918\n\t\tL1645.9,821.4L1645.9,821.4L1645.9,821.4z M1809.2,1578l0.9-330l163.3-96.6v524l-444.5,260.7v-193.2L1809.2,1578L1809.2,1578\n\t\tL1809.2,1578z" }), jsx("polygon", { style: { fill: "#FFFFFF" }, points: "1692.1,1509.6 1528.8,1605.3 1528.8,1413 1692.1,1316.4 1692.1,1509.6 \t" }), jsx("path", { style: { fill: "#FFFFFF" }, d: "M1692.1,986.4l0.9,193.2l-281.2,165v330.8l-163.3,95.7l-163.3-95.7v-330.8l-281.2-165V986.4\n\t\tL968,889.8l279.5,165.8l281.2-165.8l164.1,96.6H1692.1L1692.1,986.4z M803.9,656.5l443.7-261.6l444.5,261.6l-163.3,96.6\n\t\tl-281.2-165.8L967.2,753.1L803.9,656.5L803.9,656.5z" })] }) }));
7087
+ const Solana = ({ testnet, ...props }) => (jsxs("svg", { ...props, "aria-hidden": "true", width: "44", height: "44", viewBox: "0 0 200 200", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("rect", { width: "200", height: "200", rx: "100", fill: "#121212" }), jsx("g", { clipPath: "url(#clip0_295_42)", children: jsx("path", { d: "M149.48 125.382L132.807 142.801C132.444 143.18 132.006 143.482 131.519 143.688C131.031 143.894 130.505 144 129.974 144H50.9356C50.5585 144 50.1896 143.893 49.8742 143.691C49.5588 143.49 49.3107 143.203 49.1604 142.866C49.0101 142.529 48.9641 142.157 49.028 141.795C49.092 141.432 49.2631 141.096 49.5204 140.828L66.2061 123.408C66.5676 123.031 67.0047 122.729 67.4904 122.523C67.9762 122.317 68.5002 122.21 69.0301 122.21H148.064C148.441 122.21 148.81 122.317 149.126 122.518C149.441 122.72 149.689 123.007 149.84 123.344C149.99 123.681 150.036 124.053 149.972 124.415C149.908 124.777 149.737 125.113 149.48 125.382ZM132.807 90.3032C132.444 89.9248 132.006 89.6231 131.519 89.4169C131.031 89.2108 130.505 89.1045 129.974 89.1048H50.9356C50.5585 89.1048 50.1896 89.2121 49.8742 89.4136C49.5588 89.6151 49.3107 89.9019 49.1604 90.2388C49.0101 90.5758 48.9641 90.9482 49.028 91.3103C49.092 91.6723 49.2631 92.0083 49.5204 92.277L66.2061 109.697C66.5676 110.074 67.0047 110.375 67.4904 110.581C67.9762 110.788 68.5002 110.894 69.0301 110.895H148.064C148.441 110.895 148.81 110.788 149.126 110.586C149.441 110.385 149.689 110.098 149.84 109.761C149.99 109.424 150.036 109.052 149.972 108.69C149.908 108.328 149.737 107.992 149.48 107.723L132.807 90.3032ZM50.9356 77.7905H129.974C130.505 77.7907 131.031 77.6845 131.519 77.4783C132.006 77.2721 132.444 76.9704 132.807 76.592L149.48 59.1722C149.737 58.9036 149.908 58.5676 149.972 58.2055C150.036 57.8434 149.99 57.471 149.84 57.1341C149.689 56.7971 149.441 56.5103 149.126 56.3088C148.81 56.1073 148.441 56 148.064 56H69.0301C68.5002 56.0009 67.9762 56.1077 67.4904 56.3138C67.0047 56.52 66.5676 56.8211 66.2061 57.1985L49.5247 74.6183C49.2677 74.8866 49.0966 75.2223 49.0325 75.5839C48.9684 75.9456 49.0141 76.3177 49.1639 76.6545C49.3136 76.9913 49.5611 77.2781 49.8758 77.4799C50.1905 77.6817 50.5589 77.7896 50.9356 77.7905Z", fill: "url(#paint0_linear_295_42)" }) }), jsxs("defs", { children: [jsxs("linearGradient", { id: "paint0_linear_295_42", x1: "57.5256", y1: "146.097", x2: "137.993", y2: "52.9838", gradientUnits: "userSpaceOnUse", children: [jsx("stop", { offset: "0.08", stopColor: "#9945FF" }), jsx("stop", { offset: "0.3", stopColor: "#8752F3" }), jsx("stop", { offset: "0.5", stopColor: "#5497D5" }), jsx("stop", { offset: "0.6", stopColor: "#43B4CA" }), jsx("stop", { offset: "0.72", stopColor: "#28E0B9" }), jsx("stop", { offset: "0.97", stopColor: "#19FB9B" })] }), jsx("clipPath", { id: "clip0_295_42", children: jsx("rect", { width: "101", height: "88", fill: "white", transform: "translate(49 56)" }) })] })] }));
7088
+ 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" })] }));
6971
7089
  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
7090
  background: testnet
6973
7091
  ? "linear-gradient(180deg, #8995A9 0%, #424D5F 99.48%)"
@@ -7052,6 +7170,7 @@ const CoinLogos = ({ $size = 24 }) => {
7052
7170
  jsx(Arbitrum, {}),
7053
7171
  jsx(Base, {}),
7054
7172
  jsx(Polygon, {}),
7173
+ jsx(Solana, {}),
7055
7174
  ];
7056
7175
  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
7176
  return (jsx(Logos, { children: logos.map((element, index) => logoBlock(element, index)) }));
@@ -7588,7 +7707,7 @@ const generateMatrix = (value, errorCorrectionLevel) => {
7588
7707
  : rows[rows.length - 1].push(key)) && rows, []);
7589
7708
  };
7590
7709
  function QRCode({ ecl = "M", size: sizeProp = 200, uri, clearArea = false, image, imageBackground = "transparent", }) {
7591
- const logoSize = clearArea ? 76 : 0;
7710
+ const logoSize = clearArea ? 168 : 0;
7592
7711
  const size = sizeProp - 10 * 2;
7593
7712
  const dots = useMemo(() => {
7594
7713
  const dots = [];
@@ -7650,7 +7769,7 @@ function CustomQRCode({ value, image, imageBackground, imagePosition = "center",
7650
7769
  background: imagePosition === "center" ? imageBackground : undefined,
7651
7770
  }, 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
7771
  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: {
7772
+ }, 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
7773
  duration: 0.2,
7655
7774
  }, children: [jsx("span", {}), jsx("span", {}), jsx("span", {}), jsx("div", {})] })) })] }) }));
7656
7775
  }
@@ -8718,7 +8837,7 @@ const Spin = keyframes `
8718
8837
  0%{ transform: rotate(0deg); }
8719
8838
  100%{ transform: rotate(360deg); }
8720
8839
  `;
8721
- const LoadingContainer$2 = styled(motion.div) `
8840
+ const LoadingContainer$3 = styled(motion.div) `
8722
8841
  position: absolute;
8723
8842
  inset: 0;
8724
8843
  animation: ${Spin} 1s linear infinite;
@@ -8757,7 +8876,7 @@ const Chain = ({ id, unsupported: controlledUnsupported, radius = "50%", size =
8757
8876
  width: size,
8758
8877
  height: size,
8759
8878
  } }));
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"))] }) }));
8879
+ return (jsx(ChainContainer$1, { size: size, radius: radius, children: jsxs(AnimatePresence, { initial: false, children: [unsupported && (jsx(Unsupported, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, children: jsxs("svg", { width: "13", height: "12", viewBox: "0 0 13 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [jsx("path", { d: "M2.61317 11.2501H9.46246C10.6009 11.2501 11.3256 10.3506 11.3256 9.3549C11.3256 9.05145 11.255 8.73244 11.0881 8.43303L7.65903 2.14708C7.659 2.14702 7.65897 2.14696 7.65893 2.1469C7.65889 2.14682 7.65884 2.14673 7.65879 2.14664C7.31045 1.50746 6.6741 1.17871 6.04 1.17871C5.41478 1.17871 4.763 1.50043 4.41518 2.14968L0.993416 8.43476C0.828865 8.72426 0.75 9.04297 0.75 9.3549C0.75 10.3506 1.47471 11.2501 2.61317 11.2501Z", fill: "currentColor", stroke: "var(--ck-body-background, #fff)", strokeWidth: "1.5" }), jsx("path", { d: "M6.03258 7.43916C5.77502 7.43916 5.63096 7.29153 5.62223 7.02311L5.55675 4.96973C5.54802 4.69684 5.74446 4.5 6.02821 4.5C6.3076 4.5 6.51277 4.70131 6.50404 4.9742L6.43856 7.01864C6.42546 7.29153 6.2814 7.43916 6.03258 7.43916ZM6.03258 9.11676C5.7401 9.11676 5.5 8.9065 5.5 8.60677C5.5 8.30704 5.7401 8.09678 6.03258 8.09678C6.32506 8.09678 6.56515 8.30256 6.56515 8.60677C6.56515 8.91097 6.32069 9.11676 6.03258 9.11676Z", fill: "white" })] }) })), id ? (jsx(LogoContainer$2, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.3 }, children: chain?.logo ?? jsx(ChainIcons.UnknownChain, {}) }, `${chain?.id}-${chain?.name}-${id}`)) : (jsx(LoadingContainer$3, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, transition: { duration: 0.3 }, children: Spinner$4 }, "loading"))] }) }));
8761
8880
  };
8762
8881
 
8763
8882
  const SwitchNetworksContainer = styled.div `
@@ -9628,8 +9747,8 @@ const Spinner$2 = styled(motion.div) `
9628
9747
  }
9629
9748
  `;
9630
9749
 
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: {
9750
+ const SquircleSpinner = ({ logo, loading = true, }) => {
9751
+ return (jsxs(LogoContainer$1, { transition: { duration: 0.5, ease: [0.175, 0.885, 0.32, 0.98] }, children: [jsx(Logo$1, { children: logo }), jsx(SpinnerContainer$1, { children: jsx(AnimatePresence, { children: loading && (jsx(Spinner$2, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: {
9633
9752
  opacity: 0,
9634
9753
  transition: {
9635
9754
  duration: 0,
@@ -9793,8 +9912,8 @@ const Spinner$1 = styled(motion.div) `
9793
9912
  }
9794
9913
  `;
9795
9914
 
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: {
9915
+ const CircleSpinner = ({ logo, smallLogo, loading = true, unavailable = false, countdown = false, }) => {
9916
+ return (jsxs(LogoContainer, { transition: { duration: 0.5, ease: [0.175, 0.885, 0.32, 0.98] }, children: [jsx(Logo, { "$small": !unavailable && smallLogo, style: unavailable ? { borderRadius: 0 } : undefined, children: logo }), jsx(SpinnerContainer, { children: jsxs(AnimatePresence, { children: [loading && (jsx(Spinner$1, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: {
9798
9917
  opacity: 0,
9799
9918
  transition: {
9800
9919
  duration: countdown ? 1 : 0,
@@ -9973,11 +10092,11 @@ const ConnectWithInjector = ({ switchConnectMethod, forceState }) => {
9973
10092
  transform: "scale(1.14)",
9974
10093
  position: "relative",
9975
10094
  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: {
10095
+ }, 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
10096
  transform: "scale(1.14)",
9978
10097
  position: "relative",
9979
10098
  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"
10099
+ }, 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
10100
  ? locales.injectionScreen_connecting_injected_h1
9982
10101
  : locales.injectionScreen_connecting_h1 }), jsx(ModalBody, { children: wallet.connector.id === "injected"
9983
10102
  ? locales.injectionScreen_connecting_injected_p
@@ -10178,9 +10297,9 @@ const Confirmation = () => {
10178
10297
  justifyContent: "center",
10179
10298
  alignItems: "center",
10180
10299
  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, {})] }) }));
10300
+ }, children: [jsx(AnimationContainer$4, { children: jsxs(InsetContainer, { children: [jsx(Spinner, { "$status": done }), jsx(SuccessIcon, { "$status": done })] }) }), !done ? (jsx(ModalH1, { children: "Confirming..." })) : (jsx(ModalH1, { children: jsx(Link, { href: txURL, target: "_blank", rel: "noopener noreferrer", children: "Payment completed" }) })), jsx(PoweredByFooter, {})] }) }));
10182
10301
  };
10183
- const AnimationContainer$2 = styled(motion.div) `
10302
+ const AnimationContainer$4 = styled(motion.div) `
10184
10303
  position: relative;
10185
10304
  width: 100px;
10186
10305
  height: 100px;
@@ -10236,17 +10355,17 @@ const Spinner = styled(LoadingCircleIcon) `
10236
10355
  }
10237
10356
  `;
10238
10357
 
10239
- var PayState;
10358
+ var PayState$1;
10240
10359
  (function (PayState) {
10241
10360
  PayState["RequestingPayment"] = "Requesting Payment";
10242
10361
  PayState["SwitchingChain"] = "Switching Chain";
10243
10362
  PayState["RequestCancelled"] = "Payment Cancelled";
10244
10363
  PayState["RequestSuccessful"] = "Payment Successful";
10245
- })(PayState || (PayState = {}));
10364
+ })(PayState$1 || (PayState$1 = {}));
10246
10365
  const PayWithToken = () => {
10247
10366
  const { triggerResize, paymentInfo, setRoute, log } = useContext();
10248
10367
  const { selectedTokenOption, payWithToken } = paymentInfo;
10249
- const [payState, setPayState] = useState(PayState.RequestingPayment);
10368
+ const [payState, setPayState] = useState(PayState$1.RequestingPayment);
10250
10369
  const walletChainId = useChainId();
10251
10370
  const { switchChainAsync } = useSwitchChain();
10252
10371
  const trySwitchingChain = async (option, forceSwitch = false) => {
@@ -10270,17 +10389,17 @@ const PayWithToken = () => {
10270
10389
  };
10271
10390
  const handleTransfer = async (option) => {
10272
10391
  // Switch chain if necessary
10273
- setPayState(PayState.SwitchingChain);
10392
+ setPayState(PayState$1.SwitchingChain);
10274
10393
  const switchChain = await trySwitchingChain(option);
10275
10394
  if (!switchChain) {
10276
10395
  console.error("Switching chain failed");
10277
- setPayState(PayState.RequestCancelled);
10396
+ setPayState(PayState$1.RequestCancelled);
10278
10397
  return;
10279
10398
  }
10280
- setPayState(PayState.RequestingPayment);
10399
+ setPayState(PayState$1.RequestingPayment);
10281
10400
  try {
10282
10401
  await payWithToken(option.required);
10283
- setPayState(PayState.RequestSuccessful);
10402
+ setPayState(PayState$1.RequestSuccessful);
10284
10403
  setTimeout(() => {
10285
10404
  setRoute(ROUTES.CONFIRMATION);
10286
10405
  }, 200);
@@ -10302,7 +10421,7 @@ const PayWithToken = () => {
10302
10421
  }
10303
10422
  }
10304
10423
  }
10305
- setPayState(PayState.RequestCancelled);
10424
+ setPayState(PayState$1.RequestCancelled);
10306
10425
  console.error("Failed to pay with token", e);
10307
10426
  }
10308
10427
  };
@@ -10321,17 +10440,17 @@ const PayWithToken = () => {
10321
10440
  useEffect(() => {
10322
10441
  triggerResize();
10323
10442
  }, [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" }))] })] }));
10443
+ return (jsxs(PageContent, { children: [jsx(LoadingContainer$2, { children: jsx(AnimationContainer$3, { "$circle": true, children: jsxs(AnimatePresence, { children: [jsx(ChainLogoContainer, { children: selectedTokenOption &&
10444
+ 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
10445
  };
10327
- const LoadingContainer$1 = styled(motion.div) `
10446
+ const LoadingContainer$2 = styled(motion.div) `
10328
10447
  display: flex;
10329
10448
  align-items: center;
10330
10449
  justify-content: center;
10331
10450
  margin: 10px auto 16px;
10332
10451
  height: 120px;
10333
10452
  `;
10334
- const AnimationContainer$1 = styled(motion.div) `
10453
+ const AnimationContainer$3 = styled(motion.div) `
10335
10454
  user-select: none;
10336
10455
  position: relative;
10337
10456
  --spinner-error-opacity: 0;
@@ -10660,12 +10779,39 @@ function getBestUnconnectedWalletIcons(connector) {
10660
10779
  icons.push(jsx(Rabby, {}));
10661
10780
  return icons;
10662
10781
  }
10782
+ function getSolanaOption() {
10783
+ const { wallets } = useWallet$1();
10784
+ const { setRoute } = useContext();
10785
+ if (wallets.length === 0)
10786
+ return null;
10787
+ return {
10788
+ id: "solana",
10789
+ title: "Pay on Solana",
10790
+ icons: [jsx(Solana, {})],
10791
+ onClick: () => {
10792
+ setRoute(ROUTES.SOLANA_CONNECT);
10793
+ },
10794
+ };
10795
+ }
10796
+ function getBitcoinOption(usdRequired) {
10797
+ const { setRoute } = useContext();
10798
+ if (usdRequired < 20)
10799
+ return null;
10800
+ return {
10801
+ id: "bitcoin",
10802
+ title: "Pay with Bitcoin",
10803
+ icons: [jsx(Bitcoin, {})],
10804
+ onClick: () => {
10805
+ setRoute(ROUTES.WAITING_BITCOIN);
10806
+ },
10807
+ };
10808
+ }
10663
10809
  const SelectMethod = () => {
10664
10810
  const isMobile = useIsMobile();
10665
10811
  const { address, isConnected, connector } = useAccount();
10666
10812
  const { disconnectAsync } = useDisconnect();
10667
10813
  const { setRoute, paymentInfo, log } = useContext();
10668
- const { setSelectedExternalOption, externalPaymentOptions, senderEnsName } = paymentInfo;
10814
+ const { daimoPayOrder, setSelectedExternalOption, externalPaymentOptions, senderEnsName, } = paymentInfo;
10669
10815
  const displayName = senderEnsName ?? (address ? getAddressContraction(address) : "wallet");
10670
10816
  const connectedWalletOption = isConnected
10671
10817
  ? {
@@ -10690,18 +10836,23 @@ const SelectMethod = () => {
10690
10836
  ? [connectedWalletOption, unconnectedWalletOption]
10691
10837
  : [unconnectedWalletOption];
10692
10838
  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, {})] }));
10839
+ const solanaOption = getSolanaOption();
10840
+ const bitcoinOption = getBitcoinOption(daimoPayOrder?.destFinalCallTokenAmount.usd ?? 0);
10841
+ const options = [
10842
+ ...walletOptions,
10843
+ ...(solanaOption ? [solanaOption] : []),
10844
+ ...(externalPaymentOptions.options ?? []).map((option) => ({
10845
+ id: option.id,
10846
+ title: option.cta,
10847
+ icons: [option.logoURI],
10848
+ onClick: () => {
10849
+ setSelectedExternalOption(option);
10850
+ setRoute(ROUTES.WAITING_OTHER);
10851
+ },
10852
+ })),
10853
+ ...(bitcoinOption ? [bitcoinOption] : []),
10854
+ ];
10855
+ return (jsxs(PageContent, { children: [jsx(OrderHeader, {}), jsx(OptionsList, { requiredSkeletons: isMobile ? 4 : 3, isLoading: externalPaymentOptions.loading, options: externalPaymentOptions.loading ? [] : options }), jsx(PoweredByFooter, {})] }));
10705
10856
  };
10706
10857
 
10707
10858
  function getDaimoTokenKey(token) {
@@ -10733,7 +10884,7 @@ const SelectToken = () => {
10733
10884
  justifyContent: "center",
10734
10885
  paddingTop: 16,
10735
10886
  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) => {
10887
+ }, 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
10888
  const capitalizedChainName = capitalize(getChainName(option.required.token.chainId));
10738
10889
  const title = `${getDisplayPrice(option.required)} ${option.required.token.symbol} on ${capitalizedChainName}`;
10739
10890
  const subtitle = `Balance: ${getDisplayPrice(option.balance)} ${option.balance.token.symbol}`;
@@ -10789,17 +10940,148 @@ const WaitingOther = () => {
10789
10940
  }
10790
10941
  const optionSpinner = (() => {
10791
10942
  if (selectedExternalOption.logoShape === "circle") {
10792
- return (jsx(CircleSpinner, { logo: jsx("img", { src: selectedExternalOption.logoURI }), connecting: true, unavailable: false }));
10943
+ return (jsx(CircleSpinner, { logo: jsx("img", { src: selectedExternalOption.logoURI }), loading: true, unavailable: false }));
10793
10944
  }
10794
10945
  else {
10795
- return (jsx(SquircleSpinner, { logo: jsx("img", { src: selectedExternalOption.logoURI }), connecting: true }));
10946
+ return (jsx(SquircleSpinner, { logo: jsx("img", { src: selectedExternalOption.logoURI }), loading: true }));
10796
10947
  }
10797
10948
  })();
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: () => {
10949
+ return (jsxs(PageContent, { children: [jsx(LoadingContainer$1, { children: jsx(AnimationContainer$2, { "$circle": selectedExternalOption.logoShape === "circle", children: jsx(AnimatePresence, { children: optionSpinner }) }) }), jsxs(ModalContent, { style: { marginLeft: 24, marginRight: 24 }, children: [jsx(ModalH1, { children: "Waiting for Payment" }), paymentWaitingMessage && (jsx(ModalBody, { style: { marginTop: 12, marginBottom: 12 }, children: paymentWaitingMessage })), jsx(Button, { icon: jsx(ExternalLinkIcon, {}), onClick: () => {
10799
10950
  if (externalURL)
10800
10951
  window.open(externalURL, "_blank");
10801
10952
  }, children: "Open in New Tab" })] })] }));
10802
10953
  };
10954
+ const LoadingContainer$1 = styled(motion.div) `
10955
+ display: flex;
10956
+ align-items: center;
10957
+ justify-content: center;
10958
+ margin: 10px auto 16px;
10959
+ height: 120px;
10960
+ `;
10961
+ const AnimationContainer$2 = styled(motion.div) `
10962
+ user-select: none;
10963
+ position: relative;
10964
+ --spinner-error-opacity: 0;
10965
+ &:before {
10966
+ content: "";
10967
+ position: absolute;
10968
+ inset: 1px;
10969
+ opacity: 0;
10970
+ background: var(--ck-body-color-danger);
10971
+ ${(props) => props.$circle &&
10972
+ css `
10973
+ inset: -5px;
10974
+ border-radius: 50%;
10975
+ background: none;
10976
+ box-shadow: inset 0 0 0 3.5px var(--ck-body-color-danger);
10977
+ `}
10978
+ }
10979
+ `;
10980
+
10981
+ const ConnectSolana$1 = () => {
10982
+ const solanaWallets = useWallet$1();
10983
+ const isConnected = solanaWallets.connected;
10984
+ const { solanaConnector, setRoute } = useContext();
10985
+ const selectedWallet = solanaWallets.wallets.find((wallet) => wallet.adapter.name === solanaConnector);
10986
+ useEffect(() => {
10987
+ if (!solanaConnector)
10988
+ return;
10989
+ solanaWallets.select(solanaConnector);
10990
+ }, [solanaConnector]);
10991
+ useEffect(() => {
10992
+ if (isConnected) {
10993
+ // Wait so user can see it's connected
10994
+ setTimeout(() => setRoute(ROUTES.SOLANA_SELECT_TOKEN), 500);
10995
+ }
10996
+ }, [isConnected]);
10997
+ if (!solanaConnector)
10998
+ return null;
10999
+ return (jsxs(PageContent, { children: [jsx(LoadingContainer$1, { children: jsx(AnimationContainer$1, { children: jsx(AnimatePresence, { children: jsx(SquircleSpinner, { logo: jsx("div", { style: { borderRadius: "22.5%", overflow: "hidden" }, children: jsx("img", { src: selectedWallet?.adapter.icon, alt: selectedWallet?.adapter.name }) }), loading: true }) }) }) }), jsx(ModalContent, { style: { paddingBottom: 0 }, children: isConnected ? (jsx(ModalH1, { children: "Connected" })) : (jsxs(Fragment, { children: [jsx(ModalH1, { children: "Requesting Connection" }), jsxs(ModalBody, { children: ["Open ", selectedWallet?.adapter.name, " to continue."] })] })) })] }));
11000
+ };
11001
+ const AnimationContainer$1 = styled(motion.div) `
11002
+ user-select: none;
11003
+ position: relative;
11004
+ --spinner-error-opacity: 0;
11005
+ &:before {
11006
+ content: "";
11007
+ position: absolute;
11008
+ inset: 1px;
11009
+ opacity: 0;
11010
+ background: var(--ck-body-color-danger);
11011
+ }
11012
+ `;
11013
+
11014
+ const ConnectSolana = () => {
11015
+ const { setSolanaConnector, setRoute } = useContext();
11016
+ const solanaWallets = useWallet$1();
11017
+ const options = solanaWallets.wallets.map((wallet) => ({
11018
+ id: wallet.adapter.name,
11019
+ title: `${wallet.adapter.name}`,
11020
+ icons: [
11021
+ jsx(SquircleIcon, { icon: wallet.adapter.icon, alt: wallet.adapter.name }),
11022
+ ],
11023
+ onClick: async () => {
11024
+ setSolanaConnector(wallet.adapter.name);
11025
+ if (solanaWallets.connected) {
11026
+ await solanaWallets.disconnect();
11027
+ }
11028
+ setRoute(ROUTES.SOLANA_CONNECTOR);
11029
+ },
11030
+ }));
11031
+ return (jsxs(PageContent, { children: [jsx(OrderHeader, { minified: true }), solanaWallets.wallets.length === 0 && (jsxs(ModalContent, { style: {
11032
+ display: "flex",
11033
+ alignItems: "center",
11034
+ justifyContent: "center",
11035
+ paddingTop: 16,
11036
+ paddingBottom: 16,
11037
+ }, children: [jsx(ModalH1, { children: "No Solana wallets detected." }), jsx(Button, { onClick: () => setRoute(ROUTES.SELECT_METHOD), children: "Select Another Method" })] })), jsx(OptionsList, { options: options })] }));
11038
+ };
11039
+ const SquircleIcon = ({ icon, alt }) => (jsx("div", { style: { borderRadius: "22.5%", overflow: "hidden" }, children: jsx("img", { src: icon, alt: alt }) }));
11040
+
11041
+ var PayState;
11042
+ (function (PayState) {
11043
+ PayState["RequestingPayment"] = "Requesting Payment";
11044
+ PayState["RequestCancelled"] = "Payment Cancelled";
11045
+ PayState["RequestFailed"] = "Payment Failed";
11046
+ PayState["RequestSuccessful"] = "Payment Successful";
11047
+ })(PayState || (PayState = {}));
11048
+ const PayWithSolanaToken = () => {
11049
+ const { triggerResize, paymentInfo, setRoute } = useContext();
11050
+ const { selectedSolanaTokenOption, payWithSolanaToken } = paymentInfo;
11051
+ const [payState, setPayState] = useState(PayState.RequestingPayment);
11052
+ const handleTransfer = async () => {
11053
+ try {
11054
+ setPayState(PayState.RequestingPayment);
11055
+ assert(!!selectedSolanaTokenOption, "No token option selected");
11056
+ await payWithSolanaToken(selectedSolanaTokenOption.required.token.token);
11057
+ setPayState(PayState.RequestSuccessful);
11058
+ setTimeout(() => {
11059
+ setRoute(ROUTES.CONFIRMATION);
11060
+ }, 200);
11061
+ }
11062
+ catch (error) {
11063
+ console.error(error);
11064
+ if (error instanceof WalletSignTransactionError) {
11065
+ setPayState(PayState.RequestCancelled);
11066
+ }
11067
+ else {
11068
+ setPayState(PayState.RequestFailed);
11069
+ }
11070
+ }
11071
+ };
11072
+ let transferTimeout; // Prevent double-triggering in React dev strict mode.
11073
+ useEffect(() => {
11074
+ if (!selectedSolanaTokenOption)
11075
+ return;
11076
+ // Give user time to see the UI before opening
11077
+ transferTimeout = setTimeout(handleTransfer, 100);
11078
+ return () => clearTimeout(transferTimeout);
11079
+ }, []);
11080
+ useEffect(() => {
11081
+ triggerResize();
11082
+ }, [payState]);
11083
+ return (jsxs(PageContent, { children: [jsx(LoadingContainer, { children: jsx(AnimationContainer, { "$circle": true, children: jsx(AnimatePresence, { children: jsx(CircleSpinner, { logo: jsx("img", { src: selectedSolanaTokenOption?.required.token.logoURI, alt: selectedSolanaTokenOption?.required.token.symbol }, selectedSolanaTokenOption?.required.token.logoURI), loading: true, unavailable: false }, "CircleSpinner") }) }) }), jsxs(ModalContent, { style: { paddingBottom: 0 }, children: [jsx(ModalH1, { children: payState }), payState === PayState.RequestCancelled && (jsx(Button, { onClick: handleTransfer, children: "Retry Payment" })), payState === PayState.RequestFailed && (jsx(Button, { onClick: () => setRoute(ROUTES.SELECT_METHOD), children: "Select Another Method" }))] })] }));
11084
+ };
10803
11085
  const LoadingContainer = styled(motion.div) `
10804
11086
  display: flex;
10805
11087
  align-items: center;
@@ -10827,6 +11109,68 @@ const AnimationContainer = styled(motion.div) `
10827
11109
  }
10828
11110
  `;
10829
11111
 
11112
+ const SelectSolanaToken = () => {
11113
+ const { paymentInfo, setRoute } = useContext();
11114
+ const { solanaPaymentOptions, setSelectedSolanaTokenOption } = paymentInfo;
11115
+ return (jsxs(PageContent, { children: [jsx(OrderHeader, { minified: true }), !solanaPaymentOptions.isLoading &&
11116
+ solanaPaymentOptions.options?.length === 0 && (jsxs(ModalContent, { style: {
11117
+ display: "flex",
11118
+ alignItems: "center",
11119
+ justifyContent: "center",
11120
+ paddingTop: 16,
11121
+ paddingBottom: 16,
11122
+ }, 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) => {
11123
+ const title = `${getDisplayPrice(option.required)} ${option.required.token.symbol}`;
11124
+ const subtitle = `Balance: ${getDisplayPrice(option.balance)} ${option.balance.token.symbol}`;
11125
+ return {
11126
+ id: `${option.required.token.token}-${option.required.token.symbol}`,
11127
+ title,
11128
+ subtitle,
11129
+ icons: [
11130
+ jsx("img", { src: option.required.token.logoURI, alt: option.required.token.symbol, style: { borderRadius: 9999 } }),
11131
+ ],
11132
+ onClick: () => {
11133
+ setSelectedSolanaTokenOption(option);
11134
+ setRoute(ROUTES.SOLANA_PAY_WITH_TOKEN);
11135
+ },
11136
+ };
11137
+ }) ?? [] })] }));
11138
+ };
11139
+
11140
+ const WaitingBitcoin = () => {
11141
+ const { triggerResize, paymentInfo, setRoute } = useContext();
11142
+ const { daimoPayOrder, payWithBitcoin } = paymentInfo;
11143
+ useEffect(() => {
11144
+ const checkForSourcePayment = async () => {
11145
+ if (!daimoPayOrder)
11146
+ return;
11147
+ const found = await trpc.findSourcePayment.query({
11148
+ orderId: daimoPayOrder.id.toString(),
11149
+ });
11150
+ if (found) {
11151
+ setRoute(ROUTES.CONFIRMATION);
11152
+ }
11153
+ };
11154
+ // Check every 10 seconds, bitcoin takes a while
11155
+ const interval = setInterval(checkForSourcePayment, 10000);
11156
+ return () => clearInterval(interval);
11157
+ }, [daimoPayOrder?.id]);
11158
+ const [option, setOption] = useState();
11159
+ const [failed, setFailed] = useState(false);
11160
+ useEffect(() => {
11161
+ payWithBitcoin().then((option) => {
11162
+ if (!option)
11163
+ setFailed(true);
11164
+ else
11165
+ setOption(option);
11166
+ });
11167
+ }, []);
11168
+ useEffect(() => {
11169
+ triggerResize();
11170
+ }, [option]);
11171
+ return (jsx(PageContent, { children: failed ? (jsxs(ModalContent, { style: { marginLeft: 24, marginRight: 24 }, children: [jsx(ModalH1, { children: "Bitcoin unavailable" }), jsx(ModalBody, { children: "We're unable to process Bitcoin payments at this time. Please select another payment method." }), jsx(Button, { onClick: () => setRoute(ROUTES.SELECT_METHOD), children: "Select Another Method" })] })) : (jsxs(ModalContent, { children: [jsx(CustomQRCode, { value: option?.uri, image: jsx(Bitcoin, {}), tooltipMessage: jsxs(Fragment, { children: [jsx(ScanIconWithLogos, { logo: jsx(Bitcoin, {}) }), jsx("span", { children: "Use a Bitcoin wallet to scan" })] }) }), option && (jsxs(Fragment, { children: [jsx(OrDivider, {}), jsxs(ModalBody, { children: ["Send exactly ", option.amount, " BTC to", " ", getAddressContraction(option?.address), " and return to this page. Confirmation should appear in a few minutes."] }), jsx(CopyToClipboard, { variant: "button", string: option.address, children: "Copy Address to Clipboard" })] }))] })) }));
11172
+ };
11173
+
10830
11174
  const customThemeDefault = {};
10831
11175
  const DaimoPayModal = ({ mode = "auto", theme = "auto", customTheme = customThemeDefault, lang = "en-US", }) => {
10832
11176
  const context = useContext();
@@ -10874,8 +11218,13 @@ const DaimoPayModal = ({ mode = "auto", theme = "auto", customTheme = customThem
10874
11218
  daimoPaySelectMethod: jsx(SelectMethod, {}),
10875
11219
  daimoPaySelectToken: jsx(SelectToken, {}),
10876
11220
  daimoPayWaitingOther: jsx(WaitingOther, {}),
11221
+ daimoPayWaitingBitcoin: jsx(WaitingBitcoin, {}),
10877
11222
  daimoPayConfirmation: jsx(Confirmation, {}),
10878
11223
  daimoPayPayWithToken: jsx(PayWithToken, {}),
11224
+ daimoPaySolanaConnect: jsx(ConnectSolana, {}),
11225
+ daimoPaySolanaConnector: jsx(ConnectSolana$1, {}),
11226
+ daimoPaySolanaSelectToken: jsx(SelectSolanaToken, {}),
11227
+ daimoPaySolanaPayWithToken: jsx(PayWithSolanaToken, {}),
10879
11228
  onboarding: jsx(Introduction, {}),
10880
11229
  about: jsx(About, {}),
10881
11230
  download: jsx(DownloadApp, {}),
@@ -10927,13 +11276,24 @@ const DaimoPayModal = ({ mode = "auto", theme = "auto", customTheme = customThem
10927
11276
  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
11277
  };
10929
11278
 
11279
+ const DEFAULT_SOLANA_RPC_URL = "https://nameless-thrilling-spring.solana-mainnet.quiknode.pro/71d5c9acbf54c7cf00584cf6fab7fc37e844415f/";
11280
+ const SolanaContextProvider = ({ children, solanaRpcUrl, }) => {
11281
+ const endpoint = solanaRpcUrl ?? DEFAULT_SOLANA_RPC_URL;
11282
+ return (jsx(ConnectionProvider, { endpoint: endpoint, children: jsx(WalletProvider, { wallets: [], autoConnect: true, children: children }) }));
11283
+ };
11284
+
10930
11285
  var ROUTES;
10931
11286
  (function (ROUTES) {
10932
11287
  ROUTES["SELECT_METHOD"] = "daimoPaySelectMethod";
10933
11288
  ROUTES["SELECT_TOKEN"] = "daimoPaySelectToken";
10934
11289
  ROUTES["WAITING_OTHER"] = "daimoPayWaitingOther";
11290
+ ROUTES["WAITING_BITCOIN"] = "daimoPayWaitingBitcoin";
10935
11291
  ROUTES["PAY_WITH_TOKEN"] = "daimoPayPayWithToken";
10936
11292
  ROUTES["CONFIRMATION"] = "daimoPayConfirmation";
11293
+ ROUTES["SOLANA_CONNECT"] = "daimoPaySolanaConnect";
11294
+ ROUTES["SOLANA_CONNECTOR"] = "daimoPaySolanaConnector";
11295
+ ROUTES["SOLANA_SELECT_TOKEN"] = "daimoPaySolanaSelectToken";
11296
+ ROUTES["SOLANA_PAY_WITH_TOKEN"] = "daimoPaySolanaPayWithToken";
10937
11297
  ROUTES["ONBOARDING"] = "onboarding";
10938
11298
  ROUTES["ABOUT"] = "about";
10939
11299
  ROUTES["CONNECTORS"] = "connectors";
@@ -10944,7 +11304,7 @@ var ROUTES;
10944
11304
  ROUTES["SWITCHNETWORKS"] = "switchNetworks";
10945
11305
  })(ROUTES || (ROUTES = {}));
10946
11306
  const Context = createContext(null);
10947
- const DaimoPayProvider = ({ children, theme = "auto", mode = "auto", customTheme, options, onConnect, onDisconnect, debugMode = false, }) => {
11307
+ const DaimoPayProviderWithoutSolana = ({ children, theme = "auto", mode = "auto", customTheme, options, onConnect, onDisconnect, debugMode = false, }) => {
10948
11308
  // DaimoPayProvider must be within a WagmiProvider
10949
11309
  if (!React.useContext(WagmiContext)) {
10950
11310
  throw Error("DaimoPayProvider must be within a WagmiProvider");
@@ -10964,7 +11324,6 @@ const DaimoPayProvider = ({ children, theme = "auto", mode = "auto", customTheme
10964
11324
  throw new Error(`Daimo Pay requires chains ${REQUIRED_CHAINS.map((c) => c.name).join(", ")}. Use \`getDefaultConfig\` to automatically configure required chains.`);
10965
11325
  }
10966
11326
  }
10967
- const injectedConnector = useConnector("injected");
10968
11327
  // Default config options
10969
11328
  const defaultOptions = {
10970
11329
  language: "en-US",
@@ -11008,6 +11367,7 @@ const DaimoPayProvider = ({ children, theme = "auto", mode = "auto", customTheme
11008
11367
  const [connector, setConnector] = useState({
11009
11368
  id: "",
11010
11369
  });
11370
+ const [solanaConnector, setSolanaConnector] = useState();
11011
11371
  const [route, setRoute] = useState(ROUTES.SELECT_METHOD);
11012
11372
  const [errorMessage, setErrorMessage] = useState("");
11013
11373
  const [resize, onResize] = useState(0);
@@ -11027,13 +11387,6 @@ const DaimoPayProvider = ({ children, theme = "auto", mode = "auto", customTheme
11027
11387
  setRoute(ROUTES.SWITCHNETWORKS);
11028
11388
  }
11029
11389
  }, [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
11390
  const log = debugMode ? console.log : () => { };
11038
11391
  // PaymentInfo is a second, inner context object containing a DaimoPayOrder
11039
11392
  // plus all associated status and callbacks. In order for useContext() and
@@ -11096,6 +11449,8 @@ const DaimoPayProvider = ({ children, theme = "auto", mode = "auto", customTheme
11096
11449
  setRoute,
11097
11450
  connector,
11098
11451
  setConnector,
11452
+ solanaConnector,
11453
+ setSolanaConnector,
11099
11454
  onConnect,
11100
11455
  // Other configuration
11101
11456
  options: opts,
@@ -11119,6 +11474,9 @@ const DaimoPayProvider = ({ children, theme = "auto", mode = "auto", customTheme
11119
11474
  };
11120
11475
  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
11476
  };
11477
+ const DaimoPayProvider = (props) => {
11478
+ return (jsx(SolanaContextProvider, { solanaRpcUrl: props.solanaRpcUrl, children: jsx(DaimoPayProviderWithoutSolana, { ...props }) }));
11479
+ };
11122
11480
  const useContext = () => {
11123
11481
  const context = React.useContext(Context);
11124
11482
  if (!context)
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -6,6 +6,12 @@ export declare const Polygon: ({ testnet, ...props }: Logo) => import("react/jsx
6
6
  export declare const Optimism: ({ testnet, ...props }: Logo) => import("react/jsx-runtime").JSX.Element;
7
7
  export declare const Arbitrum: ({ testnet, ...props }: Logo) => import("react/jsx-runtime").JSX.Element;
8
8
  export declare const Telos: ({ testnet, ...props }: Logo) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const Solana: ({ testnet, ...props }: {
10
+ testnet?: boolean;
11
+ }) => import("react/jsx-runtime").JSX.Element;
12
+ export declare const Bitcoin: ({ testnet, ...props }: {
13
+ testnet?: boolean;
14
+ }) => import("react/jsx-runtime").JSX.Element;
9
15
  export declare const Base: ({ testnet, ...props }: {
10
16
  testnet?: boolean;
11
17
  }) => import("react/jsx-runtime").JSX.Element;
@@ -2,12 +2,18 @@ import React from "react";
2
2
  import { CustomTheme, DaimoPayContextOptions, DaimoPayModalOptions, Languages, Mode, Theme } from "../types";
3
3
  import { useConnectCallbackProps } from "../hooks/useConnectCallback";
4
4
  import { PaymentInfo } from "../hooks/usePaymentInfo";
5
+ import { SolanaWalletName } from "./contexts/solana";
5
6
  export declare enum ROUTES {
6
7
  SELECT_METHOD = "daimoPaySelectMethod",
7
8
  SELECT_TOKEN = "daimoPaySelectToken",
8
9
  WAITING_OTHER = "daimoPayWaitingOther",
10
+ WAITING_BITCOIN = "daimoPayWaitingBitcoin",
9
11
  PAY_WITH_TOKEN = "daimoPayPayWithToken",
10
12
  CONFIRMATION = "daimoPayConfirmation",
13
+ SOLANA_CONNECT = "daimoPaySolanaConnect",
14
+ SOLANA_CONNECTOR = "daimoPaySolanaConnector",
15
+ SOLANA_SELECT_TOKEN = "daimoPaySolanaSelectToken",
16
+ SOLANA_PAY_WITH_TOKEN = "daimoPaySolanaPayWithToken",
11
17
  ONBOARDING = "onboarding",
12
18
  ABOUT = "about",
13
19
  CONNECTORS = "connectors",
@@ -36,6 +42,8 @@ type ContextValue = {
36
42
  setRoute: React.Dispatch<React.SetStateAction<ROUTES>>;
37
43
  connector: Connector;
38
44
  setConnector: React.Dispatch<React.SetStateAction<Connector>>;
45
+ solanaConnector: SolanaWalletName | undefined;
46
+ setSolanaConnector: React.Dispatch<React.SetStateAction<SolanaWalletName | undefined>>;
39
47
  errorMessage: Error;
40
48
  debugMode?: boolean;
41
49
  log: (...props: any) => void;
@@ -57,7 +65,13 @@ type DaimoPayProviderProps = {
57
65
  customTheme?: CustomTheme;
58
66
  options?: DaimoPayContextOptions;
59
67
  debugMode?: boolean;
68
+ /**
69
+ * Be careful with this endpoint, some endpoints (incl. Alchemy) don't support
70
+ * `signatureSubscribe` which leads to txes behaving erratically
71
+ * (ex. successful txes take minutes to confirm instead of seconds)
72
+ */
73
+ solanaRpcUrl?: string;
60
74
  } & useConnectCallbackProps;
61
- export declare const DaimoPayProvider: ({ children, theme, mode, customTheme, options, onConnect, onDisconnect, debugMode, }: DaimoPayProviderProps) => React.FunctionComponentElement<React.ProviderProps<ContextValue | null>>;
75
+ export declare const DaimoPayProvider: (props: DaimoPayProviderProps) => import("react/jsx-runtime").JSX.Element;
62
76
  export declare const useContext: () => ContextValue;
63
77
  export {};
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const ConnectSolana: React.FC;
3
+ export default ConnectSolana;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const ConnectSolana: React.FC;
3
+ export default ConnectSolana;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const PayWithSolanaToken: React.FC;
3
+ export default PayWithSolanaToken;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const SelectSolanaToken: React.FC;
3
+ export default SelectSolanaToken;
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const WaitingBitcoin: React.FC;
3
+ export default WaitingBitcoin;
@@ -1,8 +1,8 @@
1
1
  import React from "react";
2
- declare const CircleSpinner: ({ logo, smallLogo, connecting, unavailable, countdown, }: {
2
+ declare const CircleSpinner: ({ logo, smallLogo, loading, unavailable, countdown, }: {
3
3
  logo?: React.ReactNode;
4
4
  smallLogo?: boolean;
5
- connecting?: boolean;
5
+ loading?: boolean;
6
6
  unavailable?: boolean;
7
7
  countdown?: boolean;
8
8
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
- declare const SquircleSpinner: ({ logo, connecting, }: {
1
+ declare const SquircleSpinner: ({ logo, loading, }: {
2
2
  logo?: React.ReactNode;
3
- connecting?: boolean;
3
+ loading?: boolean;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
5
5
  export default SquircleSpinner;
@@ -0,0 +1,6 @@
1
+ import { WalletName } from "@solana/wallet-adapter-base";
2
+ export type SolanaWalletName = WalletName<string>;
3
+ export declare const SolanaContextProvider: ({ children, solanaRpcUrl, }: {
4
+ children: React.ReactNode;
5
+ solanaRpcUrl?: string;
6
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { BigIntStr, DaimoPayOrder, PlatformType, SolanaPublicKey } from "@daimo/common";
2
+ export declare function usePayWithSolanaToken(orderId: bigint | undefined, setDaimoPayOrder: (order: DaimoPayOrder) => void, chosenFinalTokenAmount: BigIntStr | undefined, platform: PlatformType | undefined): {
3
+ payWithSolanaToken: (inputToken: SolanaPublicKey) => Promise<string>;
4
+ };
@@ -1,7 +1,8 @@
1
- import { DaimoPayOrder, DaimoPayTokenAmount, ExternalPaymentOptionMetadata, ExternalPaymentOptions } from "@daimo/common";
1
+ import { DaimoPayOrder, DaimoPayTokenAmount, ExternalPaymentOptionMetadata, ExternalPaymentOptions, SolanaPublicKey } from "@daimo/common";
2
2
  import { DaimoPayModalOptions } from "../types";
3
3
  import { trpc } from "../utils/trpc";
4
4
  import { useExternalPaymentOptions } from "./useExternalPaymentOptions";
5
+ import { SolanaPaymentOption, useSolanaPaymentOptions } from "./useSolanaPaymentOptions";
5
6
  import { useWalletPaymentOptions, WalletPaymentOption } from "./useWalletPaymentOptions";
6
7
  /** Wallet payment details, sent to processSourcePayment after submitting tx. */
7
8
  export type SourcePayment = Parameters<typeof trpc.processSourcePayment.mutate>[0];
@@ -14,13 +15,22 @@ export interface PaymentInfo {
14
15
  paymentWaitingMessage: string | undefined;
15
16
  externalPaymentOptions: ReturnType<typeof useExternalPaymentOptions>;
16
17
  walletPaymentOptions: ReturnType<typeof useWalletPaymentOptions>;
18
+ solanaPaymentOptions: ReturnType<typeof useSolanaPaymentOptions>;
17
19
  selectedExternalOption: ExternalPaymentOptionMetadata | undefined;
18
20
  selectedTokenOption: WalletPaymentOption | undefined;
21
+ selectedSolanaTokenOption: SolanaPaymentOption | undefined;
19
22
  setSelectedExternalOption: (option: ExternalPaymentOptionMetadata | undefined) => void;
20
23
  setSelectedTokenOption: (option: WalletPaymentOption | undefined) => void;
24
+ setSelectedSolanaTokenOption: (option: SolanaPaymentOption | undefined) => void;
21
25
  setChosenUsd: (amount: number) => void;
22
26
  payWithToken: (tokenAmount: DaimoPayTokenAmount) => Promise<void>;
23
27
  payWithExternal: (option: ExternalPaymentOptions) => Promise<string>;
28
+ payWithBitcoin: () => Promise<{
29
+ address: string;
30
+ amount: number;
31
+ uri: string;
32
+ } | null>;
33
+ payWithSolanaToken: (inputToken: SolanaPublicKey) => Promise<string | undefined>;
24
34
  refreshOrder: () => Promise<void>;
25
35
  onSuccess: (args: {
26
36
  txHash: string;
@@ -0,0 +1,9 @@
1
+ import { trpc } from "../utils/trpc";
2
+ export type SolanaPaymentOption = Awaited<ReturnType<typeof trpc.getSolanaPaymentOptions.query>>[0];
3
+ export declare function useSolanaPaymentOptions({ address, usdRequired, }: {
4
+ address: string | undefined;
5
+ usdRequired: number | undefined;
6
+ }): {
7
+ options: any[] | null;
8
+ isLoading: boolean;
9
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@daimo/pay",
3
3
  "private": false,
4
- "version": "0.3.13",
4
+ "version": "0.3.14",
5
5
  "author": "Daimo",
6
6
  "homepage": "https://pay.daimo.com",
7
7
  "license": "BSD-2-Clause license",
@@ -40,8 +40,11 @@
40
40
  "crypto"
41
41
  ],
42
42
  "dependencies": {
43
- "@daimo/common": "0.3.11",
44
- "@daimo/contract": "0.3.11",
43
+ "@daimo/common": "0.3.14",
44
+ "@daimo/contract": "0.3.14",
45
+ "@solana/wallet-adapter-base": "^0.9.23",
46
+ "@solana/wallet-adapter-react": "^0.15.35",
47
+ "@solana/web3.js": "^1.95.4",
45
48
  "@trpc/client": "^11.0.0-next-beta.318",
46
49
  "@trpc/server": "^11.0.0-next-beta.318",
47
50
  "buffer": "^6.0.3",
@@ -1,9 +0,0 @@
1
- export declare const InfoBox: any;
2
- export declare const InfoBoxButtons: any;
3
- export declare const LearnMoreContainer: any;
4
- export declare const LearnMoreButton: any;
5
- export declare const ConnectorsContainer: any;
6
- export declare const ConnectorButton: any;
7
- export declare const ConnectorRecentlyUsed: any;
8
- export declare const ConnectorLabel: any;
9
- export declare const ConnectorIcon: any;