coinley-pay 0.63.0 → 0.64.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CoinleyPayment-DcxnhCxE.js → CoinleyPayment-DpJjSgAk.js} +28 -9
- package/dist/{appKitEVM-f4GTnd8I.js → appKitEVM-xLzaRFEg.js} +2 -2
- package/dist/{appKitSolana-Dyj8Yus-.js → appKitSolana-bPi9q207.js} +2 -2
- package/dist/coinley-vanilla.min.js +576 -576
- package/dist/{index-Cz7KNf_g.js → index-B7cvPWls.js} +3 -3
- package/dist/{index-BFlZCZrz.js → index-TmTTxz2j.js} +3 -3
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,7 @@ import { useState, useRef, useEffect, useCallback, useMemo } from "react";
|
|
|
6
6
|
import ReactDOM, { createPortal } from "react-dom";
|
|
7
7
|
import { useConnect, useAccount, useSwitchChain, useSendTransaction, useWaitForTransactionReceipt, WagmiProvider, useDisconnect } from "wagmi";
|
|
8
8
|
import { QueryClientProvider, QueryClient } from "@tanstack/react-query";
|
|
9
|
-
import { s as sdkAnalytics, c as clarityAnalytics, d as dist, a as Buffer2, B as Buffer$1, g as getCurrencyInfo, p as prefetchRates, i as isSupportedCurrency, b as convertToUSD, f as formatCurrency } from "./index-
|
|
9
|
+
import { s as sdkAnalytics, c as clarityAnalytics, d as dist, a as Buffer2, B as Buffer$1, g as getCurrencyInfo, p as prefetchRates, i as isSupportedCurrency, b as convertToUSD, f as formatCurrency } from "./index-TmTTxz2j.js";
|
|
10
10
|
import { createConfig, fallback, http, getAccount as getAccount$1, getWalletClient, simulateContract, writeContract, readContract, waitForTransactionReceipt, estimateFeesPerGas as estimateFeesPerGas$1 } from "@wagmi/core";
|
|
11
11
|
import { injected, metaMask, coinbaseWallet, walletConnect } from "@wagmi/connectors";
|
|
12
12
|
import { defineChain as defineChain$1, erc20Abi, http as http$1, createPublicClient, fallback as fallback$1 } from "viem";
|
|
@@ -21126,7 +21126,7 @@ const WalletSelector = ({
|
|
|
21126
21126
|
try {
|
|
21127
21127
|
setAppKitError(null);
|
|
21128
21128
|
setWalletConnectAddress(solanaAccountState.address);
|
|
21129
|
-
const { createWalletConnectAdapter } = await import("./appKitSolana-
|
|
21129
|
+
const { createWalletConnectAdapter } = await import("./appKitSolana-bPi9q207.js");
|
|
21130
21130
|
const adapter = createWalletConnectAdapter(solanaAccountState.address);
|
|
21131
21131
|
await solanaWallet.connectWalletConnect(adapter, solanaAccountState.address);
|
|
21132
21132
|
console.log("✅ WalletConnect synced with SDK");
|
|
@@ -21231,7 +21231,7 @@ const WalletSelector = ({
|
|
|
21231
21231
|
setAppKitLoading(true);
|
|
21232
21232
|
setAppKitError(null);
|
|
21233
21233
|
try {
|
|
21234
|
-
const { initializeAppKitEVM, openAppKitModal } = await import("./appKitEVM-
|
|
21234
|
+
const { initializeAppKitEVM, openAppKitModal } = await import("./appKitEVM-xLzaRFEg.js");
|
|
21235
21235
|
await initializeAppKitEVM(wagmiConfig);
|
|
21236
21236
|
await openAppKitModal();
|
|
21237
21237
|
} catch (error) {
|
|
@@ -21251,7 +21251,7 @@ const WalletSelector = ({
|
|
|
21251
21251
|
setAppKitError(null);
|
|
21252
21252
|
try {
|
|
21253
21253
|
console.log("📦 Loading AppKit Solana module...");
|
|
21254
|
-
const { initializeAppKitSolana } = await import("./appKitSolana-
|
|
21254
|
+
const { initializeAppKitSolana } = await import("./appKitSolana-bPi9q207.js");
|
|
21255
21255
|
console.log("✅ Module loaded, initializing...");
|
|
21256
21256
|
const modal = await initializeAppKitSolana(solanaWallet);
|
|
21257
21257
|
console.log("✅ AppKit Solana initialized successfully");
|
|
@@ -26367,22 +26367,41 @@ const CoinleyPaymentInternal = ({
|
|
|
26367
26367
|
if ((status === "completed" || status === "swept") && txHash) {
|
|
26368
26368
|
console.log("✅ Auto-detected: Deposit payment completed!");
|
|
26369
26369
|
clearInterval(pollInterval);
|
|
26370
|
-
captureOffsetSuccessDetails(statusResult.payment, txHash);
|
|
26371
26370
|
clearUnderpaymentRecovery(paymentData.id);
|
|
26372
26371
|
persistSuccessfulPaymentHash(statusResult.payment, txHash);
|
|
26373
|
-
|
|
26372
|
+
const rawPmt = statusResult.payment;
|
|
26373
|
+
const rcvd = parseFloat(rawPmt.amountReceived || 0);
|
|
26374
|
+
const expd = parseFloat(rawPmt.amount || 0);
|
|
26375
|
+
const isOverpaid = rawPmt.refundReason === "overpaid_excess" || rawPmt.excessOwed != null || rcvd > 0 && expd > 0 && rcvd > expd;
|
|
26374
26376
|
sdkAnalytics.trackPaymentSuccess(paymentData.id, config == null ? void 0 : config.amount, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, txHash);
|
|
26375
26377
|
clarityAnalytics.trackPaymentSuccess(paymentData.id, config == null ? void 0 : config.amount, selectedNetwork == null ? void 0 : selectedNetwork.shortName, selectedToken == null ? void 0 : selectedToken.symbol, txHash);
|
|
26376
26378
|
if (onSuccess) {
|
|
26377
26379
|
onSuccess({
|
|
26378
26380
|
paymentId: paymentData.id,
|
|
26379
26381
|
transactionHash: txHash,
|
|
26380
|
-
depositAddress:
|
|
26382
|
+
depositAddress: rawPmt.depositAddress,
|
|
26381
26383
|
network: selectedNetwork == null ? void 0 : selectedNetwork.shortName,
|
|
26382
26384
|
currency: selectedToken == null ? void 0 : selectedToken.symbol,
|
|
26383
|
-
paymentDetails:
|
|
26385
|
+
paymentDetails: rawPmt
|
|
26384
26386
|
});
|
|
26385
26387
|
}
|
|
26388
|
+
if (isOverpaid) {
|
|
26389
|
+
const excessStr = rawPmt.excessOwed != null ? rawPmt.excessOwed : rcvd > 0 && expd > 0 ? String((rcvd - expd).toFixed(6)) : null;
|
|
26390
|
+
setOverpaymentInfo({
|
|
26391
|
+
paymentId: paymentData.id,
|
|
26392
|
+
excessOwed: excessStr,
|
|
26393
|
+
tokenSymbol: rawPmt.currency || (selectedToken == null ? void 0 : selectedToken.symbol) || "tokens",
|
|
26394
|
+
networkLabel: (selectedNetwork == null ? void 0 : selectedNetwork.displayName) || (selectedNetwork == null ? void 0 : selectedNetwork.name) || (selectedNetwork == null ? void 0 : selectedNetwork.shortName) || "the deposit network"
|
|
26395
|
+
});
|
|
26396
|
+
setRefundAddress("");
|
|
26397
|
+
setRefundRequestStatus(null);
|
|
26398
|
+
setRefundRequestSubmitted(false);
|
|
26399
|
+
setRefundRequestMessage("");
|
|
26400
|
+
refundPendingStartedAt.current = 0;
|
|
26401
|
+
} else {
|
|
26402
|
+
captureOffsetSuccessDetails(rawPmt, txHash);
|
|
26403
|
+
}
|
|
26404
|
+
setCurrentStep(PAYMENT_STEPS.SUCCESS);
|
|
26386
26405
|
return;
|
|
26387
26406
|
}
|
|
26388
26407
|
if (activateUnderpaymentFlow(statusResult.payment)) {
|
|
@@ -28448,4 +28467,4 @@ export {
|
|
|
28448
28467
|
chainTransports as c,
|
|
28449
28468
|
isFeatureEnabled as i
|
|
28450
28469
|
};
|
|
28451
|
-
//# sourceMappingURL=CoinleyPayment-
|
|
28470
|
+
//# sourceMappingURL=CoinleyPayment-DpJjSgAk.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as isFeatureEnabled, F as FEATURES, c as chainTransports, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-
|
|
1
|
+
import { i as isFeatureEnabled, F as FEATURES, c as chainTransports, W as WALLETCONNECT_PROJECT_ID } from "./CoinleyPayment-DpJjSgAk.js";
|
|
2
2
|
const logo = "https://coinley.io/logo.png";
|
|
3
3
|
let appKitInstance = null;
|
|
4
4
|
let isInitializing = false;
|
|
@@ -113,4 +113,4 @@ export {
|
|
|
113
113
|
initializeAppKitEVM,
|
|
114
114
|
openAppKitModal
|
|
115
115
|
};
|
|
116
|
-
//# sourceMappingURL=appKitEVM-
|
|
116
|
+
//# sourceMappingURL=appKitEVM-xLzaRFEg.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-DpJjSgAk.js";
|
|
2
2
|
const logo = "https://coinley.io/logo.png";
|
|
3
3
|
let appKitInstance = null;
|
|
4
4
|
let isInitializing = false;
|
|
@@ -243,4 +243,4 @@ export {
|
|
|
243
243
|
disconnectWalletConnect,
|
|
244
244
|
initializeAppKitSolana
|
|
245
245
|
};
|
|
246
|
-
//# sourceMappingURL=appKitSolana-
|
|
246
|
+
//# sourceMappingURL=appKitSolana-bPi9q207.js.map
|