coinley-pay 0.65.0 → 0.66.0

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.
@@ -6,7 +6,7 @@ import { useState, useRef, useEffect, useCallback, useMemo } from "react";
6
6
  import ReactDOM, { createPortal } from "react-dom";
7
7
  import { useConnect, useAccount, useSwitchChain, useSendTransaction, useWaitForTransactionReceipt, WagmiProvider, useDisconnect } from "wagmi";
8
8
  import { QueryClientProvider, QueryClient } from "@tanstack/react-query";
9
- import { s as sdkAnalytics, c as clarityAnalytics, d as dist, a as Buffer2, B as Buffer$1, g as getCurrencyInfo, p as prefetchRates, i as isSupportedCurrency, b as convertToUSD, f as formatCurrency } from "./index-DlWS8_3x.js";
9
+ import { s as sdkAnalytics, c as clarityAnalytics, d as dist, a as Buffer2, B as Buffer$1, g as getCurrencyInfo, p as prefetchRates, i as isSupportedCurrency, b as convertToUSD, f as formatCurrency } from "./index-BK2u3J1p.js";
10
10
  import { createConfig, fallback, http, getAccount as getAccount$1, getWalletClient, simulateContract, writeContract, readContract, waitForTransactionReceipt, estimateFeesPerGas as estimateFeesPerGas$1 } from "@wagmi/core";
11
11
  import { injected, metaMask, coinbaseWallet, walletConnect } from "@wagmi/connectors";
12
12
  import { defineChain as defineChain$1, erc20Abi, http as http$1, createPublicClient, fallback as fallback$1 } from "viem";
