coinley-pay 0.28.0 → 0.29.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.
- package/dist/{CoinleyPayment-Bql8B8cV.js → CoinleyPayment-DvR9sd7O.js} +112 -15
- package/dist/{appKitEVM-BcM7Ftoe.js → appKitEVM--PzCfGQT.js} +2 -2
- package/dist/{appKitSolana-BWdEszCH.js → appKitSolana-Brjblem7.js} +2 -2
- package/dist/coinley-vanilla.min.js +1 -1
- package/dist/{index-Dqu16xBs.js → index-af6vtaZH.js} +3 -3
- package/dist/{index-B6XL-PMy.js → index-fkUYCNSE.js} +3 -3
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
|
@@ -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-
|
|
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-fkUYCNSE.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";
|
|
@@ -21121,7 +21121,7 @@ const WalletSelector = ({
|
|
|
21121
21121
|
try {
|
|
21122
21122
|
setAppKitError(null);
|
|
21123
21123
|
setWalletConnectAddress(solanaAccountState.address);
|
|
21124
|
-
const { createWalletConnectAdapter } = await import("./appKitSolana-
|
|
21124
|
+
const { createWalletConnectAdapter } = await import("./appKitSolana-Brjblem7.js");
|
|
21125
21125
|
const adapter = createWalletConnectAdapter(solanaAccountState.address);
|
|
21126
21126
|
await solanaWallet.connectWalletConnect(adapter, solanaAccountState.address);
|
|
21127
21127
|
console.log("✅ WalletConnect synced with SDK");
|
|
@@ -21226,7 +21226,7 @@ const WalletSelector = ({
|
|
|
21226
21226
|
setAppKitLoading(true);
|
|
21227
21227
|
setAppKitError(null);
|
|
21228
21228
|
try {
|
|
21229
|
-
const { initializeAppKitEVM, openAppKitModal } = await import("./appKitEVM
|
|
21229
|
+
const { initializeAppKitEVM, openAppKitModal } = await import("./appKitEVM--PzCfGQT.js");
|
|
21230
21230
|
await initializeAppKitEVM(wagmiConfig);
|
|
21231
21231
|
await openAppKitModal();
|
|
21232
21232
|
} catch (error) {
|
|
@@ -21246,7 +21246,7 @@ const WalletSelector = ({
|
|
|
21246
21246
|
setAppKitError(null);
|
|
21247
21247
|
try {
|
|
21248
21248
|
console.log("📦 Loading AppKit Solana module...");
|
|
21249
|
-
const { initializeAppKitSolana } = await import("./appKitSolana-
|
|
21249
|
+
const { initializeAppKitSolana } = await import("./appKitSolana-Brjblem7.js");
|
|
21250
21250
|
console.log("✅ Module loaded, initializing...");
|
|
21251
21251
|
const modal = await initializeAppKitSolana(solanaWallet);
|
|
21252
21252
|
console.log("✅ AppKit Solana initialized successfully");
|
|
@@ -23107,6 +23107,8 @@ const injectCoinleyFonts = () => {
|
|
|
23107
23107
|
document.head.appendChild(style);
|
|
23108
23108
|
};
|
|
23109
23109
|
const CHECKOUT_BUILD = "checkout-2026-04-22b-route-destination-trials";
|
|
23110
|
+
const UNDERPAYMENT_RECOVERY_STORAGE_PREFIX = "coinley_underpayment_recovery:";
|
|
23111
|
+
const UNDERPAYMENT_RECOVERY_TTL_MS = 2 * 60 * 60 * 1e3;
|
|
23110
23112
|
const normalizeEvmAddress = (value) => {
|
|
23111
23113
|
if (typeof value !== "string") return null;
|
|
23112
23114
|
const trimmed = value.trim();
|
|
@@ -23427,6 +23429,59 @@ const CoinleyPaymentInternal = ({
|
|
|
23427
23429
|
const hasCommittedTransaction = Boolean(
|
|
23428
23430
|
currentTransactionHash || (solanaTransaction == null ? void 0 : solanaTransaction.txSignature) || (paymentData == null ? void 0 : paymentData.transactionHash)
|
|
23429
23431
|
);
|
|
23432
|
+
const getUnderpaymentRecoveryStorageKey = useCallback((paymentId = paymentData == null ? void 0 : paymentData.id) => {
|
|
23433
|
+
return paymentId ? `${UNDERPAYMENT_RECOVERY_STORAGE_PREFIX}${paymentId}` : null;
|
|
23434
|
+
}, [paymentData == null ? void 0 : paymentData.id]);
|
|
23435
|
+
const clearUnderpaymentRecovery = useCallback((paymentId = paymentData == null ? void 0 : paymentData.id) => {
|
|
23436
|
+
const storageKey = getUnderpaymentRecoveryStorageKey(paymentId);
|
|
23437
|
+
if (!storageKey || typeof window === "undefined" || !window.localStorage) return;
|
|
23438
|
+
try {
|
|
23439
|
+
window.localStorage.removeItem(storageKey);
|
|
23440
|
+
} catch (error2) {
|
|
23441
|
+
console.warn("[UnderpaymentRecovery] Failed to clear recovery state:", error2.message);
|
|
23442
|
+
}
|
|
23443
|
+
}, [getUnderpaymentRecoveryStorageKey, paymentData == null ? void 0 : paymentData.id]);
|
|
23444
|
+
const readUnderpaymentRecovery = useCallback((paymentId = paymentData == null ? void 0 : paymentData.id) => {
|
|
23445
|
+
const storageKey = getUnderpaymentRecoveryStorageKey(paymentId);
|
|
23446
|
+
if (!storageKey || typeof window === "undefined" || !window.localStorage) return null;
|
|
23447
|
+
try {
|
|
23448
|
+
const stored = window.localStorage.getItem(storageKey);
|
|
23449
|
+
if (!stored) return null;
|
|
23450
|
+
const parsed = JSON.parse(stored);
|
|
23451
|
+
const isExpired = !(parsed == null ? void 0 : parsed.timestamp) || Date.now() - parsed.timestamp > UNDERPAYMENT_RECOVERY_TTL_MS;
|
|
23452
|
+
const isSamePayment = (parsed == null ? void 0 : parsed.paymentId) === paymentId;
|
|
23453
|
+
const isValidChoice = (parsed == null ? void 0 : parsed.choice) === "offset" || (parsed == null ? void 0 : parsed.choice) === "refund";
|
|
23454
|
+
if (isExpired || !isSamePayment || !isValidChoice) {
|
|
23455
|
+
window.localStorage.removeItem(storageKey);
|
|
23456
|
+
return null;
|
|
23457
|
+
}
|
|
23458
|
+
return parsed;
|
|
23459
|
+
} catch (error2) {
|
|
23460
|
+
console.warn("[UnderpaymentRecovery] Failed to read recovery state:", error2.message);
|
|
23461
|
+
return null;
|
|
23462
|
+
}
|
|
23463
|
+
}, [getUnderpaymentRecoveryStorageKey, paymentData == null ? void 0 : paymentData.id]);
|
|
23464
|
+
const writeUnderpaymentRecovery = useCallback((choice, view = choice, infoOverride = underpaymentInfo) => {
|
|
23465
|
+
const storageKey = getUnderpaymentRecoveryStorageKey(paymentData == null ? void 0 : paymentData.id);
|
|
23466
|
+
if (!storageKey || typeof window === "undefined" || !window.localStorage) return;
|
|
23467
|
+
if (choice !== "offset" && choice !== "refund") return;
|
|
23468
|
+
try {
|
|
23469
|
+
window.localStorage.setItem(storageKey, JSON.stringify({
|
|
23470
|
+
paymentId: paymentData.id,
|
|
23471
|
+
choice,
|
|
23472
|
+
view: view === "refund" ? "refund" : "offset",
|
|
23473
|
+
expectedAmount: infoOverride == null ? void 0 : infoOverride.expectedAmount,
|
|
23474
|
+
receivedAmount: infoOverride == null ? void 0 : infoOverride.receivedAmount,
|
|
23475
|
+
shortfallAmount: infoOverride == null ? void 0 : infoOverride.shortfallAmount,
|
|
23476
|
+
tokenSymbol: infoOverride == null ? void 0 : infoOverride.tokenSymbol,
|
|
23477
|
+
refundNetworkLabel: infoOverride == null ? void 0 : infoOverride.refundNetworkLabel,
|
|
23478
|
+
paymentState: infoOverride == null ? void 0 : infoOverride.paymentState,
|
|
23479
|
+
timestamp: Date.now()
|
|
23480
|
+
}));
|
|
23481
|
+
} catch (error2) {
|
|
23482
|
+
console.warn("[UnderpaymentRecovery] Failed to persist recovery state:", error2.message);
|
|
23483
|
+
}
|
|
23484
|
+
}, [getUnderpaymentRecoveryStorageKey, paymentData == null ? void 0 : paymentData.id, underpaymentInfo]);
|
|
23430
23485
|
const normalizeUnderpaymentInfo = useCallback((payment = {}) => {
|
|
23431
23486
|
const raw = payment.underpayment || payment.underpaymentDetails || payment.shortPayment || payment.partialPayment || null;
|
|
23432
23487
|
const statusText = String(payment.status || payment.depositStatus || (raw == null ? void 0 : raw.status) || "").toLowerCase();
|
|
@@ -23460,13 +23515,21 @@ const CoinleyPaymentInternal = ({
|
|
|
23460
23515
|
const activateUnderpaymentFlow = useCallback((payment) => {
|
|
23461
23516
|
const normalized = normalizeUnderpaymentInfo(payment);
|
|
23462
23517
|
if (!normalized) return false;
|
|
23518
|
+
const recoveryState = readUnderpaymentRecovery((payment == null ? void 0 : payment.id) || (paymentData == null ? void 0 : paymentData.id));
|
|
23519
|
+
const recoveryChoice = (recoveryState == null ? void 0 : recoveryState.choice) === "offset" || (recoveryState == null ? void 0 : recoveryState.choice) === "refund" ? recoveryState.choice : null;
|
|
23520
|
+
const recoveryView = recoveryChoice ? (recoveryState == null ? void 0 : recoveryState.view) === "refund" ? "refund" : "offset" : null;
|
|
23463
23521
|
setUnderpaymentInfo(normalized);
|
|
23464
|
-
setUnderpaymentChoice(
|
|
23465
|
-
setUnderpaymentView(
|
|
23522
|
+
setUnderpaymentChoice((currentChoice) => currentChoice || recoveryChoice);
|
|
23523
|
+
setUnderpaymentView((currentView) => {
|
|
23524
|
+
if (currentView && currentView !== "choice") {
|
|
23525
|
+
return currentView;
|
|
23526
|
+
}
|
|
23527
|
+
return recoveryView || "choice";
|
|
23528
|
+
});
|
|
23466
23529
|
setManualCheckStatus(null);
|
|
23467
|
-
setRefundRequestSubmitted(false);
|
|
23530
|
+
setRefundRequestSubmitted((submitted) => recoveryChoice === "refund" ? submitted : false);
|
|
23468
23531
|
return true;
|
|
23469
|
-
}, [normalizeUnderpaymentInfo]);
|
|
23532
|
+
}, [normalizeUnderpaymentInfo, paymentData == null ? void 0 : paymentData.id, readUnderpaymentRecovery]);
|
|
23470
23533
|
const activateUnderpaymentFromDepositBalance = useCallback((balanceResult) => {
|
|
23471
23534
|
const received = Number((balanceResult == null ? void 0 : balanceResult.balance) ?? (balanceResult == null ? void 0 : balanceResult.balanceFormatted) ?? 0);
|
|
23472
23535
|
const expected = Number((balanceResult == null ? void 0 : balanceResult.expectedAmount) ?? paymentAmount ?? 0);
|
|
@@ -23944,6 +24007,7 @@ const CoinleyPaymentInternal = ({
|
|
|
23944
24007
|
const txHash = statusResult.payment.depositTxHash || statusResult.payment.sweepTxHash || statusResult.payment.transactionHash;
|
|
23945
24008
|
if ((status === "completed" || status === "swept") && txHash) {
|
|
23946
24009
|
clearInterval(pollInterval);
|
|
24010
|
+
clearUnderpaymentRecovery(paymentData.id);
|
|
23947
24011
|
setProcessingStatusMessage("");
|
|
23948
24012
|
setCurrentStep(PAYMENT_STEPS.SUCCESS);
|
|
23949
24013
|
sdkAnalytics.trackPaymentSuccess(
|
|
@@ -23972,6 +24036,7 @@ const CoinleyPaymentInternal = ({
|
|
|
23972
24036
|
}
|
|
23973
24037
|
} else if (status === "failed" || status === "sweep_failed") {
|
|
23974
24038
|
clearInterval(pollInterval);
|
|
24039
|
+
clearUnderpaymentRecovery(paymentData.id);
|
|
23975
24040
|
setProcessingStatusMessage("");
|
|
23976
24041
|
sdkAnalytics.trackPaymentFailed(
|
|
23977
24042
|
paymentData.id,
|
|
@@ -23996,7 +24061,7 @@ const CoinleyPaymentInternal = ({
|
|
|
23996
24061
|
}
|
|
23997
24062
|
}, 5e3);
|
|
23998
24063
|
return () => clearInterval(pollInterval);
|
|
23999
|
-
}, [currentStep, paymentData == null ? void 0 : paymentData.id, paymentData == null ? void 0 : paymentData.depositAddress, selectedNetwork, selectedToken, onSuccess, activateUnderpaymentFlow]);
|
|
24064
|
+
}, [currentStep, paymentData == null ? void 0 : paymentData.id, paymentData == null ? void 0 : paymentData.depositAddress, selectedNetwork, selectedToken, onSuccess, activateUnderpaymentFlow, clearUnderpaymentRecovery]);
|
|
24000
24065
|
useEffect(() => {
|
|
24001
24066
|
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);
|
|
24002
24067
|
if (!shouldPoll) {
|
|
@@ -25533,6 +25598,7 @@ const CoinleyPaymentInternal = ({
|
|
|
25533
25598
|
if ((status === "completed" || status === "swept") && txHash) {
|
|
25534
25599
|
console.log("✅ Auto-detected: Deposit payment completed!");
|
|
25535
25600
|
clearInterval(pollInterval);
|
|
25601
|
+
clearUnderpaymentRecovery(paymentData.id);
|
|
25536
25602
|
setCurrentStep(PAYMENT_STEPS.SUCCESS);
|
|
25537
25603
|
sdkAnalytics.trackPaymentSuccess(paymentData.id, config == null ? void 0 : config.amount, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, txHash);
|
|
25538
25604
|
clarityAnalytics.trackPaymentSuccess(paymentData.id, config == null ? void 0 : config.amount, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, txHash);
|
|
@@ -25549,9 +25615,11 @@ const CoinleyPaymentInternal = ({
|
|
|
25549
25615
|
} else if (status === "processing" || statusResult.payment.depositDetectedAt) {
|
|
25550
25616
|
console.log("⏳ Auto-detected: Deposit received, processing...");
|
|
25551
25617
|
clearInterval(pollInterval);
|
|
25618
|
+
clearUnderpaymentRecovery(paymentData.id);
|
|
25552
25619
|
setCurrentStep(PAYMENT_STEPS.PROCESSING);
|
|
25553
25620
|
} else if (status === "failed" || status === "expired") {
|
|
25554
25621
|
clearInterval(pollInterval);
|
|
25622
|
+
clearUnderpaymentRecovery(paymentData.id);
|
|
25555
25623
|
setError("Payment failed or expired. Please try again.");
|
|
25556
25624
|
}
|
|
25557
25625
|
}
|
|
@@ -25563,7 +25631,7 @@ const CoinleyPaymentInternal = ({
|
|
|
25563
25631
|
console.log("🛑 Stopping deposit auto-detection polling");
|
|
25564
25632
|
clearInterval(pollInterval);
|
|
25565
25633
|
};
|
|
25566
|
-
}, [paymentData == null ? void 0 : paymentData.id, paymentData == null ? void 0 : paymentData.depositAddress, paymentType, currentStep, verifyingPayment, expirationTime == null ? void 0 : expirationTime.expired, selectedNetwork, selectedToken, onSuccess, paymentFlow.api, activateUnderpaymentFlow]);
|
|
25634
|
+
}, [paymentData == null ? void 0 : paymentData.id, paymentData == null ? void 0 : paymentData.depositAddress, paymentType, currentStep, verifyingPayment, expirationTime == null ? void 0 : expirationTime.expired, selectedNetwork, selectedToken, onSuccess, paymentFlow.api, activateUnderpaymentFlow, clearUnderpaymentRecovery]);
|
|
25567
25635
|
useEffect(() => {
|
|
25568
25636
|
return () => {
|
|
25569
25637
|
if (manualCheckTimeout.current) {
|
|
@@ -25572,17 +25640,40 @@ const CoinleyPaymentInternal = ({
|
|
|
25572
25640
|
};
|
|
25573
25641
|
}, []);
|
|
25574
25642
|
useEffect(() => {
|
|
25643
|
+
const recoveryState = readUnderpaymentRecovery(paymentData == null ? void 0 : paymentData.id);
|
|
25644
|
+
if (recoveryState && recoveryState.shortfallAmount && (recoveryState.choice === "offset" || recoveryState.choice === "refund")) {
|
|
25645
|
+
setUnderpaymentInfo({
|
|
25646
|
+
expectedAmount: recoveryState.expectedAmount,
|
|
25647
|
+
receivedAmount: recoveryState.receivedAmount,
|
|
25648
|
+
shortfallAmount: recoveryState.shortfallAmount,
|
|
25649
|
+
tokenSymbol: recoveryState.tokenSymbol || (selectedToken == null ? void 0 : selectedToken.symbol) || "Token",
|
|
25650
|
+
refundNetworkLabel: recoveryState.refundNetworkLabel || (selectedNetwork == null ? void 0 : selectedNetwork.displayName) || (selectedNetwork == null ? void 0 : selectedNetwork.name) || (selectedNetwork == null ? void 0 : selectedNetwork.shortName) || "selected network",
|
|
25651
|
+
paymentState: recoveryState.paymentState || "underpaid"
|
|
25652
|
+
});
|
|
25653
|
+
setUnderpaymentChoice(recoveryState.choice);
|
|
25654
|
+
setUnderpaymentView(recoveryState.view === "refund" ? "refund" : "offset");
|
|
25655
|
+
setManualCheckStatus(null);
|
|
25656
|
+
setRefundRequestSubmitted(false);
|
|
25657
|
+
return;
|
|
25658
|
+
}
|
|
25575
25659
|
setUnderpaymentInfo(null);
|
|
25576
25660
|
setUnderpaymentChoice(null);
|
|
25577
25661
|
setUnderpaymentView("choice");
|
|
25578
25662
|
setRefundAddress("");
|
|
25579
25663
|
setRefundRequestSubmitted(false);
|
|
25580
|
-
}, [paymentData == null ? void 0 : paymentData.id]);
|
|
25664
|
+
}, [paymentData == null ? void 0 : paymentData.id, readUnderpaymentRecovery, selectedNetwork, selectedToken]);
|
|
25665
|
+
useEffect(() => {
|
|
25666
|
+
if (!(paymentData == null ? void 0 : paymentData.id) || !underpaymentInfo || !underpaymentChoice || underpaymentView === "choice") {
|
|
25667
|
+
return;
|
|
25668
|
+
}
|
|
25669
|
+
writeUnderpaymentRecovery(underpaymentChoice, underpaymentView, underpaymentInfo);
|
|
25670
|
+
}, [paymentData == null ? void 0 : paymentData.id, underpaymentInfo, underpaymentChoice, underpaymentView, writeUnderpaymentRecovery]);
|
|
25581
25671
|
const handleRefundRequestSubmit = useCallback(() => {
|
|
25582
25672
|
const trimmedAddress = refundAddress.trim();
|
|
25583
25673
|
if (!trimmedAddress) return;
|
|
25584
25674
|
setRefundRequestSubmitted(true);
|
|
25585
25675
|
setManualCheckStatus(null);
|
|
25676
|
+
clearUnderpaymentRecovery(paymentData == null ? void 0 : paymentData.id);
|
|
25586
25677
|
const refundPayload = {
|
|
25587
25678
|
paymentId: paymentData == null ? void 0 : paymentData.id,
|
|
25588
25679
|
refundAddress: trimmedAddress,
|
|
@@ -25599,7 +25690,7 @@ const CoinleyPaymentInternal = ({
|
|
|
25599
25690
|
detail: refundPayload
|
|
25600
25691
|
}));
|
|
25601
25692
|
}
|
|
25602
|
-
}, [config, refundAddress, paymentData == null ? void 0 : paymentData.id, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, underpaymentInfo]);
|
|
25693
|
+
}, [clearUnderpaymentRecovery, config, refundAddress, paymentData == null ? void 0 : paymentData.id, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, underpaymentInfo]);
|
|
25603
25694
|
const handleDepositManualCheck = useCallback(async () => {
|
|
25604
25695
|
if (manualCheckStatus === "checking" || !(paymentData == null ? void 0 : paymentData.id)) return;
|
|
25605
25696
|
setManualCheckStatus("checking");
|
|
@@ -25613,6 +25704,7 @@ const CoinleyPaymentInternal = ({
|
|
|
25613
25704
|
const txHash = statusResult.payment.depositTxHash || statusResult.payment.sweepTxHash || statusResult.payment.transactionHash;
|
|
25614
25705
|
if ((status === "completed" || status === "swept") && txHash) {
|
|
25615
25706
|
setManualCheckStatus(null);
|
|
25707
|
+
clearUnderpaymentRecovery(paymentData.id);
|
|
25616
25708
|
setCurrentStep(PAYMENT_STEPS.SUCCESS);
|
|
25617
25709
|
sdkAnalytics.trackPaymentSuccess(paymentData.id, config == null ? void 0 : config.amount, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, txHash);
|
|
25618
25710
|
clarityAnalytics.trackPaymentSuccess(paymentData.id, config == null ? void 0 : config.amount, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, txHash);
|
|
@@ -25630,6 +25722,7 @@ const CoinleyPaymentInternal = ({
|
|
|
25630
25722
|
}
|
|
25631
25723
|
if (status === "processing" || statusResult.payment.depositDetectedAt) {
|
|
25632
25724
|
setManualCheckStatus(null);
|
|
25725
|
+
clearUnderpaymentRecovery(paymentData.id);
|
|
25633
25726
|
setCurrentStep(PAYMENT_STEPS.PROCESSING);
|
|
25634
25727
|
return;
|
|
25635
25728
|
}
|
|
@@ -25651,7 +25744,7 @@ const CoinleyPaymentInternal = ({
|
|
|
25651
25744
|
setManualCheckStatus(null);
|
|
25652
25745
|
}, 1e4);
|
|
25653
25746
|
}
|
|
25654
|
-
}, [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]);
|
|
25747
|
+
}, [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, clearUnderpaymentRecovery]);
|
|
25655
25748
|
if (!isOpen) return null;
|
|
25656
25749
|
if (currentStep === PAYMENT_STEPS.PROCESSING) {
|
|
25657
25750
|
return /* @__PURE__ */ jsxs("div", { id: SDK_ROOT_ID, className: `${SDK_ROOT_CLASS} fixed inset-0 z-50`, style: { fontFamily: FONT_FAMILY }, children: [
|
|
@@ -25832,11 +25925,13 @@ const CoinleyPaymentInternal = ({
|
|
|
25832
25925
|
disabled: !underpaymentChoice,
|
|
25833
25926
|
onClick: () => {
|
|
25834
25927
|
setRefundRequestSubmitted(false);
|
|
25928
|
+
const nextView = underpaymentChoice === "refund" ? "refund" : "offset";
|
|
25929
|
+
writeUnderpaymentRecovery(underpaymentChoice, nextView, underpaymentInfo);
|
|
25835
25930
|
if (underpaymentChoice === "offset") {
|
|
25836
25931
|
modalOpenedAtRef.current = Date.now();
|
|
25837
25932
|
setTimeRemaining(paymentTimeoutMs);
|
|
25838
25933
|
}
|
|
25839
|
-
setUnderpaymentView(
|
|
25934
|
+
setUnderpaymentView(nextView);
|
|
25840
25935
|
},
|
|
25841
25936
|
className: `h-11 w-full rounded-xl px-4 text-sm font-semibold text-white transition-colors ${underpaymentChoice ? "bg-[#7042D2] hover:bg-[#5b34b1]" : "cursor-not-allowed bg-[#B59AE9]"}`,
|
|
25842
25937
|
children: "Continue"
|
|
@@ -25866,6 +25961,7 @@ const CoinleyPaymentInternal = ({
|
|
|
25866
25961
|
null,
|
|
25867
25962
|
"Send only the offset amount to the same address. Make sure to add network fees on top of this amount."
|
|
25868
25963
|
),
|
|
25964
|
+
manualCheckStatus === "not_found" && /* @__PURE__ */ jsx("div", { className: "mb-3 rounded-xl border border-amber-200 bg-amber-50 p-3", children: /* @__PURE__ */ jsx("p", { className: "text-sm leading-5 text-amber-700", children: "We have not detected the offset yet. It can take a few moments to appear on-chain, and we will keep checking automatically." }) }),
|
|
25869
25965
|
/* @__PURE__ */ jsx(
|
|
25870
25966
|
"button",
|
|
25871
25967
|
{
|
|
@@ -26906,6 +27002,7 @@ const CoinleyPaymentInternal = ({
|
|
|
26906
27002
|
setUnderpaymentView("choice");
|
|
26907
27003
|
return;
|
|
26908
27004
|
}
|
|
27005
|
+
clearUnderpaymentRecovery(paymentData == null ? void 0 : paymentData.id);
|
|
26909
27006
|
setPaymentData((prev) => {
|
|
26910
27007
|
if (!prev) return prev;
|
|
26911
27008
|
return {
|
|
@@ -27016,4 +27113,4 @@ export {
|
|
|
27016
27113
|
isFeatureEnabled as i,
|
|
27017
27114
|
logo as l
|
|
27018
27115
|
};
|
|
27019
|
-
//# sourceMappingURL=CoinleyPayment-
|
|
27116
|
+
//# sourceMappingURL=CoinleyPayment-DvR9sd7O.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-
|
|
1
|
+
import { i as isFeatureEnabled, F as FEATURES, c as chainTransports, W as WALLETCONNECT_PROJECT_ID, l as logo } from "./CoinleyPayment-DvR9sd7O.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
|
|
115
|
+
//# sourceMappingURL=appKitEVM--PzCfGQT.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as FEATURES, l as logo, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-
|
|
1
|
+
import { F as FEATURES, l as logo, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-DvR9sd7O.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-
|
|
245
|
+
//# sourceMappingURL=appKitSolana-Brjblem7.js.map
|