coinley-pay 0.54.0 → 0.56.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-BD6rtaxd.js → CoinleyPayment-D8RFAoLv.js} +27 -17
- package/dist/{appKitEVM-B3xgIRTz.js → appKitEVM-CHDlhhVF.js} +2 -2
- package/dist/{appKitSolana-FcW9To4k.js → appKitSolana-B-2MO2dc.js} +2 -2
- package/dist/coinley-vanilla.min.js +580 -580
- package/dist/{index-Bp7JOqpt.js → index-DL3QwNBL.js} +3 -3
- package/dist/{index-DCmGzoG3.js → index-vyOEi34n.js} +3 -3
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +4 -4
- 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-DL3QwNBL.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";
|
|
@@ -21126,7 +21126,7 @@ const WalletSelector = ({
|
|
|
21126
21126
|
try {
|
|
21127
21127
|
setAppKitError(null);
|
|
21128
21128
|
setWalletConnectAddress(solanaAccountState.address);
|
|
21129
|
-
const { createWalletConnectAdapter } = await import("./appKitSolana-
|
|
21129
|
+
const { createWalletConnectAdapter } = await import("./appKitSolana-B-2MO2dc.js");
|
|
21130
21130
|
const adapter = createWalletConnectAdapter(solanaAccountState.address);
|
|
21131
21131
|
await solanaWallet.connectWalletConnect(adapter, solanaAccountState.address);
|
|
21132
21132
|
console.log("✅ WalletConnect synced with SDK");
|
|
@@ -21231,7 +21231,7 @@ const WalletSelector = ({
|
|
|
21231
21231
|
setAppKitLoading(true);
|
|
21232
21232
|
setAppKitError(null);
|
|
21233
21233
|
try {
|
|
21234
|
-
const { initializeAppKitEVM, openAppKitModal } = await import("./appKitEVM-
|
|
21234
|
+
const { initializeAppKitEVM, openAppKitModal } = await import("./appKitEVM-CHDlhhVF.js");
|
|
21235
21235
|
await initializeAppKitEVM(wagmiConfig);
|
|
21236
21236
|
await openAppKitModal();
|
|
21237
21237
|
} catch (error) {
|
|
@@ -21251,7 +21251,7 @@ const WalletSelector = ({
|
|
|
21251
21251
|
setAppKitError(null);
|
|
21252
21252
|
try {
|
|
21253
21253
|
console.log("📦 Loading AppKit Solana module...");
|
|
21254
|
-
const { initializeAppKitSolana } = await import("./appKitSolana-
|
|
21254
|
+
const { initializeAppKitSolana } = await import("./appKitSolana-B-2MO2dc.js");
|
|
21255
21255
|
console.log("✅ Module loaded, initializing...");
|
|
21256
21256
|
const modal = await initializeAppKitSolana(solanaWallet);
|
|
21257
21257
|
console.log("✅ AppKit Solana initialized successfully");
|
|
@@ -22943,10 +22943,6 @@ const generateQRPaymentURI = (paymentData, selectedToken, selectedNetwork, confi
|
|
|
22943
22943
|
return null;
|
|
22944
22944
|
}
|
|
22945
22945
|
};
|
|
22946
|
-
const isInDAppBrowser = () => {
|
|
22947
|
-
if (typeof window === "undefined" || !window.ethereum) return false;
|
|
22948
|
-
return !!(window.ethereum.isMetaMask || window.ethereum.isTrust || window.ethereum.isCoinbaseWallet || window.ethereum.isZerion || window.ethereum.isRabby || window.ethereum.isRainbow);
|
|
22949
|
-
};
|
|
22950
22946
|
const openPaymentPageInWallet = (walletType, paymentData, selectedNetwork = null, selectedToken = null, apiUrl = null) => {
|
|
22951
22947
|
const paymentScreenUrl = getHostedPaymentUrl(paymentData, walletType, selectedToken, selectedNetwork, apiUrl);
|
|
22952
22948
|
if (!paymentScreenUrl) return false;
|
|
@@ -22989,7 +22985,6 @@ const deepLinkUtils = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defin
|
|
|
22989
22985
|
getHostedPaymentUrl,
|
|
22990
22986
|
getSupportedMobileWallets,
|
|
22991
22987
|
getWalletAppStoreLink,
|
|
22992
|
-
isInDAppBrowser,
|
|
22993
22988
|
normalizeWalletType,
|
|
22994
22989
|
openPaymentPageInWallet
|
|
22995
22990
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -23185,6 +23180,7 @@ const CoinleyPaymentInternal = ({
|
|
|
23185
23180
|
var _a;
|
|
23186
23181
|
const paymentFlow = usePaymentFlow(apiUrl, publicKey2 || apiKey, publicKey2 ? null : apiSecret);
|
|
23187
23182
|
const walletConnection = useWalletConnection();
|
|
23183
|
+
const failedPaymentReportsRef = useRef(/* @__PURE__ */ new Set());
|
|
23188
23184
|
const solanaWallet = useSolanaWallet();
|
|
23189
23185
|
const chainType = useMemo(() => {
|
|
23190
23186
|
if (!paymentFlow.selectedNetwork) return CHAIN_TYPES.EVM;
|
|
@@ -23449,7 +23445,7 @@ const CoinleyPaymentInternal = ({
|
|
|
23449
23445
|
createPayment,
|
|
23450
23446
|
createDepositPayment,
|
|
23451
23447
|
isDepositSupported,
|
|
23452
|
-
failPayment,
|
|
23448
|
+
failPayment: rawFailPayment,
|
|
23453
23449
|
resetState,
|
|
23454
23450
|
setSelectedNetwork,
|
|
23455
23451
|
setSelectedToken,
|
|
@@ -23463,6 +23459,18 @@ const CoinleyPaymentInternal = ({
|
|
|
23463
23459
|
} = paymentFlow;
|
|
23464
23460
|
const activeTransferPaymentId = (paymentData == null ? void 0 : paymentData.id) || (ccResult == null ? void 0 : ccResult.id) || (ccResult == null ? void 0 : ccResult.paymentId);
|
|
23465
23461
|
const activeTransferDepositAddress = (paymentData == null ? void 0 : paymentData.depositAddress) || (ccResult == null ? void 0 : ccResult.relayDepositAddress) || (ccResult == null ? void 0 : ccResult.depositAddress);
|
|
23462
|
+
const failPayment = useCallback(async (reason = "Payment cancelled by user", status = "failed") => {
|
|
23463
|
+
const paymentId = activeTransferPaymentId;
|
|
23464
|
+
if (!paymentId || currentStep === PAYMENT_STEPS.SUCCESS) return;
|
|
23465
|
+
const dedupeKey = `${paymentId}:${status}:${reason || ""}`;
|
|
23466
|
+
if (failedPaymentReportsRef.current.has(dedupeKey)) return;
|
|
23467
|
+
failedPaymentReportsRef.current.add(dedupeKey);
|
|
23468
|
+
try {
|
|
23469
|
+
await paymentFlow.api.failPayment(paymentId, reason, status);
|
|
23470
|
+
} catch (error2) {
|
|
23471
|
+
await rawFailPayment(reason, status);
|
|
23472
|
+
}
|
|
23473
|
+
}, [activeTransferPaymentId, currentStep, paymentFlow.api, rawFailPayment]);
|
|
23466
23474
|
const merchantReceiveNetworks = (merchantNetworks == null ? void 0 : merchantNetworks.length) ? merchantNetworks : networks;
|
|
23467
23475
|
const isConfiguredMerchantReceiveNetwork = useCallback((network) => {
|
|
23468
23476
|
var _a2;
|
|
@@ -24083,6 +24091,7 @@ const CoinleyPaymentInternal = ({
|
|
|
24083
24091
|
useEffect(() => {
|
|
24084
24092
|
if (isOpen) {
|
|
24085
24093
|
console.log(`[Coinley] Build: ${CHECKOUT_BUILD}`);
|
|
24094
|
+
failedPaymentReportsRef.current = /* @__PURE__ */ new Set();
|
|
24086
24095
|
loadData();
|
|
24087
24096
|
resetState();
|
|
24088
24097
|
setMobileStep("method-select");
|
|
@@ -24399,13 +24408,9 @@ const CoinleyPaymentInternal = ({
|
|
|
24399
24408
|
onClose();
|
|
24400
24409
|
};
|
|
24401
24410
|
const handleMobileTabSelect = (tab) => {
|
|
24402
|
-
if (tab === PAYMENT_TABS.WALLET && isMobile && !isInDAppBrowser()) {
|
|
24403
|
-
setActiveTab(tab);
|
|
24404
|
-
setShowMobileWalletPicker(true);
|
|
24405
|
-
setMobileStep("content");
|
|
24406
|
-
return;
|
|
24407
|
-
}
|
|
24408
24411
|
setShowMobileWalletPicker(false);
|
|
24412
|
+
setSelectedMobileWallet(null);
|
|
24413
|
+
setMobileWalletRedirecting(null);
|
|
24409
24414
|
setActiveTab(tab);
|
|
24410
24415
|
setMobileStep("content");
|
|
24411
24416
|
};
|
|
@@ -25380,6 +25385,9 @@ const CoinleyPaymentInternal = ({
|
|
|
25380
25385
|
} else if (status.phase === "settled" && !ccSucceeded.current) {
|
|
25381
25386
|
finishRecoveryLoading(() => {
|
|
25382
25387
|
ccSucceeded.current = true;
|
|
25388
|
+
setCcRefundPendingInfo(null);
|
|
25389
|
+
setCcManualCheckStatus(null);
|
|
25390
|
+
setCurrentStep(PAYMENT_STEPS.SUCCESS);
|
|
25383
25391
|
onSuccess == null ? void 0 : onSuccess(status);
|
|
25384
25392
|
});
|
|
25385
25393
|
} else if (status.phase === "received") {
|
|
@@ -25439,6 +25447,8 @@ const CoinleyPaymentInternal = ({
|
|
|
25439
25447
|
} else if (s.phase === "settled" && !ccSucceeded.current) {
|
|
25440
25448
|
ccSucceeded.current = true;
|
|
25441
25449
|
setCcRefundPendingInfo(null);
|
|
25450
|
+
setCcManualCheckStatus(null);
|
|
25451
|
+
setCurrentStep(PAYMENT_STEPS.SUCCESS);
|
|
25442
25452
|
onSuccess == null ? void 0 : onSuccess(s);
|
|
25443
25453
|
}
|
|
25444
25454
|
} catch {
|
|
@@ -28122,4 +28132,4 @@ export {
|
|
|
28122
28132
|
chainTransports as c,
|
|
28123
28133
|
isFeatureEnabled as i
|
|
28124
28134
|
};
|
|
28125
|
-
//# sourceMappingURL=CoinleyPayment-
|
|
28135
|
+
//# sourceMappingURL=CoinleyPayment-D8RFAoLv.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-D8RFAoLv.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-CHDlhhVF.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-D8RFAoLv.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-B-2MO2dc.js.map
|