@@ -21126,7 +21126,7 @@ const WalletSelector = ({
21126
21126
  try {
21127
21127
  setAppKitError(null);
21128
21128
  setWalletConnectAddress(solanaAccountState.address);
21129
- const { createWalletConnectAdapter } = await import("./appKitSolana-De-Lx7eT.js");
21129
+ const { createWalletConnectAdapter } = await import("./appKitSolana-BYyu0_pA.js");
21130
21130
  const adapter = createWalletConnectAdapter(solanaAccountState.address);
21131
21131
  await solanaWallet.connectWalletConnect(adapter, solanaAccountState.address);
21132
21132
  console.log("✅ WalletConnect synced with SDK");
@@ -21231,7 +21231,7 @@ const WalletSelector = ({
21231
21231
  setAppKitLoading(true);
21232
21232
  setAppKitError(null);
21233
21233
  try {
21234
- const { initializeAppKitEVM, openAppKitModal } = await import("./appKitEVM-CGJ7ZTpW.js");
21234
+ const { initializeAppKitEVM, openAppKitModal } = await import("./appKitEVM-CymaRMbc.js");
21235
21235
  await initializeAppKitEVM(wagmiConfig);
21236
21236
  await openAppKitModal();
21237
21237
  } catch (error) {
@@ -21251,7 +21251,7 @@ const WalletSelector = ({
21251
21251
  setAppKitError(null);
21252
21252
  try {
21253
21253
  console.log("📦 Loading AppKit Solana module...");
21254
- const { initializeAppKitSolana } = await import("./appKitSolana-De-Lx7eT.js");
21254
+ const { initializeAppKitSolana } = await import("./appKitSolana-BYyu0_pA.js");
21255
21255
  console.log("✅ Module loaded, initializing...");
21256
21256
  const modal = await initializeAppKitSolana(solanaWallet);
21257
21257
  console.log("✅ AppKit Solana initialized successfully");
@@ -27106,7 +27106,7 @@ const CoinleyPaymentInternal = ({
27106
27106
  {
27107
27107
  type: "button",
27108
27108
  onClick: () => isMobile ? handleMobileTabSelect(method.tab) : setActiveTab(method.tab),
27109
- className: `min-w-0 truncate ${isTightWalletView ? "h-7 px-2 text-[13px]" : "h-9 px-2.5 text-sm"} rounded-lg transition-colors whitespace-nowrap ${method.tab === PAYMENT_TABS.TRANSFER ? "flex-[1.35]" : "flex-1"} ${activeTab === method.tab ? "bg-white text-[#5B2EEA] shadow-[0_1px_3px_rgba(31,36,48,0.08)]" : "text-[#535865] hover:text-[#1F2430]"}`,
27109
+ className: `min-w-0 truncate ${isTightWalletView ? "h-7 px-1.5 text-[13px]" : "h-9 px-2 text-[13px]"} rounded-lg transition-colors whitespace-nowrap ${method.tab === PAYMENT_TABS.QR ? "flex-[0.8]" : "flex-[1.3]"} ${activeTab === method.tab ? "bg-white text-[#5B2EEA] shadow-[0_1px_3px_rgba(31,36,48,0.08)]" : "text-[#535865] hover:text-[#1F2430]"}`,
27110
27110
  children: isMobile ? method.mobileLabel : method.label
27111
27111
  },
27112
27112
  method.tab
@@ -27620,93 +27620,103 @@ const CoinleyPaymentInternal = ({
27620
27620
  })
27621
27621
  ] });
27622
27622
  const qrNetworkOptions = merchantFilteredNetworks.length > 0 ? merchantFilteredNetworks : networks;
27623
- const renderQrWalletChoicePanel = () => /* @__PURE__ */ jsxs("div", { className: "pt-1", children: [
27624
- renderCheckoutSelect({
27625
- id: "qr-network",
27626
- label: "Select a Network",
27627
- value: selectedNetwork == null ? void 0 : selectedNetwork.id,
27628
- placeholder: "Select a network",
27629
- options: qrNetworkOptions,
27630
- getLabel: (network) => getNetworkDisplayName(network),
27631
- getIcon: (network) => getNetworkDisplayLogo(network),
27632
- compact: true,
27633
- elevated: true,
27634
- maxVisibleItems: 4,
27635
- onChange: (networkId) => {
27636
- const network = qrNetworkOptions.find((item) => String(item.id) === String(networkId));
27637
- if (network) handleNetworkSelect(network);
27638
- }
27639
- }),
27640
- renderCheckoutSelect({
27641
- id: "qr-token",
27642
- label: "Select a Token",
27643
- value: selectedToken == null ? void 0 : selectedToken.id,
27644
- placeholder: "Select a token",
27645
- disabled: !selectedNetwork || availableTokens.length === 0,
27646
- options: availableTokens,
27647
- getLabel: (token) => getTokenDisplaySymbol(token),
27648
- getIcon: (token) => getTokenDisplayLogo(token),
27649
- compact: true,
27650
- elevated: true,
27651
- maxVisibleItems: 4,
27652
- onChange: (tokenId) => {
27653
- const token = availableTokens.find((item) => String(item.id) === String(tokenId));
27654
- if (token) handleTokenSelect(token);
27655
- }
27656
- }),
27657
- /* @__PURE__ */ jsx("p", { className: "mb-2 text-xs font-medium text-[#1F2430]", children: "Please select your wallet app" }),
27658
- /* @__PURE__ */ jsx("div", { className: "mb-3 grid grid-cols-3 gap-1.5", children: qrWalletOptions.map((wallet) => /* @__PURE__ */ jsxs(
27659
- "button",
27660
- {
27661
- type: "button",
27662
- onClick: () => handleQrWalletSelect(wallet.id),
27663
- disabled: !selectedNetwork || !selectedToken || qrLoading || isConverting,
27664
- className: `relative flex h-[76px] min-w-0 flex-col items-start justify-between rounded-lg border bg-[#FAFAFB] px-2.5 py-3 text-left transition-colors ${qrSelectedWalletId === wallet.id ? "border-[#7042D2] bg-[#FBF8FF]" : "border-[#EEF0F4] hover:border-[#C9B8F6]"} disabled:cursor-not-allowed disabled:opacity-60`,
27665
- children: [
27666
- qrSelectedWalletId === wallet.id && qrWalletChoiceConfirmed && /* @__PURE__ */ jsx("span", { className: "absolute right-[-5px] top-[-6px] flex h-4 w-4 items-center justify-center rounded-full border border-[#7042D2] bg-white text-[#7042D2]", children: /* @__PURE__ */ jsx("svg", { className: "h-2.5 w-2.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 3, d: "M5 13l4 4L19 7" }) }) }),
27667
- /* @__PURE__ */ jsx(
27668
- "img",
27669
- {
27670
- src: wallet.icon,
27671
- alt: wallet.name,
27672
- className: "h-6 w-6 object-contain",
27673
- onError: (event) => {
27674
- event.currentTarget.src = getLogoFallbackUrl(wallet.name);
27623
+ const renderQrWalletChoicePanel = () => {
27624
+ if (qrWalletChoiceConfirmed) return renderQrPaymentPanel();
27625
+ return /* @__PURE__ */ jsxs("div", { className: "pt-1", children: [
27626
+ renderCheckoutSelect({
27627
+ id: "qr-network",
27628
+ label: "Select a Network",
27629
+ value: selectedNetwork == null ? void 0 : selectedNetwork.id,
27630
+ placeholder: "Select a network",
27631
+ options: qrNetworkOptions,
27632
+ getLabel: (network) => getNetworkDisplayName(network),
27633
+ getIcon: (network) => getNetworkDisplayLogo(network),
27634
+ compact: true,
27635
+ elevated: true,
27636
+ maxVisibleItems: 4,
27637
+ onChange: (networkId) => {
27638
+ const network = qrNetworkOptions.find((item) => String(item.id) === String(networkId));
27639
+ if (network) handleNetworkSelect(network);
27640
+ }
27641
+ }),
27642
+ renderCheckoutSelect({
27643
+ id: "qr-token",
27644
+ label: "Select a Token",
27645
+ value: selectedToken == null ? void 0 : selectedToken.id,
27646
+ placeholder: "Select a token",
27647
+ disabled: !selectedNetwork || availableTokens.length === 0,
27648
+ options: availableTokens,
27649
+ getLabel: (token) => getTokenDisplaySymbol(token),
27650
+ getIcon: (token) => getTokenDisplayLogo(token),
27651
+ compact: true,
27652
+ elevated: true,
27653
+ maxVisibleItems: 4,
27654
+ onChange: (tokenId) => {
27655
+ const token = availableTokens.find((item) => String(item.id) === String(tokenId));
27656
+ if (token) handleTokenSelect(token);
27657
+ }
27658
+ }),
27659
+ /* @__PURE__ */ jsx("p", { className: "mb-2 text-xs font-medium text-[#1F2430]", children: "Please select your wallet app" }),
27660
+ /* @__PURE__ */ jsx("div", { className: "mb-3 grid grid-cols-3 gap-1.5", children: qrWalletOptions.map((wallet) => /* @__PURE__ */ jsxs(
27661
+ "button",
27662
+ {
27663
+ type: "button",
27664
+ onClick: () => handleQrWalletSelect(wallet.id),
27665
+ disabled: !selectedNetwork || !selectedToken || qrLoading || isConverting,
27666
+ className: `relative flex h-[76px] min-w-0 flex-col items-start justify-between rounded-lg border bg-[#FAFAFB] px-2.5 py-3 text-left transition-colors ${qrSelectedWalletId === wallet.id ? "border-[#7042D2] bg-[#FBF8FF]" : "border-[#EEF0F4] hover:border-[#C9B8F6]"} disabled:cursor-not-allowed disabled:opacity-60`,
27667
+ children: [
27668
+ qrSelectedWalletId === wallet.id && qrWalletChoiceConfirmed && /* @__PURE__ */ jsx("span", { className: "absolute right-[-5px] top-[-6px] flex h-4 w-4 items-center justify-center rounded-full border border-[#7042D2] bg-white text-[#7042D2]", children: /* @__PURE__ */ jsx("svg", { className: "h-2.5 w-2.5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 3, d: "M5 13l4 4L19 7" }) }) }),
27669
+ /* @__PURE__ */ jsx(
27670
+ "img",
27671
+ {
27672
+ src: wallet.icon,
27673
+ alt: wallet.name,
27674
+ className: "h-6 w-6 object-contain",
27675
+ onError: (event) => {
27676
+ event.currentTarget.src = getLogoFallbackUrl(wallet.name);
27677
+ }
27675
27678
  }
27676
- }
27677
- ),
27678
- /* @__PURE__ */ jsx("span", { className: "min-w-0 max-w-full truncate text-[13px] font-medium text-[#111827]", children: wallet.name })
27679
- ]
27680
- },
27681
- wallet.id
27682
- )) }),
27683
- qrLoading && /* @__PURE__ */ jsxs("div", { className: "mb-3 flex items-center justify-center gap-2 rounded-lg bg-[#F8F8F9] px-3 py-2 text-xs text-[#535865]", children: [
27684
- /* @__PURE__ */ jsx("img", { src: stablezactLoading, alt: "", className: "h-5 w-6 object-contain" }),
27685
- "Generating QR code..."
27686
- ] }),
27687
- qrWalletChoiceConfirmed ? renderQrPaymentPanel() : !qrLoading && /* @__PURE__ */ jsx("p", { className: "text-xs leading-5 text-[#9EA0A8]", children: "Simply select a wallet app to generate the QR code then input the amount, and transfer your funds" })
27688
- ] });
27689
- const renderQrPaymentPanel = () => /* @__PURE__ */ jsxs("div", { className: "pt-1", children: [
27690
- /* @__PURE__ */ jsxs("div", { className: "mb-4 flex flex-col gap-3 min-[380px]:flex-row min-[380px]:items-start", children: [
27691
- /* @__PURE__ */ jsx("div", { className: "h-[92px] w-[92px] flex-shrink-0 bg-white", children: qrCodeDataUrl ? /* @__PURE__ */ jsx("img", { src: qrCodeDataUrl, alt: "Payment QR Code", className: "h-full w-full" }) : /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center justify-center rounded-lg bg-gray-100", children: /* @__PURE__ */ jsx("img", { src: stablezactLoading, alt: "Loading QR code", className: "h-14 w-16 object-contain" }) }) }),
27692
- /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
27693
- /* @__PURE__ */ jsx("p", { className: "mb-2 text-base font-semibold text-[#111827]", children: "Instructions" }),
27694
- /* @__PURE__ */ jsxs("ol", { className: "list-inside list-decimal space-y-1 text-xs leading-5 text-[#111827]", children: [
27695
- /* @__PURE__ */ jsx("li", { children: "Scan QR code with your phone camera" }),
27696
- /* @__PURE__ */ jsx("li", { children: "The payment page will open inside your wallet app" }),
27697
- /* @__PURE__ */ jsxs("li", { children: [
27698
- "Confirm the payment (",
27699
- (selectedToken == null ? void 0 : selectedToken.symbol) ? `${formatAmount(paymentAmount || (config == null ? void 0 : config.amount) || 0)} ${selectedToken.symbol}` : paymentAmountLabel,
27700
- ")"
27679
+ ),
27680
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 max-w-full truncate text-[13px] font-medium text-[#111827]", children: wallet.name })
27681
+ ]
27682
+ },
27683
+ wallet.id
27684
+ )) }),
27685
+ qrLoading && /* @__PURE__ */ jsxs("div", { className: "mb-3 flex items-center justify-center gap-2 rounded-lg bg-[#F8F8F9] px-3 py-2 text-xs text-[#535865]", children: [
27686
+ /* @__PURE__ */ jsx("img", { src: stablezactLoading, alt: "", className: "h-5 w-6 object-contain" }),
27687
+ "Generating QR code..."
27688
+ ] }),
27689
+ !qrLoading && /* @__PURE__ */ jsx("p", { className: "text-xs leading-5 text-[#9EA0A8]", children: "Simply select a wallet app to generate the QR code then input the amount, and transfer your funds" })
27690
+ ] });
27691
+ };
27692
+ const renderQrPaymentPanel = () => {
27693
+ const chosenWallet = qrWalletOptions.find((wallet) => wallet.id === qrSelectedWalletId);
27694
+ return /* @__PURE__ */ jsxs("div", { className: "pt-1", children: [
27695
+ chosenWallet && /* @__PURE__ */ jsxs("p", { className: "mb-3 text-sm font-semibold text-[#111827]", children: [
27696
+ "Scan with ",
27697
+ chosenWallet.name
27698
+ ] }),
27699
+ /* @__PURE__ */ jsxs("div", { className: "mb-4 flex flex-col gap-3 min-[380px]:flex-row min-[380px]:items-start", children: [
27700
+ /* @__PURE__ */ jsx("div", { className: "h-[92px] w-[92px] flex-shrink-0 bg-white", children: qrCodeDataUrl ? /* @__PURE__ */ jsx("img", { src: qrCodeDataUrl, alt: "Payment QR Code", className: "h-full w-full" }) : /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center justify-center rounded-lg bg-gray-100", children: /* @__PURE__ */ jsx("img", { src: stablezactLoading, alt: "Loading QR code", className: "h-14 w-16 object-contain" }) }) }),
27701
+ /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
27702
+ /* @__PURE__ */ jsx("p", { className: "mb-2 text-base font-semibold text-[#111827]", children: "Instructions" }),
27703
+ /* @__PURE__ */ jsxs("ol", { className: "list-inside list-decimal space-y-1 text-xs leading-5 text-[#111827]", children: [
27704
+ /* @__PURE__ */ jsx("li", { children: "Scan QR code with your phone camera" }),
27705
+ /* @__PURE__ */ jsx("li", { children: "The payment page will open inside your wallet app" }),
27706
+ /* @__PURE__ */ jsxs("li", { children: [
27707
+ "Confirm the payment (",
27708
+ (selectedToken == null ? void 0 : selectedToken.symbol) ? `${formatAmount(paymentAmount || (config == null ? void 0 : config.amount) || 0)} ${selectedToken.symbol}` : paymentAmountLabel,
27709
+ ")"
27710
+ ] })
27701
27711
  ] })
27702
27712
  ] })
27713
+ ] }),
27714
+ paymentData && !verifyingPayment && /* @__PURE__ */ jsxs("div", { className: "mb-3 flex items-center justify-center gap-2 text-xs text-[#A3A5AC]", children: [
27715
+ /* @__PURE__ */ jsx("img", { src: stablezactLoading, alt: "", className: "h-5 w-6 object-contain" }),
27716
+ "Checking automatically every few seconds..."
27703
27717
  ] })
27704
- ] }),
27705
- paymentData && !verifyingPayment && /* @__PURE__ */ jsxs("div", { className: "mb-3 flex items-center justify-center gap-2 text-xs text-[#A3A5AC]", children: [
27706
- /* @__PURE__ */ jsx("img", { src: stablezactLoading, alt: "", className: "h-5 w-6 object-contain" }),
27707
- "Checking automatically every few seconds..."
27708
- ] })
27709
- ] });
27718
+ ] });
27719
+ };
27710
27720
  const currentWalletMeta = (() => {
27711
27721
  var _a2;
27712
27722
  const activeConnectorId = wagmiConnector == null ? void 0 : wagmiConnector.id;
@@ -28549,4 +28559,4 @@ export {
28549
28559
  chainTransports as c,
28550
28560
  isFeatureEnabled as i
28551
28561
  };
28552
- //# sourceMappingURL=CoinleyPayment-BovUsM20.js.map
28562
+ //# sourceMappingURL=CoinleyPayment-CbWEGZOi.js.map
@@ -1,4 +1,4 @@
1
- import { i as isFeatureEnabled, F as FEATURES, c as chainTransports, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-BovUsM20.js";
1
+ import { i as isFeatureEnabled, F as FEATURES, c as chainTransports, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-CbWEGZOi.js";
2
2
  const logo = "https://coinley.io/logo.png";
3
3
  let appKitInstance = null;
4
4
  let isInitializing = false;
@@ -113,4 +113,4 @@ export {
113
113
  initializeAppKitEVM,
114
114
  openAppKitModal
115
115
  };
116
- //# sourceMappingURL=appKitEVM-CGJ7ZTpW.js.map
116
+ //# sourceMappingURL=appKitEVM-CymaRMbc.js.map
@@ -1,4 +1,4 @@
1
- import { F as FEATURES, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-BovUsM20.js";
1
+ import { F as FEATURES, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-CbWEGZOi.js";
2
2
  const logo = "https://coinley.io/logo.png";
3
3
  let appKitInstance = null;
4
4
  let isInitializing = false;
@@ -243,4 +243,4 @@ export {
243
243
  disconnectWalletConnect,
244
244
  initializeAppKitSolana
245
245
  };
246
- //# sourceMappingURL=appKitSolana-De-Lx7eT.js.map
246
+ //# sourceMappingURL=appKitSolana-BYyu0_pA.js.map