@daimo/pay 0.3.5 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/build/index.es.js +124 -107
  2. package/build/index.es.js.map +1 -1
  3. package/build/packages/paykit/packages/connectkit/src/assets/chains.d.ts +14 -14
  4. package/build/packages/paykit/packages/connectkit/src/components/Common/Alert/types.d.ts +0 -1
  5. package/build/packages/paykit/packages/connectkit/src/components/Common/ChainSelectList/index.d.ts +1 -1
  6. package/build/packages/paykit/packages/connectkit/src/components/Common/CopyToClipboard/CopyToClipboardIcon.d.ts +2 -2
  7. package/build/packages/paykit/packages/connectkit/src/components/Common/OptionsList/index.d.ts +2 -3
  8. package/build/packages/paykit/packages/connectkit/src/components/Common/OrderHeader/index.d.ts +1 -1
  9. package/build/packages/paykit/packages/connectkit/src/components/Common/Portal/index.d.ts +0 -1
  10. package/build/packages/paykit/packages/connectkit/src/components/Common/ScrollArea/index.d.ts +3 -3
  11. package/build/packages/paykit/packages/connectkit/src/components/Common/Tooltip/types.d.ts +0 -1
  12. package/build/packages/paykit/packages/connectkit/src/components/ConnectModal/index.d.ts +0 -1
  13. package/build/packages/paykit/packages/connectkit/src/components/DaimoPay.d.ts +8 -27
  14. package/build/packages/paykit/packages/connectkit/src/components/DaimoPayButton/index.d.ts +13 -2
  15. package/build/packages/paykit/packages/connectkit/src/components/DaimoPayModal/ConnectUsing.d.ts +2 -0
  16. package/build/packages/paykit/packages/connectkit/src/components/DaimoPayModal/ConnectWithInjector/index.d.ts +15 -0
  17. package/build/packages/paykit/packages/connectkit/src/components/DaimoPayModal/ConnectWithInjector/styles.d.ts +6 -0
  18. package/build/packages/paykit/packages/connectkit/src/components/DaimoPayModal/ConnectWithQRCode.d.ts +5 -0
  19. package/build/packages/paykit/packages/connectkit/src/components/DaimoPayModal/index.d.ts +7 -0
  20. package/build/packages/paykit/packages/connectkit/src/components/Spinners/CircleSpinner/index.d.ts +4 -4
  21. package/build/packages/paykit/packages/connectkit/src/components/Spinners/SquircleSpinner/index.d.ts +1 -1
  22. package/build/packages/paykit/packages/connectkit/src/components/contexts/web3/index.d.ts +1 -1
  23. package/build/packages/paykit/packages/connectkit/src/hooks/useConnect.d.ts +11 -11
  24. package/build/packages/paykit/packages/connectkit/src/hooks/useDaimoPayStatus.d.ts +1 -7
  25. package/build/packages/paykit/packages/connectkit/src/hooks/useFitText.d.ts +0 -1
  26. package/build/packages/paykit/packages/connectkit/src/hooks/useLockBodyScroll.d.ts +0 -1
  27. package/build/packages/paykit/packages/connectkit/src/types.d.ts +33 -2
  28. package/build/packages/paykit/packages/connectkit/src/utils/getPaymentInfo.d.ts +22 -7
  29. package/build/packages/paykit/packages/connectkit/src/utils/index.d.ts +6 -7
  30. package/build/packages/paykit/packages/connectkit/src/wallets/walletConfigs.d.ts +0 -1
  31. package/package.json +3 -3
package/build/index.es.js CHANGED
@@ -5,7 +5,7 @@ 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 { readDaimoPayOrderID, assert, assertNotNull, DaimoPayOrderMode, DaimoPayOrderStatusDest, capitalize, ExternalPaymentOptions, getAddressContraction, getDisplayPrice, writeDaimoPayOrderID, DaimoPayOrderStatusSource } from '@daimo/common';
8
+ import { readDaimoPayOrderID, assert, assertNotNull, DaimoPayOrderMode, DaimoPayOrderStatusDest, ExternalPaymentOptions, getAddressContraction, capitalize, getDisplayPrice, debugJson, writeDaimoPayOrderID, DaimoPayIntentStatus, DaimoPayOrderStatusSource } from '@daimo/common';
9
9
  import styled$1, { css, keyframes, ThemeProvider } from 'styled-components';
10
10
  import { erc20Abi, getChainName, ethereum, arbitrum as arbitrum$1, base as base$2, optimism as optimism$1, polygon as polygon$1, ethereumSepolia, baseSepolia as baseSepolia$1, getChainExplorerTxUrl } from '@daimo/contract';
11
11
  import { zeroAddress, parseUnits } from 'viem';
@@ -900,14 +900,17 @@ const trpc = createTRPCClient({
900
900
  ],
901
901
  });
902
902
 
