coinley-checkout 1.1.2 → 1.1.5
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.
|
@@ -19087,7 +19087,8 @@ const sendAlgorandAssetTransaction = (walletConnection, tokenConfig, toAddress,
|
|
|
19087
19087
|
let apiConfig = {
|
|
19088
19088
|
apiKey: null,
|
|
19089
19089
|
apiSecret: null,
|
|
19090
|
-
apiUrl:
|
|
19090
|
+
// apiUrl: 'https://coinleyserver-production.up.railway.app',
|
|
19091
|
+
apiUrl: "https://hub.coinley.io",
|
|
19091
19092
|
merchantWalletAddresses: {},
|
|
19092
19093
|
authToken: null,
|
|
19093
19094
|
merchantFeePercentage: null,
|
|
@@ -21257,32 +21258,85 @@ const PaymentMethods = ({ onSelect, selected, theme: theme2 = "light", supported
|
|
|
21257
21258
|
return iconMap[shortName] || EthIcon;
|
|
21258
21259
|
};
|
|
21259
21260
|
const getTokenIcon = (token) => {
|
|
21260
|
-
|
|
21261
|
-
|
|
21262
|
-
|
|
21263
|
-
|
|
21261
|
+
console.log("🔍 getTokenIcon called with token:", token);
|
|
21262
|
+
console.log("🔍 Token symbol:", token.symbol);
|
|
21263
|
+
console.log("🔍 Token logo from backend:", token.logo);
|
|
21264
|
+
if (token.symbol === "PYUSD") {
|
|
21265
|
+
console.log("✅ Using PYUSD component");
|
|
21266
|
+
return { type: "component", value: PyusdIcon };
|
|
21267
|
+
}
|
|
21268
|
+
if (token.symbol === "USDP") {
|
|
21269
|
+
console.log("✅ Using USDP component");
|
|
21270
|
+
return { type: "component", value: UsdpIcon };
|
|
21271
|
+
}
|
|
21264
21272
|
if (token.logo && token.logo !== "" && !token.logo.includes("placeholder")) {
|
|
21265
|
-
|
|
21273
|
+
console.log("✅ Using backend logo:", token.logo);
|
|
21274
|
+
return { type: "image", value: token.logo };
|
|
21266
21275
|
}
|
|
21267
21276
|
const fallbackImages = {
|
|
21268
|
-
|
|
21269
|
-
"
|
|
21270
|
-
"
|
|
21271
|
-
"
|
|
21272
|
-
"
|
|
21273
|
-
"
|
|
21274
|
-
|
|
21277
|
+
// Stablecoins
|
|
21278
|
+
"USDT": "https://s2.coinmarketcap.com/static/img/coins/64x64/825.png",
|
|
21279
|
+
"USDC": "https://s2.coinmarketcap.com/static/img/coins/64x64/3408.png",
|
|
21280
|
+
"DAI": "https://s2.coinmarketcap.com/static/img/coins/64x64/4943.png",
|
|
21281
|
+
"BUSD": "https://s2.coinmarketcap.com/static/img/coins/64x64/4687.png",
|
|
21282
|
+
"USDP": "https://s2.coinmarketcap.com/static/img/coins/64x64/6958.png",
|
|
21283
|
+
// Pax Dollar
|
|
21284
|
+
"PYUSD": "https://s2.coinmarketcap.com/static/img/coins/64x64/28134.png",
|
|
21285
|
+
// PayPal USD
|
|
21286
|
+
"FRAX": "https://s2.coinmarketcap.com/static/img/coins/64x64/6952.png",
|
|
21275
21287
|
"USDJ": "https://s2.coinmarketcap.com/static/img/coins/64x64/5446.png",
|
|
21276
|
-
|
|
21277
|
-
"
|
|
21278
|
-
|
|
21279
|
-
"
|
|
21280
|
-
|
|
21281
|
-
"
|
|
21282
|
-
|
|
21283
|
-
"
|
|
21288
|
+
// JUST Stablecoin
|
|
21289
|
+
"TUSD": "https://s2.coinmarketcap.com/static/img/coins/64x64/2563.png",
|
|
21290
|
+
// Native Cryptocurrencies
|
|
21291
|
+
"ETH": "https://s2.coinmarketcap.com/static/img/coins/64x64/1027.png",
|
|
21292
|
+
// Ethereum
|
|
21293
|
+
"BNB": "https://s2.coinmarketcap.com/static/img/coins/64x64/1839.png",
|
|
21294
|
+
// BNB
|
|
21295
|
+
"TRX": "https://s2.coinmarketcap.com/static/img/coins/64x64/1958.png",
|
|
21296
|
+
// TRON
|
|
21297
|
+
"ALGO": "https://s2.coinmarketcap.com/static/img/coins/64x64/4030.png",
|
|
21298
|
+
// Algorand
|
|
21299
|
+
"SOL": "https://s2.coinmarketcap.com/static/img/coins/64x64/5426.png",
|
|
21300
|
+
// Solana
|
|
21301
|
+
"AVAX": "https://s2.coinmarketcap.com/static/img/coins/64x64/5805.png",
|
|
21302
|
+
// Avalanche
|
|
21303
|
+
"MATIC": "https://s2.coinmarketcap.com/static/img/coins/64x64/3890.png"
|
|
21304
|
+
// Polygon
|
|
21284
21305
|
};
|
|
21285
|
-
|
|
21306
|
+
const fallbackUrl = fallbackImages[token.symbol];
|
|
21307
|
+
if (fallbackUrl) {
|
|
21308
|
+
console.log("✅ Using fallback image for", token.symbol, ":", fallbackUrl);
|
|
21309
|
+
return { type: "image", value: fallbackUrl };
|
|
21310
|
+
}
|
|
21311
|
+
const placeholder = `https://via.placeholder.com/64x64/6366f1/ffffff?text=${token.symbol}`;
|
|
21312
|
+
console.log("⚠️ Using placeholder for", token.symbol, ":", placeholder);
|
|
21313
|
+
return { type: "image", value: placeholder };
|
|
21314
|
+
};
|
|
21315
|
+
const renderTokenIcon = (tokenIconData, size = 32, className = "rounded-full") => {
|
|
21316
|
+
console.log("🎨 renderTokenIcon called with:", tokenIconData);
|
|
21317
|
+
console.log("🎨 Icon type:", tokenIconData.type);
|
|
21318
|
+
console.log("🎨 Icon value:", tokenIconData.value);
|
|
21319
|
+
if (tokenIconData.type === "component") {
|
|
21320
|
+
const IconComponent = tokenIconData.value;
|
|
21321
|
+
console.log("🎨 Rendering component:", IconComponent);
|
|
21322
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(IconComponent, { size });
|
|
21323
|
+
} else {
|
|
21324
|
+
console.log("🎨 Rendering image with URL:", tokenIconData.value);
|
|
21325
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
21326
|
+
"img",
|
|
21327
|
+
{
|
|
21328
|
+
src: tokenIconData.value,
|
|
21329
|
+
alt: "Token",
|
|
21330
|
+
className: `h-${size / 4} w-${size / 4} ${className}`,
|
|
21331
|
+
style: { height: `${size}px`, width: `${size}px` },
|
|
21332
|
+
onLoad: () => console.log("✅ Image loaded successfully:", tokenIconData.value),
|
|
21333
|
+
onError: (e) => {
|
|
21334
|
+
console.error("❌ Image failed to load:", tokenIconData.value);
|
|
21335
|
+
e.target.src = `https://via.placeholder.com/${size}x${size}/6366f1/ffffff?text=?`;
|
|
21336
|
+
}
|
|
21337
|
+
}
|
|
21338
|
+
);
|
|
21339
|
+
}
|
|
21286
21340
|
};
|
|
21287
21341
|
const getPaymentMethodsForNetwork = (networkShortName) => {
|
|
21288
21342
|
if (!networkShortName)
|
|
@@ -21301,6 +21355,7 @@ const PaymentMethods = ({ onSelect, selected, theme: theme2 = "light", supported
|
|
|
21301
21355
|
setSelectedPaymentMethod(null);
|
|
21302
21356
|
};
|
|
21303
21357
|
const handleSelectPaymentMethod = (token) => {
|
|
21358
|
+
const tokenIconData = getTokenIcon(token);
|
|
21304
21359
|
const paymentMethodData = {
|
|
21305
21360
|
currency: token.symbol,
|
|
21306
21361
|
network: selectedNetwork,
|
|
@@ -21313,7 +21368,8 @@ const PaymentMethods = ({ onSelect, selected, theme: theme2 = "light", supported
|
|
|
21313
21368
|
id: token.symbol,
|
|
21314
21369
|
name: token.symbol,
|
|
21315
21370
|
description: token.name,
|
|
21316
|
-
logo:
|
|
21371
|
+
logo: tokenIconData,
|
|
21372
|
+
// Store the icon data object
|
|
21317
21373
|
network: selectedNetwork,
|
|
21318
21374
|
isStablecoin: token.isStablecoin
|
|
21319
21375
|
}
|
|
@@ -21428,17 +21484,7 @@ const PaymentMethods = ({ onSelect, selected, theme: theme2 = "light", supported
|
|
|
21428
21484
|
style: { minHeight: "56px" },
|
|
21429
21485
|
children: [
|
|
21430
21486
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "flex items-center gap-3", children: selectedPaymentMethod ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
21431
|
-
|
|
21432
|
-
"img",
|
|
21433
|
-
{
|
|
21434
|
-
src: selectedPaymentMethod.method.logo,
|
|
21435
|
-
alt: selectedPaymentMethod.method.name,
|
|
21436
|
-
className: "h-8 w-8 rounded-full",
|
|
21437
|
-
onError: (e) => {
|
|
21438
|
-
e.target.src = `https://via.placeholder.com/32x32/6366f1/ffffff?text=${selectedPaymentMethod.method.name}`;
|
|
21439
|
-
}
|
|
21440
|
-
}
|
|
21441
|
-
),
|
|
21487
|
+
renderTokenIcon(selectedPaymentMethod.method.logo, 32),
|
|
21442
21488
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-base font-normal", children: [
|
|
21443
21489
|
selectedPaymentMethod.method.description,
|
|
21444
21490
|
" (",
|
|
@@ -21466,7 +21512,7 @@ const PaymentMethods = ({ onSelect, selected, theme: theme2 = "light", supported
|
|
|
21466
21512
|
availableTokensForNetwork.filter(
|
|
21467
21513
|
(token) => token.name.toLowerCase().includes(searchQuery.toLowerCase()) || token.symbol.toLowerCase().includes(searchQuery.toLowerCase())
|
|
21468
21514
|
).map((token) => {
|
|
21469
|
-
const
|
|
21515
|
+
const tokenIconData = getTokenIcon(token);
|
|
21470
21516
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
21471
21517
|
"button",
|
|
21472
21518
|
{
|
|
@@ -21478,17 +21524,7 @@ const PaymentMethods = ({ onSelect, selected, theme: theme2 = "light", supported
|
|
|
21478
21524
|
},
|
|
21479
21525
|
style: { minHeight: "48px" },
|
|
21480
21526
|
children: [
|
|
21481
|
-
|
|
21482
|
-
"img",
|
|
21483
|
-
{
|
|
21484
|
-
src: tokenIcon,
|
|
21485
|
-
alt: token.symbol,
|
|
21486
|
-
className: "h-8 w-8 rounded-full",
|
|
21487
|
-
onError: (e) => {
|
|
21488
|
-
e.target.src = `https://via.placeholder.com/32x32/6366f1/ffffff?text=${token.symbol}`;
|
|
21489
|
-
}
|
|
21490
|
-
}
|
|
21491
|
-
),
|
|
21527
|
+
renderTokenIcon(tokenIconData, 32),
|
|
21492
21528
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
21493
21529
|
token.name,
|
|
21494
21530
|
" (",
|
|
@@ -21866,12 +21902,12 @@ const CoinleyModal = ({
|
|
|
21866
21902
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium", children: "Currency:" }),
|
|
21867
21903
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium", children: selectedPaymentMethod.currency })
|
|
21868
21904
|
] }),
|
|
21869
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border border-b
|
|
21905
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border border-b border-black" }),
|
|
21870
21906
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between", children: [
|
|
21871
21907
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium", children: "Network:" }),
|
|
21872
21908
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium", children: getNetworkDisplayName(selectedPaymentMethod.network) })
|
|
21873
21909
|
] }),
|
|
21874
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border border-b
|
|
21910
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border border-b border-black" }),
|
|
21875
21911
|
payment.feeChargedTo === "customer" && payment.feeAmount > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
21876
21912
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between", children: [
|
|
21877
21913
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-medium", children: "Processing Fee:" }),
|
|
@@ -21880,7 +21916,7 @@ const CoinleyModal = ({
|
|
|
21880
21916
|
"%"
|
|
21881
21917
|
] })
|
|
21882
21918
|
] }),
|
|
21883
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border border-b
|
|
21919
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border border-b border-black" }),
|
|
21884
21920
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between border-t pt-2 mt-1", children: [
|
|
21885
21921
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-bold", children: "Total:" }),
|
|
21886
21922
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "font-bold text-lg", children: [
|