coinley-test 0.0.39 → 0.0.41
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/index.esm.js
CHANGED
|
@@ -2016,7 +2016,7 @@ const CmcIds = {
|
|
|
2016
2016
|
// ARB
|
|
2017
2017
|
optimism: 11840,
|
|
2018
2018
|
// OP
|
|
2019
|
-
// Stablecoins
|
|
2019
|
+
// Major Stablecoins
|
|
2020
2020
|
USDT: 825,
|
|
2021
2021
|
USDC: 3408,
|
|
2022
2022
|
BUSD: 4687,
|
|
@@ -2026,11 +2026,128 @@ const CmcIds = {
|
|
|
2026
2026
|
USDP: 5992,
|
|
2027
2027
|
USDD: 5994,
|
|
2028
2028
|
FDUSD: 26081,
|
|
2029
|
-
PYUSD: 28295
|
|
2029
|
+
PYUSD: 28295,
|
|
2030
|
+
// Popular ERC-20 Tokens
|
|
2031
|
+
WBTC: 3717,
|
|
2032
|
+
// Wrapped Bitcoin
|
|
2033
|
+
LINK: 1975,
|
|
2034
|
+
// Chainlink
|
|
2035
|
+
UNI: 7083,
|
|
2036
|
+
// Uniswap
|
|
2037
|
+
AAVE: 7278,
|
|
2038
|
+
// Aave
|
|
2039
|
+
COMP: 5692,
|
|
2040
|
+
// Compound
|
|
2041
|
+
YFI: 5864,
|
|
2042
|
+
// Yearn Finance
|
|
2043
|
+
MKR: 1518,
|
|
2044
|
+
// Maker
|
|
2045
|
+
SUSHI: 6758,
|
|
2046
|
+
// SushiSwap
|
|
2047
|
+
CRV: 6538,
|
|
2048
|
+
// Curve DAO Token
|
|
2049
|
+
SNX: 2586,
|
|
2050
|
+
// Synthetix
|
|
2051
|
+
UMA: 5617,
|
|
2052
|
+
// UMA
|
|
2053
|
+
BAL: 5728,
|
|
2054
|
+
// Balancer
|
|
2055
|
+
MANA: 1966,
|
|
2056
|
+
// Decentraland
|
|
2057
|
+
SAND: 6210,
|
|
2058
|
+
// The Sandbox
|
|
2059
|
+
APE: 18876,
|
|
2060
|
+
// ApeCoin
|
|
2061
|
+
LDO: 8e3,
|
|
2062
|
+
// Lido DAO
|
|
2063
|
+
GRT: 6719,
|
|
2064
|
+
// The Graph
|
|
2065
|
+
ENS: 13855,
|
|
2066
|
+
// Ethereum Name Service
|
|
2067
|
+
RPL: 2943,
|
|
2068
|
+
// Rocket Pool
|
|
2069
|
+
SHIB: 5994,
|
|
2070
|
+
// Shiba Inu (different from USDD)
|
|
2071
|
+
// Other Popular Tokens
|
|
2072
|
+
MATIC: 3890,
|
|
2073
|
+
// Polygon (same as polygon network)
|
|
2074
|
+
BNB: 1839,
|
|
2075
|
+
// Binance Coin
|
|
2076
|
+
ADA: 2010,
|
|
2077
|
+
// Cardano (same as cardano network)
|
|
2078
|
+
SOL: 5426,
|
|
2079
|
+
// Solana (same as solana network)
|
|
2080
|
+
DOT: 6636,
|
|
2081
|
+
// Polkadot
|
|
2082
|
+
AVAX: 5805,
|
|
2083
|
+
// Avalanche (same as avalanche network)
|
|
2084
|
+
TRX: 1958,
|
|
2085
|
+
// Tron (same as tron network)
|
|
2086
|
+
ALGO: 4030,
|
|
2087
|
+
// Algorand (same as algorand network)
|
|
2088
|
+
FTM: 3513,
|
|
2089
|
+
// Fantom (same as fantom network)
|
|
2090
|
+
ARB: 11841,
|
|
2091
|
+
// Arbitrum (same as arbitrum network)
|
|
2092
|
+
OP: 11840,
|
|
2093
|
+
// Optimism (same as optimism network)
|
|
2094
|
+
// Additional DeFi tokens
|
|
2095
|
+
"1INCH": 8104,
|
|
2096
|
+
// 1inch
|
|
2097
|
+
DYDX: 11156,
|
|
2098
|
+
// dYdX
|
|
2099
|
+
ICP: 8916,
|
|
2100
|
+
// Internet Computer
|
|
2101
|
+
FIL: 2280,
|
|
2102
|
+
// Filecoin
|
|
2103
|
+
CAKE: 7186,
|
|
2104
|
+
// PancakeSwap
|
|
2105
|
+
RUNE: 4157,
|
|
2106
|
+
// THORChain
|
|
2107
|
+
ALPHA: 7232,
|
|
2108
|
+
// Alpha Finance Lab
|
|
2109
|
+
BNT: 1727,
|
|
2110
|
+
// Bancor
|
|
2111
|
+
KNC: 1982,
|
|
2112
|
+
// Kyber Network Crystal
|
|
2113
|
+
ZRX: 1896,
|
|
2114
|
+
// 0x
|
|
2115
|
+
REN: 2539,
|
|
2116
|
+
// Ren
|
|
2117
|
+
LRC: 1934,
|
|
2118
|
+
// Loopring
|
|
2119
|
+
// Wrapped tokens
|
|
2120
|
+
WETH: 2396,
|
|
2121
|
+
// Wrapped Ether
|
|
2122
|
+
WMATIC: 3890,
|
|
2123
|
+
// Wrapped MATIC (same as MATIC)
|
|
2124
|
+
WBNB: 1839,
|
|
2125
|
+
// Wrapped BNB (same as BNB)
|
|
2126
|
+
// Additional stablecoins and pegged tokens
|
|
2127
|
+
UST: 7129,
|
|
2128
|
+
// TerraUSD (Classic)
|
|
2129
|
+
USTC: 7129,
|
|
2130
|
+
// TerraUSD Classic
|
|
2131
|
+
LUSD: 8115,
|
|
2132
|
+
// Liquity USD
|
|
2133
|
+
MIM: 9681,
|
|
2134
|
+
// Magic Internet Money
|
|
2135
|
+
FEI: 8642,
|
|
2136
|
+
// Fei USD
|
|
2137
|
+
TRIBE: 8741,
|
|
2138
|
+
// Tribe
|
|
2139
|
+
RAI: 8525,
|
|
2140
|
+
// Rai Reflex Index
|
|
2141
|
+
SUSD: 2927
|
|
2142
|
+
// sUSD (Synthetix USD)
|
|
2030
2143
|
};
|
|
2031
2144
|
const getCmcLogoUrl = (symbol) => {
|
|
2032
|
-
|
|
2033
|
-
|
|
2145
|
+
if (!symbol) return null;
|
|
2146
|
+
const directId = CmcIds[symbol.toUpperCase()];
|
|
2147
|
+
if (directId) {
|
|
2148
|
+
return `${CMC_LOGO_BASE_URL}/${directId}.png`;
|
|
2149
|
+
}
|
|
2150
|
+
return null;
|
|
2034
2151
|
};
|
|
2035
2152
|
const NetworkLogos = {
|
|
2036
2153
|
ethereum: getCmcLogoUrl("ethereum"),
|
|
@@ -2045,17 +2162,8 @@ const NetworkLogos = {
|
|
|
2045
2162
|
arbitrum: getCmcLogoUrl("arbitrum"),
|
|
2046
2163
|
optimism: getCmcLogoUrl("optimism")
|
|
2047
2164
|
};
|
|
2048
|
-
const
|
|
2049
|
-
|
|
2050
|
-
USDC: getCmcLogoUrl("USDC"),
|
|
2051
|
-
BUSD: getCmcLogoUrl("BUSD"),
|
|
2052
|
-
DAI: getCmcLogoUrl("DAI"),
|
|
2053
|
-
FRAX: getCmcLogoUrl("FRAX"),
|
|
2054
|
-
TUSD: getCmcLogoUrl("TUSD"),
|
|
2055
|
-
USDP: getCmcLogoUrl("USDP"),
|
|
2056
|
-
USDD: getCmcLogoUrl("USDD"),
|
|
2057
|
-
FDUSD: getCmcLogoUrl("FDUSD"),
|
|
2058
|
-
PYUSD: getCmcLogoUrl("PYUSD")
|
|
2165
|
+
const getTokenLogoUrl = (symbol) => {
|
|
2166
|
+
return getCmcLogoUrl(symbol);
|
|
2059
2167
|
};
|
|
2060
2168
|
const ModernDropdown = ({
|
|
2061
2169
|
options = [],
|
|
@@ -2815,11 +2923,12 @@ const EnhancedSimpleCoinleyPayment = ({
|
|
|
2815
2923
|
};
|
|
2816
2924
|
const renderNetworkOption = (network) => {
|
|
2817
2925
|
var _a2, _b2;
|
|
2926
|
+
const networkLogoUrl = NetworkLogos[network.shortName];
|
|
2818
2927
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-3", children: [
|
|
2819
|
-
|
|
2928
|
+
networkLogoUrl ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2820
2929
|
"img",
|
|
2821
2930
|
{
|
|
2822
|
-
src:
|
|
2931
|
+
src: networkLogoUrl,
|
|
2823
2932
|
alt: network.name,
|
|
2824
2933
|
className: "w-8 h-8 rounded-full",
|
|
2825
2934
|
onError: (e) => {
|
|
@@ -2832,7 +2941,7 @@ const EnhancedSimpleCoinleyPayment = ({
|
|
|
2832
2941
|
"div",
|
|
2833
2942
|
{
|
|
2834
2943
|
className: "w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center",
|
|
2835
|
-
style: { display:
|
|
2944
|
+
style: { display: networkLogoUrl ? "none" : "flex" },
|
|
2836
2945
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-bold text-gray-600", children: (_a2 = network.shortName) == null ? void 0 : _a2.slice(0, 2).toUpperCase() })
|
|
2837
2946
|
}
|
|
2838
2947
|
),
|
|
@@ -2844,11 +2953,12 @@ const EnhancedSimpleCoinleyPayment = ({
|
|
|
2844
2953
|
};
|
|
2845
2954
|
const renderTokenOption = (token) => {
|
|
2846
2955
|
var _a2, _b2;
|
|
2956
|
+
const tokenLogoUrl = getTokenLogoUrl(token.symbol);
|
|
2847
2957
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-3", children: [
|
|
2848
|
-
|
|
2958
|
+
tokenLogoUrl ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2849
2959
|
"img",
|
|
2850
2960
|
{
|
|
2851
|
-
src:
|
|
2961
|
+
src: tokenLogoUrl,
|
|
2852
2962
|
alt: token.symbol,
|
|
2853
2963
|
className: "w-8 h-8 rounded-full",
|
|
2854
2964
|
onError: (e) => {
|
|
@@ -2861,7 +2971,7 @@ const EnhancedSimpleCoinleyPayment = ({
|
|
|
2861
2971
|
"div",
|
|
2862
2972
|
{
|
|
2863
2973
|
className: "w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center",
|
|
2864
|
-
style: { display:
|
|
2974
|
+
style: { display: tokenLogoUrl ? "none" : "flex" },
|
|
2865
2975
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-bold text-gray-600", children: (_a2 = token.symbol) == null ? void 0 : _a2.slice(0, 2) })
|
|
2866
2976
|
}
|
|
2867
2977
|
),
|
|
@@ -2986,10 +3096,10 @@ const EnhancedSimpleCoinleyPayment = ({
|
|
|
2986
3096
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-bold text-gray-600", children: (_a = selectedNetwork.shortName) == null ? void 0 : _a.slice(0, 2).toUpperCase() })
|
|
2987
3097
|
}
|
|
2988
3098
|
),
|
|
2989
|
-
|
|
3099
|
+
getTokenLogoUrl(selectedToken.symbol) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
2990
3100
|
"img",
|
|
2991
3101
|
{
|
|
2992
|
-
src:
|
|
3102
|
+
src: getTokenLogoUrl(selectedToken.symbol),
|
|
2993
3103
|
alt: selectedToken.symbol,
|
|
2994
3104
|
className: "w-8 h-8 rounded-full",
|
|
2995
3105
|
onError: (e) => {
|
|
@@ -3002,7 +3112,7 @@ const EnhancedSimpleCoinleyPayment = ({
|
|
|
3002
3112
|
"div",
|
|
3003
3113
|
{
|
|
3004
3114
|
className: "w-8 h-8 rounded-full bg-gray-200 flex items-center justify-center",
|
|
3005
|
-
style: { display:
|
|
3115
|
+
style: { display: getTokenLogoUrl(selectedToken.symbol) ? "none" : "flex" },
|
|
3006
3116
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-bold text-gray-600", children: (_b = selectedToken.symbol) == null ? void 0 : _b.slice(0, 2) })
|
|
3007
3117
|
}
|
|
3008
3118
|
),
|
|
@@ -3062,10 +3172,10 @@ const EnhancedSimpleCoinleyPayment = ({
|
|
|
3062
3172
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold text-gray-700", children: "Currency:" }),
|
|
3063
3173
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "font-semibold text-[#7042D2] flex items-center", children: [
|
|
3064
3174
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mr-2", children: [
|
|
3065
|
-
|
|
3175
|
+
getTokenLogoUrl(selectedToken.symbol) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3066
3176
|
"img",
|
|
3067
3177
|
{
|
|
3068
|
-
src:
|
|
3178
|
+
src: getTokenLogoUrl(selectedToken.symbol),
|
|
3069
3179
|
alt: selectedToken.symbol,
|
|
3070
3180
|
className: "w-5 h-5 rounded-full inline-block",
|
|
3071
3181
|
onError: (e) => {
|
|
@@ -3078,7 +3188,7 @@ const EnhancedSimpleCoinleyPayment = ({
|
|
|
3078
3188
|
"div",
|
|
3079
3189
|
{
|
|
3080
3190
|
className: "w-5 h-5 rounded-full bg-gray-200 inline-flex items-center justify-center",
|
|
3081
|
-
style: { display:
|
|
3191
|
+
style: { display: getTokenLogoUrl(selectedToken.symbol) ? "none" : "inline-flex" },
|
|
3082
3192
|
children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xs font-bold text-gray-600", children: (_c = selectedToken.symbol) == null ? void 0 : _c.slice(0, 2) })
|
|
3083
3193
|
}
|
|
3084
3194
|
)
|