coinley-pay 0.62.0 → 0.64.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-EVIUXV4Y.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-TmTTxz2j.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-Qc2Ml_-f.js");
21129
+ const { createWalletConnectAdapter } = await import("./appKitSolana-bPi9q207.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-Dsu3B87G.js");
21234
+ const { initializeAppKitEVM, openAppKitModal } = await import("./appKitEVM-xLzaRFEg.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-Qc2Ml_-f.js");
21254
+ const { initializeAppKitSolana } = await import("./appKitSolana-bPi9q207.js");
21255
21255
  console.log("✅ Module loaded, initializing...");
21256
21256
  const modal = await initializeAppKitSolana(solanaWallet);
21257
21257
  console.log("✅ AppKit Solana initialized successfully");
@@ -23379,6 +23379,7 @@ const CoinleyPaymentInternal = ({
23379
23379
  const [refundRequestMessage, setRefundRequestMessage] = useState("");
23380
23380
  const [offsetSuccessDetails, setOffsetSuccessDetails] = useState(null);
23381
23381
  const [refundSuccessDetails, setRefundSuccessDetails] = useState(null);
23382
+ const [overpaymentInfo, setOverpaymentInfo] = useState(null);
23382
23383
  const [recoveryLoadingAction, setRecoveryLoadingAction] = useState(null);
23383
23384
  const [recoveryLoadingStatus, setRecoveryLoadingStatus] = useState(null);
23384
23385
  const manualCheckTimeout = useRef(null);
@@ -24315,11 +24316,13 @@ const CoinleyPaymentInternal = ({
24315
24316
  const txHash = resolvePaymentTransactionHash(statusResult.payment);
24316
24317
  if ((status === "completed" || status === "swept") && txHash) {
24317
24318
  clearInterval(pollInterval);
24318
- captureOffsetSuccessDetails(statusResult.payment, txHash);
24319
24319
  clearUnderpaymentRecovery(paymentData.id);
24320
24320
  setProcessingStatusMessage("");
24321
24321
  persistSuccessfulPaymentHash(statusResult.payment, txHash);
24322
- setCurrentStep(PAYMENT_STEPS.SUCCESS);
24322
+ const rawPmt = statusResult.payment;
24323
+ const rcvd = parseFloat(rawPmt.amountReceived || 0);
24324
+ const expd = parseFloat(rawPmt.amount || 0);
24325
+ const isOverpaid = rawPmt.refundReason === "overpaid_excess" || rawPmt.excessOwed != null || rcvd > 0 && expd > 0 && rcvd > expd;
24323
24326
  sdkAnalytics.trackPaymentSuccess(
24324
24327
  paymentData.id,
24325
24328
  config == null ? void 0 : config.amount,
@@ -24338,12 +24341,29 @@ const CoinleyPaymentInternal = ({
24338
24341
  onSuccess({
24339
24342
  paymentId: paymentData.id,
24340
24343
  transactionHash: txHash,
24341
- depositAddress: statusResult.payment.depositAddress,
24344
+ depositAddress: rawPmt.depositAddress,
24342
24345
  network: selectedNetwork == null ? void 0 : selectedNetwork.shortName,
24343
24346
  currency: selectedToken == null ? void 0 : selectedToken.symbol,
24344
- paymentDetails: statusResult.payment
24347
+ paymentDetails: rawPmt
24348
+ });
24349
+ }
24350
+ if (isOverpaid) {
24351
+ const excessStr = rawPmt.excessOwed != null ? rawPmt.excessOwed : rcvd > 0 && expd > 0 ? String((rcvd - expd).toFixed(6)) : null;
24352
+ setOverpaymentInfo({
24353
+ paymentId: paymentData.id,
24354
+ excessOwed: excessStr,
24355
+ tokenSymbol: rawPmt.currency || (selectedToken == null ? void 0 : selectedToken.symbol) || "tokens",
24356
+ networkLabel: (selectedNetwork == null ? void 0 : selectedNetwork.displayName) || (selectedNetwork == null ? void 0 : selectedNetwork.name) || (selectedNetwork == null ? void 0 : selectedNetwork.shortName) || "the deposit network"
24345
24357
  });
24358
+ setRefundAddress("");
24359
+ setRefundRequestStatus(null);
24360
+ setRefundRequestSubmitted(false);
24361
+ setRefundRequestMessage("");
24362
+ refundPendingStartedAt.current = 0;
24363
+ } else {
24364
+ captureOffsetSuccessDetails(rawPmt, txHash);
24346
24365
  }
24366
+ setCurrentStep(PAYMENT_STEPS.SUCCESS);
24347
24367
  return;
24348
24368
  }
24349
24369
  if (activateUnderpaymentFlow(statusResult.payment)) {
@@ -24378,6 +24398,25 @@ const CoinleyPaymentInternal = ({
24378
24398
  }, 5e3);
24379
24399
  return () => clearInterval(pollInterval);
24380
24400
  }, [currentStep, paymentData == null ? void 0 : paymentData.id, paymentData == null ? void 0 : paymentData.depositAddress, selectedNetwork, selectedToken, onSuccess, activateUnderpaymentFlow, captureOffsetSuccessDetails, clearUnderpaymentRecovery, resolvePaymentTransactionHash, persistSuccessfulPaymentHash]);
24401
+ useEffect(() => {
24402
+ if (currentStep !== PAYMENT_STEPS.SUCCESS || !(overpaymentInfo == null ? void 0 : overpaymentInfo.paymentId) || !refundRequestSubmitted || refundRequestStatus !== "pending") {
24403
+ return;
24404
+ }
24405
+ const pollInterval = setInterval(async () => {
24406
+ var _a2;
24407
+ try {
24408
+ const statusResult = await paymentFlow.api.getDepositStatus(overpaymentInfo.paymentId);
24409
+ if (statusResult.success && ((_a2 = statusResult.payment) == null ? void 0 : _a2.refundStatus) === "refunded") {
24410
+ clearInterval(pollInterval);
24411
+ refundPendingStartedAt.current = 0;
24412
+ setRefundRequestStatus("refunded");
24413
+ }
24414
+ } catch (e) {
24415
+ console.warn("[OverpaymentRefundPoll] Error:", e.message);
24416
+ }
24417
+ }, 5e3);
24418
+ return () => clearInterval(pollInterval);
24419
+ }, [currentStep, overpaymentInfo, refundRequestSubmitted, refundRequestStatus, paymentFlow.api]);
24381
24420
  useEffect(() => {
24382
24421
  const shouldPoll = (paymentData == null ? void 0 : paymentData.id) && (activeTab === PAYMENT_TABS.QR || activeTab === PAYMENT_TABS.TRANSFER) && currentStep === PAYMENT_STEPS.CONFIRM && !verifyingPayment && paymentType !== PAYMENT_TYPES.DEPOSIT && !(paymentData == null ? void 0 : paymentData.isDepositPayment) && !(paymentData == null ? void 0 : paymentData.depositAddress);
24383
24422
  if (!shouldPoll) {
@@ -24477,6 +24516,7 @@ const CoinleyPaymentInternal = ({
24477
24516
  setRecoveryLoadingAction(null);
24478
24517
  setRecoveryLoadingStatus(null);
24479
24518
  setCcSuccessDetails(null);
24519
+ setOverpaymentInfo(null);
24480
24520
  if (recoveryLoadingTimeout.current) {
24481
24521
  clearTimeout(recoveryLoadingTimeout.current);
24482
24522
  recoveryLoadingTimeout.current = null;
@@ -26327,22 +26367,41 @@ const CoinleyPaymentInternal = ({
26327
26367
  if ((status === "completed" || status === "swept") && txHash) {
26328
26368
  console.log("✅ Auto-detected: Deposit payment completed!");
26329
26369
  clearInterval(pollInterval);
26330
- captureOffsetSuccessDetails(statusResult.payment, txHash);
26331
26370
  clearUnderpaymentRecovery(paymentData.id);
26332
26371
  persistSuccessfulPaymentHash(statusResult.payment, txHash);
26333
- setCurrentStep(PAYMENT_STEPS.SUCCESS);
26372
+ const rawPmt = statusResult.payment;
26373
+ const rcvd = parseFloat(rawPmt.amountReceived || 0);
26374
+ const expd = parseFloat(rawPmt.amount || 0);
26375
+ const isOverpaid = rawPmt.refundReason === "overpaid_excess" || rawPmt.excessOwed != null || rcvd > 0 && expd > 0 && rcvd > expd;
26334
26376
  sdkAnalytics.trackPaymentSuccess(paymentData.id, config == null ? void 0 : config.amount, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, txHash);
26335
26377
  clarityAnalytics.trackPaymentSuccess(paymentData.id, config == null ? void 0 : config.amount, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, txHash);
26336
26378
  if (onSuccess) {
26337
26379
  onSuccess({
26338
26380
  paymentId: paymentData.id,
26339
26381
  transactionHash: txHash,
26340
- depositAddress: statusResult.payment.depositAddress,
26382
+ depositAddress: rawPmt.depositAddress,
26341
26383
  network: selectedNetwork == null ? void 0 : selectedNetwork.shortName,
26342
26384
  currency: selectedToken == null ? void 0 : selectedToken.symbol,
26343
- paymentDetails: statusResult.payment
26385
+ paymentDetails: rawPmt
26344
26386
  });
26345
26387
  }
26388
+ if (isOverpaid) {
26389
+ const excessStr = rawPmt.excessOwed != null ? rawPmt.excessOwed : rcvd > 0 && expd > 0 ? String((rcvd - expd).toFixed(6)) : null;
26390
+ setOverpaymentInfo({
26391
+ paymentId: paymentData.id,
26392
+ excessOwed: excessStr,
26393
+ tokenSymbol: rawPmt.currency || (selectedToken == null ? void 0 : selectedToken.symbol) || "tokens",
26394
+ networkLabel: (selectedNetwork == null ? void 0 : selectedNetwork.displayName) || (selectedNetwork == null ? void 0 : selectedNetwork.name) || (selectedNetwork == null ? void 0 : selectedNetwork.shortName) || "the deposit network"
26395
+ });
26396
+ setRefundAddress("");
26397
+ setRefundRequestStatus(null);
26398
+ setRefundRequestSubmitted(false);
26399
+ setRefundRequestMessage("");
26400
+ refundPendingStartedAt.current = 0;
26401
+ } else {
26402
+ captureOffsetSuccessDetails(rawPmt, txHash);
26403
+ }
26404
+ setCurrentStep(PAYMENT_STEPS.SUCCESS);
26346
26405
  return;
26347
26406
  }
26348
26407
  if (activateUnderpaymentFlow(statusResult.payment)) {
@@ -26484,6 +26543,31 @@ const CoinleyPaymentInternal = ({
26484
26543
  });
26485
26544
  }
26486
26545
  }, [activeTransferPaymentId, captureRefundSuccessDetails, ccOriginChainId, ccOriginToken == null ? void 0 : ccOriginToken.symbol, ccResult, clearUnderpaymentRecovery, config, finishRecoveryLoading, getCrossChainRefundPendingStatus, getRefundPendingStatus, holdRecoveryLoading, refundAddress, refundRequestStatus, paymentFlow.api, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, startRecoveryLoading, underpaymentInfo]);
26546
+ const handleOverpaymentRefundSubmit = useCallback(async () => {
26547
+ var _a2;
26548
+ const trimmedAddress = refundAddress.trim();
26549
+ if (!trimmedAddress || !(overpaymentInfo == null ? void 0 : overpaymentInfo.paymentId) || refundRequestStatus === "submitting") return;
26550
+ setRefundRequestStatus("submitting");
26551
+ setRefundRequestMessage("");
26552
+ refundPendingStartedAt.current = Date.now();
26553
+ try {
26554
+ const result = await paymentFlow.api.requestDepositRefund(overpaymentInfo.paymentId, trimmedAddress);
26555
+ const refundSt = ((_a2 = result == null ? void 0 : result.payment) == null ? void 0 : _a2.refundStatus) || (result == null ? void 0 : result.status) || "pending";
26556
+ setRefundRequestSubmitted(true);
26557
+ if (refundSt === "refunded") {
26558
+ refundPendingStartedAt.current = 0;
26559
+ setRefundRequestStatus("refunded");
26560
+ } else {
26561
+ refundPendingStartedAt.current = refundPendingStartedAt.current || Date.now();
26562
+ setRefundRequestStatus("pending");
26563
+ }
26564
+ setRefundRequestMessage("");
26565
+ } catch (error2) {
26566
+ refundPendingStartedAt.current = 0;
26567
+ setRefundRequestStatus("error");
26568
+ setRefundRequestMessage(error2.message || "Failed to submit refund request. Please try again.");
26569
+ }
26570
+ }, [overpaymentInfo, refundAddress, refundRequestStatus, paymentFlow.api]);
26487
26571
  const handleDepositManualCheck = useCallback(async () => {
26488
26572
  if (manualCheckStatus === "checking" || !(paymentData == null ? void 0 : paymentData.id)) return;
26489
26573
  const isOffsetRecovery = Boolean(underpaymentInfo && underpaymentView === "offset");
@@ -26496,22 +26580,41 @@ const CoinleyPaymentInternal = ({
26496
26580
  if ((status === "completed" || status === "swept") && txHash) {
26497
26581
  finishRecoveryLoading(() => {
26498
26582
  setManualCheckStatus(null);
26499
- captureOffsetSuccessDetails(statusResult.payment, txHash);
26500
26583
  clearUnderpaymentRecovery(paymentData.id);
26501
26584
  persistSuccessfulPaymentHash(statusResult.payment, txHash);
26502
- setCurrentStep(PAYMENT_STEPS.SUCCESS);
26585
+ const rawPmt = statusResult.payment;
26586
+ const rcvd = parseFloat(rawPmt.amountReceived || 0);
26587
+ const expd = parseFloat(rawPmt.amount || 0);
26588
+ const isOverpaid = rawPmt.refundReason === "overpaid_excess" || rawPmt.excessOwed != null || rcvd > 0 && expd > 0 && rcvd > expd;
26503
26589
  sdkAnalytics.trackPaymentSuccess(paymentData.id, config == null ? void 0 : config.amount, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, txHash);
26504
26590
  clarityAnalytics.trackPaymentSuccess(paymentData.id, config == null ? void 0 : config.amount, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, txHash);
26505
26591
  if (onSuccess) {
26506
26592
  onSuccess({
26507
26593
  paymentId: paymentData.id,
26508
26594
  transactionHash: txHash,
26509
- depositAddress: statusResult.payment.depositAddress,
26595
+ depositAddress: rawPmt.depositAddress,
26510
26596
  network: selectedNetwork == null ? void 0 : selectedNetwork.shortName,
26511
26597
  currency: selectedToken == null ? void 0 : selectedToken.symbol,
26512
- paymentDetails: statusResult.payment
26598
+ paymentDetails: rawPmt
26513
26599
  });
26514
26600
  }
26601
+ if (isOverpaid) {
26602
+ const excessStr = rawPmt.excessOwed != null ? rawPmt.excessOwed : rcvd > 0 && expd > 0 ? String((rcvd - expd).toFixed(6)) : null;
26603
+ setOverpaymentInfo({
26604
+ paymentId: paymentData.id,
26605
+ excessOwed: excessStr,
26606
+ tokenSymbol: rawPmt.currency || (selectedToken == null ? void 0 : selectedToken.symbol) || "tokens",
26607
+ networkLabel: (selectedNetwork == null ? void 0 : selectedNetwork.displayName) || (selectedNetwork == null ? void 0 : selectedNetwork.name) || (selectedNetwork == null ? void 0 : selectedNetwork.shortName) || "the deposit network"
26608
+ });
26609
+ setRefundAddress("");
26610
+ setRefundRequestStatus(null);
26611
+ setRefundRequestSubmitted(false);
26612
+ setRefundRequestMessage("");
26613
+ refundPendingStartedAt.current = 0;
26614
+ } else {
26615
+ captureOffsetSuccessDetails(rawPmt, txHash);
26616
+ }
26617
+ setCurrentStep(PAYMENT_STEPS.SUCCESS);
26515
26618
  });
26516
26619
  return;
26517
26620
  }
@@ -26620,6 +26723,92 @@ const CoinleyPaymentInternal = ({
26620
26723
  );
26621
26724
  }
26622
26725
  if (currentStep === PAYMENT_STEPS.SUCCESS) {
26726
+ if (overpaymentInfo) {
26727
+ const opElapsedMs = refundPendingStartedAt.current ? Math.max(Date.now() - refundPendingStartedAt.current, 0) : 0;
26728
+ const opGuidance = refundRequestSubmitted && refundRequestStatus === "pending" ? getRefundPendingGuidance(opElapsedMs) : null;
26729
+ return renderInPortal(
26730
+ /* @__PURE__ */ jsxs("div", { id: SDK_ROOT_ID, className: `${SDK_ROOT_CLASS} fixed inset-0 z-50`, style: { fontFamily: FONT_FAMILY }, children: [
26731
+ /* @__PURE__ */ jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50", onClick: onClose }),
26732
+ /* @__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__ */ jsxs("div", { className: isMobile ? "coinley-mobile-sheet relative flex w-full max-h-[92dvh] flex-col overflow-hidden rounded-t-[24px] bg-white px-4 pb-5 pt-7 shadow-2xl animate-slide-up-sheet" : "relative flex h-auto min-h-[520px] w-[430px] max-w-[calc(100vw-32px)] flex-col overflow-hidden rounded-[28px] bg-white px-4 pb-5 pt-7 shadow-2xl", children: [
26733
+ /* @__PURE__ */ jsx(
26734
+ "button",
26735
+ {
26736
+ type: "button",
26737
+ onClick: onClose,
26738
+ className: "absolute right-4 top-5 flex h-8 w-8 items-center justify-center rounded-full text-[#111827] transition-colors hover:bg-gray-100",
26739
+ "aria-label": "Close payment modal",
26740
+ children: /* @__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: 2, d: "M6 18L18 6M6 6l12 12" }) })
26741
+ }
26742
+ ),
26743
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col overflow-y-auto pt-2", children: [
26744
+ /* @__PURE__ */ jsxs("div", { className: "mb-5 text-center", children: [
26745
+ /* @__PURE__ */ jsx("div", { className: "mx-auto mb-3 flex h-16 w-16 items-center justify-center rounded-full bg-[#D9F8E6]", children: /* @__PURE__ */ jsx("div", { className: "flex h-11 w-11 items-center justify-center rounded-full bg-[#08C65A] text-white", children: /* @__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: 2.5, d: "M5 13l4 4L19 7" }) }) }) }),
26746
+ /* @__PURE__ */ jsx("h3", { className: "mb-1 text-lg font-semibold text-black", children: "Payment Received" }),
26747
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-[#6B7280]", children: overpaymentInfo.excessOwed ? `You sent ${formatAmount(overpaymentInfo.excessOwed)} ${overpaymentInfo.tokenSymbol} more than required. We will refund the excess to you.` : `You sent more than the required amount. We will refund the excess to you.` })
26748
+ ] }),
26749
+ /* @__PURE__ */ jsx("div", { className: "mb-5 rounded-lg border border-[#F5E5B8] bg-[#FFF9E8] px-3 py-2", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-2", children: [
26750
+ /* @__PURE__ */ jsx("svg", { className: "mt-0.5 h-4 w-4 flex-shrink-0 text-[#B54708]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 9v4m0 4h.01M12 3a9 9 0 110 18 9 9 0 010-18z" }) }),
26751
+ /* @__PURE__ */ jsxs("p", { className: "text-xs leading-5 text-[#B54708]", children: [
26752
+ overpaymentInfo.excessOwed ? `We are holding ${formatAmount(overpaymentInfo.excessOwed)} ${overpaymentInfo.tokenSymbol} for you.` : `We are holding your excess ${overpaymentInfo.tokenSymbol} for you.`,
26753
+ " ",
26754
+ "Provide a wallet address below. You can safely close this window after submitting — the refund processes automatically."
26755
+ ] })
26756
+ ] }) }),
26757
+ refundRequestStatus === "refunded" ? /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-[#D1FAE5] bg-[#ECFDF5] px-3 py-3 text-center", children: [
26758
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold text-[#065F46]", children: "Excess refunded" }),
26759
+ /* @__PURE__ */ jsxs("p", { className: "mt-1 text-xs leading-5 text-[#047857]", children: [
26760
+ "Your excess ",
26761
+ overpaymentInfo.tokenSymbol,
26762
+ " has been sent to your wallet."
26763
+ ] })
26764
+ ] }) : opGuidance ? /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-[#EEF0F4] bg-[#FAFAFB] px-3 py-3", children: [
26765
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold text-[#111827]", children: opGuidance.title }),
26766
+ /* @__PURE__ */ jsx("p", { className: "mt-1 text-xs leading-5 text-[#535865]", children: opGuidance.description }),
26767
+ /* @__PURE__ */ jsx("p", { className: "mt-2 text-xs leading-5 text-[#8B8E98]", children: opGuidance.eta })
26768
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
26769
+ /* @__PURE__ */ jsxs("label", { className: "mb-2 block text-xs font-medium text-[#111827]", children: [
26770
+ "Your ",
26771
+ overpaymentInfo.tokenSymbol,
26772
+ " (",
26773
+ overpaymentInfo.networkLabel,
26774
+ ") wallet address for refund"
26775
+ ] }),
26776
+ /* @__PURE__ */ jsx(
26777
+ "input",
26778
+ {
26779
+ type: "text",
26780
+ value: refundAddress,
26781
+ onChange: (e) => setRefundAddress(e.target.value),
26782
+ placeholder: "Paste your wallet address here",
26783
+ className: "mb-4 h-11 w-full rounded-xl border border-[#E4E6EB] bg-white px-3 text-sm text-[#1F2430] outline-none transition-colors placeholder:text-[#8B8E98] focus:border-[#B49AF0]"
26784
+ }
26785
+ ),
26786
+ refundRequestMessage && /* @__PURE__ */ jsx("p", { className: `mb-3 text-xs leading-5 ${refundRequestStatus === "error" ? "text-red-600" : "text-[#8B8E98]"}`, children: refundRequestMessage }),
26787
+ /* @__PURE__ */ jsx(
26788
+ "button",
26789
+ {
26790
+ type: "button",
26791
+ onClick: handleOverpaymentRefundSubmit,
26792
+ disabled: !refundAddress.trim() || refundRequestStatus === "submitting",
26793
+ className: "h-12 w-full rounded-xl bg-[#7042D2] px-4 text-sm font-semibold text-white transition-colors hover:bg-[#5b34b1] disabled:opacity-50 disabled:cursor-not-allowed",
26794
+ children: refundRequestStatus === "submitting" ? "Submitting..." : "Submit Refund Address"
26795
+ }
26796
+ )
26797
+ ] })
26798
+ ] }),
26799
+ (refundRequestStatus === "refunded" || opGuidance) && /* @__PURE__ */ jsx(
26800
+ "button",
26801
+ {
26802
+ type: "button",
26803
+ onClick: onClose,
26804
+ className: "mt-4 h-12 w-full rounded-lg border border-[#E4E6EB] px-4 text-sm font-semibold text-[#374151] transition-colors hover:bg-gray-50",
26805
+ children: "Close"
26806
+ }
26807
+ )
26808
+ ] }) })
26809
+ ] })
26810
+ );
26811
+ }
26623
26812
  if (offsetSuccessDetails) {
26624
26813
  return renderInPortal(
26625
26814
  /* @__PURE__ */ jsxs("div", { id: SDK_ROOT_ID, className: `${SDK_ROOT_CLASS} fixed inset-0 z-50`, style: { fontFamily: FONT_FAMILY }, children: [
@@ -28278,4 +28467,4 @@ export {
28278
28467
  chainTransports as c,
28279
28468
  isFeatureEnabled as i
28280
28469
  };
28281
- //# sourceMappingURL=CoinleyPayment-CkjhX3Ry.js.map
28470
+ //# sourceMappingURL=CoinleyPayment-DpJjSgAk.js.map
@@ -1,4 +1,4 @@
1
- import { i as isFeatureEnabled, F as FEATURES, c as chainTransports, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-CkjhX3Ry.js";
1
+ import { i as isFeatureEnabled, F as FEATURES, c as chainTransports, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-DpJjSgAk.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-Dsu3B87G.js.map
116
+ //# sourceMappingURL=appKitEVM-xLzaRFEg.js.map
@@ -1,4 +1,4 @@
1
- import { F as FEATURES, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-CkjhX3Ry.js";
1
+ import { F as FEATURES, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-DpJjSgAk.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-Qc2Ml_-f.js.map
246
+ //# sourceMappingURL=appKitSolana-bPi9q207.js.map