coinley-pay 0.19.0 → 0.20.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.
@@ -5,7 +5,7 @@ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
5
5
  import { useState, useRef, useEffect, useCallback, useMemo } from "react";
6
6
  import { useConnect, useAccount, useSwitchChain, useSendTransaction, useWaitForTransactionReceipt, WagmiProvider, useDisconnect } from "wagmi";
7
7
  import { QueryClientProvider, QueryClient } from "@tanstack/react-query";
8
- 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-BCVqFOuo.js";
8
+ 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-YblNXa3i.js";
9
9
  import { createConfig, fallback, http, getAccount as getAccount$1, getWalletClient, simulateContract, writeContract, readContract, waitForTransactionReceipt, estimateFeesPerGas as estimateFeesPerGas$1 } from "@wagmi/core";
10
10
  import { injected, metaMask, coinbaseWallet, walletConnect } from "@wagmi/connectors";
11
11
  import { defineChain as defineChain$1, erc20Abi, http as http$1, createPublicClient, fallback as fallback$1 } from "viem";
@@ -20451,85 +20451,88 @@ const PaymentStatus = ({
20451
20451
  ] });
20452
20452
  }
20453
20453
  if (status === "success") {
20454
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-6 px-4", children: [
20455
- /* @__PURE__ */ jsx("div", { className: "mb-6", children: renderIcon() }),
20456
- /* @__PURE__ */ jsx("h3", { className: "text-2xl font-bold mb-3 text-gray-900", style: { fontFamily: "Gilroy-Medium, Gilroy-Regular, sans-serif" }, children: "Payment Successful!" }),
20457
- payment && selectedPaymentMethod && /* @__PURE__ */ jsxs("p", { className: "text-center max-w-[235px] mb-6 text-gray-600", style: { fontFamily: "Gilroy-Medium, Gilroy-Regular, sans-serif" }, children: [
20458
- "Your payment of ",
20459
- /* @__PURE__ */ jsxs("span", { className: "text-[#7042D2] font-semibold", children: [
20460
- payment.totalAmount || payment.amount,
20461
- " ",
20462
- selectedPaymentMethod.currency
20463
- ] }),
20464
- " has been completed."
20454
+ const displayAmount = (payment == null ? void 0 : payment.totalAmount) || (payment == null ? void 0 : payment.amount) || (payment == null ? void 0 : payment.totalAmountUSD) || (payment == null ? void 0 : payment.amountUSD) || 0;
20455
+ const tokenSymbol = (selectedPaymentMethod == null ? void 0 : selectedPaymentMethod.symbol) || (selectedPaymentMethod == null ? void 0 : selectedPaymentMethod.currency) || (selectedPaymentMethod == null ? void 0 : selectedPaymentMethod.tokenSymbol) || (selectedPaymentMethod == null ? void 0 : selectedPaymentMethod.name) || "Token";
20456
+ const networkName = (selectedNetwork == null ? void 0 : selectedNetwork.name) || (selectedNetwork == null ? void 0 : selectedNetwork.displayName) || (selectedNetwork == null ? void 0 : selectedNetwork.shortName) || "Network";
20457
+ const explorerUrl = getExplorerUrl(transactionHash, selectedNetwork);
20458
+ const explorerName = getExplorerName(selectedNetwork);
20459
+ return /* @__PURE__ */ jsxs("div", { className: "relative flex h-full w-full flex-col px-3 pb-0 pt-[84px]", children: [
20460
+ onClose && /* @__PURE__ */ jsx(
20461
+ "button",
20462
+ {
20463
+ type: "button",
20464
+ onClick: onClose,
20465
+ className: "absolute right-1 top-1 flex h-8 w-8 items-center justify-center rounded-full text-black transition-colors hover:bg-gray-100",
20466
+ "aria-label": "Close",
20467
+ children: /* @__PURE__ */ jsx("svg", { className: "h-6 w-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
20468
+ }
20469
+ ),
20470
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center text-center", children: [
20471
+ /* @__PURE__ */ jsx("div", { className: "mb-3 flex h-16 w-16 items-center justify-center rounded-full bg-[#D8F8E7] p-2", children: /* @__PURE__ */ jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-[#0CCB63] text-white", children: /* @__PURE__ */ jsx("svg", { className: "h-6 w-6", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2.5, d: "M5 13l4 4L19 7" }) }) }) }),
20472
+ /* @__PURE__ */ jsx("h3", { className: "mb-3 text-base font-semibold text-black", children: "Payment Successful" }),
20473
+ /* @__PURE__ */ jsxs("p", { className: "mb-9 text-base text-[#A9ABB2]", children: [
20474
+ /* @__PURE__ */ jsxs("span", { className: "font-semibold text-black", children: [
20475
+ "$",
20476
+ Number(displayAmount || 0).toFixed(2)
20477
+ ] }),
20478
+ /* @__PURE__ */ jsxs("span", { children: [
20479
+ " sent to ",
20480
+ merchantName
20481
+ ] })
20482
+ ] })
20465
20483
  ] }),
20466
- transactionHash && /* @__PURE__ */ jsxs("div", { className: "w-full mb-6 px-4", children: [
20467
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium mb-2 text-gray-700", style: { fontFamily: "Gilroy-Medium, Gilroy-Regular, sans-serif" }, children: "Transaction Details" }),
20484
+ /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
20485
+ /* @__PURE__ */ jsx("p", { className: "mb-1 text-xs font-medium text-[#4B5563]", children: "Transaction ID" }),
20468
20486
  /* @__PURE__ */ jsxs(
20469
- "div",
20487
+ "button",
20470
20488
  {
20471
- className: "flex items-center justify-between p-3 rounded-lg border cursor-pointer transition-colors bg-gray-50 border-gray-200 hover:bg-gray-100 mb-3",
20489
+ type: "button",
20472
20490
  onClick: copyTransactionHash,
20491
+ className: "mb-4 flex h-11 w-full items-center justify-between rounded-lg border border-[#EEF0F4] bg-[#FAFAFB] px-3 text-left transition-colors hover:bg-gray-100",
20473
20492
  children: [
20474
- /* @__PURE__ */ jsx("span", { className: "font-mono text-sm text-gray-700", children: formatTransactionHash(transactionHash) }),
20475
- /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
20476
- copiedHash ? /* @__PURE__ */ jsx("span", { className: "text-green-500 text-xs font-medium mr-2", children: "Copied!" }) : null,
20477
- /* @__PURE__ */ jsx(
20478
- "svg",
20479
- {
20480
- xmlns: "http://www.w3.org/2000/svg",
20481
- className: "h-4 w-4 text-gray-500",
20482
- fill: "none",
20483
- viewBox: "0 0 24 24",
20484
- stroke: "currentColor",
20485
- children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" })
20486
- }
20487
- )
20493
+ /* @__PURE__ */ jsx("span", { className: "font-mono text-sm font-semibold text-black", children: formatTransactionHash(transactionHash) }),
20494
+ /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 text-black", children: [
20495
+ copiedHash && /* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-[#0CCB63]", children: "Copied" }),
20496
+ /* @__PURE__ */ jsx("svg", { className: "h-5 w-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.7, d: "M8 7a2 2 0 012-2h8a2 2 0 012 2v8a2 2 0 01-2 2h-2M6 9H5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-1" }) })
20488
20497
  ] })
20489
20498
  ]
20490
20499
  }
20491
20500
  ),
20492
- (() => {
20493
- const explorerUrl = getExplorerUrl(transactionHash, selectedNetwork);
20494
- const explorerName = getExplorerName(selectedNetwork);
20495
- return selectedNetwork && explorerUrl && /* @__PURE__ */ jsxs(
20496
- "a",
20497
- {
20498
- href: explorerUrl,
20499
- target: "_blank",
20500
- rel: "noopener noreferrer",
20501
- className: "flex items-center justify-center gap-2 w-full p-3 rounded-lg border border-[#7042D2] bg-white hover:bg-purple-50 transition-colors group",
20502
- children: [
20503
- /* @__PURE__ */ jsxs("span", { className: "text-sm font-medium text-[#7042D2]", style: { fontFamily: "Gilroy-Medium, Gilroy-Regular, sans-serif" }, children: [
20504
- "View on ",
20505
- explorerName
20506
- ] }),
20507
- /* @__PURE__ */ jsx(
20508
- "svg",
20509
- {
20510
- xmlns: "http://www.w3.org/2000/svg",
20511
- className: "h-4 w-4 text-[#7042D2] group-hover:translate-x-1 transition-transform",
20512
- fill: "none",
20513
- viewBox: "0 0 24 24",
20514
- stroke: "currentColor",
20515
- strokeWidth: 2,
20516
- children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" })
20517
- }
20518
- )
20519
- ]
20520
- }
20521
- );
20522
- })()
20501
+ /* @__PURE__ */ jsxs("div", { className: "space-y-0", children: [
20502
+ /* @__PURE__ */ jsxs("div", { className: "flex h-11 items-center justify-between border-b border-[#EEF0F4]", children: [
20503
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-[#A9ABB2]", children: "Network" }),
20504
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-black", children: networkName })
20505
+ ] }),
20506
+ /* @__PURE__ */ jsxs("div", { className: "flex h-11 items-center justify-between border-b border-[#EEF0F4]", children: [
20507
+ /* @__PURE__ */ jsx("span", { className: "text-sm text-[#A9ABB2]", children: "Token" }),
20508
+ /* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-black", children: tokenSymbol })
20509
+ ] })
20510
+ ] }),
20511
+ explorerUrl && /* @__PURE__ */ jsxs(
20512
+ "a",
20513
+ {
20514
+ href: explorerUrl,
20515
+ target: "_blank",
20516
+ rel: "noopener noreferrer",
20517
+ className: "mt-3 flex h-[43px] w-full items-center justify-center gap-2 rounded-lg border border-[#B997FF] bg-white text-sm font-semibold text-[#7042D2] transition-colors hover:bg-purple-50",
20518
+ children: [
20519
+ /* @__PURE__ */ jsxs("span", { children: [
20520
+ "View on ",
20521
+ explorerName
20522
+ ] }),
20523
+ /* @__PURE__ */ jsx("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" }) })
20524
+ ]
20525
+ }
20526
+ )
20523
20527
  ] }),
20524
- onClose && /* @__PURE__ */ jsx(
20528
+ onClose && /* @__PURE__ */ jsx("div", { className: "mt-auto pt-5", children: /* @__PURE__ */ jsx(
20525
20529
  "button",
20526
20530
  {
20527
20531
  onClick: onClose,
20528
- className: "w-full py-3 px-4 bg-[#7042D2] text-white font-semibold rounded-2xl text-lg shadow-md hover:bg-[#5b34b1] transition-colors",
20529
- style: { fontFamily: "Gilroy-Medium, Gilroy-Regular, sans-serif" },
20532
+ className: "h-11 w-full rounded-lg bg-[#7042D2] px-4 text-base font-semibold text-white transition-colors hover:bg-[#5b34b1]",
20530
20533
  children: "Close"
20531
20534
  }
20532
- )
20535
+ ) })
20533
20536
  ] });
20534
20537
  }
20535
20538
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
@@ -21120,7 +21123,7 @@ const WalletSelector = ({
21120
21123
  try {
21121
21124
  setAppKitError(null);
21122
21125
  setWalletConnectAddress(solanaAccountState.address);
21123
- const { createWalletConnectAdapter } = await import("./appKitSolana-fo6vF0_g.js");
21126
+ const { createWalletConnectAdapter } = await import("./appKitSolana-QAp0wzR5.js");
21124
21127
  const adapter = createWalletConnectAdapter(solanaAccountState.address);
21125
21128
  await solanaWallet.connectWalletConnect(adapter, solanaAccountState.address);
21126
21129
  console.log("✅ WalletConnect synced with SDK");
@@ -21225,7 +21228,7 @@ const WalletSelector = ({
21225
21228
  setAppKitLoading(true);
21226
21229
  setAppKitError(null);
21227
21230
  try {
21228
- const { initializeAppKitEVM, openAppKitModal } = await import("./appKitEVM-DNxsUg-8.js");
21231
+ const { initializeAppKitEVM, openAppKitModal } = await import("./appKitEVM-jh6msvrg.js");
21229
21232
  await initializeAppKitEVM(wagmiConfig);
21230
21233
  await openAppKitModal();
21231
21234
  } catch (error) {
@@ -21245,7 +21248,7 @@ const WalletSelector = ({
21245
21248
  setAppKitError(null);
21246
21249
  try {
21247
21250
  console.log("📦 Loading AppKit Solana module...");
21248
- const { initializeAppKitSolana } = await import("./appKitSolana-fo6vF0_g.js");
21251
+ const { initializeAppKitSolana } = await import("./appKitSolana-QAp0wzR5.js");
21249
21252
  console.log("✅ Module loaded, initializing...");
21250
21253
  const modal = await initializeAppKitSolana(solanaWallet);
21251
21254
  console.log("✅ AppKit Solana initialized successfully");
@@ -25822,7 +25825,7 @@ const CoinleyPaymentInternal = ({
25822
25825
  if (currentStep === PAYMENT_STEPS.SUCCESS) {
25823
25826
  return /* @__PURE__ */ jsxs("div", { id: SDK_ROOT_ID, className: `${SDK_ROOT_CLASS} fixed inset-0 z-50`, style: { fontFamily: FONT_FAMILY }, children: [
25824
25827
  /* @__PURE__ */ jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50" }),
25825
- /* @__PURE__ */ jsx("div", { className: isMobile ? "fixed inset-0 flex items-end" : "fixed inset-0 flex items-center justify-center p-4", style: { zIndex: 51 }, children: /* @__PURE__ */ jsx("div", { className: isMobile ? "bg-white rounded-t-3xl p-8 w-full max-h-[80vh] overflow-y-auto animate-slide-up-sheet" : "bg-white rounded-2xl p-8 max-w-md w-full", children: /* @__PURE__ */ jsx(
25828
+ /* @__PURE__ */ jsx("div", { className: isMobile ? "fixed inset-0 flex items-end" : "fixed inset-0 flex items-center justify-center p-4", style: { zIndex: 51 }, children: /* @__PURE__ */ jsx("div", { className: isMobile ? "relative flex w-full max-h-[92vh] flex-col overflow-y-auto rounded-t-[28px] bg-white px-4 pb-5 pt-5 animate-slide-up-sheet" : "relative flex h-[553px] w-[450px] max-w-[calc(100vw-32px)] flex-col overflow-hidden rounded-[28px] bg-white px-4 pb-5 pt-5", children: /* @__PURE__ */ jsx(
25826
25829
  PaymentStatus,
25827
25830
  {
25828
25831
  status: "success",
@@ -27002,4 +27005,4 @@ export {
27002
27005
  isFeatureEnabled as i,
27003
27006
  logo as l
27004
27007
  };
27005
- //# sourceMappingURL=CoinleyPayment-DK-cf2Vl.js.map
27008
+ //# sourceMappingURL=CoinleyPayment-Bj4u9uQh.js.map
@@ -1,4 +1,4 @@
1
- import { i as isFeatureEnabled, F as FEATURES, c as chainTransports, W as WALLETCONNECT_PROJECT_ID, l as logo } from "./CoinleyPayment-DK-cf2Vl.js";
1
+ import { i as isFeatureEnabled, F as FEATURES, c as chainTransports, W as WALLETCONNECT_PROJECT_ID, l as logo } from "./CoinleyPayment-Bj4u9uQh.js";
2
2
  let appKitInstance = null;
3
3
  let isInitializing = false;
4
4
  let initializationPromise = null;
@@ -112,4 +112,4 @@ export {
112
112
  initializeAppKitEVM,
113
113
  openAppKitModal
114
114
  };
115
- //# sourceMappingURL=appKitEVM-DNxsUg-8.js.map
115
+ //# sourceMappingURL=appKitEVM-jh6msvrg.js.map
@@ -1,4 +1,4 @@
1
- import { F as FEATURES, l as logo, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-DK-cf2Vl.js";
1
+ import { F as FEATURES, l as logo, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-Bj4u9uQh.js";
2
2
  let appKitInstance = null;
3
3
  let isInitializing = false;
4
4
  let initializationPromise = null;
@@ -242,4 +242,4 @@ export {
242
242
  disconnectWalletConnect,
243
243
  initializeAppKitSolana
244
244
  };
245
- //# sourceMappingURL=appKitSolana-fo6vF0_g.js.map
245
+ //# sourceMappingURL=appKitSolana-QAp0wzR5.js.map