coinley-pay 0.18.0 → 0.20.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-BRiKHFaK.js → CoinleyPayment-Bj4u9uQh.js} +82 -72
- package/dist/{appKitEVM-7klvcQWP.js → appKitEVM-jh6msvrg.js} +2 -2
- package/dist/{appKitSolana-COVsc1hI.js → appKitSolana-QAp0wzR5.js} +2 -2
- package/dist/coinley-vanilla.min.js +576 -576
- package/dist/{index-CJRf3v5i.js → index-BfkJtaex.js} +3 -3
- package/dist/{index-DjkvRRWK.js → index-YblNXa3i.js} +3 -3
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- 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-YblNXa3i.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";
|
|
@@ -20451,85 +20451,88 @@ const PaymentStatus = ({
|
|
|
20451
20451
|
] });
|
|
20452
20452
|
}
|
|
20453
20453
|
if (status === "success") {
|
|
20454
|
-
|
|
20455
|
-
|
|
20456
|
-
|
|
20457
|
-
|
|
20458
|
-
|
|
20459
|
-
|
|
20460
|
-
|
|
20461
|
-
|
|
20462
|
-
|
|
20463
|
-
|
|
20464
|
-
|
|
20454
|
+
const displayAmount = (payment == null ? void 0 : payment.totalAmount) || (payment == null ? void 0 : payment.amount) || (payment == null ? void 0 : payment.totalAmountUSD) || (payment == null ? void 0 : payment.amountUSD) || 0;
|
|
20455
|
+
const tokenSymbol = (selectedPaymentMethod == null ? void 0 : selectedPaymentMethod.symbol) || (selectedPaymentMethod == null ? void 0 : selectedPaymentMethod.currency) || (selectedPaymentMethod == null ? void 0 : selectedPaymentMethod.tokenSymbol) || (selectedPaymentMethod == null ? void 0 : selectedPaymentMethod.name) || "Token";
|
|
20456
|
+
const networkName = (selectedNetwork == null ? void 0 : selectedNetwork.name) || (selectedNetwork == null ? void 0 : selectedNetwork.displayName) || (selectedNetwork == null ? void 0 : selectedNetwork.shortName) || "Network";
|
|
20457
|
+
const explorerUrl = getExplorerUrl(transactionHash, selectedNetwork);
|
|
20458
|
+
const explorerName = getExplorerName(selectedNetwork);
|
|
20459
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative flex h-full w-full flex-col px-3 pb-0 pt-[84px]", children: [
|
|
20460
|
+
onClose && /* @__PURE__ */ jsx(
|
|
20461
|
+
"button",
|
|
20462
|
+
{
|
|
20463
|
+
type: "button",
|
|
20464
|
+
onClick: onClose,
|
|
20465
|
+
className: "absolute right-1 top-1 flex h-8 w-8 items-center justify-center rounded-full text-black transition-colors hover:bg-gray-100",
|
|
20466
|
+
"aria-label": "Close",
|
|
20467
|
+
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: "M6 18L18 6M6 6l12 12" }) })
|
|
20468
|
+
}
|
|
20469
|
+
),
|
|
20470
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center text-center", children: [
|
|
20471
|
+
/* @__PURE__ */ jsx("div", { className: "mb-3 flex h-16 w-16 items-center justify-center rounded-full bg-[#D8F8E7] p-2", children: /* @__PURE__ */ jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-full bg-[#0CCB63] text-white", 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.5, d: "M5 13l4 4L19 7" }) }) }) }),
|
|
20472
|
+
/* @__PURE__ */ jsx("h3", { className: "mb-3 text-base font-semibold text-black", children: "Payment Successful" }),
|
|
20473
|
+
/* @__PURE__ */ jsxs("p", { className: "mb-9 text-base text-[#A9ABB2]", children: [
|
|
20474
|
+
/* @__PURE__ */ jsxs("span", { className: "font-semibold text-black", children: [
|
|
20475
|
+
"$",
|
|
20476
|
+
Number(displayAmount || 0).toFixed(2)
|
|
20477
|
+
] }),
|
|
20478
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
20479
|
+
" sent to ",
|
|
20480
|
+
merchantName
|
|
20481
|
+
] })
|
|
20482
|
+
] })
|
|
20465
20483
|
] }),
|
|
20466
|
-
|
|
20467
|
-
/* @__PURE__ */ jsx("p", { className: "text-
|
|
20484
|
+
/* @__PURE__ */ jsxs("div", { className: "w-full", children: [
|
|
20485
|
+
/* @__PURE__ */ jsx("p", { className: "mb-1 text-xs font-medium text-[#4B5563]", children: "Transaction ID" }),
|
|
20468
20486
|
/* @__PURE__ */ jsxs(
|
|
20469
|
-
"
|
|
20487
|
+
"button",
|
|
20470
20488
|
{
|
|
20471
|
-
|
|
20489
|
+
type: "button",
|
|
20472
20490
|
onClick: copyTransactionHash,
|
|
20491
|
+
className: "mb-4 flex h-11 w-full items-center justify-between rounded-lg border border-[#EEF0F4] bg-[#FAFAFB] px-3 text-left transition-colors hover:bg-gray-100",
|
|
20473
20492
|
children: [
|
|
20474
|
-
/* @__PURE__ */ jsx("span", { className: "font-mono text-sm text-
|
|
20475
|
-
/* @__PURE__ */ jsxs("
|
|
20476
|
-
copiedHash
|
|
20477
|
-
/* @__PURE__ */ jsx(
|
|
20478
|
-
"svg",
|
|
20479
|
-
{
|
|
20480
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
20481
|
-
className: "h-4 w-4 text-gray-500",
|
|
20482
|
-
fill: "none",
|
|
20483
|
-
viewBox: "0 0 24 24",
|
|
20484
|
-
stroke: "currentColor",
|
|
20485
|
-
children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" })
|
|
20486
|
-
}
|
|
20487
|
-
)
|
|
20493
|
+
/* @__PURE__ */ jsx("span", { className: "font-mono text-sm font-semibold text-black", children: formatTransactionHash(transactionHash) }),
|
|
20494
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 text-black", children: [
|
|
20495
|
+
copiedHash && /* @__PURE__ */ jsx("span", { className: "text-xs font-medium text-[#0CCB63]", children: "Copied" }),
|
|
20496
|
+
/* @__PURE__ */ jsx("svg", { className: "h-5 w-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 1.7, d: "M8 7a2 2 0 012-2h8a2 2 0 012 2v8a2 2 0 01-2 2h-2M6 9H5a2 2 0 00-2 2v8a2 2 0 002 2h8a2 2 0 002-2v-1" }) })
|
|
20488
20497
|
] })
|
|
20489
20498
|
]
|
|
20490
20499
|
}
|
|
20491
20500
|
),
|
|
20492
|
-
(
|
|
20493
|
-
|
|
20494
|
-
|
|
20495
|
-
|
|
20496
|
-
|
|
20497
|
-
|
|
20498
|
-
|
|
20499
|
-
|
|
20500
|
-
|
|
20501
|
-
|
|
20502
|
-
|
|
20503
|
-
|
|
20504
|
-
|
|
20505
|
-
|
|
20506
|
-
|
|
20507
|
-
|
|
20508
|
-
|
|
20509
|
-
|
|
20510
|
-
|
|
20511
|
-
|
|
20512
|
-
|
|
20513
|
-
|
|
20514
|
-
|
|
20515
|
-
|
|
20516
|
-
|
|
20517
|
-
|
|
20518
|
-
)
|
|
20519
|
-
]
|
|
20520
|
-
}
|
|
20521
|
-
);
|
|
20522
|
-
})()
|
|
20501
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-0", children: [
|
|
20502
|
+
/* @__PURE__ */ jsxs("div", { className: "flex h-11 items-center justify-between border-b border-[#EEF0F4]", children: [
|
|
20503
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-[#A9ABB2]", children: "Network" }),
|
|
20504
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-black", children: networkName })
|
|
20505
|
+
] }),
|
|
20506
|
+
/* @__PURE__ */ jsxs("div", { className: "flex h-11 items-center justify-between border-b border-[#EEF0F4]", children: [
|
|
20507
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm text-[#A9ABB2]", children: "Token" }),
|
|
20508
|
+
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-black", children: tokenSymbol })
|
|
20509
|
+
] })
|
|
20510
|
+
] }),
|
|
20511
|
+
explorerUrl && /* @__PURE__ */ jsxs(
|
|
20512
|
+
"a",
|
|
20513
|
+
{
|
|
20514
|
+
href: explorerUrl,
|
|
20515
|
+
target: "_blank",
|
|
20516
|
+
rel: "noopener noreferrer",
|
|
20517
|
+
className: "mt-3 flex h-[43px] w-full items-center justify-center gap-2 rounded-lg border border-[#B997FF] bg-white text-sm font-semibold text-[#7042D2] transition-colors hover:bg-purple-50",
|
|
20518
|
+
children: [
|
|
20519
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
20520
|
+
"View on ",
|
|
20521
|
+
explorerName
|
|
20522
|
+
] }),
|
|
20523
|
+
/* @__PURE__ */ jsx("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" }) })
|
|
20524
|
+
]
|
|
20525
|
+
}
|
|
20526
|
+
)
|
|
20523
20527
|
] }),
|
|
20524
|
-
onClose && /* @__PURE__ */ jsx(
|
|
20528
|
+
onClose && /* @__PURE__ */ jsx("div", { className: "mt-auto pt-5", children: /* @__PURE__ */ jsx(
|
|
20525
20529
|
"button",
|
|
20526
20530
|
{
|
|
20527
20531
|
onClick: onClose,
|
|
20528
|
-
className: "w-full
|
|
20529
|
-
style: { fontFamily: "Gilroy-Medium, Gilroy-Regular, sans-serif" },
|
|
20532
|
+
className: "h-11 w-full rounded-lg bg-[#7042D2] px-4 text-base font-semibold text-white transition-colors hover:bg-[#5b34b1]",
|
|
20530
20533
|
children: "Close"
|
|
20531
20534
|
}
|
|
20532
|
-
)
|
|
20535
|
+
) })
|
|
20533
20536
|
] });
|
|
20534
20537
|
}
|
|
20535
20538
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center py-6", children: [
|
|
@@ -21120,7 +21123,7 @@ const WalletSelector = ({
|
|
|
21120
21123
|
try {
|
|
21121
21124
|
setAppKitError(null);
|
|
21122
21125
|
setWalletConnectAddress(solanaAccountState.address);
|
|
21123
|
-
const { createWalletConnectAdapter } = await import("./appKitSolana-
|
|
21126
|
+
const { createWalletConnectAdapter } = await import("./appKitSolana-QAp0wzR5.js");
|
|
21124
21127
|
const adapter = createWalletConnectAdapter(solanaAccountState.address);
|
|
21125
21128
|
await solanaWallet.connectWalletConnect(adapter, solanaAccountState.address);
|
|
21126
21129
|
console.log("✅ WalletConnect synced with SDK");
|
|
@@ -21225,7 +21228,7 @@ const WalletSelector = ({
|
|
|
21225
21228
|
setAppKitLoading(true);
|
|
21226
21229
|
setAppKitError(null);
|
|
21227
21230
|
try {
|
|
21228
|
-
const { initializeAppKitEVM, openAppKitModal } = await import("./appKitEVM-
|
|
21231
|
+
const { initializeAppKitEVM, openAppKitModal } = await import("./appKitEVM-jh6msvrg.js");
|
|
21229
21232
|
await initializeAppKitEVM(wagmiConfig);
|
|
21230
21233
|
await openAppKitModal();
|
|
21231
21234
|
} catch (error) {
|
|
@@ -21245,7 +21248,7 @@ const WalletSelector = ({
|
|
|
21245
21248
|
setAppKitError(null);
|
|
21246
21249
|
try {
|
|
21247
21250
|
console.log("📦 Loading AppKit Solana module...");
|
|
21248
|
-
const { initializeAppKitSolana } = await import("./appKitSolana-
|
|
21251
|
+
const { initializeAppKitSolana } = await import("./appKitSolana-QAp0wzR5.js");
|
|
21249
21252
|
console.log("✅ Module loaded, initializing...");
|
|
21250
21253
|
const modal = await initializeAppKitSolana(solanaWallet);
|
|
21251
21254
|
console.log("✅ AppKit Solana initialized successfully");
|
|
@@ -25822,7 +25825,7 @@ const CoinleyPaymentInternal = ({
|
|
|
25822
25825
|
if (currentStep === PAYMENT_STEPS.SUCCESS) {
|
|
25823
25826
|
return /* @__PURE__ */ jsxs("div", { id: SDK_ROOT_ID, className: `${SDK_ROOT_CLASS} fixed inset-0 z-50`, style: { fontFamily: FONT_FAMILY }, children: [
|
|
25824
25827
|
/* @__PURE__ */ jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50" }),
|
|
25825
|
-
/* @__PURE__ */ jsx("div", { className: isMobile ? "fixed inset-0 flex items-end" : "fixed inset-0 flex items-center justify-center p-4", style: { zIndex: 51 }, children: /* @__PURE__ */ jsx("div", { className: isMobile ? "
|
|
25828
|
+
/* @__PURE__ */ jsx("div", { className: isMobile ? "fixed inset-0 flex items-end" : "fixed inset-0 flex items-center justify-center p-4", style: { zIndex: 51 }, children: /* @__PURE__ */ jsx("div", { className: isMobile ? "relative flex w-full max-h-[92vh] flex-col overflow-y-auto rounded-t-[28px] bg-white px-4 pb-5 pt-5 animate-slide-up-sheet" : "relative flex h-[553px] w-[450px] max-w-[calc(100vw-32px)] flex-col overflow-hidden rounded-[28px] bg-white px-4 pb-5 pt-5", children: /* @__PURE__ */ jsx(
|
|
25826
25829
|
PaymentStatus,
|
|
25827
25830
|
{
|
|
25828
25831
|
status: "success",
|
|
@@ -26894,6 +26897,7 @@ const CoinleyPaymentInternal = ({
|
|
|
26894
26897
|
const isTransferAddressGenerated = activeTab === PAYMENT_TABS.TRANSFER && selectedNetwork && selectedToken && (paymentData == null ? void 0 : paymentData.depositAddress);
|
|
26895
26898
|
const isWalletReadyForPayment = isWalletExtensionReadyView;
|
|
26896
26899
|
const isWalletBackHeaderView = activeTab === PAYMENT_TABS.WALLET && showWalletConfirm;
|
|
26900
|
+
const isWalletTokenSelectionView = activeTab === PAYMENT_TABS.WALLET && selectedNetwork && !selectedToken && !showWalletConfirm && !(showMobileWalletPicker && isMobile);
|
|
26897
26901
|
const isQrPaymentActiveView = activeTab === PAYMENT_TABS.QR && qrWalletChoiceConfirmed;
|
|
26898
26902
|
const handleTransferAddressBack = async () => {
|
|
26899
26903
|
setPaymentData((prev) => {
|
|
@@ -26914,6 +26918,12 @@ const CoinleyPaymentInternal = ({
|
|
|
26914
26918
|
setSelectedToken(null);
|
|
26915
26919
|
setPaymentData(null);
|
|
26916
26920
|
};
|
|
26921
|
+
const handleWalletTokenSelectionBack = () => {
|
|
26922
|
+
setSelectedNetwork(null);
|
|
26923
|
+
setSelectedToken(null);
|
|
26924
|
+
setPaymentData(null);
|
|
26925
|
+
setWalletNetworkSearch("");
|
|
26926
|
+
};
|
|
26917
26927
|
const handleQrBack = () => {
|
|
26918
26928
|
setPaymentData(null);
|
|
26919
26929
|
setQrCodeDataUrl("");
|
|
@@ -26934,10 +26944,10 @@ const CoinleyPaymentInternal = ({
|
|
|
26934
26944
|
isMobile && /* @__PURE__ */ jsx("div", { className: "flex justify-center pt-3 pb-1 flex-shrink-0", children: /* @__PURE__ */ jsx("div", { className: "w-10 h-1 bg-gray-300 rounded-full" }) }),
|
|
26935
26945
|
/* @__PURE__ */ jsxs("div", { className: `flex min-h-0 flex-1 flex-col px-4 ${isTightWalletView ? "pb-2 pt-3" : "pb-4 pt-4"}`, children: [
|
|
26936
26946
|
/* @__PURE__ */ jsxs("div", { className: `${isTightWalletView ? "mb-3" : "mb-5"} flex items-center justify-between`, children: [
|
|
26937
|
-
isTransferAddressGenerated || isWalletReadyForPayment || isQrPaymentActiveView || isWalletBackHeaderView ? /* @__PURE__ */ jsx(
|
|
26947
|
+
isTransferAddressGenerated || isWalletReadyForPayment || isQrPaymentActiveView || isWalletBackHeaderView || isWalletTokenSelectionView ? /* @__PURE__ */ jsx(
|
|
26938
26948
|
"button",
|
|
26939
26949
|
{
|
|
26940
|
-
onClick: isTransferAddressGenerated ? handleTransferAddressBack : isQrPaymentActiveView ? handleQrBack : handleWalletReadyBack,
|
|
26950
|
+
onClick: isTransferAddressGenerated ? handleTransferAddressBack : isQrPaymentActiveView ? handleQrBack : isWalletTokenSelectionView ? handleWalletTokenSelectionBack : handleWalletReadyBack,
|
|
26941
26951
|
className: `${isTightWalletView ? "h-8 w-8" : "h-9 w-9"} flex items-center justify-center rounded-full border border-[#E5E7EB] text-[#111827] transition-colors hover:bg-gray-50`,
|
|
26942
26952
|
"aria-label": "Go back",
|
|
26943
26953
|
children: /* @__PURE__ */ jsx("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15 19l-7-7 7-7" }) })
|
|
@@ -26995,4 +27005,4 @@ export {
|
|
|
26995
27005
|
isFeatureEnabled as i,
|
|
26996
27006
|
logo as l
|
|
26997
27007
|
};
|
|
26998
|
-
//# sourceMappingURL=CoinleyPayment-
|
|
27008
|
+
//# sourceMappingURL=CoinleyPayment-Bj4u9uQh.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-Bj4u9uQh.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-jh6msvrg.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-Bj4u9uQh.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-QAp0wzR5.js.map
|