coinley-pay 0.45.0 → 0.47.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-CmMOW8Fu.js → CoinleyPayment-kt3eOJlB.js} +180 -100
- package/dist/{appKitEVM-Dxo1Z_69.js → appKitEVM-CA1A3oZb.js} +2 -2
- package/dist/{appKitSolana-BmONG1Sf.js → appKitSolana-mYWu1Cjx.js} +2 -2
- package/dist/coinley-vanilla.min.js +580 -580
- package/dist/{index-oXUT3-CW.js → index-C00n-j2g.js} +3 -3
- package/dist/{index-CyqvsmiG.js → index-DEozbpiN.js} +3 -3
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/style.css +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-DEozbpiN.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-
|
|
21125
|
+
const { createWalletConnectAdapter } = await import("./appKitSolana-mYWu1Cjx.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-
|
|
21230
|
+
const { initializeAppKitEVM, openAppKitModal } = await import("./appKitEVM-CA1A3oZb.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-
|
|
21250
|
+
const { initializeAppKitSolana } = await import("./appKitSolana-mYWu1Cjx.js");
|
|
21251
21251
|
console.log("✅ Module loaded, initializing...");
|
|
21252
21252
|
const modal = await initializeAppKitSolana(solanaWallet);
|
|
21253
21253
|
console.log("✅ AppKit Solana initialized successfully");
|
|
@@ -23318,7 +23318,6 @@ const CoinleyPaymentInternal = ({
|
|
|
23318
23318
|
const [ccError, setCcError] = useState(null);
|
|
23319
23319
|
const [ccGenerating, setCcGenerating] = useState(false);
|
|
23320
23320
|
const [ccManualCheckStatus, setCcManualCheckStatus] = useState("idle");
|
|
23321
|
-
const [transferNoticeModal, setTransferNoticeModal] = useState(null);
|
|
23322
23321
|
const ccSucceeded = useRef(false);
|
|
23323
23322
|
const ccStatusPollInFlight = useRef(false);
|
|
23324
23323
|
const [networkSearch, setNetworkSearch] = useState("");
|
|
@@ -23353,6 +23352,7 @@ const CoinleyPaymentInternal = ({
|
|
|
23353
23352
|
const [offsetSuccessDetails, setOffsetSuccessDetails] = useState(null);
|
|
23354
23353
|
const [refundSuccessDetails, setRefundSuccessDetails] = useState(null);
|
|
23355
23354
|
const [recoveryLoadingAction, setRecoveryLoadingAction] = useState(null);
|
|
23355
|
+
const [recoveryLoadingStatus, setRecoveryLoadingStatus] = useState(null);
|
|
23356
23356
|
const manualCheckTimeout = useRef(null);
|
|
23357
23357
|
const recoveryLoadingStartedAt = useRef(0);
|
|
23358
23358
|
const recoveryLoadingTimeout = useRef(null);
|
|
@@ -23457,9 +23457,6 @@ const CoinleyPaymentInternal = ({
|
|
|
23457
23457
|
} = paymentFlow;
|
|
23458
23458
|
const activeTransferPaymentId = (paymentData == null ? void 0 : paymentData.id) || (ccResult == null ? void 0 : ccResult.id) || (ccResult == null ? void 0 : ccResult.paymentId);
|
|
23459
23459
|
const activeTransferDepositAddress = (paymentData == null ? void 0 : paymentData.depositAddress) || (ccResult == null ? void 0 : ccResult.relayDepositAddress) || (ccResult == null ? void 0 : ccResult.depositAddress);
|
|
23460
|
-
const showTransferNoticeModal = useCallback((message, title = "Transfer not detected yet") => {
|
|
23461
|
-
setTransferNoticeModal({ title, message });
|
|
23462
|
-
}, []);
|
|
23463
23460
|
const merchantReceiveNetworks = (merchantNetworks == null ? void 0 : merchantNetworks.length) ? merchantNetworks : networks;
|
|
23464
23461
|
const isMerchantReceiveNetwork = useCallback((network) => {
|
|
23465
23462
|
var _a2;
|
|
@@ -23659,15 +23656,19 @@ const CoinleyPaymentInternal = ({
|
|
|
23659
23656
|
paymentState: payment.paymentState || (raw == null ? void 0 : raw.paymentState) || statusText || "underpaid"
|
|
23660
23657
|
};
|
|
23661
23658
|
}, [paymentAmount, selectedNetwork, selectedToken]);
|
|
23662
|
-
const activateUnderpaymentFlow = useCallback((payment) => {
|
|
23659
|
+
const activateUnderpaymentFlow = useCallback((payment, options = {}) => {
|
|
23663
23660
|
const normalized = normalizeUnderpaymentInfo(payment);
|
|
23664
23661
|
if (!normalized) return false;
|
|
23662
|
+
const forceRefund = options.forceRefund === true;
|
|
23665
23663
|
const recoveryState = readUnderpaymentRecovery((payment == null ? void 0 : payment.id) || (paymentData == null ? void 0 : paymentData.id));
|
|
23666
|
-
const recoveryChoice = (recoveryState == null ? void 0 : recoveryState.choice) === "offset" || (recoveryState == null ? void 0 : recoveryState.choice) === "refund" ? recoveryState.choice : null;
|
|
23667
|
-
const recoveryView = recoveryChoice ? (recoveryState == null ? void 0 : recoveryState.view) === "refund" ? "refund" : "offset" : null;
|
|
23664
|
+
const recoveryChoice = forceRefund ? "refund" : (recoveryState == null ? void 0 : recoveryState.choice) === "offset" || (recoveryState == null ? void 0 : recoveryState.choice) === "refund" ? recoveryState.choice : null;
|
|
23665
|
+
const recoveryView = forceRefund ? "refund" : recoveryChoice ? (recoveryState == null ? void 0 : recoveryState.view) === "refund" ? "refund" : "offset" : null;
|
|
23668
23666
|
setUnderpaymentInfo(normalized);
|
|
23669
|
-
setUnderpaymentChoice((currentChoice) => currentChoice || recoveryChoice);
|
|
23667
|
+
setUnderpaymentChoice((currentChoice) => forceRefund ? "refund" : currentChoice || recoveryChoice);
|
|
23670
23668
|
setUnderpaymentView((currentView) => {
|
|
23669
|
+
if (forceRefund) {
|
|
23670
|
+
return "refund";
|
|
23671
|
+
}
|
|
23671
23672
|
if (currentView && currentView !== "choice") {
|
|
23672
23673
|
return currentView;
|
|
23673
23674
|
}
|
|
@@ -23711,7 +23712,7 @@ const CoinleyPaymentInternal = ({
|
|
|
23711
23712
|
currency: (underpayment == null ? void 0 : underpayment.tokenSymbol) || (underpayment == null ? void 0 : underpayment.currency) || rawPayment.currency || statusResult.currency || (ccOriginToken == null ? void 0 : ccOriginToken.symbol),
|
|
23712
23713
|
refundNetworkLabel: (underpayment == null ? void 0 : underpayment.refundNetworkLabel) || rawPayment.refundNetworkLabel || ccChainName(relay.originChainId || (ccResult == null ? void 0 : ccResult.originChainId) || ccOriginChainId),
|
|
23713
23714
|
underpayment
|
|
23714
|
-
});
|
|
23715
|
+
}, { forceRefund: true });
|
|
23715
23716
|
}, [activateUnderpaymentFlow, ccOriginChainId, ccOriginToken == null ? void 0 : ccOriginToken.symbol, ccResult == null ? void 0 : ccResult.id, ccResult == null ? void 0 : ccResult.originChainId, ccResult == null ? void 0 : ccResult.relayDepositAddress]);
|
|
23716
23717
|
const clearUnderpaymentUiState = useCallback((paymentId) => {
|
|
23717
23718
|
setUnderpaymentInfo(null);
|
|
@@ -23720,12 +23721,14 @@ const CoinleyPaymentInternal = ({
|
|
|
23720
23721
|
setManualCheckStatus(null);
|
|
23721
23722
|
setCcManualCheckStatus(null);
|
|
23722
23723
|
setRecoveryLoadingAction(null);
|
|
23724
|
+
setRecoveryLoadingStatus(null);
|
|
23723
23725
|
clearUnderpaymentRecovery(paymentId || activeTransferPaymentId);
|
|
23724
23726
|
}, [activeTransferPaymentId, clearUnderpaymentRecovery]);
|
|
23725
23727
|
useEffect(() => {
|
|
23726
23728
|
setOffsetSuccessDetails(null);
|
|
23727
23729
|
setRefundSuccessDetails(null);
|
|
23728
23730
|
setRecoveryLoadingAction(null);
|
|
23731
|
+
setRecoveryLoadingStatus(null);
|
|
23729
23732
|
}, [paymentData == null ? void 0 : paymentData.id]);
|
|
23730
23733
|
const selectedNetworkIsSolana = (selectedNetwork == null ? void 0 : selectedNetwork.chainType) === "solana" || (selectedNetwork == null ? void 0 : selectedNetwork.shortName) === "solana";
|
|
23731
23734
|
const sourceNeedsMerchantBridge = Boolean(
|
|
@@ -24352,6 +24355,7 @@ const CoinleyPaymentInternal = ({
|
|
|
24352
24355
|
setSelectedMobileWallet(null);
|
|
24353
24356
|
setMobileWalletRedirecting(null);
|
|
24354
24357
|
setRecoveryLoadingAction(null);
|
|
24358
|
+
setRecoveryLoadingStatus(null);
|
|
24355
24359
|
if (recoveryLoadingTimeout.current) {
|
|
24356
24360
|
clearTimeout(recoveryLoadingTimeout.current);
|
|
24357
24361
|
recoveryLoadingTimeout.current = null;
|
|
@@ -24628,9 +24632,29 @@ const CoinleyPaymentInternal = ({
|
|
|
24628
24632
|
};
|
|
24629
24633
|
}, [useGenericMobileTokenList, selectedNetwork == null ? void 0 : selectedNetwork.isExtraNetwork, selectedNetwork == null ? void 0 : selectedNetwork.chainId, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedNetwork == null ? void 0 : selectedNetwork.name, paymentFlow.api]);
|
|
24630
24634
|
const availableTokens = useMemo(() => {
|
|
24635
|
+
var _a2;
|
|
24631
24636
|
if (!selectedNetwork) return [];
|
|
24632
24637
|
const networkTokens = [];
|
|
24633
|
-
if (selectedNetwork.
|
|
24638
|
+
if (selectedNetwork.isCrossChainSource) {
|
|
24639
|
+
const sourceTokens = ((_a2 = selectedNetwork.crossChainSource) == null ? void 0 : _a2.tokens) || [];
|
|
24640
|
+
for (const token of sourceTokens) {
|
|
24641
|
+
const symbol = String(token.symbol || "").toUpperCase();
|
|
24642
|
+
const address2 = token.address || token.contractAddress || symbol;
|
|
24643
|
+
networkTokens.push({
|
|
24644
|
+
id: `cross-chain-${selectedNetwork.chainId}-${address2}`,
|
|
24645
|
+
symbol,
|
|
24646
|
+
name: token.name || symbol,
|
|
24647
|
+
address: address2,
|
|
24648
|
+
contractAddress: address2,
|
|
24649
|
+
decimals: token.decimals || 18,
|
|
24650
|
+
isStablecoin: ["USDC", "USDT", "DAI"].includes(symbol),
|
|
24651
|
+
balance: null,
|
|
24652
|
+
balanceFormatted: null,
|
|
24653
|
+
logo: token.logoURI || token.logo || getTokenLogoUrl(symbol),
|
|
24654
|
+
Network: { shortName: selectedNetwork.shortName, name: selectedNetwork.name }
|
|
24655
|
+
});
|
|
24656
|
+
}
|
|
24657
|
+
} else if (selectedNetwork.isBridgeNetwork && selectedNetwork.bridgeDestination) {
|
|
24634
24658
|
const bt = selectedNetwork.bridgeTokens;
|
|
24635
24659
|
if (bt == null ? void 0 : bt.usdc) {
|
|
24636
24660
|
networkTokens.push({
|
|
@@ -24655,8 +24679,8 @@ const CoinleyPaymentInternal = ({
|
|
|
24655
24679
|
} else {
|
|
24656
24680
|
const serverTokens = tokens.filter(
|
|
24657
24681
|
(token) => {
|
|
24658
|
-
var
|
|
24659
|
-
return ((
|
|
24682
|
+
var _a3;
|
|
24683
|
+
return ((_a3 = token.Network) == null ? void 0 : _a3.shortName) === (selectedNetwork == null ? void 0 : selectedNetwork.shortName) || token.networkId === (selectedNetwork == null ? void 0 : selectedNetwork.id);
|
|
24660
24684
|
}
|
|
24661
24685
|
);
|
|
24662
24686
|
if (useGenericMobileTokenList) {
|
|
@@ -24719,8 +24743,8 @@ const CoinleyPaymentInternal = ({
|
|
|
24719
24743
|
for (const st of serverTokens) {
|
|
24720
24744
|
const walletMatch = walletTokens.find(
|
|
24721
24745
|
(wt) => {
|
|
24722
|
-
var
|
|
24723
|
-
return ((
|
|
24746
|
+
var _a3, _b, _c, _d;
|
|
24747
|
+
return ((_a3 = wt.symbol) == null ? void 0 : _a3.toUpperCase()) === ((_b = st.symbol) == null ? void 0 : _b.toUpperCase()) || ((_c = wt.contractAddress) == null ? void 0 : _c.toLowerCase()) === ((_d = st.contractAddress) == null ? void 0 : _d.toLowerCase());
|
|
24724
24748
|
}
|
|
24725
24749
|
);
|
|
24726
24750
|
networkTokens.push({
|
|
@@ -24734,8 +24758,8 @@ const CoinleyPaymentInternal = ({
|
|
|
24734
24758
|
for (const wt of walletTokens) {
|
|
24735
24759
|
const alreadyListed = networkTokens.some(
|
|
24736
24760
|
(t) => {
|
|
24737
|
-
var
|
|
24738
|
-
return ((
|
|
24761
|
+
var _a3, _b, _c, _d;
|
|
24762
|
+
return ((_a3 = t.symbol) == null ? void 0 : _a3.toUpperCase()) === ((_b = wt.symbol) == null ? void 0 : _b.toUpperCase()) || ((_c = t.contractAddress) == null ? void 0 : _c.toLowerCase()) === ((_d = wt.contractAddress) == null ? void 0 : _d.toLowerCase());
|
|
24739
24763
|
}
|
|
24740
24764
|
);
|
|
24741
24765
|
if (!alreadyListed) {
|
|
@@ -24747,7 +24771,7 @@ const CoinleyPaymentInternal = ({
|
|
|
24747
24771
|
}
|
|
24748
24772
|
}
|
|
24749
24773
|
}
|
|
24750
|
-
const filteredTokens = networkTokens.filter((t) => {
|
|
24774
|
+
const filteredTokens = (selectedNetwork == null ? void 0 : selectedNetwork.isCrossChainSource) ? networkTokens : networkTokens.filter((t) => {
|
|
24751
24775
|
if (t.isSwapToken) return true;
|
|
24752
24776
|
return isTokenBridgeSupported(selectedNetwork == null ? void 0 : selectedNetwork.shortName, t.symbol);
|
|
24753
24777
|
});
|
|
@@ -25107,6 +25131,12 @@ const CoinleyPaymentInternal = ({
|
|
|
25107
25131
|
setError("");
|
|
25108
25132
|
setQrCodeDataUrl("");
|
|
25109
25133
|
setQrWalletChoiceConfirmed(false);
|
|
25134
|
+
setCcResult(null);
|
|
25135
|
+
setCcQrCode("");
|
|
25136
|
+
setCcPhase("idle");
|
|
25137
|
+
setCcManualCheckStatus("idle");
|
|
25138
|
+
setCcOriginChainId((network == null ? void 0 : network.isCrossChainSource) ? String(network.chainId) : "");
|
|
25139
|
+
setCcOriginToken(null);
|
|
25110
25140
|
setSelectedNetwork(network);
|
|
25111
25141
|
setSelectedToken(null);
|
|
25112
25142
|
if (network == null ? void 0 : network.isBridgeNetwork) {
|
|
@@ -25129,6 +25159,7 @@ const CoinleyPaymentInternal = ({
|
|
|
25129
25159
|
setQrCodeDataUrl("");
|
|
25130
25160
|
setQrWalletChoiceConfirmed(false);
|
|
25131
25161
|
setSelectedToken(token);
|
|
25162
|
+
setCcOriginToken((selectedNetwork == null ? void 0 : selectedNetwork.isCrossChainSource) ? token : null);
|
|
25132
25163
|
createNewAttempt("token-selected", {
|
|
25133
25164
|
snapshot: buildSelectionSnapshot(selectedNetwork, token, address, solanaWallet == null ? void 0 : solanaWallet.publicKey)
|
|
25134
25165
|
});
|
|
@@ -25152,24 +25183,38 @@ const CoinleyPaymentInternal = ({
|
|
|
25152
25183
|
return c ? c.tokens : [];
|
|
25153
25184
|
}, [ccSources, ccOriginChainId]);
|
|
25154
25185
|
const handleGenerateCrossChain = async () => {
|
|
25155
|
-
|
|
25186
|
+
var _a2, _b, _c;
|
|
25187
|
+
const originChainId = (selectedNetwork == null ? void 0 : selectedNetwork.isCrossChainSource) ? selectedNetwork.chainId : ccOriginChainId;
|
|
25188
|
+
const originToken = (selectedNetwork == null ? void 0 : selectedNetwork.isCrossChainSource) ? selectedToken : ccOriginToken;
|
|
25189
|
+
const originCurrency = (originToken == null ? void 0 : originToken.address) || (originToken == null ? void 0 : originToken.contractAddress) || (originToken == null ? void 0 : originToken.symbol);
|
|
25190
|
+
if (!originChainId || !originToken || !originCurrency) return;
|
|
25191
|
+
const originNetwork = (selectedNetwork == null ? void 0 : selectedNetwork.isCrossChainSource) ? selectedNetwork : { id: `cross-chain-${originChainId}`, chainId: originChainId, shortName: `chain-${originChainId}` };
|
|
25192
|
+
const attempt = createNewAttempt("cross-chain-transfer", {
|
|
25193
|
+
snapshot: buildSelectionSnapshot(originNetwork, originToken, address, solanaWallet == null ? void 0 : solanaWallet.publicKey)
|
|
25194
|
+
});
|
|
25156
25195
|
setCcError(null);
|
|
25157
25196
|
setCcGenerating(true);
|
|
25197
|
+
setCcOriginChainId(String(originChainId));
|
|
25198
|
+
setCcOriginToken(originToken);
|
|
25158
25199
|
try {
|
|
25159
25200
|
const r = await paymentFlow.api.createCrossChainPayment({
|
|
25160
|
-
amount:
|
|
25161
|
-
originChainId: Number(
|
|
25162
|
-
originCurrency
|
|
25201
|
+
amount: String((config == null ? void 0 : config.amount) ?? paymentAmount),
|
|
25202
|
+
originChainId: Number(originChainId),
|
|
25203
|
+
originCurrency
|
|
25163
25204
|
});
|
|
25205
|
+
if (((_a2 = activeAttemptRef.current) == null ? void 0 : _a2.id) !== attempt.id) return;
|
|
25164
25206
|
const p = r.payment || r;
|
|
25165
25207
|
setCcResult(p);
|
|
25166
25208
|
setCcPhase("awaiting_deposit");
|
|
25167
25209
|
setCcManualCheckStatus("idle");
|
|
25168
25210
|
setCcQrCode(await QRCode.toDataURL(p.relayDepositAddress, { width: 220, margin: 1 }));
|
|
25169
25211
|
} catch (e) {
|
|
25212
|
+
if (((_b = activeAttemptRef.current) == null ? void 0 : _b.id) !== attempt.id) return;
|
|
25170
25213
|
setCcError(e.message || "Could not generate payment address");
|
|
25171
25214
|
} finally {
|
|
25172
|
-
|
|
25215
|
+
if (((_c = activeAttemptRef.current) == null ? void 0 : _c.id) === attempt.id) {
|
|
25216
|
+
setCcGenerating(false);
|
|
25217
|
+
}
|
|
25173
25218
|
}
|
|
25174
25219
|
};
|
|
25175
25220
|
const startRecoveryLoading = useCallback((action) => {
|
|
@@ -25179,8 +25224,9 @@ const CoinleyPaymentInternal = ({
|
|
|
25179
25224
|
}
|
|
25180
25225
|
recoveryLoadingStartedAt.current = Date.now();
|
|
25181
25226
|
setRecoveryLoadingAction(action);
|
|
25227
|
+
setRecoveryLoadingStatus(null);
|
|
25182
25228
|
}, []);
|
|
25183
|
-
const
|
|
25229
|
+
const runAfterRecoveryMinimum = useCallback((callback) => {
|
|
25184
25230
|
const elapsed = Date.now() - recoveryLoadingStartedAt.current;
|
|
25185
25231
|
const delay = Math.max(RECOVERY_LOADING_MIN_MS - elapsed, 0);
|
|
25186
25232
|
if (recoveryLoadingTimeout.current) {
|
|
@@ -25188,12 +25234,41 @@ const CoinleyPaymentInternal = ({
|
|
|
25188
25234
|
}
|
|
25189
25235
|
recoveryLoadingTimeout.current = setTimeout(() => {
|
|
25190
25236
|
recoveryLoadingTimeout.current = null;
|
|
25191
|
-
setRecoveryLoadingAction(null);
|
|
25192
25237
|
if (typeof callback === "function") {
|
|
25193
25238
|
callback();
|
|
25194
25239
|
}
|
|
25195
25240
|
}, delay);
|
|
25196
25241
|
}, []);
|
|
25242
|
+
const finishRecoveryLoading = useCallback((callback) => {
|
|
25243
|
+
runAfterRecoveryMinimum(() => {
|
|
25244
|
+
setRecoveryLoadingAction(null);
|
|
25245
|
+
setRecoveryLoadingStatus(null);
|
|
25246
|
+
if (typeof callback === "function") {
|
|
25247
|
+
callback();
|
|
25248
|
+
}
|
|
25249
|
+
});
|
|
25250
|
+
}, [runAfterRecoveryMinimum]);
|
|
25251
|
+
const holdRecoveryLoading = useCallback((action, status) => {
|
|
25252
|
+
runAfterRecoveryMinimum(() => {
|
|
25253
|
+
setRecoveryLoadingAction(action);
|
|
25254
|
+
setRecoveryLoadingStatus({ action, ...status });
|
|
25255
|
+
});
|
|
25256
|
+
}, [runAfterRecoveryMinimum]);
|
|
25257
|
+
const getOffsetWaitingStatus = useCallback((overrides = {}) => {
|
|
25258
|
+
const shortfallLabel = underpaymentInfo ? `${formatAmount(underpaymentInfo.shortfallAmount || underpaymentInfo.amountRemaining || 0)} ${underpaymentInfo.tokenSymbol || (selectedToken == null ? void 0 : selectedToken.symbol) || ""}`.trim() : "the remaining amount";
|
|
25259
|
+
const networkLabel = (underpaymentInfo == null ? void 0 : underpaymentInfo.refundNetworkLabel) || (selectedNetwork == null ? void 0 : selectedNetwork.name) || (selectedNetwork == null ? void 0 : selectedNetwork.shortName) || "the selected network";
|
|
25260
|
+
return {
|
|
25261
|
+
title: "Still checking your offset",
|
|
25262
|
+
description: "We have not detected your offset yet. Keep this screen open; we will keep checking automatically.",
|
|
25263
|
+
detail: `Waiting for ${shortfallLabel} on ${networkLabel}.`,
|
|
25264
|
+
...overrides
|
|
25265
|
+
};
|
|
25266
|
+
}, [selectedNetwork == null ? void 0 : selectedNetwork.name, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, underpaymentInfo]);
|
|
25267
|
+
const getRefundPendingStatus = useCallback(() => ({
|
|
25268
|
+
title: "Refund request received",
|
|
25269
|
+
description: "We will process it automatically.",
|
|
25270
|
+
detail: `Refunding the received ${(underpaymentInfo == null ? void 0 : underpaymentInfo.tokenSymbol) || (selectedToken == null ? void 0 : selectedToken.symbol) || "tokens"} on ${(underpaymentInfo == null ? void 0 : underpaymentInfo.refundNetworkLabel) || (selectedNetwork == null ? void 0 : selectedNetwork.name) || (selectedNetwork == null ? void 0 : selectedNetwork.shortName) || "the selected network"}.`
|
|
25271
|
+
}), [selectedNetwork == null ? void 0 : selectedNetwork.name, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, underpaymentInfo == null ? void 0 : underpaymentInfo.refundNetworkLabel, underpaymentInfo == null ? void 0 : underpaymentInfo.tokenSymbol]);
|
|
25197
25272
|
useEffect(() => () => {
|
|
25198
25273
|
if (recoveryLoadingTimeout.current) {
|
|
25199
25274
|
clearTimeout(recoveryLoadingTimeout.current);
|
|
@@ -25209,34 +25284,42 @@ const CoinleyPaymentInternal = ({
|
|
|
25209
25284
|
setCcPhase(status.phase);
|
|
25210
25285
|
if (activateUnderpaymentFromCrossChainStatus(status)) {
|
|
25211
25286
|
if (isOffsetRecovery) {
|
|
25212
|
-
|
|
25213
|
-
|
|
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
|
-
});
|
|
25287
|
+
setCcManualCheckStatus("not_found");
|
|
25288
|
+
holdRecoveryLoading("offset", getOffsetWaitingStatus());
|
|
25216
25289
|
} else {
|
|
25217
25290
|
setCcManualCheckStatus(null);
|
|
25218
25291
|
}
|
|
25219
25292
|
} else if (status.phase === "bridging") {
|
|
25220
|
-
|
|
25221
|
-
|
|
25222
|
-
|
|
25223
|
-
|
|
25224
|
-
|
|
25293
|
+
if (isOffsetRecovery) {
|
|
25294
|
+
holdRecoveryLoading("offset", getOffsetWaitingStatus({
|
|
25295
|
+
title: "Transfer detected",
|
|
25296
|
+
description: "We have detected your offset and are waiting for processing to complete.",
|
|
25297
|
+
detail: "We will keep checking automatically."
|
|
25298
|
+
}));
|
|
25299
|
+
} else {
|
|
25300
|
+
finishRecoveryLoading(() => {
|
|
25301
|
+
clearUnderpaymentUiState(status.paymentId || ccResult.id);
|
|
25302
|
+
setCcManualCheckStatus("idle");
|
|
25303
|
+
});
|
|
25304
|
+
}
|
|
25305
|
+
} else if (status.phase === "settled" && !ccSucceeded.current) {
|
|
25225
25306
|
finishRecoveryLoading(() => {
|
|
25226
25307
|
ccSucceeded.current = true;
|
|
25227
25308
|
onSuccess == null ? void 0 : onSuccess(status);
|
|
25228
25309
|
});
|
|
25310
|
+
} else if (status.phase === "received") {
|
|
25311
|
+
finishRecoveryLoading(() => {
|
|
25312
|
+
setCcManualCheckStatus("idle");
|
|
25313
|
+
});
|
|
25229
25314
|
} else if (status.phase === "failed") {
|
|
25230
25315
|
finishRecoveryLoading(() => {
|
|
25231
25316
|
setCcManualCheckStatus("failed");
|
|
25232
25317
|
});
|
|
25233
25318
|
} else {
|
|
25234
|
-
|
|
25235
|
-
|
|
25236
|
-
|
|
25237
|
-
|
|
25238
|
-
);
|
|
25239
|
-
});
|
|
25319
|
+
setCcManualCheckStatus("not_found");
|
|
25320
|
+
if (isOffsetRecovery) {
|
|
25321
|
+
holdRecoveryLoading("offset", getOffsetWaitingStatus());
|
|
25322
|
+
}
|
|
25240
25323
|
}
|
|
25241
25324
|
} catch (error2) {
|
|
25242
25325
|
finishRecoveryLoading(() => {
|
|
@@ -25259,7 +25342,7 @@ const CoinleyPaymentInternal = ({
|
|
|
25259
25342
|
setCcManualCheckStatus(null);
|
|
25260
25343
|
} else if (s.phase === "bridging") {
|
|
25261
25344
|
clearUnderpaymentUiState(s.paymentId || ccResult.id);
|
|
25262
|
-
} else if (
|
|
25345
|
+
} else if (s.phase === "settled" && !ccSucceeded.current) {
|
|
25263
25346
|
ccSucceeded.current = true;
|
|
25264
25347
|
onSuccess == null ? void 0 : onSuccess(s);
|
|
25265
25348
|
}
|
|
@@ -26151,11 +26234,8 @@ const CoinleyPaymentInternal = ({
|
|
|
26151
26234
|
setCurrentStep(PAYMENT_STEPS.SUCCESS);
|
|
26152
26235
|
});
|
|
26153
26236
|
} else {
|
|
26154
|
-
|
|
26155
|
-
|
|
26156
|
-
setRefundRequestMessage("");
|
|
26157
|
-
showTransferNoticeModal(refundMessage, "Refund request received");
|
|
26158
|
-
});
|
|
26237
|
+
setRefundRequestMessage("");
|
|
26238
|
+
holdRecoveryLoading("refund", getRefundPendingStatus());
|
|
26159
26239
|
}
|
|
26160
26240
|
} catch (error2) {
|
|
26161
26241
|
console.warn("[RefundRequest] Error:", error2.message);
|
|
@@ -26165,7 +26245,7 @@ const CoinleyPaymentInternal = ({
|
|
|
26165
26245
|
setRefundRequestMessage(error2.message || "Failed to submit refund request. Please try again.");
|
|
26166
26246
|
});
|
|
26167
26247
|
}
|
|
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,
|
|
26248
|
+
}, [activeTransferPaymentId, captureRefundSuccessDetails, ccOriginChainId, ccOriginToken == null ? void 0 : ccOriginToken.symbol, clearUnderpaymentRecovery, config, finishRecoveryLoading, getRefundPendingStatus, holdRecoveryLoading, refundAddress, refundRequestStatus, paymentFlow.api, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, startRecoveryLoading, underpaymentInfo]);
|
|
26169
26249
|
const handleDepositManualCheck = useCallback(async () => {
|
|
26170
26250
|
if (manualCheckStatus === "checking" || !(paymentData == null ? void 0 : paymentData.id)) return;
|
|
26171
26251
|
const isOffsetRecovery = Boolean(underpaymentInfo && underpaymentView === "offset");
|
|
@@ -26199,13 +26279,8 @@ const CoinleyPaymentInternal = ({
|
|
|
26199
26279
|
}
|
|
26200
26280
|
if (activateUnderpaymentFlow(statusResult.payment)) {
|
|
26201
26281
|
if (isOffsetRecovery) {
|
|
26202
|
-
|
|
26203
|
-
|
|
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
|
-
});
|
|
26282
|
+
setManualCheckStatus("not_found");
|
|
26283
|
+
holdRecoveryLoading("offset", getOffsetWaitingStatus());
|
|
26209
26284
|
}
|
|
26210
26285
|
return;
|
|
26211
26286
|
}
|
|
@@ -26222,22 +26297,19 @@ const CoinleyPaymentInternal = ({
|
|
|
26222
26297
|
const balanceResult = await paymentFlow.api.getDepositBalance(paymentData.id);
|
|
26223
26298
|
if ((balanceResult == null ? void 0 : balanceResult.success) && activateUnderpaymentFromDepositBalance(balanceResult)) {
|
|
26224
26299
|
if (isOffsetRecovery) {
|
|
26225
|
-
|
|
26226
|
-
|
|
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
|
-
});
|
|
26300
|
+
setManualCheckStatus("not_found");
|
|
26301
|
+
holdRecoveryLoading("offset", getOffsetWaitingStatus());
|
|
26232
26302
|
}
|
|
26233
26303
|
return;
|
|
26234
26304
|
}
|
|
26235
26305
|
}
|
|
26236
26306
|
finishRecoveryLoading(() => {
|
|
26237
26307
|
setManualCheckStatus("not_found");
|
|
26238
|
-
|
|
26239
|
-
|
|
26240
|
-
|
|
26308
|
+
if (isOffsetRecovery) {
|
|
26309
|
+
setRecoveryLoadingAction("offset");
|
|
26310
|
+
setRecoveryLoadingStatus({ action: "offset", ...getOffsetWaitingStatus() });
|
|
26311
|
+
return;
|
|
26312
|
+
}
|
|
26241
26313
|
manualCheckTimeout.current = setTimeout(() => {
|
|
26242
26314
|
setManualCheckStatus(null);
|
|
26243
26315
|
}, 1e4);
|
|
@@ -26246,15 +26318,17 @@ const CoinleyPaymentInternal = ({
|
|
|
26246
26318
|
console.warn("[ManualCheck] Error:", error2.message);
|
|
26247
26319
|
finishRecoveryLoading(() => {
|
|
26248
26320
|
setManualCheckStatus("not_found");
|
|
26249
|
-
|
|
26250
|
-
|
|
26251
|
-
|
|
26321
|
+
if (isOffsetRecovery) {
|
|
26322
|
+
setRecoveryLoadingAction("offset");
|
|
26323
|
+
setRecoveryLoadingStatus({ action: "offset", ...getOffsetWaitingStatus() });
|
|
26324
|
+
return;
|
|
26325
|
+
}
|
|
26252
26326
|
manualCheckTimeout.current = setTimeout(() => {
|
|
26253
26327
|
setManualCheckStatus(null);
|
|
26254
26328
|
}, 1e4);
|
|
26255
26329
|
});
|
|
26256
26330
|
}
|
|
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,
|
|
26331
|
+
}, [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, getOffsetWaitingStatus, holdRecoveryLoading]);
|
|
26258
26332
|
const truncateAddress = (addr) => {
|
|
26259
26333
|
if (!addr) return "";
|
|
26260
26334
|
return `${addr.slice(0, 4)}......${addr.slice(-4)}`;
|
|
@@ -26633,9 +26707,9 @@ const CoinleyPaymentInternal = ({
|
|
|
26633
26707
|
] })
|
|
26634
26708
|
] });
|
|
26635
26709
|
const renderUnderpaymentOffsetPanel = () => recoveryLoadingAction === "offset" ? renderRecoveryLoadingPanel({
|
|
26636
|
-
title: "Checking your offset",
|
|
26637
|
-
description: "We are checking the blockchain for your offset payment. This usually takes a few seconds.",
|
|
26638
|
-
detail: `Waiting for the remaining ${underpaymentOffsetAmountLabel} on ${underpaymentInfo.refundNetworkLabel || getOffsetSuccessNetworkName(selectedNetwork)}.`
|
|
26710
|
+
title: (recoveryLoadingStatus == null ? void 0 : recoveryLoadingStatus.action) === "offset" ? recoveryLoadingStatus.title : "Checking your offset",
|
|
26711
|
+
description: (recoveryLoadingStatus == null ? void 0 : recoveryLoadingStatus.action) === "offset" ? recoveryLoadingStatus.description : "We are checking the blockchain for your offset payment. This usually takes a few seconds.",
|
|
26712
|
+
detail: (recoveryLoadingStatus == null ? void 0 : recoveryLoadingStatus.action) === "offset" ? recoveryLoadingStatus.detail : `Waiting for the remaining ${underpaymentOffsetAmountLabel} on ${underpaymentInfo.refundNetworkLabel || getOffsetSuccessNetworkName(selectedNetwork)}.`
|
|
26639
26713
|
}) : /* @__PURE__ */ jsxs("div", { className: "pt-1", children: [
|
|
26640
26714
|
/* @__PURE__ */ jsxs("div", { className: "mb-5 flex items-start gap-3", children: [
|
|
26641
26715
|
/* @__PURE__ */ jsx("div", { className: "h-[92px] w-[92px] flex-shrink-0 bg-white", children: (ccResult ? ccQrCode : depositQrCode) ? /* @__PURE__ */ jsx("img", { src: ccResult ? ccQrCode : depositQrCode, alt: "Deposit Address QR Code", className: "h-full w-full" }) : /* @__PURE__ */ jsx("div", { className: "flex h-full w-full items-center justify-center rounded-lg bg-gray-100", children: /* @__PURE__ */ jsx("img", { src: stablezactLoading, alt: "Loading QR code", className: "h-14 w-16 object-contain" }) }) }),
|
|
@@ -26661,9 +26735,9 @@ const CoinleyPaymentInternal = ({
|
|
|
26661
26735
|
)
|
|
26662
26736
|
] });
|
|
26663
26737
|
const renderUnderpaymentRefundPanel = () => recoveryLoadingAction === "refund" ? renderRecoveryLoadingPanel({
|
|
26664
|
-
title: "Preparing your refund",
|
|
26665
|
-
description: "We are submitting your refund request and checking whether it can be sent immediately.",
|
|
26666
|
-
detail: `Refunding the received ${underpaymentInfo.tokenSymbol} on ${underpaymentInfo.refundNetworkLabel}.`
|
|
26738
|
+
title: (recoveryLoadingStatus == null ? void 0 : recoveryLoadingStatus.action) === "refund" ? recoveryLoadingStatus.title : "Preparing your refund",
|
|
26739
|
+
description: (recoveryLoadingStatus == null ? void 0 : recoveryLoadingStatus.action) === "refund" ? recoveryLoadingStatus.description : "We are submitting your refund request and checking whether it can be sent immediately.",
|
|
26740
|
+
detail: (recoveryLoadingStatus == null ? void 0 : recoveryLoadingStatus.action) === "refund" ? recoveryLoadingStatus.detail : `Refunding the received ${underpaymentInfo.tokenSymbol} on ${underpaymentInfo.refundNetworkLabel}.`
|
|
26667
26741
|
}) : /* @__PURE__ */ jsxs("div", { className: "pt-1", children: [
|
|
26668
26742
|
renderUnderpaymentWarning(
|
|
26669
26743
|
`Refund of $${formatAmount(underpaymentInfo.receivedAmount || 0)} ${underpaymentInfo.tokenSymbol}`,
|
|
@@ -26688,11 +26762,27 @@ const CoinleyPaymentInternal = ({
|
|
|
26688
26762
|
),
|
|
26689
26763
|
refundRequestMessage && /* @__PURE__ */ jsx("p", { className: `mt-2 text-center text-xs leading-5 ${refundRequestStatus === "error" ? "text-red-600" : "text-[#8B8E98]"}`, children: refundRequestMessage })
|
|
26690
26764
|
] });
|
|
26691
|
-
const
|
|
26765
|
+
const directTransferNetworks = networks.filter((network) => {
|
|
26692
26766
|
const chainId = parseInt(network.chainId);
|
|
26693
26767
|
const supportedChains = [8453, 56, 42161, 137, 10, 43114, 143, 59144, 534352, 130];
|
|
26694
26768
|
return supportedChains.includes(chainId);
|
|
26695
26769
|
});
|
|
26770
|
+
const directTransferChainIds = new Set(directTransferNetworks.map((network) => Number(network.chainId)));
|
|
26771
|
+
const crossChainSourceNetworks = ccSources.filter((source) => !directTransferChainIds.has(Number(source.chainId))).map((source) => {
|
|
26772
|
+
const chainId = Number(source.chainId);
|
|
26773
|
+
const knownChain = ALCHEMY_EVM_CHAINS.find((chain) => Number(chain.id) === chainId);
|
|
26774
|
+
return {
|
|
26775
|
+
id: `cross-chain-${chainId}`,
|
|
26776
|
+
name: (knownChain == null ? void 0 : knownChain.displayName) || ccChainName(chainId),
|
|
26777
|
+
shortName: (knownChain == null ? void 0 : knownChain.shortName) || `chain-${chainId}`,
|
|
26778
|
+
chainId,
|
|
26779
|
+
chainType: "evm",
|
|
26780
|
+
isCrossChainSource: true,
|
|
26781
|
+
crossChainSource: source,
|
|
26782
|
+
logo: ccChainIcon(chainId)
|
|
26783
|
+
};
|
|
26784
|
+
});
|
|
26785
|
+
const transferNetworks = [...directTransferNetworks, ...crossChainSourceNetworks];
|
|
26696
26786
|
const renderCheckoutSelect = ({ id, label, value, placeholder, disabled, onChange, options, getLabel, getIcon, compact = false, elevated = false, maxVisibleItems = 4 }) => {
|
|
26697
26787
|
const dropdownId = id || label;
|
|
26698
26788
|
const selectedOption = options.find((option) => String(option.id) === String(value));
|
|
@@ -27265,6 +27355,13 @@ const CoinleyPaymentInternal = ({
|
|
|
27265
27355
|
disabled: !ccOriginToken || ccGenerating || isConverting
|
|
27266
27356
|
});
|
|
27267
27357
|
}
|
|
27358
|
+
if (activeTab === PAYMENT_TABS.TRANSFER && (selectedNetwork == null ? void 0 : selectedNetwork.isCrossChainSource) && selectedToken && !ccResult && !(paymentData == null ? void 0 : paymentData.depositAddress)) {
|
|
27359
|
+
return renderFooterPrimaryButton({
|
|
27360
|
+
label: ccGenerating ? "Generating Address..." : `Pay ${paymentAmountLabel}`,
|
|
27361
|
+
onClick: handleGenerateCrossChain,
|
|
27362
|
+
disabled: ccGenerating || isConverting
|
|
27363
|
+
});
|
|
27364
|
+
}
|
|
27268
27365
|
if (activeTab === PAYMENT_TABS.TRANSFER && activeTransferDepositAddress && underpaymentInfo) {
|
|
27269
27366
|
if (underpaymentView === "choice") {
|
|
27270
27367
|
return renderFooterPrimaryButton({
|
|
@@ -27295,7 +27392,7 @@ const CoinleyPaymentInternal = ({
|
|
|
27295
27392
|
return null;
|
|
27296
27393
|
}
|
|
27297
27394
|
return renderFooterPrimaryButton({
|
|
27298
|
-
label: refundRequestSubmitted ? "Refund request submitted" : "Submit
|
|
27395
|
+
label: refundRequestSubmitted ? "Refund request submitted" : "Submit Refund request",
|
|
27299
27396
|
onClick: handleRefundRequestSubmit,
|
|
27300
27397
|
disabled: !refundAddress.trim() || refundRequestStatus === "submitting" || refundRequestStatus === "pending" || refundRequestStatus === "refunded"
|
|
27301
27398
|
});
|
|
@@ -27374,23 +27471,6 @@ const CoinleyPaymentInternal = ({
|
|
|
27374
27471
|
/* @__PURE__ */ jsx("p", { className: `${isTightWalletView ? "mt-1" : isCompactCheckoutView ? "mt-2" : "mt-3"} text-xs text-[#A9ABB2]`, children: "Powered by Stablezact" })
|
|
27375
27472
|
] });
|
|
27376
27473
|
};
|
|
27377
|
-
const renderTransferNoticeModal = () => {
|
|
27378
|
-
if (!transferNoticeModal) return null;
|
|
27379
|
-
return /* @__PURE__ */ jsx("div", { className: "fixed inset-0 z-[70] flex items-center justify-center bg-black/45 px-4", children: /* @__PURE__ */ jsxs("div", { className: "w-full max-w-[340px] rounded-2xl bg-white p-5 text-center shadow-2xl", children: [
|
|
27380
|
-
/* @__PURE__ */ jsx("div", { className: "mx-auto mb-3 flex h-11 w-11 items-center justify-center rounded-full bg-amber-50 text-amber-600", 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: "M12 9v4m0 4h.01M12 3a9 9 0 110 18 9 9 0 010-18z" }) }) }),
|
|
27381
|
-
/* @__PURE__ */ jsx("h3", { className: "mb-2 text-base font-semibold text-[#111827]", children: transferNoticeModal.title }),
|
|
27382
|
-
/* @__PURE__ */ jsx("p", { className: "mb-5 text-sm leading-5 text-[#6B7280]", children: transferNoticeModal.message }),
|
|
27383
|
-
/* @__PURE__ */ jsx(
|
|
27384
|
-
"button",
|
|
27385
|
-
{
|
|
27386
|
-
type: "button",
|
|
27387
|
-
onClick: () => setTransferNoticeModal(null),
|
|
27388
|
-
className: "h-11 w-full rounded-xl bg-[#7042D2] px-4 text-sm font-semibold text-white transition-colors hover:bg-[#5b34b1]",
|
|
27389
|
-
children: "Got it"
|
|
27390
|
-
}
|
|
27391
|
-
)
|
|
27392
|
-
] }) });
|
|
27393
|
-
};
|
|
27394
27474
|
const renderTabContent = () => {
|
|
27395
27475
|
var _a2, _b, _c, _d;
|
|
27396
27476
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -27753,7 +27833,7 @@ const CoinleyPaymentInternal = ({
|
|
|
27753
27833
|
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
27754
27834
|
renderUnderpaymentWarning(
|
|
27755
27835
|
"Important!",
|
|
27756
|
-
|
|
27836
|
+
`Send exactly ${ccResult.amountToSendFormatted || ccResult.amountToSend} ${(ccOriginToken == null ? void 0 : ccOriginToken.symbol) || (selectedToken == null ? void 0 : selectedToken.symbol) || ccResult.originCurrency || ""} on ${ccChainName(ccResult.originChainId || ccOriginChainId)} to this wallet address. Include enough native token for network fees.`
|
|
27757
27837
|
),
|
|
27758
27838
|
ccPhase === "failed" ? /* @__PURE__ */ jsx("div", { className: "rounded-lg border border-red-200 bg-red-50 px-3 py-2 text-center text-xs font-medium text-red-600", children: "Payment failed — please try again" }) : ccPhase === "received" || ccPhase === "settled" ? /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-2 text-xs font-medium text-green-600", children: [
|
|
27759
27839
|
/* @__PURE__ */ jsx("span", { className: "relative inline-flex h-2 w-2 rounded-full bg-green-500" }),
|
|
@@ -27804,6 +27884,7 @@ const CoinleyPaymentInternal = ({
|
|
|
27804
27884
|
const isQrPaymentActiveView = activeTab === PAYMENT_TABS.QR && qrWalletChoiceConfirmed;
|
|
27805
27885
|
const handleTransferAddressBack = async () => {
|
|
27806
27886
|
setRecoveryLoadingAction(null);
|
|
27887
|
+
setRecoveryLoadingStatus(null);
|
|
27807
27888
|
if (underpaymentInfo && underpaymentView !== "choice") {
|
|
27808
27889
|
setUnderpaymentView("choice");
|
|
27809
27890
|
return;
|
|
@@ -27897,8 +27978,7 @@ const CoinleyPaymentInternal = ({
|
|
|
27897
27978
|
/* @__PURE__ */ jsx("div", { className: `min-h-0 flex-1 ${isCheckoutDropdownOpen ? "overflow-visible" : "overflow-y-auto coinley-scroll"} pb-1`, children: renderTabContent() }),
|
|
27898
27979
|
renderCheckoutFooter()
|
|
27899
27980
|
] })
|
|
27900
|
-
] }) })
|
|
27901
|
-
renderTransferNoticeModal()
|
|
27981
|
+
] }) })
|
|
27902
27982
|
] });
|
|
27903
27983
|
};
|
|
27904
27984
|
const CoinleyPayment = (props) => {
|
|
@@ -27934,4 +28014,4 @@ export {
|
|
|
27934
28014
|
chainTransports as c,
|
|
27935
28015
|
isFeatureEnabled as i
|
|
27936
28016
|
};
|
|
27937
|
-
//# sourceMappingURL=CoinleyPayment-
|
|
28017
|
+
//# sourceMappingURL=CoinleyPayment-kt3eOJlB.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as isFeatureEnabled, F as FEATURES, c as chainTransports, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-
|
|
1
|
+
import { i as isFeatureEnabled, F as FEATURES, c as chainTransports, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-kt3eOJlB.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-
|
|
116
|
+
//# sourceMappingURL=appKitEVM-CA1A3oZb.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as FEATURES, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-
|
|
1
|
+
import { F as FEATURES, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-kt3eOJlB.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-
|
|
246
|
+
//# sourceMappingURL=appKitSolana-mYWu1Cjx.js.map
|