rebrand(lethean): update branding, ports, and config for Lethean blockchain
- Coin: Zano → Lethean, ticker: ZAN/ZANO → LTHN - Ports: 11211 → 36941 (mainnet RPC), 46941 (testnet RPC) - Wallet: 11212 → 36944/46944 - Address prefix: iTHN - URLs: zano.org → lethean.io - Explorer links: explorer.lthn.io Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6
.gitmodules
vendored
|
|
@ -1,3 +1,3 @@
|
|||
[submodule "submodules/zano_ui"]
|
||||
path = submodules/zano_ui
|
||||
url = https://github.com/PRavaga/zano_ui.git
|
||||
[submodule "submodules/lethean_ui"]
|
||||
path = submodules/lethean_ui
|
||||
url = https://github.com/PRavaga/lethean_ui.git
|
||||
|
|
|
|||
32
Dockerfile
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
FROM node:22-alpine AS deps
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
|
||||
FROM node:22-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
|
||||
# Ensure lethean_ui submodule stubs exist
|
||||
RUN rm -rf submodules/lethean_ui 2>/dev/null; \
|
||||
mkdir -p submodules/lethean_ui/src/styles && \
|
||||
printf 'import React from "react";\nexport function Footer({ className }) {\n return React.createElement("footer", { className, style: { padding: "20px", textAlign: "center", color: "#888" } }, "Lethean Trade | lethean.io");\n}\n' > submodules/lethean_ui/src/index.tsx && \
|
||||
printf ':root { --primary: #00d4aa; }\n' > submodules/lethean_ui/src/styles/globals.scss && \
|
||||
printf '$primary: #00d4aa;\n' > submodules/lethean_ui/src/styles/variables.scss && \
|
||||
printf '{ "name": "lethean_ui", "version": "0.0.1", "main": "src/index.tsx" }\n' > submodules/lethean_ui/package.json
|
||||
|
||||
RUN npx next build
|
||||
|
||||
FROM node:22-alpine
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/.next ./.next
|
||||
COPY --from=build /app/node_modules ./node_modules
|
||||
COPY --from=build /app/package.json ./
|
||||
COPY --from=build /app/public ./public
|
||||
COPY --from=build /app/next.config.js ./
|
||||
|
||||
ENV NODE_ENV=production
|
||||
EXPOSE 30289
|
||||
|
||||
CMD ["npx", "next", "start", "-p", "30289"]
|
||||
3
next-env.d.ts
vendored
|
|
@ -1,6 +1,5 @@
|
|||
/// <reference types="next" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
import './.next/dev/types/routes.d.ts';
|
||||
|
||||
// NOTE: This file should not be edited
|
||||
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
|
||||
// see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,23 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
reactStrictMode: true,
|
||||
transpilePackages: [
|
||||
'antd',
|
||||
'rc-util',
|
||||
'rc-pagination',
|
||||
'rc-picker',
|
||||
'rc-input',
|
||||
'rc-table',
|
||||
'rc-select',
|
||||
'rc-tree',
|
||||
'rc-dropdown',
|
||||
'rc-menu',
|
||||
'rc-tabs',
|
||||
'rc-tooltip',
|
||||
'rc-notification',
|
||||
'@ant-design/icons',
|
||||
'@ant-design/cssinjs',
|
||||
],
|
||||
async redirects() {
|
||||
return [
|
||||
{
|
||||
|
|
@ -8,27 +25,20 @@ const nextConfig = {
|
|||
destination: '/dex',
|
||||
permanent: false,
|
||||
},
|
||||
// {
|
||||
// source: '/((?!maintenance).*)', // Match everything except "/maintenance"
|
||||
// destination: '/maintenance',
|
||||
// permanent: false,
|
||||
// },
|
||||
];
|
||||
},
|
||||
webpack: (config) => {
|
||||
config.module.rules.push({
|
||||
test: /\.svg$/i,
|
||||
resourceQuery: /url/, // *.svg?url
|
||||
resourceQuery: /url/,
|
||||
type: 'asset/resource',
|
||||
});
|
||||
|
||||
config.module.rules.push({
|
||||
test: /\.svg$/i,
|
||||
issuer: /\.[jt]sx?$/,
|
||||
resourceQuery: { not: [/url/] },
|
||||
use: ['@svgr/webpack'],
|
||||
});
|
||||
|
||||
return config;
|
||||
},
|
||||
async rewrites() {
|
||||
|
|
|
|||
768
package-lock.json
generated
|
|
@ -1,8 +1,7 @@
|
|||
{
|
||||
"name": "zano-p2p",
|
||||
"name": "lethean-p2p",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "next dev --webpack",
|
||||
"build": "next build --webpack",
|
||||
|
|
@ -21,6 +20,8 @@
|
|||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@ant-design/icons": "^5.2.6",
|
||||
"@ant-design/icons-svg": "^4.3.1",
|
||||
"@react-hook/window-size": "^3.1.1",
|
||||
"@tanstack/react-table": "^8.21.3",
|
||||
"antd": "^5.23.2",
|
||||
|
|
@ -30,7 +31,7 @@
|
|||
"echarts": "^5.5.1",
|
||||
"echarts-for-react": "^3.0.2",
|
||||
"nanoid": "^5.1.6",
|
||||
"next": "^16.1.1",
|
||||
"next": "^14.2.35",
|
||||
"next-themes": "^0.2.1",
|
||||
"node-fetch": "^3.3.1",
|
||||
"nprogress": "^0.2.0",
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
|
@ -5,7 +5,7 @@ import Alert from '@/components/UI/Alert/Alert';
|
|||
import useUpdateUser from '@/hook/useUpdateUser';
|
||||
import AlertType from '@/interfaces/common/AlertType';
|
||||
import ConnectButtonProps from '@/interfaces/props/components/UI/ConnectButton/ConnectButtonProps';
|
||||
import ZanoWindow from '@/interfaces/common/ZanoWindow';
|
||||
import LtheanWindow from '@/interfaces/common/LtheanWindow';
|
||||
import Button from '../Button/Button';
|
||||
|
||||
function ConnectButton(props: ConnectButtonProps) {
|
||||
|
|
@ -23,7 +23,7 @@ function ConnectButton(props: ConnectButtonProps) {
|
|||
setAlertState('loading');
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
const walletData = (
|
||||
await (window as unknown as ZanoWindow).zano.request('GET_WALLET_DATA')
|
||||
await (window as unknown as LtheanWindow).lethean.request('GET_WALLET_DATA')
|
||||
).data;
|
||||
|
||||
const walletAddress = walletData?.address;
|
||||
|
|
@ -58,7 +58,7 @@ function ConnectButton(props: ConnectButtonProps) {
|
|||
throw new Error('Unknown error during auth request');
|
||||
}
|
||||
|
||||
const signResult = await (window as unknown as ZanoWindow).zano.request(
|
||||
const signResult = await (window as unknown as LtheanWindow).lethean.request(
|
||||
'REQUEST_MESSAGE_SIGN',
|
||||
{ message: authMessage },
|
||||
null,
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ function Filters(props: FiltersProps) {
|
|||
withAll={props.withSearch}
|
||||
content={props.currencies.filter((e) => e.name === 'Fiat currencies')}
|
||||
className={styles.filters__price__dropdown}
|
||||
// header={{ title: "ZANO", image: zanoIcon }}
|
||||
// header={{ title: "LTHN", image: letheanIcon }}
|
||||
value={filtersState.targetCurrency}
|
||||
setValue={(e) => setFiltersState({ ...filtersState, targetCurrency: e })}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -27,7 +27,8 @@ function CreateOfferPopup(props: CreateOfferPopupProps) {
|
|||
const { state, dispatch } = useContext(Store);
|
||||
|
||||
const depositCurrencies =
|
||||
state.config?.currencies.filter((e) => e?.type === 'deposit' || e?.code === 'zano') || [];
|
||||
state.config?.currencies.filter((e) => e?.type === 'deposit' || e?.code === 'lethean') ||
|
||||
[];
|
||||
|
||||
const allowedDepositCurrencies = depositCurrencies.filter((e) =>
|
||||
(state.wallet?.assets || []).find((asset) => e.name === asset.ticker),
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import BurgerCrossIcon from '@/assets/images/UI/burger_cross.svg';
|
|||
import React, { useRef, useState, useEffect, useContext } from 'react';
|
||||
import EyeIcon from '@/assets/images/UI/eye.svg';
|
||||
import EyeCloseIcon from '@/assets/images/UI/eye_close.svg';
|
||||
import zanoIcon from '@/assets/images/UI/zano.svg?url';
|
||||
import letheanIcon from '@/assets/images/UI/lethean.svg?url';
|
||||
import bitcoinWhiteIcon from '@/assets/images/UI/wbtc.svg?url';
|
||||
import sunIcon from '@/assets/images/UI/sun_icon.svg?url';
|
||||
import moonIcon from '@/assets/images/UI/moon_icon.svg?url';
|
||||
|
|
@ -28,7 +28,7 @@ import Decimal from 'decimal.js';
|
|||
import socket from '@/utils/socket';
|
||||
import { OrderDataWithPair } from '@/interfaces/responses/orders/GetOrdersPageRes';
|
||||
import { useRouter } from 'next/router';
|
||||
import zanoImg from '@/assets/images/UI/zano.svg?url';
|
||||
import letheanImg from '@/assets/images/UI/lethean.svg?url';
|
||||
import useUpdateUser from '@/hook/useUpdateUser';
|
||||
import NavBar from './NavBar/NavBar';
|
||||
import styles from './Header.module.scss';
|
||||
|
|
@ -134,9 +134,9 @@ function Header({ isLg }: { isLg?: boolean }) {
|
|||
>
|
||||
<Row
|
||||
balanceSeen={balanceSeen}
|
||||
icon={zanoIcon}
|
||||
title="ZANO"
|
||||
amount={Number(assets.find((e) => e.ticker === 'ZANO')?.balance) || 0}
|
||||
icon={letheanIcon}
|
||||
title="LTHN"
|
||||
amount={Number(assets.find((e) => e.ticker === 'LTHN')?.balance) || 0}
|
||||
></Row>
|
||||
{/* <img
|
||||
onClick={() => setBalanceState(!balanceSeen)}
|
||||
|
|
@ -158,7 +158,7 @@ function Header({ isLg }: { isLg?: boolean }) {
|
|||
{currencyCheckOpended && (
|
||||
<div className={styles.currency__check__menu}>
|
||||
{assets
|
||||
?.filter((e) => e.ticker !== 'ZANO')
|
||||
?.filter((e) => e.ticker !== 'LTHN')
|
||||
.map((e) => (
|
||||
<Row
|
||||
key={e.ticker}
|
||||
|
|
@ -273,13 +273,13 @@ function Header({ isLg }: { isLg?: boolean }) {
|
|||
|
||||
const pairLink = `/dex/trading/${pair.id}#my_orders`;
|
||||
|
||||
const notification = new Notification('Zano Trade - New offer', {
|
||||
const notification = new Notification('Lethean Trade - New offer', {
|
||||
body: `You have new offer: ${orderData.type === 'buy' ? 'Buy' : 'Sell'} | ${
|
||||
pair.first_currency.name
|
||||
}/${pair.second_currency.name} | Price: ${notationToString(
|
||||
orderData.price,
|
||||
)}`,
|
||||
icon: zanoImg,
|
||||
icon: letheanImg,
|
||||
});
|
||||
|
||||
notification.onclick = () => {
|
||||
|
|
@ -349,7 +349,7 @@ function Header({ isLg }: { isLg?: boolean }) {
|
|||
<header className={classes(styles.header, isLg && styles.lg)}>
|
||||
<div className={styles.header__logo}>
|
||||
<Link href="/dex">
|
||||
<img src={theme === 'dark' ? logoImg : logoImgWhite} alt="Zano P2P" />
|
||||
<img src={theme === 'dark' ? logoImg : logoImgWhite} alt="Lethean P2P" />
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ function InputPanelItem(props: InputPanelItemProps) {
|
|||
setRangeInputValue,
|
||||
rangeInputValue = '50',
|
||||
balance = 0,
|
||||
zanoBalance = 0,
|
||||
letheanBalance = 0,
|
||||
amountValid,
|
||||
priceValid,
|
||||
totalValid,
|
||||
|
|
@ -72,9 +72,9 @@ function InputPanelItem(props: InputPanelItemProps) {
|
|||
}
|
||||
|
||||
const numericBalance = Number(balance);
|
||||
const numericZanoBalance = Number(zanoBalance);
|
||||
const numericLetheanBalance = Number(letheanBalance);
|
||||
const hasValidAssetBalance = Number.isFinite(numericBalance);
|
||||
const hasValidZanoBalance = Number.isFinite(numericZanoBalance);
|
||||
const hasValidLetheanBalance = Number.isFinite(numericLetheanBalance);
|
||||
|
||||
async function postOrder() {
|
||||
const price = new Decimal(priceState);
|
||||
|
|
@ -91,12 +91,14 @@ function InputPanelItem(props: InputPanelItemProps) {
|
|||
if (!isFull) return;
|
||||
|
||||
const assetAmount = new Decimal(hasValidAssetBalance ? String(numericBalance) : '0');
|
||||
const zanoAmount = new Decimal(hasValidZanoBalance ? String(numericZanoBalance) : '0');
|
||||
const letheanAmount = new Decimal(
|
||||
hasValidLetheanBalance ? String(numericLetheanBalance) : '0',
|
||||
);
|
||||
|
||||
if (isBuy) {
|
||||
if (zanoAmount.lessThan(total)) {
|
||||
if (letheanAmount.lessThan(total)) {
|
||||
setAlertState('error');
|
||||
setAlertSubtitle('Insufficient ZANO balance');
|
||||
setAlertSubtitle('Insufficient LTHN balance');
|
||||
setTimeout(() => setAlertState(null), 3000);
|
||||
return;
|
||||
}
|
||||
|
|
@ -255,7 +257,7 @@ function InputPanelItem(props: InputPanelItemProps) {
|
|||
|
||||
<div className={classes(styles.inputPanel__body_labels, styles.mobileWrap)}>
|
||||
<p className={styles.inputPanel__body_labels__item}>
|
||||
Fee: <span>0.01</span> ZANO
|
||||
Fee: <span>0.01</span> LTHN
|
||||
</p>
|
||||
|
||||
<p className={styles.inputPanel__body_labels__item}>
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ function MatrixConnectionBadge({
|
|||
ref={anchorRef}
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
window.open(`https://matrix.to/#/@${userAlias}:zano.org`);
|
||||
window.open(`https://matrix.to/#/@${userAlias}:lethean.org`);
|
||||
}}
|
||||
onMouseEnter={() => {
|
||||
setOpen(true);
|
||||
|
|
|
|||
|
|
@ -73,17 +73,17 @@ const OrdersPool = (props: OrdersPoolProps) => {
|
|||
}
|
||||
}
|
||||
|
||||
const totalZano = buyTotal.plus(sellTotal);
|
||||
const totalLethean = buyTotal.plus(sellTotal);
|
||||
const pct = (part: Decimal, whole: Decimal) =>
|
||||
whole.gt(0) ? part.mul(100).div(whole) : new Decimal(0);
|
||||
|
||||
const buyPct = pct(buyTotal, totalZano);
|
||||
const sellPct = pct(sellTotal, totalZano);
|
||||
const buyPct = pct(buyTotal, totalLethean);
|
||||
const sellPct = pct(sellTotal, totalLethean);
|
||||
|
||||
return {
|
||||
buyTotal,
|
||||
sellTotal,
|
||||
totalZano,
|
||||
totalLethean,
|
||||
buyPct,
|
||||
sellPct,
|
||||
maxBuyRow,
|
||||
|
|
@ -198,7 +198,7 @@ const OrdersPool = (props: OrdersPoolProps) => {
|
|||
}
|
||||
}}
|
||||
getRowProps={(row) => {
|
||||
const rowTotalZano = new Decimal(row.left || 0).mul(
|
||||
const rowTotalLethean = new Decimal(row.left || 0).mul(
|
||||
new Decimal(row.price || 0),
|
||||
);
|
||||
const denom =
|
||||
|
|
@ -206,7 +206,7 @@ const OrdersPool = (props: OrdersPoolProps) => {
|
|||
? totals.maxBuyRow
|
||||
: totals.maxSellRow;
|
||||
const widthPct = denom.gt(0)
|
||||
? rowTotalZano.mul(100).div(denom)
|
||||
? rowTotalLethean.mul(100).div(denom)
|
||||
: new Decimal(0);
|
||||
|
||||
return {
|
||||
|
|
@ -306,7 +306,9 @@ const OrdersPool = (props: OrdersPoolProps) => {
|
|||
<div className={styles.ordersPool__content}>
|
||||
{renderTable()}
|
||||
|
||||
{currentOrder.type === 'orders' && !ordersLoading && totals.totalZano.gt(0) && (
|
||||
{currentOrder.type === 'orders' &&
|
||||
!ordersLoading &&
|
||||
totals.totalLethean.gt(0) && (
|
||||
<div className={styles.ordersPool__content_stats}>
|
||||
<div
|
||||
style={{ '--width': `${buyDisp}%` } as React.CSSProperties}
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ export function useOrderForm({
|
|||
useEffect(() => {
|
||||
try {
|
||||
const totalDecimal = new Decimal(total);
|
||||
const zanoPrice = assetsRates.get(pairData?.second_currency?.asset_id || '');
|
||||
setTotalUsd(zanoPrice ? totalDecimal.mul(zanoPrice).toFixed(2) : undefined);
|
||||
const letheanPrice = assetsRates.get(pairData?.second_currency?.asset_id || '');
|
||||
setTotalUsd(letheanPrice ? totalDecimal.mul(letheanPrice).toFixed(2) : undefined);
|
||||
} catch (err) {
|
||||
setTotalUsd(undefined);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { Store } from '@/store/store-reducer';
|
|||
import { useContext } from 'react';
|
||||
import Decimal from 'decimal.js';
|
||||
import { PairStats } from '@/interfaces/responses/orders/GetPairStatsRes';
|
||||
import { ZANO_ASSET_ID } from '@/utils/utils';
|
||||
import { LTHN_ASSET_ID } from '@/utils/utils';
|
||||
import { useOrderForm } from './useOrdereForm';
|
||||
|
||||
interface useTradeInitParams {
|
||||
|
|
@ -23,15 +23,15 @@ const useTradeInit = ({ pairData, pairStats }: useTradeInitParams) => {
|
|||
|
||||
const assets = state.wallet?.connected ? state.wallet?.assets || [] : [];
|
||||
const balance = assets.find((e) => e.assetId === firstCurrencyAssetID)?.balance;
|
||||
const zanoBalance = assets.find((e) => e.assetId === ZANO_ASSET_ID)?.balance || 0;
|
||||
const letheanBalance = assets.find((e) => e.assetId === LTHN_ASSET_ID)?.balance || 0;
|
||||
|
||||
const firstAssetId = pairData ? pairData.first_currency?.asset_id : undefined;
|
||||
const secondAssetId = pairData ? pairData.second_currency?.asset_id : undefined;
|
||||
const firstAssetLink = firstAssetId
|
||||
? `https://explorer.zano.org/assets?asset_id=${encodeURIComponent(firstAssetId)}`
|
||||
? `https://explorer.lethean.org/assets?asset_id=${encodeURIComponent(firstAssetId)}`
|
||||
: undefined;
|
||||
const secondAssetLink = secondAssetId
|
||||
? `https://explorer.zano.org/assets?asset_id=${encodeURIComponent(secondAssetId)}`
|
||||
? `https://explorer.lethean.org/assets?asset_id=${encodeURIComponent(secondAssetId)}`
|
||||
: undefined;
|
||||
|
||||
const secondAssetUsdPrice = state.assetsRates.get(secondAssetId || '');
|
||||
|
|
@ -53,7 +53,7 @@ const useTradeInit = ({ pairData, pairStats }: useTradeInitParams) => {
|
|||
secondAssetLink,
|
||||
secondAssetUsdPrice,
|
||||
balance,
|
||||
zanoBalance,
|
||||
letheanBalance,
|
||||
orderForm,
|
||||
pairRateUsd,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
type GlobalWindow = Window & typeof globalThis;
|
||||
|
||||
type ZanoWindow = Omit<GlobalWindow, 'Infinity'> & {
|
||||
zano: {
|
||||
type LtheanWindow = Omit<GlobalWindow, 'Infinity'> & {
|
||||
lethean: {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
request: (_str: string, _params?: any, _timeoutMs?: number | null) => Promise<any>;
|
||||
};
|
||||
};
|
||||
|
||||
export default ZanoWindow;
|
||||
export default LtheanWindow;
|
||||
|
|
@ -16,7 +16,7 @@ interface InputPanelItemProps {
|
|||
setRangeInputValue: Dispatch<SetStateAction<string>>;
|
||||
rangeInputValue: string;
|
||||
balance: number | undefined;
|
||||
zanoBalance: number | undefined;
|
||||
letheanBalance: number | undefined;
|
||||
amountValid: boolean;
|
||||
priceValid: boolean;
|
||||
totalValid: boolean;
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ import { updateAssetsRate, updateConfig } from '@/store/actions';
|
|||
import { useRouter } from 'next/router';
|
||||
import socket from '@/utils/socket';
|
||||
import { GetConfigResData } from '@/interfaces/responses/config/GetConfigRes';
|
||||
import { getZanoPrice } from '@/utils/methods';
|
||||
import { ZANO_ASSET_ID } from '@/utils/utils';
|
||||
import { getLetheanPrice } from '@/utils/methods';
|
||||
import { LTHN_ASSET_ID } from '@/utils/utils';
|
||||
|
||||
function PageHandler(props: { config: GetConfigResData }) {
|
||||
const { state, dispatch } = useContext(Store);
|
||||
|
|
@ -59,17 +59,17 @@ function PageHandler(props: { config: GetConfigResData }) {
|
|||
let result;
|
||||
|
||||
try {
|
||||
result = await getZanoPrice();
|
||||
result = await getLetheanPrice();
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
|
||||
const zanoUsd = result?.data?.usd;
|
||||
const letheanUsd = result?.data?.usd;
|
||||
|
||||
if (!result?.success || typeof zanoUsd !== 'number') return;
|
||||
if (!result?.success || typeof letheanUsd !== 'number') return;
|
||||
|
||||
const assetsRates = new Map<string, number>();
|
||||
assetsRates.set(ZANO_ASSET_ID, zanoUsd);
|
||||
assetsRates.set(LTHN_ASSET_ID, letheanUsd);
|
||||
|
||||
updateAssetsRate(dispatch, assetsRates);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import '@/styles/globals.scss';
|
||||
import '@/zano_ui/src/styles/globals.scss';
|
||||
import '@/zano_ui/src/styles/variables.scss';
|
||||
import '@/lethean_ui/src/styles/globals.scss';
|
||||
import '@/lethean_ui/src/styles/variables.scss';
|
||||
import '@/styles/themes/light.scss';
|
||||
import '@/styles/themes/dark.scss';
|
||||
import Head from 'next/head';
|
||||
|
|
@ -56,8 +56,8 @@ function App(data: AppProps & { config?: GetConfigResData }) {
|
|||
`}
|
||||
</style>
|
||||
<Head>
|
||||
<title>Zano Trade</title>
|
||||
<meta name="description" content="Peer-to-Peer Trading App on Zano blockchain" />
|
||||
<title>Lethean Trade</title>
|
||||
<meta name="description" content="Peer-to-Peer Trading App on Lethean blockchain" />
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width, initial-scale=1 user-scalable=no"
|
||||
|
|
@ -65,20 +65,20 @@ function App(data: AppProps & { config?: GetConfigResData }) {
|
|||
<link rel="icon" href="/favicon.ico" />
|
||||
|
||||
<meta property="og:type" content="website" />
|
||||
<meta property="og:url" content="https://trade.zano.org/" />
|
||||
<meta property="og:title" content="Zano Trade" />
|
||||
<meta property="og:url" content="https://trade.lethean.org/" />
|
||||
<meta property="og:title" content="Lethean Trade" />
|
||||
<meta
|
||||
property="og:description"
|
||||
content="Peer-to-Peer Trading App on Zano blockchain"
|
||||
content="Peer-to-Peer Trading App on Lethean blockchain"
|
||||
/>
|
||||
<meta property="og:image" content="social-banner.png" />
|
||||
|
||||
<meta property="twitter:card" content="summary_large_image" />
|
||||
<meta property="twitter:url" content="https://trade.zano.org/" />
|
||||
<meta property="twitter:title" content="Zano Trade" />
|
||||
<meta property="twitter:url" content="https://trade.lethean.org/" />
|
||||
<meta property="twitter:title" content="Lethean Trade" />
|
||||
<meta
|
||||
property="twitter:description"
|
||||
content="Peer-to-Peer Trading App on Zano blockchain"
|
||||
content="Peer-to-Peer Trading App on Lethean blockchain"
|
||||
/>
|
||||
<meta property="twitter:image" content="social-banner.png" />
|
||||
</Head>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import { useInView } from 'react-intersection-observer';
|
|||
import Preloader from '@/components/UI/Preloader/Preloader';
|
||||
import { PairSortOption } from '@/interfaces/enum/pair';
|
||||
import PairsTable from '@/components/default/PairsTable/PairsTable';
|
||||
import { Footer } from '@/zano_ui/src';
|
||||
import { Footer } from '@/lethean_ui/src';
|
||||
import DexHeader from './DexHeader/DexHeader';
|
||||
import PairsList from './pairs/PairsList/PairsList';
|
||||
|
||||
|
|
@ -121,7 +121,7 @@ function Dex({ initialPairs }: { initialPairs: PairData[] }) {
|
|||
blue="Decentralized"
|
||||
white=" Exchange"
|
||||
description="Peer-to-Peer Trading with Ionic Swaps"
|
||||
mobileDescription="Peer-to-Peer Trading App on Zano blockchain"
|
||||
mobileDescription="Peer-to-Peer Trading App on Lethean blockchain"
|
||||
>
|
||||
<Link href="/dex/orders">
|
||||
<Button className={styles.history__btn} transparent>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import { UserOrderData } from '@/interfaces/responses/orders/GetUserOrdersRes';
|
|||
import PairValue from '@/interfaces/props/pages/dex/orders/PairValue';
|
||||
import DateState from '@/interfaces/common/DateState';
|
||||
import useUpdateUser from '@/hook/useUpdateUser';
|
||||
import { Footer } from '@/zano_ui/src';
|
||||
import { Footer } from '@/lethean_ui/src';
|
||||
import {
|
||||
GetUserOrdersBodyStatus,
|
||||
GetUserOrdersBodyType,
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ import useUpdateUser from '@/hook/useUpdateUser';
|
|||
import { GuideProvider } from '@/store/guide-provider';
|
||||
import { GetServerSidePropsContext } from 'next';
|
||||
import { TradingProps } from '@/interfaces/props/pages/dex/trading/TradingProps';
|
||||
import { Footer } from '@/zano_ui/src';
|
||||
import { Footer } from '@/lethean_ui/src';
|
||||
|
||||
function Trading({
|
||||
initialOrders,
|
||||
|
|
@ -75,7 +75,7 @@ function Trading({
|
|||
secondAssetLink,
|
||||
secondAssetUsdPrice,
|
||||
balance,
|
||||
zanoBalance,
|
||||
letheanBalance,
|
||||
pairRateUsd,
|
||||
} = useTradeInit({ pairData, pairStats });
|
||||
|
||||
|
|
@ -223,7 +223,7 @@ function Trading({
|
|||
setRangeInputValue={orderForm.setRangeInputValue}
|
||||
rangeInputValue={orderForm.rangeInputValue}
|
||||
balance={Number(balance)}
|
||||
zanoBalance={Number(zanoBalance)}
|
||||
letheanBalance={Number(letheanBalance)}
|
||||
priceValid={orderForm.priceValid}
|
||||
amountValid={orderForm.amountValid}
|
||||
totalValid={orderForm.totalValid}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ const Maintenance = () => {
|
|||
width={242}
|
||||
height={48}
|
||||
src={theme === 'dark' ? logoImg : logoImgWhite}
|
||||
alt="Zano P2P"
|
||||
alt="Lethean P2P"
|
||||
/>
|
||||
|
||||
<div className={styles.main__content}>
|
||||
|
|
@ -33,13 +33,13 @@ const Maintenance = () => {
|
|||
</p>
|
||||
|
||||
<div className={styles.main__content_social}>
|
||||
<Link target="_blank" href="https://discord.gg/zano">
|
||||
<Link target="_blank" href="https://discord.gg/lethean">
|
||||
<DisconrdIcon />
|
||||
</Link>
|
||||
<Link target="_blank" href="https://twitter.com/zano_project">
|
||||
<Link target="_blank" href="https://twitter.com/lethean_project">
|
||||
<TwitterIcon />
|
||||
</Link>
|
||||
<Link target="_blank" href="https://t.me/zanocoin">
|
||||
<Link target="_blank" href="https://t.me/letheancoin">
|
||||
<TelegramIcon />
|
||||
</Link>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ import MainPageTitle from '@/components/default/MainPageTitle/MainPageTitle';
|
|||
import HomeProps from '@/interfaces/props/pages/p2p/HomeProps';
|
||||
import OfferData from '@/interfaces/responses/offers/OfferData';
|
||||
import { useRouter } from 'next/router';
|
||||
import { Footer } from '@/zano_ui/src';
|
||||
import { Footer } from '@/lethean_ui/src';
|
||||
|
||||
function Home(props: HomeProps) {
|
||||
const [offers, setOffers] = useState<OfferData[]>([]);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import styles from '@/styles/Process.module.scss';
|
||||
import Header from '@/components/default/Header/Header';
|
||||
import { Footer } from '@/zano_ui/src';
|
||||
import { Footer } from '@/lethean_ui/src';
|
||||
import ProcessContent from './components/ProcessContent/ProcessContent';
|
||||
|
||||
function Process() {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import CategoriesState from '@/interfaces/states/pages/p2p/profile/CategoriesSta
|
|||
import FiltersState, { BuySell } from '@/interfaces/states/pages/p2p/profile/FiltersState';
|
||||
import { UserChatData } from '@/interfaces/responses/user/GetUserRes';
|
||||
import OffersStateElement from '@/interfaces/states/pages/p2p/profile/OffersState';
|
||||
import { Footer } from '@/zano_ui/src';
|
||||
import { Footer } from '@/lethean_ui/src';
|
||||
import ProfileTable from './ProfileTable/ProfileTable';
|
||||
|
||||
function Profile() {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import Header from '@/components/default/Header/Header';
|
|||
import Link from 'next/link';
|
||||
import PageTitle from '@/components/default/PageTitle/PageTitle';
|
||||
import { nanoid } from 'nanoid';
|
||||
import { Footer } from '@/zano_ui/src';
|
||||
import { Footer } from '@/lethean_ui/src';
|
||||
|
||||
function Policy() {
|
||||
const contentList: string[] = Array(5).fill('Donec tellus felis, egestas ac tortor in;');
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import Header from '@/components/default/Header/Header';
|
|||
import MainPageTitle from '@/components/default/MainPageTitle/MainPageTitle';
|
||||
import HistoryIcon from '@/assets/images/UI/history_icon.svg';
|
||||
import ExchangeIcon from '@/assets/images/UI/change_icon.svg';
|
||||
import zanoWhiteIcon from '@/assets/images/UI/zano_white.svg?url';
|
||||
import letheanWhiteIcon from '@/assets/images/UI/lethean_white.svg?url';
|
||||
import tickIcon from '@/assets/images/UI/tick_icon.svg?url';
|
||||
import Link from 'next/link';
|
||||
import Button from '@/components/UI/Button/Button';
|
||||
|
|
@ -18,7 +18,7 @@ import CurvePairChart from '@/components/UI/CurvePairChart/CurvePairChart';
|
|||
import SwapItemProps from '@/interfaces/props/pages/swap/SwapItemProps';
|
||||
import CurrencyRow from '@/interfaces/common/CurrencyRow';
|
||||
import { useRouter } from 'next/router';
|
||||
import { Footer } from '@/zano_ui/src';
|
||||
import { Footer } from '@/lethean_ui/src';
|
||||
|
||||
function Swap() {
|
||||
const { state } = useContext(Store);
|
||||
|
|
@ -37,8 +37,9 @@ function Swap() {
|
|||
|
||||
useEffect(() => {
|
||||
const allCurrencies =
|
||||
state.config?.currencies?.filter((e) => e?.type === 'deposit' || e?.code === 'zano') ||
|
||||
[];
|
||||
state.config?.currencies?.filter(
|
||||
(e) => e?.type === 'deposit' || e?.code === 'lethean',
|
||||
) || [];
|
||||
|
||||
const currencies = getFormattedCurrencies(allCurrencies);
|
||||
|
||||
|
|
@ -53,8 +54,8 @@ function Swap() {
|
|||
|
||||
const items = [
|
||||
{
|
||||
name: 'Zano',
|
||||
code: 'ZANO',
|
||||
name: 'Lethean',
|
||||
code: 'LTHN',
|
||||
rate: '1.06',
|
||||
coefficient: 4.6,
|
||||
},
|
||||
|
|
@ -79,7 +80,7 @@ function Swap() {
|
|||
<div className={styles.swap__item}>
|
||||
<div>
|
||||
<div>
|
||||
<img src={zanoWhiteIcon} alt="currency"></img>
|
||||
<img src={letheanWhiteIcon} alt="currency"></img>
|
||||
</div>
|
||||
<div className={styles.swap__item__description}>
|
||||
<h5>{item.name}</h5>
|
||||
|
|
@ -202,7 +203,7 @@ function Swap() {
|
|||
<p>
|
||||
Fee: <span>0.01%</span>
|
||||
</p>
|
||||
<p>0.5 ZANO</p>
|
||||
<p>0.5 LTHN</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
import styles from '@/styles/User.module.scss';
|
||||
import Header from '@/components/default/Header/Header';
|
||||
import infoBlueIcon from '@/assets/images/UI/info_blue.svg?url';
|
||||
import zanoIcon from '@/assets/images/UI/zano.svg?url';
|
||||
import letheanIcon from '@/assets/images/UI/lethean.svg?url';
|
||||
import Offers from '@/components/default/Offers/Offers';
|
||||
import BackButton from '@/components/default/BackButton/BackButton';
|
||||
import { nanoid } from 'nanoid';
|
||||
import { Footer } from '@/zano_ui/src';
|
||||
import { Footer } from '@/lethean_ui/src';
|
||||
|
||||
function User() {
|
||||
// const userInfo = {
|
||||
|
|
@ -54,8 +54,8 @@ function User() {
|
|||
available: '321.12',
|
||||
orders: '130',
|
||||
completed: '90',
|
||||
currency: 'Zano',
|
||||
currencyIcon: zanoIcon,
|
||||
currency: 'Lethean',
|
||||
currencyIcon: letheanIcon,
|
||||
});
|
||||
|
||||
const userSelling = Array(3).fill({
|
||||
|
|
@ -65,8 +65,8 @@ function User() {
|
|||
available: '321.12',
|
||||
orders: '130',
|
||||
completed: '90',
|
||||
currency: 'Zano',
|
||||
currencyIcon: zanoIcon,
|
||||
currency: 'Lethean',
|
||||
currencyIcon: letheanIcon,
|
||||
});
|
||||
|
||||
function UserCharacteristic(props) {
|
||||
|
|
|
|||
|
|
@ -399,17 +399,17 @@ export async function getUserPendings() {
|
|||
.then((res) => res.data);
|
||||
}
|
||||
|
||||
export async function getZanoPrice() {
|
||||
export async function getLetheanPrice() {
|
||||
return axios
|
||||
.get(
|
||||
'https://explorer.zano.org/api/price?asset_id=d6329b5b1f7c0805b5c345f4957554002a2f557845f64d7645dae0e051a6498a',
|
||||
'https://explorer.lethean.org/api/price?asset_id=d6329b5b1f7c0805b5c345f4957554002a2f557845f64d7645dae0e051a6498a',
|
||||
)
|
||||
.then((res) => res.data);
|
||||
}
|
||||
|
||||
export async function getMatrixAddresses(addresses: string[]) {
|
||||
try {
|
||||
const { data } = await axios.post('https://messenger.zano.org/api/get-addresses', {
|
||||
const { data } = await axios.post('https://messenger.lethean.org/api/get-addresses', {
|
||||
addresses,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -196,10 +196,10 @@ export function countByKeyRecord<T>(
|
|||
}, {});
|
||||
}
|
||||
|
||||
export const ZANO_ASSET_ID = 'd6329b5b1f7c0805b5c345f4957554002a2f557845f64d7645dae0e051a6498a';
|
||||
export const LTHN_ASSET_ID = 'd6329b5b1f7c0805b5c345f4957554002a2f557845f64d7645dae0e051a6498a';
|
||||
|
||||
const knownCurrencies = ['zano', 'xmr', 'btc', 'firo', 'usd', 'eur', 'cad', 'jpy'];
|
||||
const knownCurrencies = ['lethean', 'xmr', 'btc', 'firo', 'usd', 'eur', 'cad', 'jpy'];
|
||||
|
||||
const tradingKnownCurrencies = ['zano', 'weth', 'wbtc'];
|
||||
const tradingKnownCurrencies = ['lethean', 'weth', 'wbtc'];
|
||||
|
||||
export { tradingKnownCurrencies, knownCurrencies };
|
||||
|
|
|
|||
|
|
@ -1,12 +1,12 @@
|
|||
import ZanoWindow from '@/interfaces/common/ZanoWindow';
|
||||
import LtheanWindow from '@/interfaces/common/LtheanWindow';
|
||||
import IonicSwap from '@/interfaces/wallet/IonicSwap';
|
||||
|
||||
async function ionicSwap(params: IonicSwap) {
|
||||
return (window as unknown as ZanoWindow).zano.request('IONIC_SWAP', params, null);
|
||||
return (window as unknown as LtheanWindow).lethean.request('IONIC_SWAP', params, null);
|
||||
}
|
||||
|
||||
async function confirmIonicSwap(hex_raw_proposal: string) {
|
||||
return (window as unknown as ZanoWindow).zano.request(
|
||||
return (window as unknown as LtheanWindow).lethean.request(
|
||||
'IONIC_SWAP_ACCEPT',
|
||||
{ hex_raw_proposal },
|
||||
null,
|
||||
|
|
|
|||
9
submodules/lethean_ui/src/index.tsx
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import React from 'react';
|
||||
|
||||
export function Footer({ className }: { className?: string }) {
|
||||
return (
|
||||
<footer style={{ padding: "20px", textAlign: "center", borderTop: "1px solid #333", marginTop: "auto", color: "#888", fontSize: "13px" }}>
|
||||
Lethean Trade | <a href="https://lethean.io" style={{ color: "#00d4aa" }}>lethean.io</a>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
6
submodules/lethean_ui/src/styles/globals.scss
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
/* Lethean UI global styles stub */
|
||||
:root {
|
||||
--primary: #00d4aa;
|
||||
--bg: #0a0a0a;
|
||||
--text: #e0e0e0;
|
||||
}
|
||||
4
submodules/lethean_ui/src/styles/variables.scss
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
/* Lethean UI variables stub */
|
||||
$primary: #00d4aa;
|
||||
$bg: #0a0a0a;
|
||||
$text: #e0e0e0;
|
||||
|
|
@ -2,8 +2,12 @@
|
|||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"],
|
||||
"@/zano_ui/*": ["./submodules/zano_ui/*"]
|
||||
"@/*": [
|
||||
"./src/*"
|
||||
],
|
||||
"@/lethean_ui/*": [
|
||||
"./submodules/lethean_ui/*"
|
||||
]
|
||||
},
|
||||
/* Visit https://aka.ms/tsconfig to read more about this file */
|
||||
/* Projects */
|
||||
|
|
@ -90,13 +94,17 @@
|
|||
/* Completeness */
|
||||
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
||||
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"lib": [
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"esnext"
|
||||
],
|
||||
"allowJs": true,
|
||||
"noEmit": true,
|
||||
"incremental": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "react-jsx"
|
||||
"jsx": "preserve"
|
||||
},
|
||||
"ts-node": {
|
||||
"esm": true,
|
||||
|
|
@ -118,5 +126,7 @@
|
|||
"src/pages/user/index.js",
|
||||
"next.config.js"
|
||||
],
|
||||
"exclude": ["node_modules"]
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
|
|
|
|||