coinley-pay 0.44.0 → 0.45.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-BxLKbwy5.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-CyqvsmiG.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";
@@ -21122,7 +21122,7 @@ const WalletSelector = ({
21122
21122
  try {
21123
21123
  setAppKitError(null);
21124
21124
  setWalletConnectAddress(solanaAccountState.address);
21125
- const { createWalletConnectAdapter } = await import("./appKitSolana-CG78TZQO.js");
21125
+ const { createWalletConnectAdapter } = await import("./appKitSolana-BmONG1Sf.js");
21126
21126
  const adapter = createWalletConnectAdapter(solanaAccountState.address);
21127
21127
  await solanaWallet.connectWalletConnect(adapter, solanaAccountState.address);
21128
21128
  console.log("✅ WalletConnect synced with SDK");
@@ -21227,7 +21227,7 @@ const WalletSelector = ({
21227
21227
  setAppKitLoading(true);
21228
21228
  setAppKitError(null);
21229
21229
  try {
21230
- const { initializeAppKitEVM, openAppKitModal } = await import("./appKitEVM-UnYPliV_.js");
21230
+ const { initializeAppKitEVM, openAppKitModal } = await import("./appKitEVM-Dxo1Z_69.js");
21231
21231
  await initializeAppKitEVM(wagmiConfig);
21232
21232
  await openAppKitModal();
21233
21233
  } catch (error) {
@@ -21247,7 +21247,7 @@ const WalletSelector = ({
21247
21247
  setAppKitError(null);
21248
21248
  try {
21249
21249
  console.log("📦 Loading AppKit Solana module...");
21250
- const { initializeAppKitSolana } = await import("./appKitSolana-CG78TZQO.js");
21250
+ const { initializeAppKitSolana } = await import("./appKitSolana-BmONG1Sf.js");
21251
21251
  console.log("✅ Module loaded, initializing...");
21252
21252
  const modal = await initializeAppKitSolana(solanaWallet);
21253
21253
  console.log("✅ AppKit Solana initialized successfully");
@@ -23132,6 +23132,7 @@ const injectCoinleyFonts = () => {
23132
23132
  const CHECKOUT_BUILD = "checkout-2026-04-22b-route-destination-trials";
23133
23133
  const UNDERPAYMENT_RECOVERY_STORAGE_PREFIX = "coinley_underpayment_recovery:";
23134
23134
  const UNDERPAYMENT_RECOVERY_TTL_MS = 2 * 60 * 60 * 1e3;
23135
+ const RECOVERY_LOADING_MIN_MS = 1200;
23135
23136
  const normalizeEvmAddress = (value) => {
23136
23137
  if (typeof value !== "string") return null;
23137
23138
  const trimmed = value.trim();
@@ -23351,7 +23352,10 @@ const CoinleyPaymentInternal = ({
23351
23352
  const [refundRequestMessage, setRefundRequestMessage] = useState("");
23352
23353
  const [offsetSuccessDetails, setOffsetSuccessDetails] = useState(null);
23353
23354
  const [refundSuccessDetails, setRefundSuccessDetails] = useState(null);
23355
+ const [recoveryLoadingAction, setRecoveryLoadingAction] = useState(null);
23354
23356
  const manualCheckTimeout = useRef(null);
23357
+ const recoveryLoadingStartedAt = useRef(0);
23358
+ const recoveryLoadingTimeout = useRef(null);
23355
23359
  const [copiedField, setCopiedField] = useState(null);
23356
23360
  const [expirationTime, setExpirationTime] = useState(null);
23357
23361
  const STANDARD_PAYMENT_TIMEOUT_MS = 15 * 60 * 1e3;
@@ -23715,11 +23719,13 @@ const CoinleyPaymentInternal = ({
23715
23719
  setUnderpaymentView("choice");
23716
23720
  setManualCheckStatus(null);
23717
23721
  setCcManualCheckStatus(null);
23722
+ setRecoveryLoadingAction(null);
23718
23723
  clearUnderpaymentRecovery(paymentId || activeTransferPaymentId);
23719
23724
  }, [activeTransferPaymentId, clearUnderpaymentRecovery]);
23720
23725
  useEffect(() => {
23721
23726
  setOffsetSuccessDetails(null);
23722
23727
  setRefundSuccessDetails(null);
23728
+ setRecoveryLoadingAction(null);
23723
23729
  }, [paymentData == null ? void 0 : paymentData.id]);
23724
23730
  const selectedNetworkIsSolana = (selectedNetwork == null ? void 0 : selectedNetwork.chainType) === "solana" || (selectedNetwork == null ? void 0 : selectedNetwork.shortName) === "solana";
23725
23731
  const sourceNeedsMerchantBridge = Boolean(
@@ -24345,6 +24351,11 @@ const CoinleyPaymentInternal = ({
24345
24351
  setMobilePaymentStarted(false);
24346
24352
  setSelectedMobileWallet(null);
24347
24353
  setMobileWalletRedirecting(null);
24354
+ setRecoveryLoadingAction(null);
24355
+ if (recoveryLoadingTimeout.current) {
24356
+ clearTimeout(recoveryLoadingTimeout.current);
24357
+ recoveryLoadingTimeout.current = null;
24358
+ }
24348
24359
  if (typeof window !== "undefined" && window.sessionStorage) {
24349
24360
  sessionStorage.removeItem("coinley_mobile_payment_started");
24350
24361
  }
@@ -25161,30 +25172,77 @@ const CoinleyPaymentInternal = ({
25161
25172
  setCcGenerating(false);
25162
25173
  }
25163
25174
  };
25175
+ const startRecoveryLoading = useCallback((action) => {
25176
+ if (recoveryLoadingTimeout.current) {
25177
+ clearTimeout(recoveryLoadingTimeout.current);
25178
+ recoveryLoadingTimeout.current = null;
25179
+ }
25180
+ recoveryLoadingStartedAt.current = Date.now();
25181
+ setRecoveryLoadingAction(action);
25182
+ }, []);
25183
+ const finishRecoveryLoading = useCallback((callback) => {
25184
+ const elapsed = Date.now() - recoveryLoadingStartedAt.current;
25185
+ const delay = Math.max(RECOVERY_LOADING_MIN_MS - elapsed, 0);
25186
+ if (recoveryLoadingTimeout.current) {
25187
+ clearTimeout(recoveryLoadingTimeout.current);
25188
+ }
25189
+ recoveryLoadingTimeout.current = setTimeout(() => {
25190
+ recoveryLoadingTimeout.current = null;
25191
+ setRecoveryLoadingAction(null);
25192
+ if (typeof callback === "function") {
25193
+ callback();
25194
+ }
25195
+ }, delay);
25196
+ }, []);
25197
+ useEffect(() => () => {
25198
+ if (recoveryLoadingTimeout.current) {
25199
+ clearTimeout(recoveryLoadingTimeout.current);
25200
+ }
25201
+ }, []);
25164
25202
  const handleCrossChainManualCheck = async () => {
25165
25203
  if (!(ccResult == null ? void 0 : ccResult.id) || ccManualCheckStatus === "checking") return;
25204
+ const isOffsetRecovery = Boolean(underpaymentInfo && underpaymentView === "offset");
25166
25205
  setCcManualCheckStatus("checking");
25167
25206
  setCcError(null);
25168
25207
  try {
25169
25208
  const status = await paymentFlow.api.getCrossChainStatus(ccResult.id);
25170
25209
  setCcPhase(status.phase);
25171
25210
  if (activateUnderpaymentFromCrossChainStatus(status)) {
25172
- setCcManualCheckStatus(null);
25211
+ if (isOffsetRecovery) {
25212
+ finishRecoveryLoading(() => {
25213
+ setCcManualCheckStatus("not_found");
25214
+ showTransferNoticeModal("We have not detected your offset yet. It can take a few moments to appear on-chain, and we will keep checking automatically.");
25215
+ });
25216
+ } else {
25217
+ setCcManualCheckStatus(null);
25218
+ }
25173
25219
  } else if (status.phase === "bridging") {
25174
- clearUnderpaymentUiState(status.paymentId || ccResult.id);
25175
- showTransferNoticeModal("We have detected your transfer and are waiting for the bridge to complete. We will keep checking automatically.", "Transfer detected");
25220
+ finishRecoveryLoading(() => {
25221
+ clearUnderpaymentUiState(status.paymentId || ccResult.id);
25222
+ showTransferNoticeModal("We have detected your transfer and are waiting for the bridge to complete. We will keep checking automatically.", "Transfer detected");
25223
+ });
25176
25224
  } else if ((status.phase === "received" || status.phase === "settled") && !ccSucceeded.current) {
25177
- ccSucceeded.current = true;
25178
- onSuccess == null ? void 0 : onSuccess(status);
25225
+ finishRecoveryLoading(() => {
25226
+ ccSucceeded.current = true;
25227
+ onSuccess == null ? void 0 : onSuccess(status);
25228
+ });
25179
25229
  } else if (status.phase === "failed") {
25180
- setCcManualCheckStatus("failed");
25230
+ finishRecoveryLoading(() => {
25231
+ setCcManualCheckStatus("failed");
25232
+ });
25181
25233
  } else {
25182
- setCcManualCheckStatus("not_found");
25183
- showTransferNoticeModal("We have not detected your transfer yet. It can take a few moments to appear on-chain, and we will keep checking automatically.");
25234
+ finishRecoveryLoading(() => {
25235
+ setCcManualCheckStatus("not_found");
25236
+ showTransferNoticeModal(
25237
+ isOffsetRecovery ? "We have not detected your offset yet. It can take a few moments to appear on-chain, and we will keep checking automatically." : "We have not detected your transfer yet. It can take a few moments to appear on-chain, and we will keep checking automatically."
25238
+ );
25239
+ });
25184
25240
  }
25185
25241
  } catch (error2) {
25186
- setCcError(error2.message || "Could not check this payment yet. Please try again.");
25187
- setCcManualCheckStatus("idle");
25242
+ finishRecoveryLoading(() => {
25243
+ setCcError(error2.message || "Could not check this payment yet. Please try again.");
25244
+ setCcManualCheckStatus("idle");
25245
+ });
25188
25246
  }
25189
25247
  };
25190
25248
  useEffect(() => {
@@ -26055,9 +26113,10 @@ const CoinleyPaymentInternal = ({
26055
26113
  writeUnderpaymentRecovery(underpaymentChoice, underpaymentView, underpaymentInfo);
26056
26114
  }, [paymentData == null ? void 0 : paymentData.id, underpaymentInfo, underpaymentChoice, underpaymentView, writeUnderpaymentRecovery]);
26057
26115
  const handleRefundRequestSubmit = useCallback(async () => {
26058
- var _a2, _b;
26116
+ var _a2;
26059
26117
  const trimmedAddress = refundAddress.trim();
26060
26118
  if (!trimmedAddress || !activeTransferPaymentId || refundRequestStatus === "submitting") return;
26119
+ startRecoveryLoading("refund");
26061
26120
  setRefundRequestStatus("submitting");
26062
26121
  setRefundRequestMessage("");
26063
26122
  setManualCheckStatus(null);
@@ -26084,24 +26143,32 @@ const CoinleyPaymentInternal = ({
26084
26143
  setRefundRequestSubmitted(true);
26085
26144
  setRefundRequestStatus(refundStatus === "refunded" ? "refunded" : "pending");
26086
26145
  if (refundStatus === "refunded") {
26087
- setRefundRequestMessage("");
26088
- captureRefundSuccessDetails(result == null ? void 0 : result.payment, (_b = result == null ? void 0 : result.payment) == null ? void 0 : _b.refundTxHash, trimmedAddress);
26089
- clearUnderpaymentRecovery(activeTransferPaymentId);
26090
- setCurrentStep(PAYMENT_STEPS.SUCCESS);
26146
+ finishRecoveryLoading(() => {
26147
+ var _a3;
26148
+ setRefundRequestMessage("");
26149
+ captureRefundSuccessDetails(result == null ? void 0 : result.payment, (_a3 = result == null ? void 0 : result.payment) == null ? void 0 : _a3.refundTxHash, trimmedAddress);
26150
+ clearUnderpaymentRecovery(activeTransferPaymentId);
26151
+ setCurrentStep(PAYMENT_STEPS.SUCCESS);
26152
+ });
26091
26153
  } else {
26092
26154
  const refundMessage = "Refund request received. We will process it automatically.";
26093
- setRefundRequestMessage("");
26094
- showTransferNoticeModal(refundMessage, "Refund request received");
26155
+ finishRecoveryLoading(() => {
26156
+ setRefundRequestMessage("");
26157
+ showTransferNoticeModal(refundMessage, "Refund request received");
26158
+ });
26095
26159
  }
26096
26160
  } catch (error2) {
26097
26161
  console.warn("[RefundRequest] Error:", error2.message);
26098
- setRefundRequestSubmitted(false);
26099
- setRefundRequestStatus("error");
26100
- setRefundRequestMessage(error2.message || "Failed to submit refund request. Please try again.");
26162
+ finishRecoveryLoading(() => {
26163
+ setRefundRequestSubmitted(false);
26164
+ setRefundRequestStatus("error");
26165
+ setRefundRequestMessage(error2.message || "Failed to submit refund request. Please try again.");
26166
+ });
26101
26167
  }
26102
- }, [activeTransferPaymentId, captureRefundSuccessDetails, ccOriginChainId, ccOriginToken == null ? void 0 : ccOriginToken.symbol, clearUnderpaymentRecovery, config, refundAddress, refundRequestStatus, paymentFlow.api, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, showTransferNoticeModal, underpaymentInfo]);
26168
+ }, [activeTransferPaymentId, captureRefundSuccessDetails, ccOriginChainId, ccOriginToken == null ? void 0 : ccOriginToken.symbol, clearUnderpaymentRecovery, config, finishRecoveryLoading, refundAddress, refundRequestStatus, paymentFlow.api, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, showTransferNoticeModal, startRecoveryLoading, underpaymentInfo]);
26103
26169
  const handleDepositManualCheck = useCallback(async () => {
26104
26170
  if (manualCheckStatus === "checking" || !(paymentData == null ? void 0 : paymentData.id)) return;
26171
+ const isOffsetRecovery = Boolean(underpaymentInfo && underpaymentView === "offset");
26105
26172
  setManualCheckStatus("checking");
26106
26173
  try {
26107
26174
  const statusResult = await paymentFlow.api.getDepositStatus(paymentData.id);
@@ -26109,55 +26176,85 @@ const CoinleyPaymentInternal = ({
26109
26176
  const status = statusResult.payment.status;
26110
26177
  const txHash = resolvePaymentTransactionHash(statusResult.payment);
26111
26178
  if ((status === "completed" || status === "swept") && txHash) {
26112
- setManualCheckStatus(null);
26113
- captureOffsetSuccessDetails(statusResult.payment, txHash);
26114
- clearUnderpaymentRecovery(paymentData.id);
26115
- persistSuccessfulPaymentHash(statusResult.payment, txHash);
26116
- setCurrentStep(PAYMENT_STEPS.SUCCESS);
26117
- sdkAnalytics.trackPaymentSuccess(paymentData.id, config == null ? void 0 : config.amount, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, txHash);
26118
- clarityAnalytics.trackPaymentSuccess(paymentData.id, config == null ? void 0 : config.amount, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, txHash);
26119
- if (onSuccess) {
26120
- onSuccess({
26121
- paymentId: paymentData.id,
26122
- transactionHash: txHash,
26123
- depositAddress: statusResult.payment.depositAddress,
26124
- network: selectedNetwork == null ? void 0 : selectedNetwork.shortName,
26125
- currency: selectedToken == null ? void 0 : selectedToken.symbol,
26126
- paymentDetails: statusResult.payment
26127
- });
26128
- }
26179
+ finishRecoveryLoading(() => {
26180
+ setManualCheckStatus(null);
26181
+ captureOffsetSuccessDetails(statusResult.payment, txHash);
26182
+ clearUnderpaymentRecovery(paymentData.id);
26183
+ persistSuccessfulPaymentHash(statusResult.payment, txHash);
26184
+ setCurrentStep(PAYMENT_STEPS.SUCCESS);
26185
+ sdkAnalytics.trackPaymentSuccess(paymentData.id, config == null ? void 0 : config.amount, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, txHash);
26186
+ clarityAnalytics.trackPaymentSuccess(paymentData.id, config == null ? void 0 : config.amount, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, txHash);
26187
+ if (onSuccess) {
26188
+ onSuccess({
26189
+ paymentId: paymentData.id,
26190
+ transactionHash: txHash,
26191
+ depositAddress: statusResult.payment.depositAddress,
26192
+ network: selectedNetwork == null ? void 0 : selectedNetwork.shortName,
26193
+ currency: selectedToken == null ? void 0 : selectedToken.symbol,
26194
+ paymentDetails: statusResult.payment
26195
+ });
26196
+ }
26197
+ });
26129
26198
  return;
26130
26199
  }
26131
26200
  if (activateUnderpaymentFlow(statusResult.payment)) {
26201
+ if (isOffsetRecovery) {
26202
+ finishRecoveryLoading(() => {
26203
+ setManualCheckStatus("not_found");
26204
+ showTransferNoticeModal("We have not detected your offset yet. It can take a few moments to appear on-chain, and we will keep checking automatically.");
26205
+ manualCheckTimeout.current = setTimeout(() => {
26206
+ setManualCheckStatus(null);
26207
+ }, 1e4);
26208
+ });
26209
+ }
26132
26210
  return;
26133
26211
  }
26134
26212
  if (status === "processing" || statusResult.payment.depositDetectedAt) {
26135
- setManualCheckStatus(null);
26136
- clearUnderpaymentRecovery(paymentData.id);
26137
- setCurrentStep(PAYMENT_STEPS.PROCESSING);
26213
+ finishRecoveryLoading(() => {
26214
+ setManualCheckStatus(null);
26215
+ clearUnderpaymentRecovery(paymentData.id);
26216
+ setCurrentStep(PAYMENT_STEPS.PROCESSING);
26217
+ });
26138
26218
  return;
26139
26219
  }
26140
26220
  }
26141
26221
  if (paymentData == null ? void 0 : paymentData.depositAddress) {
26142
26222
  const balanceResult = await paymentFlow.api.getDepositBalance(paymentData.id);
26143
26223
  if ((balanceResult == null ? void 0 : balanceResult.success) && activateUnderpaymentFromDepositBalance(balanceResult)) {
26224
+ if (isOffsetRecovery) {
26225
+ finishRecoveryLoading(() => {
26226
+ setManualCheckStatus("not_found");
26227
+ showTransferNoticeModal("We have not detected your offset yet. It can take a few moments to appear on-chain, and we will keep checking automatically.");
26228
+ manualCheckTimeout.current = setTimeout(() => {
26229
+ setManualCheckStatus(null);
26230
+ }, 1e4);
26231
+ });
26232
+ }
26144
26233
  return;
26145
26234
  }
26146
26235
  }
26147
- setManualCheckStatus("not_found");
26148
- showTransferNoticeModal("We have not detected your transfer yet. It can take a few moments to appear on-chain, and we will keep checking automatically.");
26149
- manualCheckTimeout.current = setTimeout(() => {
26150
- setManualCheckStatus(null);
26151
- }, 1e4);
26236
+ finishRecoveryLoading(() => {
26237
+ setManualCheckStatus("not_found");
26238
+ showTransferNoticeModal(
26239
+ isOffsetRecovery ? "We have not detected your offset yet. It can take a few moments to appear on-chain, and we will keep checking automatically." : "We have not detected your transfer yet. It can take a few moments to appear on-chain, and we will keep checking automatically."
26240
+ );
26241
+ manualCheckTimeout.current = setTimeout(() => {
26242
+ setManualCheckStatus(null);
26243
+ }, 1e4);
26244
+ });
26152
26245
  } catch (error2) {
26153
26246
  console.warn("[ManualCheck] Error:", error2.message);
26154
- setManualCheckStatus("not_found");
26155
- showTransferNoticeModal("We have not detected your transfer yet. It can take a few moments to appear on-chain, and we will keep checking automatically.");
26156
- manualCheckTimeout.current = setTimeout(() => {
26157
- setManualCheckStatus(null);
26158
- }, 1e4);
26247
+ finishRecoveryLoading(() => {
26248
+ setManualCheckStatus("not_found");
26249
+ showTransferNoticeModal(
26250
+ isOffsetRecovery ? "We have not detected your offset yet. It can take a few moments to appear on-chain, and we will keep checking automatically." : "We have not detected your transfer yet. It can take a few moments to appear on-chain, and we will keep checking automatically."
26251
+ );
26252
+ manualCheckTimeout.current = setTimeout(() => {
26253
+ setManualCheckStatus(null);
26254
+ }, 1e4);
26255
+ });
26159
26256
  }
26160
- }, [manualCheckStatus, paymentData == null ? void 0 : paymentData.id, paymentData == null ? void 0 : paymentData.depositAddress, paymentFlow.api, config == null ? void 0 : config.amount, selectedNetwork, selectedToken, onSuccess, activateUnderpaymentFlow, activateUnderpaymentFromDepositBalance, captureOffsetSuccessDetails, clearUnderpaymentRecovery, resolvePaymentTransactionHash, persistSuccessfulPaymentHash, showTransferNoticeModal]);
26257
+ }, [manualCheckStatus, paymentData == null ? void 0 : paymentData.id, paymentData == null ? void 0 : paymentData.depositAddress, paymentFlow.api, config == null ? void 0 : config.amount, selectedNetwork, selectedToken, onSuccess, underpaymentInfo, underpaymentView, activateUnderpaymentFlow, activateUnderpaymentFromDepositBalance, captureOffsetSuccessDetails, clearUnderpaymentRecovery, resolvePaymentTransactionHash, persistSuccessfulPaymentHash, finishRecoveryLoading, showTransferNoticeModal]);
26161
26258
  const truncateAddress = (addr) => {
26162
26259
  if (!addr) return "";
26163
26260
  return `${addr.slice(0, 4)}......${addr.slice(-4)}`;
@@ -26535,7 +26632,7 @@ const CoinleyPaymentInternal = ({
26535
26632
  /* @__PURE__ */ jsx("p", { className: "text-xs leading-5 text-[#535865]", children: detail })
26536
26633
  ] })
26537
26634
  ] });
26538
- const renderUnderpaymentOffsetPanel = () => manualCheckStatus === "checking" || ccManualCheckStatus === "checking" ? renderRecoveryLoadingPanel({
26635
+ const renderUnderpaymentOffsetPanel = () => recoveryLoadingAction === "offset" ? renderRecoveryLoadingPanel({
26539
26636
  title: "Checking your offset",
26540
26637
  description: "We are checking the blockchain for your offset payment. This usually takes a few seconds.",
26541
26638
  detail: `Waiting for the remaining ${underpaymentOffsetAmountLabel} on ${underpaymentInfo.refundNetworkLabel || getOffsetSuccessNetworkName(selectedNetwork)}.`
@@ -26563,7 +26660,7 @@ const CoinleyPaymentInternal = ({
26563
26660
  `This is the same wallet address for your underpaid transaction. Send only the remaining offset amount (${underpaymentOffsetAmountLabel}) and keep enough native gas in your wallet for the network fee.`
26564
26661
  )
26565
26662
  ] });
26566
- const renderUnderpaymentRefundPanel = () => refundRequestStatus === "submitting" ? renderRecoveryLoadingPanel({
26663
+ const renderUnderpaymentRefundPanel = () => recoveryLoadingAction === "refund" ? renderRecoveryLoadingPanel({
26567
26664
  title: "Preparing your refund",
26568
26665
  description: "We are submitting your refund request and checking whether it can be sent immediately.",
26569
26666
  detail: `Refunding the received ${underpaymentInfo.tokenSymbol} on ${underpaymentInfo.refundNetworkLabel}.`
@@ -27177,17 +27274,24 @@ const CoinleyPaymentInternal = ({
27177
27274
  });
27178
27275
  }
27179
27276
  if (underpaymentView === "offset") {
27180
- if (manualCheckStatus === "checking" || ccManualCheckStatus === "checking") {
27277
+ if (recoveryLoadingAction === "offset") {
27181
27278
  return null;
27182
27279
  }
27183
27280
  return renderFooterPrimaryButton({
27184
27281
  label: "I've made transfer",
27185
- onClick: ccResult ? handleCrossChainManualCheck : handleDepositManualCheck,
27282
+ onClick: () => {
27283
+ startRecoveryLoading("offset");
27284
+ if (ccResult) {
27285
+ handleCrossChainManualCheck();
27286
+ } else {
27287
+ handleDepositManualCheck();
27288
+ }
27289
+ },
27186
27290
  disabled: false
27187
27291
  });
27188
27292
  }
27189
27293
  if (underpaymentView === "refund") {
27190
- if (refundRequestStatus === "submitting") {
27294
+ if (recoveryLoadingAction === "refund") {
27191
27295
  return null;
27192
27296
  }
27193
27297
  return renderFooterPrimaryButton({
@@ -27699,6 +27803,7 @@ const CoinleyPaymentInternal = ({
27699
27803
  const isWalletTokenSelectionView = activeTab === PAYMENT_TABS.WALLET && selectedNetwork && !selectedToken && !showWalletConfirm && !(showMobileWalletPicker && isMobile);
27700
27804
  const isQrPaymentActiveView = activeTab === PAYMENT_TABS.QR && qrWalletChoiceConfirmed;
27701
27805
  const handleTransferAddressBack = async () => {
27806
+ setRecoveryLoadingAction(null);
27702
27807
  if (underpaymentInfo && underpaymentView !== "choice") {
27703
27808
  setUnderpaymentView("choice");
27704
27809
  return;
@@ -27829,4 +27934,4 @@ export {
27829
27934
  chainTransports as c,
27830
27935
  isFeatureEnabled as i
27831
27936
  };
27832
- //# sourceMappingURL=CoinleyPayment-DyKwmgOv.js.map
27937
+ //# sourceMappingURL=CoinleyPayment-CmMOW8Fu.js.map
@@ -1,4 +1,4 @@
1
- import { i as isFeatureEnabled, F as FEATURES, c as chainTransports, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-DyKwmgOv.js";
1
+ import { i as isFeatureEnabled, F as FEATURES, c as chainTransports, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-CmMOW8Fu.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-UnYPliV_.js.map
116
+ //# sourceMappingURL=appKitEVM-Dxo1Z_69.js.map
@@ -1,4 +1,4 @@
1
- import { F as FEATURES, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-DyKwmgOv.js";
1
+ import { F as FEATURES, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-CmMOW8Fu.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-CG78TZQO.js.map
246
+ //# sourceMappingURL=appKitSolana-BmONG1Sf.js.map