coinley-pay 0.47.0 → 0.49.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-kt3eOJlB.js → CoinleyPayment-C7JQcQGP.js} +38 -10
- package/dist/{appKitEVM-CA1A3oZb.js → appKitEVM-Bm9fbB-H.js} +2 -2
- package/dist/{appKitSolana-mYWu1Cjx.js → appKitSolana-ClunNFLF.js} +2 -2
- package/dist/coinley-vanilla.min.js +1 -1
- package/dist/{index-DEozbpiN.js → index-BKwDoo1D.js} +3 -3
- package/dist/{index-C00n-j2g.js → index-VxEuNaK3.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-BKwDoo1D.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-ClunNFLF.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-Bm9fbB-H.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-ClunNFLF.js");
|
|
21251
21251
|
console.log("✅ Module loaded, initializing...");
|
|
21252
21252
|
const modal = await initializeAppKitSolana(solanaWallet);
|
|
21253
21253
|
console.log("✅ AppKit Solana initialized successfully");
|
|
@@ -23458,6 +23458,17 @@ const CoinleyPaymentInternal = ({
|
|
|
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
23460
|
const merchantReceiveNetworks = (merchantNetworks == null ? void 0 : merchantNetworks.length) ? merchantNetworks : networks;
|
|
23461
|
+
const isConfiguredMerchantReceiveNetwork = useCallback((network) => {
|
|
23462
|
+
var _a2;
|
|
23463
|
+
const shortName = (_a2 = network == null ? void 0 : network.shortName) == null ? void 0 : _a2.toLowerCase();
|
|
23464
|
+
if (!shortName) return false;
|
|
23465
|
+
return (merchantNetworks || []).some(
|
|
23466
|
+
(merchantNetwork) => {
|
|
23467
|
+
var _a3;
|
|
23468
|
+
return ((_a3 = merchantNetwork == null ? void 0 : merchantNetwork.shortName) == null ? void 0 : _a3.toLowerCase()) === shortName;
|
|
23469
|
+
}
|
|
23470
|
+
);
|
|
23471
|
+
}, [merchantNetworks]);
|
|
23461
23472
|
const isMerchantReceiveNetwork = useCallback((network) => {
|
|
23462
23473
|
var _a2;
|
|
23463
23474
|
const shortName = (_a2 = network == null ? void 0 : network.shortName) == null ? void 0 : _a2.toLowerCase();
|
|
@@ -25282,7 +25293,16 @@ const CoinleyPaymentInternal = ({
|
|
|
25282
25293
|
try {
|
|
25283
25294
|
const status = await paymentFlow.api.getCrossChainStatus(ccResult.id);
|
|
25284
25295
|
setCcPhase(status.phase);
|
|
25285
|
-
if (
|
|
25296
|
+
if (status.refundStatus === "refunded") {
|
|
25297
|
+
finishRecoveryLoading(() => {
|
|
25298
|
+
ccSucceeded.current = true;
|
|
25299
|
+
setRefundRequestStatus("refunded");
|
|
25300
|
+
setRefundRequestMessage("");
|
|
25301
|
+
captureRefundSuccessDetails(status, status.refundTxHash, status.refundRecipient || refundAddress.trim());
|
|
25302
|
+
clearUnderpaymentRecovery(status.paymentId || ccResult.id);
|
|
25303
|
+
setCurrentStep(PAYMENT_STEPS.SUCCESS);
|
|
25304
|
+
});
|
|
25305
|
+
} else if (activateUnderpaymentFromCrossChainStatus(status)) {
|
|
25286
25306
|
if (isOffsetRecovery) {
|
|
25287
25307
|
setCcManualCheckStatus("not_found");
|
|
25288
25308
|
holdRecoveryLoading("offset", getOffsetWaitingStatus());
|
|
@@ -25332,13 +25352,21 @@ const CoinleyPaymentInternal = ({
|
|
|
25332
25352
|
if (!(ccResult == null ? void 0 : ccResult.id)) return;
|
|
25333
25353
|
let cancelled = false;
|
|
25334
25354
|
const tick = async () => {
|
|
25355
|
+
if (ccSucceeded.current) return;
|
|
25335
25356
|
if (ccStatusPollInFlight.current) return;
|
|
25336
25357
|
ccStatusPollInFlight.current = true;
|
|
25337
25358
|
try {
|
|
25338
25359
|
const s = await paymentFlow.api.getCrossChainStatus(ccResult.id);
|
|
25339
25360
|
if (cancelled) return;
|
|
25340
25361
|
setCcPhase(s.phase);
|
|
25341
|
-
if (
|
|
25362
|
+
if (s.refundStatus === "refunded") {
|
|
25363
|
+
ccSucceeded.current = true;
|
|
25364
|
+
setRefundRequestStatus("refunded");
|
|
25365
|
+
setRefundRequestMessage("");
|
|
25366
|
+
captureRefundSuccessDetails(s, s.refundTxHash, s.refundRecipient || refundAddress.trim());
|
|
25367
|
+
clearUnderpaymentRecovery(s.paymentId || ccResult.id);
|
|
25368
|
+
setCurrentStep(PAYMENT_STEPS.SUCCESS);
|
|
25369
|
+
} else if (activateUnderpaymentFromCrossChainStatus(s)) {
|
|
25342
25370
|
setCcManualCheckStatus(null);
|
|
25343
25371
|
} else if (s.phase === "bridging") {
|
|
25344
25372
|
clearUnderpaymentUiState(s.paymentId || ccResult.id);
|
|
@@ -25357,7 +25385,7 @@ const CoinleyPaymentInternal = ({
|
|
|
25357
25385
|
cancelled = true;
|
|
25358
25386
|
clearInterval(t);
|
|
25359
25387
|
};
|
|
25360
|
-
}, [activateUnderpaymentFromCrossChainStatus, ccResult == null ? void 0 : ccResult.id, clearUnderpaymentUiState, onSuccess, paymentFlow.api]);
|
|
25388
|
+
}, [activateUnderpaymentFromCrossChainStatus, captureRefundSuccessDetails, ccResult == null ? void 0 : ccResult.id, clearUnderpaymentRecovery, clearUnderpaymentUiState, onSuccess, paymentFlow.api, refundAddress]);
|
|
25361
25389
|
const handleGenerateTransferAddress = async () => {
|
|
25362
25390
|
if (isConverting) {
|
|
25363
25391
|
setError("Please wait for currency conversion to complete");
|
|
@@ -26592,7 +26620,7 @@ const CoinleyPaymentInternal = ({
|
|
|
26592
26620
|
const hasDirectTransferNetworks = networks.some((network) => {
|
|
26593
26621
|
const chainId = parseInt(network.chainId);
|
|
26594
26622
|
const supportedChains = [8453, 56, 42161, 137, 10, 43114, 143, 59144, 534352, 130];
|
|
26595
|
-
return supportedChains.includes(chainId);
|
|
26623
|
+
return supportedChains.includes(chainId) && isConfiguredMerchantReceiveNetwork(network);
|
|
26596
26624
|
});
|
|
26597
26625
|
const isCrossChainTransferSetupView = activeTab === PAYMENT_TABS.TRANSFER && !ccResult && !(paymentData == null ? void 0 : paymentData.depositAddress) && !hasDirectTransferNetworks;
|
|
26598
26626
|
const isCrossChainTransferAddressView = activeTab === PAYMENT_TABS.TRANSFER && !!ccResult;
|
|
@@ -26765,7 +26793,7 @@ const CoinleyPaymentInternal = ({
|
|
|
26765
26793
|
const directTransferNetworks = networks.filter((network) => {
|
|
26766
26794
|
const chainId = parseInt(network.chainId);
|
|
26767
26795
|
const supportedChains = [8453, 56, 42161, 137, 10, 43114, 143, 59144, 534352, 130];
|
|
26768
|
-
return supportedChains.includes(chainId);
|
|
26796
|
+
return supportedChains.includes(chainId) && isConfiguredMerchantReceiveNetwork(network);
|
|
26769
26797
|
});
|
|
26770
26798
|
const directTransferChainIds = new Set(directTransferNetworks.map((network) => Number(network.chainId)));
|
|
26771
26799
|
const crossChainSourceNetworks = ccSources.filter((source) => !directTransferChainIds.has(Number(source.chainId))).map((source) => {
|
|
@@ -28014,4 +28042,4 @@ export {
|
|
|
28014
28042
|
chainTransports as c,
|
|
28015
28043
|
isFeatureEnabled as i
|
|
28016
28044
|
};
|
|
28017
|
-
//# sourceMappingURL=CoinleyPayment-
|
|
28045
|
+
//# sourceMappingURL=CoinleyPayment-C7JQcQGP.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-C7JQcQGP.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-Bm9fbB-H.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-C7JQcQGP.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-ClunNFLF.js.map
|