903
- function getPaymentInfo() {
903
+ function getPaymentInfo(setOpen, log) {
904
904
  // Wallet state.
905
905
  const { address: senderAddr } = useAccount();
906
906
  const { writeContractAsync } = useWriteContract();
907
907
  const { sendTransactionAsync } = useSendTransaction();
908
908
  // Daimo Pay order state.
909
- const [daimoPayOrder, setDaimoPayOrder] = useState(null);
910
- const [paymentWaitingMessage, setPaymentWaitingMessage] = useState(null);
909
+ const [daimoPayOrder, setDaimoPayOrder] = useState();
910
+ const [paymentWaitingMessage, setPaymentWaitingMessage] = useState();
911
+ // Payment UI config.
912
+ const [modalOptions, setModalOptions] = useState({});
913
+ // UI state. Selection for external payment (Binance, etc) vs wallet payment.
911
914
  const [selectedExternalOption, setSelectedExternalOption] = useState();
912
915
  const [selectedTokenOption, setSelectedTokenOption] = useState();
913
916
  const payWithToken = async (tokenAmount) => {
@@ -918,7 +921,7 @@ function getPaymentInfo() {
918
921
  platform: detectPlatform(window.navigator.userAgent),
919
922
  refundAddress: senderAddr,
920
923
  });
921
- console.log(`[CHECKOUT] Hydrated order: ${JSON.stringify(hydratedOrder)}, checking out with ${tokenAmount.token.token}`);
924
+ log(`[CHECKOUT] Hydrated order: ${JSON.stringify(hydratedOrder)}, checking out with ${tokenAmount.token.token}`);
922
925
  const txHash = await (async () => {
923
926
  try {
924
927
  if (tokenAmount.token.token === zeroAddress) {
@@ -978,8 +981,9 @@ function getPaymentInfo() {
978
981
  });
979
982
  setDaimoPayOrder(order);
980
983
  }, [daimoPayOrder?.id]);
984
+ /** User picked a different deposit amount. */
981
985
  const setChosenUsd = (usdAmount) => {
982
- console.log(`[CHECKOUT] Setting chosen USD amount to ${usdAmount}`);
986
+ log(`[CHECKOUT] Setting chosen USD amount to ${usdAmount}`);
983
987
  assert(!!daimoPayOrder);
984
988
  const token = daimoPayOrder.destFinalCallTokenAmount.token;
985
989
  const tokenAmount = parseUnits((usdAmount / token.usd).toString(), token.decimals);
@@ -1005,12 +1009,20 @@ function getPaymentInfo() {
1005
1009
  console.error(`[CHECKOUT] No order found for ${payId}`);
1006
1010
  return;
1007
1011
  }
1008
- console.log(`[CHECKOUT] Parsed order: ${JSON.stringify(order)}`);
1012
+ log(`[CHECKOUT] Parsed order: ${JSON.stringify(order)}`);
1009
1013
  setDaimoPayOrder(order);
1010
1014
  }, [daimoPayOrder]);
1015
+ const onSuccess = ({ txHash, txURL }) => {
1016
+ if (modalOptions?.closeOnSuccess) {
1017
+ log(`[CHECKOUT] transaction succeeded, closing: ${txHash} ${txURL}`);
1018
+ setTimeout(() => setOpen(false), 1000);
1019
+ }
1020
+ };
1011
1021
  return {
1012
1022
  setPayId,
1013
1023
  daimoPayOrder,
1024
+ modalOptions,
1025
+ setModalOptions,
1014
1026
  paymentWaitingMessage,
1015
1027
  selectedExternalOption,
1016
1028
  selectedTokenOption,
@@ -1020,6 +1032,7 @@ function getPaymentInfo() {
1020
1032
  payWithToken,
1021
1033
  payWithExternal,
1022
1034
  refreshOrder,
1035
+ onSuccess,
1023
1036
  };
1024
1037
  }
1025
1038
 
@@ -2164,7 +2177,7 @@ const ResetContainer = styled(motion.div) `
2164
2177
  `;
2165
2178
 
2166
2179
  var name = "@daimo/pay";
2167
- var version = "0.3.5";
2180
+ var version = "0.3.7";
2168
2181
  var author = "Daimo";
2169
2182
  var homepage = "https://pay.daimo.com";
2170
2183
  var license = "BSD-2-Clause license";
@@ -2203,8 +2216,8 @@ var keywords = [
2203
2216
  "crypto"
2204
2217
  ];
2205
2218
  var dependencies = {
2206
- "@daimo/common": "0.3.1",
2207
- "@daimo/contract": "0.3.1",
2219
+ "@daimo/common": "0.3.6",
2220
+ "@daimo/contract": "0.3.6",
2208
2221
  "@trpc/client": "^11.0.0-next-beta.318",
2209
2222
  "@trpc/server": "^11.0.0-next-beta.318",
2210
2223
  buffer: "^6.0.3",
@@ -6609,6 +6622,7 @@ const ScrollAreaContainer = styled.div `
6609
6622
 
6610
6623
  const ArrowDown = () => (jsx("svg", { width: "11", height: "12", viewBox: "0 0 11 12", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: jsx("path", { d: "M5.49438 1L5.49438 11M5.49438 11L9.5 7M5.49438 11L1.5 7", stroke: "currentColor", strokeWidth: "1.75", strokeLinecap: "round", strokeLinejoin: "round" }) }));
6611
6624
  const ScrollArea = ({ children, height, backgroundColor, mobileDirection, }) => {
6625
+ const { log } = useContext();
6612
6626
  const ref = useRef(null);
6613
6627
  const moreRef = useRef(null);
6614
6628
  const isMobile = useIsMobile();
@@ -6622,7 +6636,7 @@ const ScrollArea = ({ children, height, backgroundColor, mobileDirection, }) =>
6622
6636
  moreRef.current.classList.remove("hide");
6623
6637
  }
6624
6638
  }
6625
- console.log(`[SCROLL AREA]: ${el.scrollHeight}, ${el.clientHeight}`);
6639
+ log(`[SCROLL AREA]: ${el.scrollHeight}, ${el.clientHeight}`);
6626
6640
  const handleScroll = (e) => {
6627
6641
  const { scrollTop, scrollHeight, clientHeight, scrollLeft, scrollWidth, clientWidth, } = e.target;
6628
6642
  if (moreRef.current) {
@@ -6959,6 +6973,7 @@ const InputField = styled(motion.input) `
6959
6973
  line-height: inherit;
6960
6974
  font-size: inherit;
6961
6975
  font-weight: inherit;
6976
+ color: inherit;
6962
6977
  border: none;
6963
6978
  padding: 0;
6964
6979
  &:focus {
@@ -10036,24 +10051,27 @@ const Confirmation = () => {
10036
10051
  }, 300);
10037
10052
  return () => clearInterval(interval);
10038
10053
  }, [refreshOrder]);
10039
- const { done, txURL, currency } = (() => {
10054
+ const { done, txURL } = (() => {
10040
10055
  if (daimoPayOrder && daimoPayOrder.mode === DaimoPayOrderMode.HYDRATED) {
10041
- if (daimoPayOrder.destStatus === DaimoPayOrderStatusDest.CLAIMED ||
10042
- daimoPayOrder.destStatus === DaimoPayOrderStatusDest.FAST_FINISHED) {
10056
+ // Frontends are optimistic, assume submits will be successful
10057
+ const { destStatus } = daimoPayOrder;
10058
+ if (destStatus === DaimoPayOrderStatusDest.FAST_FINISH_SUBMITTED ||
10059
+ destStatus === DaimoPayOrderStatusDest.FAST_FINISHED ||
10060
+ destStatus === DaimoPayOrderStatusDest.CLAIM_SUCCESSFUL) {
10043
10061
  const txHash = daimoPayOrder.destFastFinishTxHash ?? daimoPayOrder.destClaimTxHash;
10044
10062
  const chainId = daimoPayOrder.destFinalCallTokenAmount.token.chainId;
10045
- const currency = `${capitalize(getChainName(chainId))} ${daimoPayOrder.destFinalCallTokenAmount.token.symbol}`;
10063
+ assert(txHash != null, `Dest ${destStatus}, but missing txHash`);
10064
+ const txURL = getChainExplorerTxUrl(chainId, txHash);
10065
+ paymentInfo.onSuccess({ txHash, txURL });
10046
10066
  return {
10047
10067
  done: true,
10048
- txURL: txHash ? getChainExplorerTxUrl(chainId, txHash) : undefined,
10049
- currency,
10068
+ txURL,
10050
10069
  };
10051
10070
  }
10052
10071
  }
10053
10072
  return {
10054
10073
  done: false,
10055
10074
  txURL: undefined,
10056
- currency: undefined,
10057
10075
  };
10058
10076
  })();
10059
10077
  return (jsx(PageContent, { style: {
@@ -10065,7 +10083,7 @@ const Confirmation = () => {
10065
10083
  justifyContent: "center",
10066
10084
  alignItems: "center",
10067
10085
  paddingBottom: 0,
10068
- }, children: [jsx(AnimationContainer$2, { children: jsxs(InsetContainer, { children: [jsx(Spinner, { "$status": done }), jsx(SuccessIcon, { "$status": done })] }) }), !done ? (jsx(ModalH1, { children: "Confirming..." })) : (jsx(ModalH1, { children: jsxs(Link, { href: txURL, target: "_blank", rel: "noopener noreferrer", children: ["Payment completed in ", currency] }) })), jsx(PoweredByFooter, {})] }) }));
10086
+ }, 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, {})] }) }));
10069
10087
  };
