coinley-pay 0.22.0 → 0.23.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-pbTQ15wF.js → CoinleyPayment-Cl3PzsxC.js} +90 -35
- package/dist/{appKitEVM-Bs-au6VA.js → appKitEVM-BDZw0_fy.js} +2 -2
- package/dist/{appKitSolana-KE60037B.js → appKitSolana-CKJ3gWw5.js} +2 -2
- package/dist/coinley-vanilla.min.js +576 -576
- package/dist/{index-Y4crJwqS.js → index-BElt06nj.js} +3 -3
- package/dist/{index-BLIQ06qE.js → index-OSKXr_YB.js} +3 -3
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +7 -7
- 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-OSKXr_YB.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";
|
|
@@ -2123,6 +2123,13 @@ class SimplePaymentAPI {
|
|
|
2123
2123
|
};
|
|
2124
2124
|
}
|
|
2125
2125
|
}
|
|
2126
|
+
async getPayableNetworks() {
|
|
2127
|
+
try {
|
|
2128
|
+
return await this.request("/api/networks/payable");
|
|
2129
|
+
} catch (error) {
|
|
2130
|
+
return this.getNetworks();
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2126
2133
|
async getTokens() {
|
|
2127
2134
|
try {
|
|
2128
2135
|
return await this.request("/api/networks/stablecoins");
|
|
@@ -2285,6 +2292,13 @@ class SimplePaymentAPI {
|
|
|
2285
2292
|
};
|
|
2286
2293
|
}
|
|
2287
2294
|
}
|
|
2295
|
+
async getPayableTokens() {
|
|
2296
|
+
try {
|
|
2297
|
+
return await this.request("/api/networks/payable/stablecoins");
|
|
2298
|
+
} catch (error) {
|
|
2299
|
+
return this.getTokens();
|
|
2300
|
+
}
|
|
2301
|
+
}
|
|
2288
2302
|
async createPayment(data) {
|
|
2289
2303
|
return await this.request("/api/payments/create", {
|
|
2290
2304
|
method: "POST",
|
|
@@ -2552,7 +2566,9 @@ const getBridgeTokenAddress = (symbol, bridgeTokens) => {
|
|
|
2552
2566
|
const usePaymentFlow = (apiUrl, apiKey, apiSecret) => {
|
|
2553
2567
|
const [currentStep, setCurrentStep] = useState("method");
|
|
2554
2568
|
const [networks, setNetworks] = useState([]);
|
|
2569
|
+
const [merchantNetworks, setMerchantNetworks] = useState([]);
|
|
2555
2570
|
const [tokens, setTokens] = useState([]);
|
|
2571
|
+
const [merchantTokens, setMerchantTokens] = useState([]);
|
|
2556
2572
|
const [selectedNetwork, setSelectedNetwork] = useState(null);
|
|
2557
2573
|
const [selectedToken, setSelectedToken] = useState(null);
|
|
2558
2574
|
const [paymentMethod, setPaymentMethod] = useState(null);
|
|
@@ -2568,18 +2584,19 @@ const usePaymentFlow = (apiUrl, apiKey, apiSecret) => {
|
|
|
2568
2584
|
const [bridgeDestination, setBridgeDestination] = useState(null);
|
|
2569
2585
|
const api = useRef(new SimplePaymentAPI(apiUrl, apiKey, apiSecret));
|
|
2570
2586
|
const loadData = async () => {
|
|
2571
|
-
var _a, _b;
|
|
2572
2587
|
try {
|
|
2573
2588
|
setLoading(true);
|
|
2574
2589
|
setError("");
|
|
2575
|
-
const [
|
|
2590
|
+
const [merchantNetworksRes, merchantTokensRes, payableNetworksRes, payableTokensRes] = await Promise.all([
|
|
2576
2591
|
api.current.getNetworks(),
|
|
2577
|
-
api.current.getTokens()
|
|
2592
|
+
api.current.getTokens(),
|
|
2593
|
+
api.current.getPayableNetworks ? api.current.getPayableNetworks() : api.current.getNetworks(),
|
|
2594
|
+
api.current.getPayableTokens ? api.current.getPayableTokens() : api.current.getTokens()
|
|
2578
2595
|
]);
|
|
2579
2596
|
const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
|
2580
2597
|
typeof navigator !== "undefined" ? navigator.userAgent : ""
|
|
2581
2598
|
);
|
|
2582
|
-
const
|
|
2599
|
+
const normalizeNetworks = (networkList = []) => networkList.reduce((acc, network) => {
|
|
2583
2600
|
if (network.shortName === "tron" || network.shortName === "algorand") {
|
|
2584
2601
|
return acc;
|
|
2585
2602
|
}
|
|
@@ -2603,14 +2620,16 @@ const usePaymentFlow = (apiUrl, apiKey, apiSecret) => {
|
|
|
2603
2620
|
acc.push(network);
|
|
2604
2621
|
}
|
|
2605
2622
|
return acc;
|
|
2606
|
-
}, [])
|
|
2607
|
-
const
|
|
2608
|
-
|
|
2623
|
+
}, []);
|
|
2624
|
+
const uniqueNetworks = normalizeNetworks(payableNetworksRes.networks || merchantNetworksRes.networks || []);
|
|
2625
|
+
const uniqueMerchantNetworks = normalizeNetworks(merchantNetworksRes.networks || []);
|
|
2626
|
+
const normalizeTokens = (tokenList = []) => tokenList.reduce((acc, token) => {
|
|
2627
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
2609
2628
|
const allowedTokens = ["USDC", "USDT", "SOL"];
|
|
2610
2629
|
if (!allowedTokens.includes(token.symbol)) {
|
|
2611
2630
|
return acc;
|
|
2612
2631
|
}
|
|
2613
|
-
if (((
|
|
2632
|
+
if (((_a = token.Network) == null ? void 0 : _a.shortName) === "tron" || ((_b = token.Network) == null ? void 0 : _b.shortName) === "algorand") {
|
|
2614
2633
|
return acc;
|
|
2615
2634
|
}
|
|
2616
2635
|
if (((_c = token.Network) == null ? void 0 : _c.shortName) === "arbitrum-nova" || parseInt((_d = token.Network) == null ? void 0 : _d.chainId) === 42170) {
|
|
@@ -2622,29 +2641,33 @@ const usePaymentFlow = (apiUrl, apiKey, apiSecret) => {
|
|
|
2622
2641
|
}
|
|
2623
2642
|
const key = `${token.symbol}-${((_g = token.Network) == null ? void 0 : _g.shortName) || token.networkId}`;
|
|
2624
2643
|
if (!acc.some((t) => {
|
|
2625
|
-
var
|
|
2626
|
-
return `${t.symbol}-${((
|
|
2644
|
+
var _a2;
|
|
2645
|
+
return `${t.symbol}-${((_a2 = t.Network) == null ? void 0 : _a2.shortName) || t.networkId}` === key;
|
|
2627
2646
|
})) {
|
|
2628
2647
|
acc.push(token);
|
|
2629
2648
|
}
|
|
2630
2649
|
return acc;
|
|
2631
|
-
}, [])
|
|
2650
|
+
}, []);
|
|
2651
|
+
const uniqueTokens = normalizeTokens(payableTokensRes.stablecoins || merchantTokensRes.stablecoins || []);
|
|
2652
|
+
const uniqueMerchantTokens = normalizeTokens(merchantTokensRes.stablecoins || []);
|
|
2632
2653
|
setNetworks(uniqueNetworks);
|
|
2654
|
+
setMerchantNetworks(uniqueMerchantNetworks);
|
|
2633
2655
|
setTokens(uniqueTokens);
|
|
2634
|
-
|
|
2656
|
+
setMerchantTokens(uniqueMerchantTokens);
|
|
2657
|
+
loadBridgeNetworks(uniqueMerchantNetworks);
|
|
2635
2658
|
} catch (err) {
|
|
2636
2659
|
setError("Failed to load payment options. Using fallback data.");
|
|
2637
2660
|
} finally {
|
|
2638
2661
|
setLoading(false);
|
|
2639
2662
|
}
|
|
2640
2663
|
};
|
|
2641
|
-
const loadBridgeNetworks = async (
|
|
2664
|
+
const loadBridgeNetworks = async (merchantNetworks2) => {
|
|
2642
2665
|
try {
|
|
2643
2666
|
const merchantChainIds = new Set(
|
|
2644
|
-
|
|
2667
|
+
merchantNetworks2.filter((n) => n.chainId && n.shortName !== "solana" && n.chainType !== "solana").map((n) => parseInt(n.chainId))
|
|
2645
2668
|
);
|
|
2646
2669
|
if (merchantChainIds.size === 0) return;
|
|
2647
|
-
const bestDest = getBestDestinationChain(
|
|
2670
|
+
const bestDest = getBestDestinationChain(merchantNetworks2);
|
|
2648
2671
|
if (!bestDest) return;
|
|
2649
2672
|
const destChainId = parseInt(bestDest.chainId);
|
|
2650
2673
|
const destBridgeTokens = getKnownBridgeTokens(destChainId);
|
|
@@ -2915,14 +2938,14 @@ const usePaymentFlow = (apiUrl, apiKey, apiSecret) => {
|
|
|
2915
2938
|
const getMerchantStablecoin = (network) => {
|
|
2916
2939
|
const networkShortName = network == null ? void 0 : network.shortName;
|
|
2917
2940
|
if (!networkShortName) return null;
|
|
2918
|
-
const usdc =
|
|
2941
|
+
const usdc = merchantTokens.find(
|
|
2919
2942
|
(t) => {
|
|
2920
2943
|
var _a;
|
|
2921
2944
|
return t.symbol === "USDC" && ((_a = t.Network) == null ? void 0 : _a.shortName) === networkShortName && !t.isSwapToken;
|
|
2922
2945
|
}
|
|
2923
2946
|
);
|
|
2924
2947
|
if (usdc) return usdc;
|
|
2925
|
-
const usdt =
|
|
2948
|
+
const usdt = merchantTokens.find(
|
|
2926
2949
|
(t) => {
|
|
2927
2950
|
var _a;
|
|
2928
2951
|
return t.symbol === "USDT" && ((_a = t.Network) == null ? void 0 : _a.shortName) === networkShortName && !t.isSwapToken;
|
|
@@ -2962,7 +2985,9 @@ const usePaymentFlow = (apiUrl, apiKey, apiSecret) => {
|
|
|
2962
2985
|
// State
|
|
2963
2986
|
currentStep,
|
|
2964
2987
|
networks,
|
|
2988
|
+
merchantNetworks,
|
|
2965
2989
|
tokens,
|
|
2990
|
+
merchantTokens,
|
|
2966
2991
|
selectedNetwork,
|
|
2967
2992
|
selectedToken,
|
|
2968
2993
|
paymentMethod,
|
|
@@ -21095,7 +21120,7 @@ const WalletSelector = ({
|
|
|
21095
21120
|
try {
|
|
21096
21121
|
setAppKitError(null);
|
|
21097
21122
|
setWalletConnectAddress(solanaAccountState.address);
|
|
21098
|
-
const { createWalletConnectAdapter } = await import("./appKitSolana-
|
|
21123
|
+
const { createWalletConnectAdapter } = await import("./appKitSolana-CKJ3gWw5.js");
|
|
21099
21124
|
const adapter = createWalletConnectAdapter(solanaAccountState.address);
|
|
21100
21125
|
await solanaWallet.connectWalletConnect(adapter, solanaAccountState.address);
|
|
21101
21126
|
console.log("✅ WalletConnect synced with SDK");
|
|
@@ -21200,7 +21225,7 @@ const WalletSelector = ({
|
|
|
21200
21225
|
setAppKitLoading(true);
|
|
21201
21226
|
setAppKitError(null);
|
|
21202
21227
|
try {
|
|
21203
|
-
const { initializeAppKitEVM, openAppKitModal } = await import("./appKitEVM-
|
|
21228
|
+
const { initializeAppKitEVM, openAppKitModal } = await import("./appKitEVM-BDZw0_fy.js");
|
|
21204
21229
|
await initializeAppKitEVM(wagmiConfig);
|
|
21205
21230
|
await openAppKitModal();
|
|
21206
21231
|
} catch (error) {
|
|
@@ -21220,7 +21245,7 @@ const WalletSelector = ({
|
|
|
21220
21245
|
setAppKitError(null);
|
|
21221
21246
|
try {
|
|
21222
21247
|
console.log("📦 Loading AppKit Solana module...");
|
|
21223
|
-
const { initializeAppKitSolana } = await import("./appKitSolana-
|
|
21248
|
+
const { initializeAppKitSolana } = await import("./appKitSolana-CKJ3gWw5.js");
|
|
21224
21249
|
console.log("✅ Module loaded, initializing...");
|
|
21225
21250
|
const modal = await initializeAppKitSolana(solanaWallet);
|
|
21226
21251
|
console.log("✅ AppKit Solana initialized successfully");
|
|
@@ -23331,6 +23356,7 @@ const CoinleyPaymentInternal = ({
|
|
|
23331
23356
|
const {
|
|
23332
23357
|
currentStep,
|
|
23333
23358
|
networks,
|
|
23359
|
+
merchantNetworks,
|
|
23334
23360
|
tokens,
|
|
23335
23361
|
selectedNetwork,
|
|
23336
23362
|
selectedToken,
|
|
@@ -23354,6 +23380,18 @@ const CoinleyPaymentInternal = ({
|
|
|
23354
23380
|
setIsBridgePayment,
|
|
23355
23381
|
setBridgeDestination
|
|
23356
23382
|
} = paymentFlow;
|
|
23383
|
+
const merchantReceiveNetworks = (merchantNetworks == null ? void 0 : merchantNetworks.length) ? merchantNetworks : networks;
|
|
23384
|
+
const isMerchantReceiveNetwork = useCallback((network) => {
|
|
23385
|
+
var _a2;
|
|
23386
|
+
const shortName = (_a2 = network == null ? void 0 : network.shortName) == null ? void 0 : _a2.toLowerCase();
|
|
23387
|
+
if (!shortName) return false;
|
|
23388
|
+
return (merchantReceiveNetworks || []).some(
|
|
23389
|
+
(merchantNetwork) => {
|
|
23390
|
+
var _a3;
|
|
23391
|
+
return ((_a3 = merchantNetwork == null ? void 0 : merchantNetwork.shortName) == null ? void 0 : _a3.toLowerCase()) === shortName;
|
|
23392
|
+
}
|
|
23393
|
+
);
|
|
23394
|
+
}, [merchantReceiveNetworks]);
|
|
23357
23395
|
const {
|
|
23358
23396
|
connectedWallet,
|
|
23359
23397
|
address,
|
|
@@ -23383,7 +23421,11 @@ const CoinleyPaymentInternal = ({
|
|
|
23383
23421
|
const hasCommittedTransaction = Boolean(
|
|
23384
23422
|
currentTransactionHash || (solanaTransaction == null ? void 0 : solanaTransaction.txSignature) || (paymentData == null ? void 0 : paymentData.transactionHash)
|
|
23385
23423
|
);
|
|
23386
|
-
const
|
|
23424
|
+
const selectedNetworkIsSolana = (selectedNetwork == null ? void 0 : selectedNetwork.chainType) === "solana" || (selectedNetwork == null ? void 0 : selectedNetwork.shortName) === "solana";
|
|
23425
|
+
const sourceNeedsMerchantBridge = Boolean(
|
|
23426
|
+
selectedNetwork && !selectedNetworkIsSolana && !isMerchantReceiveNetwork(selectedNetwork)
|
|
23427
|
+
);
|
|
23428
|
+
const isSwapOrBridgeFlow = requiresDepositRouting(selectedNetwork, selectedToken) || sourceNeedsMerchantBridge;
|
|
23387
23429
|
const paymentTimeoutMs = isSwapOrBridgeFlow ? BRIDGE_PAYMENT_TIMEOUT_MS : STANDARD_PAYMENT_TIMEOUT_MS;
|
|
23388
23430
|
useEffect(() => {
|
|
23389
23431
|
if (hasCommittedTransaction) return;
|
|
@@ -23447,10 +23489,10 @@ const CoinleyPaymentInternal = ({
|
|
|
23447
23489
|
};
|
|
23448
23490
|
const STALE_ATTEMPT_MESSAGE = "Your payment quote changed while you were switching networks or tokens. Please try again.";
|
|
23449
23491
|
const UNSUPPORTED_ROUTE_MESSAGE = "This network is temporarily unavailable for this payment route. Try another token or network.";
|
|
23450
|
-
const getBridgeDestinationCandidates = (
|
|
23492
|
+
const getBridgeDestinationCandidates = (merchantNetworks2, originNetwork = null, limit = 3) => {
|
|
23451
23493
|
var _a2, _b;
|
|
23452
23494
|
const originShortName = (_a2 = originNetwork == null ? void 0 : originNetwork.shortName) == null ? void 0 : _a2.toLowerCase();
|
|
23453
|
-
const byShortName = new Map((
|
|
23495
|
+
const byShortName = new Map((merchantNetworks2 || []).filter((network) => network == null ? void 0 : network.shortName).map((network) => [network.shortName.toLowerCase(), network]));
|
|
23454
23496
|
const ordered = [];
|
|
23455
23497
|
for (const preferred of BRIDGE_DESTINATION_PRIORITY) {
|
|
23456
23498
|
const network = byShortName.get(preferred);
|
|
@@ -24325,15 +24367,16 @@ const CoinleyPaymentInternal = ({
|
|
|
24325
24367
|
const isSolanaSwap = (selectedNetwork == null ? void 0 : selectedNetwork.shortName) === "solana" || (selectedNetwork == null ? void 0 : selectedNetwork.chainType) === "solana";
|
|
24326
24368
|
const originChainId = isSolanaSwap ? RELAY_SOLANA_CHAIN_ID : parseInt(selectedNetwork.chainId);
|
|
24327
24369
|
const chainHasCreate2 = DEPOSIT_SUPPORTED_CHAINS.includes(originChainId);
|
|
24370
|
+
const sourceIsMerchantDestination = isMerchantReceiveNetwork(selectedNetwork);
|
|
24328
24371
|
let destChainId, merchantStable, destStablecoinAddress, destinationCandidates = null;
|
|
24329
|
-
if (chainHasCreate2) {
|
|
24372
|
+
if (chainHasCreate2 && sourceIsMerchantDestination) {
|
|
24330
24373
|
destChainId = originChainId;
|
|
24331
24374
|
merchantStable = paymentFlow.getMerchantStablecoin(selectedNetwork);
|
|
24332
24375
|
if (!merchantStable) return;
|
|
24333
24376
|
const destBridgeTokens = selectedNetwork.bridgeTokens || {};
|
|
24334
24377
|
destStablecoinAddress = getBridgeTokenAddress(merchantStable.symbol, destBridgeTokens) || merchantStable.contractAddress;
|
|
24335
24378
|
} else {
|
|
24336
|
-
destinationCandidates = getBridgeDestinationCandidates(
|
|
24379
|
+
destinationCandidates = getBridgeDestinationCandidates(merchantReceiveNetworks, selectedNetwork, 3);
|
|
24337
24380
|
if (destinationCandidates.length === 0) return;
|
|
24338
24381
|
console.log("[Swap] Cross-chain destination trials:", {
|
|
24339
24382
|
fromChain: originChainId,
|
|
@@ -24441,7 +24484,7 @@ const CoinleyPaymentInternal = ({
|
|
|
24441
24484
|
}
|
|
24442
24485
|
} else {
|
|
24443
24486
|
const originChainId = parseInt(selectedNetwork.chainId);
|
|
24444
|
-
const destinationCandidates = getBridgeDestinationCandidates(
|
|
24487
|
+
const destinationCandidates = getBridgeDestinationCandidates(merchantReceiveNetworks, selectedNetwork, 3);
|
|
24445
24488
|
if (destinationCandidates.length === 0 || !selectedToken.contractAddress || selectedToken.contractAddress === "native") return;
|
|
24446
24489
|
console.log("[Bridge] Cross-chain stablecoin destination trials:", {
|
|
24447
24490
|
token: selectedToken.symbol,
|
|
@@ -24461,7 +24504,18 @@ const CoinleyPaymentInternal = ({
|
|
|
24461
24504
|
logPrefix: "[Bridge]"
|
|
24462
24505
|
});
|
|
24463
24506
|
}
|
|
24464
|
-
}, [
|
|
24507
|
+
}, [
|
|
24508
|
+
selectedNetwork == null ? void 0 : selectedNetwork.id,
|
|
24509
|
+
selectedNetwork == null ? void 0 : selectedNetwork.shortName,
|
|
24510
|
+
selectedToken == null ? void 0 : selectedToken.id,
|
|
24511
|
+
address,
|
|
24512
|
+
solanaWallet == null ? void 0 : solanaWallet.publicKey,
|
|
24513
|
+
paymentAmount,
|
|
24514
|
+
retryEpoch,
|
|
24515
|
+
isSwapOrBridgeFlow,
|
|
24516
|
+
merchantReceiveNetworks,
|
|
24517
|
+
isMerchantReceiveNetwork
|
|
24518
|
+
]);
|
|
24465
24519
|
useEffect(() => {
|
|
24466
24520
|
if (!isSwapOrBridgeFlow || !(selectedToken == null ? void 0 : selectedToken.id) || relayBridge.bridgeStatus === "quoting") {
|
|
24467
24521
|
return;
|
|
@@ -24723,8 +24777,8 @@ const CoinleyPaymentInternal = ({
|
|
|
24723
24777
|
return;
|
|
24724
24778
|
}
|
|
24725
24779
|
} else if (connectedWalletType === "solana" && !merchantHasSolanaWallet) {
|
|
24726
|
-
const quotedDest = ((_e = relayBridge.bridgeQuote) == null ? void 0 : _e.destChainId) ?
|
|
24727
|
-
const bestDest = quotedDest || getBestDestinationChain(
|
|
24780
|
+
const quotedDest = ((_e = relayBridge.bridgeQuote) == null ? void 0 : _e.destChainId) ? merchantReceiveNetworks.find((network) => parseInt(network.chainId) === parseInt(relayBridge.bridgeQuote.destChainId)) : null;
|
|
24781
|
+
const bestDest = quotedDest || getBestDestinationChain(merchantReceiveNetworks);
|
|
24728
24782
|
const effectiveNetwork = (bestDest == null ? void 0 : bestDest.shortName) || "base";
|
|
24729
24783
|
console.log(`[Payment] Solana bridge: no Solana wallet, bridging to ${effectiveNetwork}`);
|
|
24730
24784
|
const depositConfig = {
|
|
@@ -24755,17 +24809,18 @@ const CoinleyPaymentInternal = ({
|
|
|
24755
24809
|
const DEPOSIT_SUPPORTED_CHAINS = [8453, 56, 42161, 137, 10, 43114, 143, 59144, 534352, 130];
|
|
24756
24810
|
const selectedChainId = parseInt(selectedNetwork == null ? void 0 : selectedNetwork.chainId);
|
|
24757
24811
|
const chainHasCreate2 = DEPOSIT_SUPPORTED_CHAINS.includes(selectedChainId);
|
|
24812
|
+
const sourceIsMerchantDestination = isMerchantReceiveNetwork(selectedNetwork);
|
|
24758
24813
|
let effectiveNetwork;
|
|
24759
24814
|
let merchantStable;
|
|
24760
24815
|
if (selectedNetwork == null ? void 0 : selectedNetwork.isBridgeNetwork) {
|
|
24761
24816
|
effectiveNetwork = (_g = selectedNetwork.bridgeDestination) == null ? void 0 : _g.shortName;
|
|
24762
24817
|
merchantStable = paymentFlow.getMerchantStablecoin({ shortName: effectiveNetwork });
|
|
24763
|
-
} else if (chainHasCreate2) {
|
|
24818
|
+
} else if (chainHasCreate2 && sourceIsMerchantDestination) {
|
|
24764
24819
|
effectiveNetwork = selectedNetwork.shortName;
|
|
24765
24820
|
merchantStable = paymentFlow.getMerchantStablecoin(selectedNetwork);
|
|
24766
24821
|
} else {
|
|
24767
|
-
const quotedDest = ((_h = relayBridge.bridgeQuote) == null ? void 0 : _h.destChainId) ?
|
|
24768
|
-
const bestDest = quotedDest || getBestDestinationChain(
|
|
24822
|
+
const quotedDest = ((_h = relayBridge.bridgeQuote) == null ? void 0 : _h.destChainId) ? merchantReceiveNetworks.find((network) => parseInt(network.chainId) === parseInt(relayBridge.bridgeQuote.destChainId)) : null;
|
|
24823
|
+
const bestDest = quotedDest || getBestDestinationChain(merchantReceiveNetworks);
|
|
24769
24824
|
effectiveNetwork = (bestDest == null ? void 0 : bestDest.shortName) || "base";
|
|
24770
24825
|
merchantStable = paymentFlow.getMerchantStablecoin(bestDest || { shortName: "base" });
|
|
24771
24826
|
console.log(`[Swap] Chain ${selectedChainId} has no CREATE2, bridging to ${effectiveNetwork}`);
|
|
@@ -24876,7 +24931,7 @@ const CoinleyPaymentInternal = ({
|
|
|
24876
24931
|
setCurrentStep(PAYMENT_STEPS.PROCESSING);
|
|
24877
24932
|
if ((activePaymentData == null ? void 0 : activePaymentData.isDepositPayment) && (activePaymentData == null ? void 0 : activePaymentData.depositAddress)) {
|
|
24878
24933
|
console.log("[Solana] Bridged payment — executing Relay Solana→EVM bridge");
|
|
24879
|
-
const bestDest = getBestDestinationChain(
|
|
24934
|
+
const bestDest = getBestDestinationChain(merchantReceiveNetworks);
|
|
24880
24935
|
const destChainId = bestDest ? parseInt(bestDest.chainId) : 8453;
|
|
24881
24936
|
const knownUSDC = {
|
|
24882
24937
|
8453: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
@@ -26649,4 +26704,4 @@ export {
|
|
|
26649
26704
|
isFeatureEnabled as i,
|
|
26650
26705
|
logo as l
|
|
26651
26706
|
};
|
|
26652
|
-
//# sourceMappingURL=CoinleyPayment-
|
|
26707
|
+
//# sourceMappingURL=CoinleyPayment-Cl3PzsxC.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-Cl3PzsxC.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-BDZw0_fy.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-Cl3PzsxC.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-CKJ3gWw5.js.map
|