10070
10088
  const AnimationContainer$2 = styled(motion.div) `
10071
10089
  position: relative;
@@ -10131,7 +10149,7 @@ var PayState;
10131
10149
  PayState["RequestSuccessful"] = "Payment Successful";
10132
10150
  })(PayState || (PayState = {}));
10133
10151
  const PayWithToken = () => {
10134
- const { triggerResize, paymentInfo, setRoute } = useContext();
10152
+ const { triggerResize, paymentInfo, setRoute, log } = useContext();
10135
10153
  const { selectedTokenOption, payWithToken } = paymentInfo;
10136
10154
  const [payState, setPayState] = useState(PayState.RequestingPayment);
10137
10155
  const walletChainId = useChainId();
@@ -10160,7 +10178,7 @@ const PayWithToken = () => {
10160
10178
  setPayState(PayState.SwitchingChain);
10161
10179
  const switchChain = await trySwitchingChain(option);
10162
10180
  if (!switchChain) {
10163
- console.log("Switching chain failed");
10181
+ console.error("Switching chain failed");
10164
10182
  setPayState(PayState.RequestCancelled);
10165
10183
  return;
10166
10184
  }
@@ -10176,7 +10194,7 @@ const PayWithToken = () => {
10176
10194
  if (e?.name === "ConnectorChainMismatchError") {
10177
10195
  // Workaround for Rainbow wallet bug -- user is able to switch chain without
10178
10196
  // the wallet updating the chain ID for wagmi.
10179
- console.log("Chain mismatch detected, attempting to switch and retry");
10197
+ log("Chain mismatch detected, attempting to switch and retry");
10180
10198
  const switchSuccessful = await trySwitchingChain(option, true);
10181
10199
  if (switchSuccessful) {
10182
10200
  try {
@@ -10434,10 +10452,10 @@ const OptionsContainer = styled.div `
10434
10452
  `;
10435
10453
 
10436
10454
  const OptionsList = ({ options, isLoading, requiredSkeletons, }) => {
10437
- const { triggerResize } = useContext();
10455
+ const { triggerResize, log } = useContext();
10438
10456
  const optionsLength = options.length;
10439
10457
  useEffect(() => {
10440
- console.log(`[OPTIONS RESIZE]: ${optionsLength}, triggering resize`);
10458
+ log(`[OPTIONS RESIZE]: ${optionsLength}, triggering resize`);
10441
10459
  if (optionsLength > 0) {
10442
10460
  triggerResize();
10443
10461
  }
@@ -10649,6 +10667,7 @@ const SelectToken = () => {
10649
10667
  useEffect(() => {
10650
10668
  if (!payerAddress || !daimoPayOrder)
10651
10669
  return;
10670
+ setPaymentOptions(null);
10652
10671
  setIsLoadingOptions(true);
10653
10672
  const destChainId = daimoPayOrder.destFinalCallTokenAmount.token.chainId;
10654
10673
  trpc.getWalletPaymentOptions
@@ -10666,7 +10685,7 @@ const SelectToken = () => {
10666
10685
  justifyContent: "center",
10667
10686
  paddingTop: 16,
10668
10687
  paddingBottom: 16,
10669
- }, 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: isLoadingOptions, options: paymentOptions?.map((option) => {
10688
+ }, 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: isLoadingOptions, options: paymentOptions?.map((option) => {
10670
10689
  const capitalizedChainName = capitalize(getChainName(option.required.token.chainId));
10671
10690
  const title = `${getDisplayPrice(option.required)} ${option.required.token.symbol} on ${capitalizedChainName}`;
10672
10691
  const subtitle = `Balance: ${getDisplayPrice(option.balance)} ${option.balance.token.symbol}`;
@@ -10688,6 +10707,7 @@ const SelectToken = () => {
10688
10707
  const WaitingOther = () => {
10689
10708
  const { triggerResize, paymentInfo, setRoute } = useContext();
10690
10709
  const { selectedExternalOption, payWithExternal, paymentWaitingMessage, daimoPayOrder, } = paymentInfo;
10710
+ const [externalURL, setExternalURL] = useState(null);
10691
10711
  useEffect(() => {
10692
10712
  const checkForSourcePayment = async () => {
10693
10713
  if (!daimoPayOrder)
@@ -10702,6 +10722,20 @@ const WaitingOther = () => {
10702
10722
  const interval = setInterval(checkForSourcePayment, 1000);
10703
10723
  return () => clearInterval(interval);
10704
10724
  }, [daimoPayOrder?.id]);
10725
+ useEffect(() => {
10726
+ if (!selectedExternalOption)
10727
+ return;
10728
+ payWithExternal(selectedExternalOption.id).then((url) => {
10729
+ setExternalURL(url);
10730
+ setTimeout(() => {
10731
+ window.open(url, "_blank");
10732
+ });
10733
+ });
10734
+ }, [selectedExternalOption]);
10735
+ const waitingMessageLength = paymentWaitingMessage?.length;
10736
+ useEffect(() => {
10737
+ triggerResize();
10738
+ }, [waitingMessageLength, externalURL]);
10705
10739
  if (!selectedExternalOption) {
10706
10740
  return jsx(PageContent, {});
10707
10741
  }
@@ -10713,23 +10747,10 @@ const WaitingOther = () => {
10713
10747
  return (jsx(SquircleSpinner, { logo: jsx("img", { src: selectedExternalOption.logoURI }), connecting: true }));
10714
10748
  }
10715
10749
  })();
10716
- useEffect(() => {
10717
- if (!selectedExternalOption)
10718
- return;
10719
- // Note: Safari doesn't support window.open in an async function.
10720
- // We need to trigger this in the main thread:
10721
- // https://stackoverflow.com/a/39387533
10722
- const windowOpen = window.open("about:blank", "_blank");
10723
- payWithExternal(selectedExternalOption.id).then((url) => {
10724
- if (windowOpen)
10725
- windowOpen.location.href = url;
10726
- });
10727
- }, [selectedExternalOption]);
10728
- const waitingMessageLength = paymentWaitingMessage?.length;
10729
- useEffect(() => {
10730
- triggerResize();
10731
- }, [waitingMessageLength]);
10732
- 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 }, children: paymentWaitingMessage }))] })] }));
10750
+ 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: () => {
10751
+ if (externalURL)
10752
+ window.open(externalURL, "_blank");
10753
+ }, children: "Open in New Tab" })] })] }));
10733
10754
  };
10734
10755
  const LoadingContainer = styled(motion.div) `
10735
10756
  display: flex;
@@ -10759,7 +10780,7 @@ const AnimationContainer = styled(motion.div) `
10759
10780
  `;
10760
10781
 
10761
10782
  const customThemeDefault = {};
10762
- const ConnectModal = ({ mode = "auto", theme = "auto", customTheme = customThemeDefault, lang = "en-US", }) => {
10783
+ const DaimoPayModal = ({ mode = "auto", theme = "auto", customTheme = customThemeDefault, lang = "en-US", }) => {
10763
10784
  const context = useContext();
10764
10785
  const { setSelectedExternalOption, setSelectedTokenOption } = context.paymentInfo;
10765
10786
  const { isConnected, chain } = useAccount();
@@ -10820,7 +10841,9 @@ const ConnectModal = ({ mode = "auto", theme = "auto", customTheme = customTheme
10820
10841
  context.setOpen(false);
10821
10842
  }
10822
10843
  useEffect(() => {
10823
- if (context.route === ROUTES.CONNECT || context.route === ROUTES.CONNECTORS || context.route === ROUTES.MOBILECONNECTORS) {
10844
+ if (context.route === ROUTES.CONNECT ||
10845
+ context.route === ROUTES.CONNECTORS ||
10846
+ context.route === ROUTES.MOBILECONNECTORS) {
10824
10847
  if (isConnected) {
10825
10848
  context.setRoute(ROUTES.SELECT_TOKEN);
10826
10849
  }
@@ -10915,6 +10938,7 @@ const DaimoPayProvider = ({ children, theme = "auto", mode = "auto", customTheme
10915
10938
  enforceSupportedChains: false,
10916
10939
  ethereumOnboardingUrl: undefined,
10917
10940
  walletOnboardingUrl: undefined,
10941
+ overlayBlur: undefined,
10918
10942
  };
10919
10943
  const opts = Object.assign({}, defaultOptions, options);
10920
10944
  if (typeof window !== "undefined") {
@@ -10963,9 +10987,11 @@ const DaimoPayProvider = ({ children, theme = "auto", mode = "auto", customTheme
10963
10987
  }
10964
10988
  }, [injectedConnector]);
10965
10989
  const log = debugMode ? console.log : () => { };
10966
- const paymentInfo = getPaymentInfo();
10967
- const loadPayment = async (payId) => {
10990
+ const paymentInfo = getPaymentInfo(setOpen, log);
10991
+ const loadAndShowPayment = async (payId, modalOptions) => {
10992
+ log(`[PAY] showing order ${payId}, options ${debugJson(modalOptions)}`);
10968
10993
  await paymentInfo.setPayId(payId);
10994
+ paymentInfo.setModalOptions(modalOptions);
10969
10995
  const daimoPayOrder = paymentInfo.daimoPayOrder;
10970
10996
  if (daimoPayOrder &&
10971
10997
  daimoPayOrder.mode === DaimoPayOrderMode.HYDRATED &&
@@ -10975,6 +11001,7 @@ const DaimoPayProvider = ({ children, theme = "auto", mode = "auto", customTheme
10975
11001
  else {
10976
11002
  setRoute(ROUTES.SELECT_METHOD);
10977
11003
  }
11004
+ setOpen(true);
10978
11005
  };
10979
11006
  const value = {
10980
11007
  theme: ckTheme,
@@ -10989,7 +11016,7 @@ const DaimoPayProvider = ({ children, theme = "auto", mode = "auto", customTheme
10989
11016
  setOpen,
10990
11017
  route,
10991
11018
  setRoute,
10992
- loadPayment,
11019
+ loadAndShowPayment,
10993
11020
  connector,
10994
11021
  setConnector,
10995
11022
  onConnect,
@@ -11010,7 +11037,7 @@ const DaimoPayProvider = ({ children, theme = "auto", mode = "auto", customTheme
11010
11037
  triggerResize: () => onResize((prev) => prev + 1),
11011
11038
  paymentInfo,
11012
11039
  };
11013
- return createElement(Context.Provider, { value }, jsx(Web3ContextProvider, { enabled: open, children: jsxs(ThemeProvider, { theme: defaultTheme$1, children: [children, jsx(ConnectModal, { lang: ckLang, theme: ckTheme, mode: mode, customTheme: ckCustomTheme })] }) }));
11040
+ 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 })] }) }));
11014
11041
  };
11015
11042
  const useContext = () => {
11016
11043
  const context = React.useContext(Context);
@@ -11019,41 +11046,6 @@ const useContext = () => {
11019
11046
  return context;
11020
11047
  };
11021
11048
 
11022
- const useModal = ({ onConnect, onDisconnect } = {}) => {
11023
- const context = useContext();
11024
- useConnectCallback({
11025
- onConnect,
11026
- onDisconnect,
11027
- });
11028
- const close = () => {
11029
- context.setOpen(false);
11030
- };
11031
- const open = () => {
11032
- context.setOpen(true);
11033
- };
11034
- const gotoAndOpen = (route) => {
11035
- context.setRoute(route);
11036
- open();
11037
- };
11038
- return {
11039
- open: context.open,
11040
- setOpen: (show) => {
11041
- if (show) {
11042
- gotoAndOpen(ROUTES.SELECT_METHOD);
11043
- }
11044
- else {
11045
- close();
11046
- }
11047
- },
11048
- // Disconnected Routes
11049
- openAbout: () => gotoAndOpen(ROUTES.ABOUT),
11050
- openOnboarding: () => gotoAndOpen(ROUTES.ONBOARDING),
11051
- // Connected Routes
11052
- openProfile: () => gotoAndOpen(ROUTES.PROFILE),
11053
- openSwitchNetworks: () => gotoAndOpen(ROUTES.SWITCHNETWORKS),
11054
- };
11055
- };
11056
-
11057
11049
  const TextContainer = styled(motion.div) `
11058
11050
  top: 0;
11059
11051
  bottom: 0;
@@ -11290,28 +11282,23 @@ const contentVariants = {
11290
11282
  },
11291
11283
  },
11292
11284
  };
11293
- const DaimoPayButtonRenderer = ({ payId, children, }) => {
11285
+ const DaimoPayButtonRenderer = ({ payId, closeOnSuccess, children, }) => {
11294
11286
  const isMounted = useIsMounted();
11295
11287
  const context = useContext();
11296
- const { open, setOpen } = useModal();
11297
- const { address, isConnected, chain } = useAccount();
11288
+ const { address, chain } = useAccount();
11298
11289
  const isChainSupported = useChainIsSupported(chain?.id);
11299
11290
  const { data: ensName } = useEnsName({
11300
11291
  chainId: 1,
11301
11292
  address: address,
11302
11293
  });
11303
- function hide() {
11304
- setOpen(false);
11305
- }
11306
11294
  // Pre-load payment info in background.
11307
11295
  const { setPayId } = context.paymentInfo;
11308
11296
  useEffect(() => {
11309
11297
  setPayId(payId);
11310
11298
  }, [payId]);
11311
- async function show() {
11312
- await context.loadPayment(payId); // ensure payment info is loaded before opening.
11313
- context.setOpen(true);
11314
- }
11299
+ const hide = () => context.setOpen(false);
11300
+ const modalOptions = { closeOnSuccess };
11301
+ const show = () => context.loadAndShowPayment(payId, modalOptions);
11315
11302
  if (!children)
11316
11303
  return null;
11317
11304
  if (!isMounted)
@@ -11323,7 +11310,7 @@ const DaimoPayButtonRenderer = ({ payId, children, }) => {
11323
11310
  chain: chain,
11324
11311
  unsupported: !isChainSupported,
11325
11312
  isConnected: !!address,
11326
- isConnecting: open, // Using `open` to determine if connecting as wagmi isConnecting only is set to true when an active connector is awaiting connection
11313
+ isConnecting: context.open,
11327
11314
  address: address,
11328
11315
  truncatedAddress: address ? truncateEthAddress(address) : undefined,
11329
11316
  ensName: ensName?.toString(),
@@ -11332,17 +11319,12 @@ const DaimoPayButtonRenderer = ({ payId, children, }) => {
11332
11319
  DaimoPayButtonRenderer.displayName = "DaimoPayButton.Custom";
11333
11320
  function DaimoPayButtonInner() {
11334
11321
  const { paymentInfo } = useContext();
11335
- const label = paymentInfo?.daimoPayOrder?.metadata.intent ?? "Pay";
11322
+ const label = paymentInfo?.daimoPayOrder?.metadata?.intent ?? "Pay";
11336
11323
  return (jsx(AnimatePresence, { initial: false, children: jsx(TextContainer, { initial: "initial", animate: "animate", exit: "exit", variants: contentVariants, style: {
11337
11324
  height: 40,
11338
- //padding: '0 5px',
11339
11325
  }, children: label }, "connectWalletText") }));
11340
11326
  }
11341
- function DaimoPayButton({ payId,
11342
- // Theming
11343
- theme, mode, customTheme,
11344
- // Events
11345
- onClick, }) {
11327
+ function DaimoPayButton({ payId, theme, mode, customTheme, closeOnSuccess, onClick, }) {
11346
11328
  const isMounted = useIsMounted();
11347
11329
  const context = useContext();
11348
11330
  // Pre-load payment info in background.
@@ -11350,10 +11332,8 @@ onClick, }) {
11350
11332
  useEffect(() => {
11351
11333
  setPayId(payId);
11352
11334
  }, [payId]);
11353
- async function show() {
11354
- await context.loadPayment(payId); // ensure payment info is loaded
11355
- context.setOpen(true);
11356
- }
11335
+ const modalOptions = { closeOnSuccess };
11336
+ const show = () => context.loadAndShowPayment(payId, modalOptions);
11357
11337
  if (!isMounted)
11358
11338
  return null;
11359
11339
  return (jsx(ResetContainer, { "$useTheme": theme ?? context.theme, "$useMode": mode ?? context.mode, "$customTheme": customTheme ?? context.customTheme, children: jsx(ThemeContainer, { onClick: () => {
@@ -11367,6 +11347,41 @@ onClick, }) {
11367
11347
  }
11368
11348
  DaimoPayButton.Custom = DaimoPayButtonRenderer;
11369
11349
 
11350
+ const useModal = ({ onConnect, onDisconnect } = {}) => {
11351
+ const context = useContext();
11352
+ useConnectCallback({
11353
+ onConnect,
11354
+ onDisconnect,
11355
+ });
11356
+ const close = () => {
11357
+ context.setOpen(false);
11358
+ };
11359
+ const open = () => {
11360
+ context.setOpen(true);
11361
+ };
11362
+ const gotoAndOpen = (route) => {
11363
+ context.setRoute(route);
11364
+ open();
11365
+ };
11366
+ return {
11367
+ open: context.open,
11368
+ setOpen: (show) => {
11369
+ if (show) {
11370
+ gotoAndOpen(ROUTES.SELECT_METHOD);
11371
+ }
11372
+ else {
11373
+ close();
11374
+ }
11375
+ },
11376
+ // Disconnected Routes
11377
+ openAbout: () => gotoAndOpen(ROUTES.ABOUT),
11378
+ openOnboarding: () => gotoAndOpen(ROUTES.ONBOARDING),
11379
+ // Connected Routes
11380
+ openProfile: () => gotoAndOpen(ROUTES.PROFILE),
11381
+ openSwitchNetworks: () => gotoAndOpen(ROUTES.SWITCHNETWORKS),
11382
+ };
11383
+ };
11384
+
11370
11385
  function useDaimoPayStatus() {
11371
11386
  const { paymentInfo } = useContext();
11372
11387
  const status = (() => {
@@ -11375,9 +11390,11 @@ function useDaimoPayStatus() {
11375
11390
  const order = paymentInfo.daimoPayOrder;
11376
11391
  const paymentId = writeDaimoPayOrderID(order.id);
11377
11392
  if (order.mode === DaimoPayOrderMode.HYDRATED) {
11378
- if (order.destStatus === DaimoPayOrderStatusDest.FAST_FINISHED || order.destStatus === DaimoPayOrderStatusDest.CLAIMED) {
11393
+ if (order.intentStatus != DaimoPayIntentStatus.PENDING) {
11379
11394
  return {
11380
- status: "payment_completed",
11395
+ status: order.intentStatus === DaimoPayIntentStatus.SUCCESSFUL
11396
+ ? "payment_completed"
11397
+ : "payment_bounced",
11381
11398
  paymentId,
11382
11399
  };
11383
11400
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -7,7 +7,7 @@ export declare const Optimism: ({ testnet, ...props }: Logo) => import("react/js
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
9
  export declare const Base: ({ testnet, ...props }: {
10
- testnet?: boolean | undefined;
10
+ testnet?: boolean;
11
11
  }) => import("react/jsx-runtime").JSX.Element;
12
12
  export declare const chainToLogo: {
13
13
  [x: number]: import("react/jsx-runtime").JSX.Element;
@@ -15,30 +15,30 @@ export declare const chainToLogo: {
15
15
  declare const _default: {
16
16
  UnknownChain: ({ testnet, ...props }: Logo) => import("react/jsx-runtime").JSX.Element;
17
17
  Base: ({ testnet, ...props }: {
18
- testnet?: boolean | undefined;
18
+ testnet?: boolean;
19
19
  }) => import("react/jsx-runtime").JSX.Element;
20
20
  Ethereum: ({ testnet, ...props }: Logo) => import("react/jsx-runtime").JSX.Element;
21
21
  Polygon: ({ testnet, ...props }: Logo) => import("react/jsx-runtime").JSX.Element;
22
22
  Optimism: ({ testnet, ...props }: Logo) => import("react/jsx-runtime").JSX.Element;
23
23
  Arbitrum: ({ testnet, ...props }: Logo) => import("react/jsx-runtime").JSX.Element;
24
24
  Aurora: ({ testnet, ...props }: {
25
- testnet?: boolean | undefined;
25
+ testnet?: boolean;
26
26
  }) => import("react/jsx-runtime").JSX.Element;
27
27
  Avalanche: ({ testnet, ...props }: {
28
- testnet?: boolean | undefined;
28
+ testnet?: boolean;
29
29
  }) => import("react/jsx-runtime").JSX.Element;
30
30
  Celo: ({ testnet, ...props }: {
31
- testnet?: boolean | undefined;
31
+ testnet?: boolean;
32
32
  }) => import("react/jsx-runtime").JSX.Element;
33
33
  Telos: ({ testnet, ...props }: Logo) => import("react/jsx-runtime").JSX.Element;
34
34
  Gnosis: ({ testnet, ...props }: {
35
- testnet?: boolean | undefined;
35
+ testnet?: boolean;
36
36
  }) => import("react/jsx-runtime").JSX.Element;
37
37
  Evmos: ({ testnet, ...props }: {
38
- testnet?: boolean | undefined;
38
+ testnet?: boolean;
39
39
  }) => import("react/jsx-runtime").JSX.Element;
40
40
  BinanceSmartChain: ({ testnet, ...props }: {
41
- testnet?: boolean | undefined;
41
+ testnet?: boolean;
42
42
  }) => import("react/jsx-runtime").JSX.Element;
43
43
  Foundry: ({ testnet, ...props }: Logo) => import("react/jsx-runtime").JSX.Element;
44
44
  Sepolia: ({ testnet, ...props }: Logo) => import("react/jsx-runtime").JSX.Element;
@@ -46,22 +46,22 @@ declare const _default: {
46
46
  zkSync: ({ testnet, ...props }: Logo) => import("react/jsx-runtime").JSX.Element;
47
47
  Flare: ({ testnet, ...props }: Logo) => import("react/jsx-runtime").JSX.Element;
48
48
  Canto: ({ testnet, ...props }: {
49
- testnet?: boolean | undefined;
49
+ testnet?: boolean;
50
50
  }) => import("react/jsx-runtime").JSX.Element;
51
51
  Fantom: ({ testnet, ...props }: {
52
- testnet?: boolean | undefined;
52
+ testnet?: boolean;
53
53
  }) => import("react/jsx-runtime").JSX.Element;
54
54
  Filecoin: ({ testnet, ...props }: {
55
- testnet?: boolean | undefined;
55
+ testnet?: boolean;
56
56
  }) => import("react/jsx-runtime").JSX.Element;
57
57
  Metis: ({ testnet, ...props }: {
58
- testnet?: boolean | undefined;
58
+ testnet?: boolean;
59
59
  }) => import("react/jsx-runtime").JSX.Element;
60
60
  IoTeX: ({ testnet, ...props }: {
61
- testnet?: boolean | undefined;
61
+ testnet?: boolean;
62
62
  }) => import("react/jsx-runtime").JSX.Element;
63
63
  Zora: ({ testnet, ...props }: {
64
- testnet?: boolean | undefined;
64
+ testnet?: boolean;
65
65
  }) => import("react/jsx-runtime").JSX.Element;
66
66
  };
67
67
  export default _default;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type AlertProps = {
3
2
  children?: React.ReactNode;
4
3
  icon?: React.ReactNode;
@@ -1,4 +1,4 @@
1
1
  declare const ChainSelectList: ({ variant, }: {
2
- variant?: "primary" | "secondary" | undefined;
2
+ variant?: "primary" | "secondary";
3
3
  }) => import("react/jsx-runtime").JSX.Element;
4
4
  export default ChainSelectList;
@@ -1,5 +1,5 @@
1
1
  declare const CopyToClipboardIcon: ({ copied, small, }: {
2
- copied?: boolean | undefined;
3
- small?: boolean | undefined;
2
+ copied?: boolean;
3
+ small?: boolean;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
5
5
  export default CopyToClipboardIcon;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  interface Option {
3
2
  id: string;
4
3
  title: string;
@@ -8,7 +7,7 @@ interface Option {
8
7
  }
9
8
  declare const OptionsList: ({ options, isLoading, requiredSkeletons, }: {
10
9
  options: Option[];
11
- isLoading?: boolean | undefined;
12
- requiredSkeletons?: number | undefined;
10
+ isLoading?: boolean;
11
+ requiredSkeletons?: number;
13
12
  }) => import("react/jsx-runtime").JSX.Element;
14
13
  export default OptionsList;
@@ -1,3 +1,3 @@
1
1
  export declare const OrderHeader: ({ minified }: {
2
- minified?: boolean | undefined;
2
+ minified?: boolean;
3
3
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Portal: (props: any) => import("react").ReactPortal | null;
3
2
  export default Portal;
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  export declare const ScrollArea: ({ children, height, backgroundColor, mobileDirection, }: {
3
3
  children: React.ReactNode;
4
- height?: number | undefined;
5
- backgroundColor?: string | undefined;
6
- mobileDirection?: "horizontal" | "vertical" | undefined;
4
+ height?: number;
5
+ backgroundColor?: string;
6
+ mobileDirection?: "horizontal" | "vertical";
7
7
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type TooltipSizeProps = "small" | "large";
3
2
  export type TooltipProps = {
4
3
  message?: string | React.ReactNode;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { CustomTheme, Languages, Mode, Theme } from "../../types";
3
2
  declare const ConnectModal: React.FC<{
4
3
  mode?: Mode;
@@ -1,5 +1,5 @@
1
- import React, { ReactNode } from "react";
2
- import { CustomAvatarProps, CustomTheme, Languages, Mode, Theme } from "../types";
1
+ import React from "react";
2
+ import { CustomTheme, DaimoPayContextOptions, DaimoPayModalOptions, Languages, Mode, Theme } from "../types";
3
3
  import { useConnectCallbackProps } from "../hooks/useConnectCallback";
4
4
  import { PaymentInfo } from "../utils/getPaymentInfo";
5
5
  export declare enum ROUTES {
@@ -34,47 +34,28 @@ type ContextValue = {
34
34
  setOpen: React.Dispatch<React.SetStateAction<boolean>>;
35
35
  route: string;
36
36
  setRoute: React.Dispatch<React.SetStateAction<ROUTES>>;
37
- loadPayment: (payId: string) => Promise<void>;
38
37
  connector: Connector;
39
38
  setConnector: React.Dispatch<React.SetStateAction<Connector>>;
40
39
  errorMessage: Error;
41
- options?: DaimoPayOptions;
42
40
  debugMode?: boolean;
43
41
  log: (...props: any) => void;
44
42
  displayError: (message: string | React.ReactNode | null, code?: any) => void;
45
43
  resize: number;
46
44
  triggerResize: () => void;
45
+ /** Global options, across all pay buttons and payments. */
46
+ options?: DaimoPayContextOptions;
47
+ /** Loads a payment, then shows the modal to complete payment. */
48
+ loadAndShowPayment: (payId: string, modalOptions: DaimoPayModalOptions) => Promise<void>;
49
+ /** Payment status & callbacks. */
47
50
  paymentInfo: PaymentInfo;
48
51
  } & useConnectCallbackProps;
49
52
  export declare const Context: React.Context<ContextValue | null>;
50
- export type DaimoPayOptions = {
51
- language?: Languages;
52
- hideBalance?: boolean;
53
- hideTooltips?: boolean;
54
- hideQuestionMarkCTA?: boolean;
55
- hideNoWalletCTA?: boolean;
56
- hideRecentBadge?: boolean;
57
- walletConnectCTA?: "link" | "modal" | "both";
58
- avoidLayoutShift?: boolean;
59
- embedGoogleFonts?: boolean;
60
- truncateLongENSAddress?: boolean;
61
- walletConnectName?: string;
62
- reducedMotion?: boolean;
63
- disclaimer?: ReactNode | string;
64
- bufferPolyfill?: boolean;
65
- customAvatar?: React.FC<CustomAvatarProps>;
66
- initialChainId?: number;
67
- enforceSupportedChains?: boolean;
68
- ethereumOnboardingUrl?: string;
69
- walletOnboardingUrl?: string;
70
- overlayBlur?: number;
71
- };
72
53
  type DaimoPayProviderProps = {
73
54
  children?: React.ReactNode;
74
55
  theme?: Theme;
75
56
  mode?: Mode;
76
57
  customTheme?: CustomTheme;
77
- options?: DaimoPayOptions;
58
+ options?: DaimoPayContextOptions;
78
59
  debugMode?: boolean;
79
60
  } & useConnectCallbackProps;
80
61
  export declare const DaimoPayProvider: ({ children, theme, mode, customTheme, options, onConnect, onDisconnect, debugMode, }: DaimoPayProviderProps) => React.FunctionComponentElement<React.ProviderProps<ContextValue | null>>;
@@ -3,7 +3,11 @@ import { Chain } from "viem";
3
3
  import { CustomTheme, Mode, Theme } from "../../types";
4
4
  type Hash = `0x${string}`;
5
5
  type DaimoPayButtonRendererProps = {
6
+ /** The payment ID, generated via the Daimo Pay API. */
6
7
  payId: string;
8
+ /** Automatically close the modal after a successful payment. */
9
+ closeOnSuccess?: boolean;
10
+ /** Custom renderer */
7
11
  children?: (renderProps: {
8
12
  show?: () => void;
9
13
  hide?: () => void;
@@ -20,13 +24,20 @@ type DaimoPayButtonRendererProps = {
20
24
  }) => React.ReactNode;
21
25
  };
22
26
  type DaimoPayButtonProps = {
27
+ /** The payment ID, generated via the Daimo Pay API. */
23
28
  payId: string;
24
- theme?: Theme;
29
+ /** Light mode, dark mode, or auto. */
25
30
  mode?: Mode;
31
+ /** Named theme. See docs for options. */
32
+ theme?: Theme;
33
+ /** Custom theme. See docs for options. */
26
34
  customTheme?: CustomTheme;
35
+ /** Automatically close the modal after a successful payment. */
36
+ closeOnSuccess?: boolean;
37
+ /** Get notified when the user clicks, opening the payment modal. */
27
38
  onClick?: (open: () => void) => void;
28
39
  };
29
- export declare function DaimoPayButton({ payId, theme, mode, customTheme, onClick, }: DaimoPayButtonProps): import("react/jsx-runtime").JSX.Element | null;
40
+ export declare function DaimoPayButton({ payId, theme, mode, customTheme, closeOnSuccess, onClick, }: DaimoPayButtonProps): import("react/jsx-runtime").JSX.Element | null;
30
41
  export declare namespace DaimoPayButton {
31
42
  var Custom: React.FC<DaimoPayButtonRendererProps>;
32
43
  }
@@ -0,0 +1,2 @@
1
+ declare const ConnectUsing: () => import("react/jsx-runtime").JSX.Element;
2
+ export default ConnectUsing;
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ export declare const states: {
3
+ CONNECTED: string;
4
+ CONNECTING: string;
5
+ EXPIRING: string;
6
+ FAILED: string;
7
+ REJECTED: string;
8
+ NOTCONNECTED: string;
9
+ UNAVAILABLE: string;
10
+ };
11
+ declare const ConnectWithInjector: React.FC<{
12
+ switchConnectMethod: (id?: string) => void;
13
+ forceState?: typeof states;
14
+ }>;
15
+ export default ConnectWithInjector;
@@ -0,0 +1,6 @@
1
+ export declare const Content: any;
2
+ export declare const Container: any;
3
+ export declare const ConnectingContainer: any;
4
+ export declare const ConnectingAnimation: any;
5
+ export declare const RetryButton: any;
6
+ export declare const RetryIconContainer: any;
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ declare const ConnectWithQRCode: React.FC<{
3
+ switchConnectMethod: (id?: string) => void;
4
+ }>;
5
+ export default ConnectWithQRCode;
@@ -0,0 +1,7 @@
1
+ import { CustomTheme, Languages, Mode, Theme } from "../../types";
2
+ export declare const DaimoPayModal: React.FC<{
3
+ mode?: Mode;
4
+ theme?: Theme;
5
+ customTheme?: CustomTheme;
6
+ lang?: Languages;
7
+ }>;
@@ -1,9 +1,9 @@
1
1
  import React from "react";
2
2
  declare const CircleSpinner: ({ logo, smallLogo, connecting, unavailable, countdown, }: {
3
3
  logo?: React.ReactNode;
4
- smallLogo?: boolean | undefined;
5
- connecting?: boolean | undefined;
6
- unavailable?: boolean | undefined;
7
- countdown?: boolean | undefined;
4
+ smallLogo?: boolean;
5
+ connecting?: boolean;
6
+ unavailable?: boolean;
7
+ countdown?: boolean;
8
8
  }) => import("react/jsx-runtime").JSX.Element;
9
9
  export default CircleSpinner;
@@ -1,5 +1,5 @@
1
1
  declare const SquircleSpinner: ({ logo, connecting, }: {
2
2
  logo?: React.ReactNode;
3
- connecting?: boolean | undefined;
3
+ connecting?: boolean;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
5
5
  export default SquircleSpinner;
@@ -18,7 +18,7 @@ type Web3Context = {
18
18
  };
19
19
  declare const Web3Context: React.Context<Web3Context>;
20
20
  export declare const Web3ContextProvider: ({ enabled, children, }: {
21
- enabled?: boolean | undefined;
21
+ enabled?: boolean;
22
22
  children: React.ReactNode;
23
23
  }) => import("react/jsx-runtime").JSX.Element;
24
24
  export declare const useWeb3: () => Web3Context;
@@ -20,12 +20,12 @@ export declare function useConnect({ ...props }?: UseConnectParameters): {
20
20
  submittedAt: number;
21
21
  connect: ({ connector, chainId, mutation, }: {
22
22
  connector: CreateConnectorFn | Connector;
23
- chainId?: number | undefined;
23
+ chainId?: number;
24
24
  mutation?: UseConnectParameters["mutation"];
25
25
  }) => void;
26
26
  connectAsync: ({ connector, chainId, mutation, }: {
27
27
  connector: CreateConnectorFn | Connector;
28
- chainId?: number | undefined;
28
+ chainId?: number;
29
29
  mutation?: UseConnectParameters["mutation"];
30
30
  }) => Promise<import("wagmi/query").ConnectData<import("wagmi").Config>>;
31
31
  connectors: readonly Connector[];
@@ -33,7 +33,7 @@ export declare function useConnect({ ...props }?: UseConnectParameters): {
33
33
  data: undefined;
34
34
  variables: {
35
35
  chainId?: number | undefined;
36
- connector: CreateConnectorFn | Connector;
36
+ connector: Connector | CreateConnectorFn;
37
37
  };
38
38
  error: null;
39
39
  isError: false;
@@ -49,12 +49,12 @@ export declare function useConnect({ ...props }?: UseConnectParameters): {
49
49
  submittedAt: number;
50
50
  connect: ({ connector, chainId, mutation, }: {
51
51
  connector: CreateConnectorFn | Connector;
52
- chainId?: number | undefined;
52
+ chainId?: number;
53
53
  mutation?: UseConnectParameters["mutation"];
54
54
  }) => void;
55
55
  connectAsync: ({ connector, chainId, mutation, }: {
56
56
  connector: CreateConnectorFn | Connector;
57
- chainId?: number | undefined;
57
+ chainId?: number;
58
58
  mutation?: UseConnectParameters["mutation"];
59
59
  }) => Promise<import("wagmi/query").ConnectData<import("wagmi").Config>>;
60
60
  connectors: readonly Connector[];
@@ -62,7 +62,7 @@ export declare function useConnect({ ...props }?: UseConnectParameters): {
62
62
  data: undefined;
63
63
  variables: {
64
64
  chainId?: number | undefined;
65
- connector: CreateConnectorFn | Connector;
65
+ connector: Connector | CreateConnectorFn;
66
66
  };
67
67
  error: import("@wagmi/core").ConnectErrorType;
68
68
  isError: true;
@@ -78,12 +78,12 @@ export declare function useConnect({ ...props }?: UseConnectParameters): {
78
78
  submittedAt: number;
79
79
  connect: ({ connector, chainId, mutation, }: {
80
80
  connector: CreateConnectorFn | Connector;
81
- chainId?: number | undefined;
81
+ chainId?: number;
82
82
  mutation?: UseConnectParameters["mutation"];
83
83
  }) => void;
84
84
  connectAsync: ({ connector, chainId, mutation, }: {
85
85
  connector: CreateConnectorFn | Connector;
86
- chainId?: number | undefined;
86
+ chainId?: number;
87
87
  mutation?: UseConnectParameters["mutation"];
88
88
  }) => Promise<import("wagmi/query").ConnectData<import("wagmi").Config>>;
89
89
  connectors: readonly Connector[];
@@ -91,7 +91,7 @@ export declare function useConnect({ ...props }?: UseConnectParameters): {
91
91
  data: import("wagmi/query").ConnectData<import("wagmi").Config>;
92
92
  variables: {
93
93
  chainId?: number | undefined;
94
- connector: CreateConnectorFn | Connector;
94
+ connector: Connector | CreateConnectorFn;
95
95
  };
96
96
  error: null;
97
97
  isError: false;
@@ -107,12 +107,12 @@ export declare function useConnect({ ...props }?: UseConnectParameters): {
107
107
  submittedAt: number;
108
108
  connect: ({ connector, chainId, mutation, }: {
109
109
  connector: CreateConnectorFn | Connector;
110
- chainId?: number | undefined;
110
+ chainId?: number;
111
111
  mutation?: UseConnectParameters["mutation"];
112
112
  }) => void;
113
113
  connectAsync: ({ connector, chainId, mutation, }: {
114
114
  connector: CreateConnectorFn | Connector;
115
- chainId?: number | undefined;
115
+ chainId?: number;
116
116
  mutation?: UseConnectParameters["mutation"];
117
117
  }) => Promise<import("wagmi/query").ConnectData<import("wagmi").Config>>;
118
118
  connectors: readonly Connector[];
@@ -1,10 +1,4 @@
1
1
  export declare function useDaimoPayStatus(): {
2
- status: "payment_completed";
3
- paymentId: string;
4
- } | {
5
- status: "payment_started";
6
- paymentId: string;
7
- } | {
8
- status: "payment_pending";
2
+ status: string;
9
3
  paymentId: string;
10
4
  } | undefined;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type TLogLevel = "debug" | "info" | "warn" | "error" | "none";
3
2
  export type TOptions = {
4
3
  logLevel?: TLogLevel;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export default function useLockBodyScroll(initialLocked: boolean): (boolean | import("react").Dispatch<import("react").SetStateAction<boolean>>)[];
@@ -1,3 +1,5 @@
1
+ import { ReactNode } from "react";
2
+ import { CustomAvatarProps } from "./components/Common/Avatar";
1
3
  import { Languages as Lang } from "./localizations";
2
4
  export type Languages = Lang;
3
5
  export type Theme = "auto" | "web95" | "retro" | "soft" | "midnight" | "minimal" | "rounded" | "nouns";
@@ -9,5 +11,34 @@ export type All = {
9
11
  customTheme?: CustomTheme;
10
12
  lang?: Languages;
11
13
  };
12
- export type { CustomAvatarProps } from "./components/Common/Avatar";
13
- export type { DaimoPayOptions } from "./components/DaimoPay";
14
+ export type { CustomAvatarProps };
15
+ /** Global options, across all pay buttons and payments. */
16
+ export type DaimoPayContextOptions = {
17
+ language?: Languages;
18
+ hideBalance?: boolean;
19
+ hideTooltips?: boolean;
20
+ hideQuestionMarkCTA?: boolean;
21
+ hideNoWalletCTA?: boolean;
22
+ hideRecentBadge?: boolean;
23
+ walletConnectCTA?: "link" | "modal" | "both";
24
+ /** Avoids layout shift when the DaimoPay modal is open by adding padding to the body */
25
+ avoidLayoutShift?: boolean;
26
+ /** Automatically embeds Google Font of the current theme. Does not work with custom themes */
27
+ embedGoogleFonts?: boolean;
28
+ truncateLongENSAddress?: boolean;
29
+ walletConnectName?: string;
30
+ reducedMotion?: boolean;
31
+ disclaimer?: ReactNode | string;
32
+ bufferPolyfill?: boolean;
33
+ customAvatar?: React.FC<CustomAvatarProps>;
34
+ initialChainId?: number;
35
+ enforceSupportedChains?: boolean;
36
+ ethereumOnboardingUrl?: string;
37
+ walletOnboardingUrl?: string;
38
+ /** Blur the background when the modal is open */
39
+ overlayBlur?: number;
40
+ };
41
+ /** Modal UI options, set on the pay button triggering that modal. */
42
+ export type DaimoPayModalOptions = {
43
+ closeOnSuccess?: boolean;
44
+ };
@@ -1,12 +1,17 @@
1
- /// <reference types="react" />
2
1
  import { DaimoPayOrder, DaimoPayTokenAmount, ExternalPaymentOptionMetadata, ExternalPaymentOptions } from "@daimo/common";
2
+ import { DaimoPayModalOptions } from "../types";
3
3
  import { trpc } from "./trpc";
4
- export type SourcePayment = Parameters<typeof trpc.processSourcePayment.mutate>[0];
4
+ /** Wallet payment options. User picks one. */
5
5
  export type PaymentOption = Awaited<ReturnType<typeof trpc.getWalletPaymentOptions.query>>[0];
6
+ /** Wallet payment details, sent to processSourcePayment after submitting tx. */
7
+ export type SourcePayment = Parameters<typeof trpc.processSourcePayment.mutate>[0];
8
+ /** Loads a DaimoPayOrder + manages the corresponding modal. */
6
9
  export interface PaymentInfo {
7
10
  setPayId: (id: string | null) => Promise<void>;
8
- daimoPayOrder: DaimoPayOrder | null;
9
- paymentWaitingMessage: string | null;
11
+ daimoPayOrder: DaimoPayOrder | undefined;
12
+ modalOptions: DaimoPayModalOptions;
13
+ setModalOptions: (modalOptions: DaimoPayModalOptions) => void;
14
+ paymentWaitingMessage: string | undefined;
10
15
  selectedExternalOption: ExternalPaymentOptionMetadata | undefined;
11
16
  selectedTokenOption: PaymentOption | undefined;
12
17
  setSelectedExternalOption: (option: ExternalPaymentOptionMetadata | undefined) => void;
@@ -15,11 +20,17 @@ export interface PaymentInfo {
15
20
  payWithToken: (tokenAmount: DaimoPayTokenAmount) => Promise<void>;
16
21
  payWithExternal: (option: ExternalPaymentOptions) => Promise<string>;
17
22
  refreshOrder: () => Promise<void>;
23
+ onSuccess: (args: {
24
+ txHash: string;
25
+ txURL?: string;
26
+ }) => void;
18
27
  }
19
- export declare function getPaymentInfo(): {
28
+ export declare function getPaymentInfo(setOpen: (showModal: boolean) => void, log: (...args: any[]) => void): {
20
29
  setPayId: (payId: string | null) => Promise<void>;
21
- daimoPayOrder: DaimoPayOrder | null;
22
- paymentWaitingMessage: string | null;
30
+ daimoPayOrder: DaimoPayOrder | undefined;
31
+ modalOptions: DaimoPayModalOptions;
32
+ setModalOptions: import("react").Dispatch<import("react").SetStateAction<DaimoPayModalOptions>>;
33
+ paymentWaitingMessage: string | undefined;
23
34
  selectedExternalOption: ExternalPaymentOptionMetadata | undefined;
24
35
  selectedTokenOption: any;
25
36
  setSelectedExternalOption: import("react").Dispatch<import("react").SetStateAction<ExternalPaymentOptionMetadata | undefined>>;
@@ -28,4 +39,8 @@ export declare function getPaymentInfo(): {
28
39
  payWithToken: (tokenAmount: DaimoPayTokenAmount) => Promise<void>;
29
40
  payWithExternal: (option: ExternalPaymentOptions) => Promise<any>;
30
41
  refreshOrder: () => Promise<void>;
42
+ onSuccess: ({ txHash, txURL }: {
43
+ txHash: string;
44
+ txURL?: string;
45
+ }) => void;
31
46
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import React from "react";
3
2
  declare const truncateEthAddress: (address?: string, separator?: string) => string;
4
3
  declare const truncateENSAddress: (ensName: string, maxLength: number) => string;
@@ -9,10 +8,10 @@ declare const isAndroid: () => boolean;
9
8
  declare const isMobile: () => boolean;
10
9
  type ReactChildArray = ReturnType<typeof React.Children.toArray>;
11
10
  declare function flattenChildren(children: React.ReactNode): ReactChildArray;
12
- export declare const isWalletConnectConnector: (connectorId?: string) => boolean;
13
- export declare const isMetaMaskConnector: (connectorId?: string) => boolean;
14
- export declare const isCoinbaseWalletConnector: (connectorId?: string) => boolean;
15
- export declare const isLedgerConnector: (connectorId?: string) => boolean;
16
- export declare const isSafeConnector: (connectorId?: string) => boolean;
17
- export declare const isInjectedConnector: (connectorId?: string) => boolean;
11
+ export declare const isWalletConnectConnector: (connectorId?: string) => connectorId is "walletConnect";
12
+ export declare const isMetaMaskConnector: (connectorId?: string) => connectorId is "metaMaskSDK";
13
+ export declare const isCoinbaseWalletConnector: (connectorId?: string) => connectorId is "coinbaseWalletSDK";
14
+ export declare const isLedgerConnector: (connectorId?: string) => connectorId is "ledger";
15
+ export declare const isSafeConnector: (connectorId?: string) => connectorId is "safe";
16
+ export declare const isInjectedConnector: (connectorId?: string) => connectorId is "injected";
18
17
  export { detectBrowser, detectOS, flattenChildren, isAndroid, isMobile, nFormatter, truncateENSAddress, truncateEthAddress };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * EIP-6963: Multi Injected Provider Discovery
4
3
  * https://eips.ethereum.org/EIPS/eip-6963
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@daimo/pay",
3
3
  "private": false,
4
- "version": "0.3.5",
4
+ "version": "0.3.7",
5
5
  "author": "Daimo",
6
6
  "homepage": "https://pay.daimo.com",
7
7
  "license": "BSD-2-Clause license",
@@ -40,8 +40,8 @@
40
40
  "crypto"
41
41
  ],
42
42
  "dependencies": {
43
- "@daimo/common": "0.3.1",
44
- "@daimo/contract": "0.3.1",
43
+ "@daimo/common": "0.3.6",
44
+ "@daimo/contract": "0.3.6",
45
45
  "@trpc/client": "^11.0.0-next-beta.318",
46
46
  "@trpc/server": "^11.0.0-next-beta.318",
47
47
  "buffer": "^6.0.3",