Поменял git

This commit is contained in:
urec56 2024-02-14 17:05:40 +03:00
commit 66cee52039
22 changed files with 6249 additions and 0 deletions

163
.gitignore vendored Normal file
View file

@ -0,0 +1,163 @@
# ---> Python
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/
# Translations
*.mo
*.pot
# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal
# Flask stuff:
instance/
.webassets-cache
# Scrapy stuff:
.scrapy
# Sphinx documentation
docs/_build/
# PyBuilder
.pybuilder/
target/
# Jupyter Notebook
.ipynb_checkpoints
# IPython
profile_default/
ipython_config.py
# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version
# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock
# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/
# Celery stuff
celerybeat-schedule
celerybeat.pid
# SageMath parsed files
*.sage.py
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# Spyder project settings
.spyderproject
.spyproject
# Rope project settings
.ropeproject
# mkdocs documentation
/site
# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# Pyre type checker
.pyre/
# pytype static type analyzer
.pytype/
# Cython debug symbols
cython_debug/
# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/
node_modules

8
README.md Normal file
View file

@ -0,0 +1,8 @@
# React + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

64
chat.html Normal file
View file

@ -0,0 +1,64 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div class="flex flex-col items-center">
<h1>WebSocket Chat</h1>
<h2>Your ID: <span id="ws-id"></span></h2>
<form action="" onsubmit="sendMessage(event)">
<input class="bg-green-300" type="text" id="messageText" autocomplete="off"/>
<button>Send</button>
</form>
<ul id='messages'>
</ul>
<div>
<script>
async function getLastMessages() {
const url = 'http://localhost:8000/api/chat/last_messages'
const response = await fetch(url, {
method: 'GET'
})
return response.json()
}
getLastMessages()
.then(messages => {
appendMessage("Предыдущие 5 сообщений:")
messages.forEach(msg => {
appendMessage(msg.message)
})
appendMessage("\nНовые сообщения:")
})
function appendMessage(msg) {
let messages = document.getElementById('messages')
let message = document.createElement('li')
let content = document.createTextNode(msg)
message.appendChild(content)
messages.appendChild(message)
}
let chat_id = 2
document.querySelector("#ws-id").textContent = chat_id;
let ws = new WebSocket(`ws://localhost:8000/api/chat/ws/${chat_id}?user_id=2`);
ws.onmessage = function (event) {
appendMessage(event.data)
};
function sendMessage(event) {
let input = document.getElementById("messageText")
ws.send(input.value)
input.value = ''
event.preventDefault()
}
</script>
</div>
</div>
</body>
</html>

13
index.html Normal file
View file

@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/BP_NEON_4.gif" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>BlackPhoenix</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/chat/main.jsx"></script>
</body>
</html>

4961
package-lock.json generated Normal file

File diff suppressed because it is too large Load diff

27
package.json Normal file
View file

@ -0,0 +1,27 @@
{
"name": "react-crypto-app",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build",
"lint": "eslint react-crypto-initial --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"antd": "^5.14.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react": "^18.2.43",
"@types/react-dom": "^18.2.17",
"@vitejs/plugin-react": "^4.2.1",
"eslint": "^8.55.0",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5",
"vite": "^5.0.8"
}
}

BIN
public/BP_NEON_4.gif Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 KiB

BIN
public/unknown.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 796 KiB

1
public/vite.svg Normal file
View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

22
src/chat/App.jsx Normal file
View file

@ -0,0 +1,22 @@
import { Layout } from 'antd';
import AppHeader from "./components/layout/AppHeader.jsx";
import AppFooter from "./components/layout/AppFooter.jsx";
import AppContent from "./components/layout/AppContent.jsx";
import AppZalupa from "./components/layout/AppZalupa.jsx";
import ChatPage from "./components/layout/AppChat.jsx";
export default function App() {
return <ChatPage />
// <Layout>
// <AppHeader />
// {/*<AppZalupa />*/}
// <Layout>
// <AppContent />
// </Layout>
// <AppFooter />
// </Layout>
}

65
src/chat/api.js Normal file
View file

@ -0,0 +1,65 @@
import {cryptoData, cryptoAssets} from "./data.js";
export function fakeFetchCrypto() {
return new Promise(resolve => {
setTimeout(() => {
resolve(cryptoData)
}, 2000)
})
.then(function (response) {
return response.json();
})
.then(function (data) {
console.log(data);
return data;
})
.catch(function (error) {
console.log('Ошибка:', error);
});
}
export function fetchAssets() {
return new Promise(resolve => {
setTimeout(() => {
resolve(cryptoAssets)
}, 2000)
})
}
export function fetchUsers() {
return (fetch('http://localhost:8000/api/users', {
method: "GET"
})
.then(function (res) {
return res.json();
})
.then(function (data) {
console.log(data);
return data;
})
.catch(function (err) {
console.log('Ошибка:', err);
})
)
}
export function fetchLastMessage() {
return (fetch('http://localhost:8000/api/chat/get_last_message/2', {
method: "GET",
credentials: "include"
})
.then(function (res) {
return res.json();
})
.then(function (data) {
console.log(data);
return data;
})
.catch(function (err) {
console.log('Ошибка:', err);
})
)
}
let chat_id = 2
export let ws = new WebSocket(`ws://localhost:8000/chat/ws/${chat_id}?user_id=1`);

View file

@ -0,0 +1,72 @@
import React, { useState, useEffect } from 'react';
import ChatMessage from './ChatMessage'; // Предполагается, что у вас есть компонент для отображения сообщений чата
import { getChatMessages, getUserData } from './api'; // Функции для получения данных из API
function ChatPage() {
const [userData, setUserData] = useState(null);
const [messages, setMessages] = useState([]);
const [loading, setLoading] = useState(true);
useEffect(() => {
// Получение данных пользователя из API
getUserData()
.then(data => {
setUserData(data);
})
.catch(error => {
console.error('Error fetching user data:', error);
});
}, []);
useEffect(() => {
// Получение последних сообщений чата из API
getChatMessages()
.then(data => {
setMessages(data);
setLoading(false);
})
.catch(error => {
console.error('Error fetching chat messages:', error);
setLoading(false);
});
}, []);
const loadMoreMessages = () => {
// Загрузка дополнительных сообщений из API
// Реализация этой функции зависит от вашего API и его пагинации
// Может потребоваться отслеживать текущую страницу сообщений и передавать ее в API запрос
};
return (
<div className="chat-container">
{/* Хедер с логотипом и данными пользователя */}
<header className="header">
<div className="logo">Your Logo</div>
{userData && (
<div className="user-info">
<img src={userData.avatar_image} alt="User Avatar" />
<span>{userData.username}</span>
</div>
)}
</header>
{/* Отображение сообщений чата */}
<div className="chat-messages">
{loading ? (
<p>Loading messages...</p>
) : (
<>
{messages.map(message => (
<ChatMessage key={message.id} message={message} />
))}
<button onClick={loadMoreMessages}>Load More</button>
</>
)}
</div>
{/* Дополнительный код и стили */}
</div>
);
}
export default ChatPage;

View file

@ -0,0 +1,48 @@
import {Layout, Spin} from "antd";
import {fakeFetchCrypto, fetchAssets, fetchUsers, fetchLastMessage, ws} from "../../api.js";
import {useEffect, useState} from "react";
const contentStyle = {
textAlign: 'center',
minHeight: 120,
lineHeight: 'calc(100vh - 64px)',
color: '#fff',
backgroundColor: '#001529',
padding: '1rem',
};
export default function AppContent() {
const [loading, setLoading] = useState(true)
const [users, setUsers] = useState([])
const [assets, setAssets] = useState([])
const [lastMessage, setMessage] = useState([])
const [messages, setMessages] = useState([])
useEffect(() => {
async function preload() {
const result = await fetchUsers()
const message = await fetchLastMessage()
setMessage(message[0].message)
setUsers(result)
setLoading(false)
}
preload()
}, []);
ws.onmessage = function (event) {
const data = JSON.parse(event.data)
setMessages(data.message);
};
if (loading) {
return <Spin fullscreen/>
}
return (<Layout.Content style={contentStyle}>
{messages}
</Layout.Content>)
}

View file

@ -0,0 +1,11 @@
import {Layout} from "antd";
const footerStyle = {
textAlign: 'center',
color: '#fff',
backgroundColor: '#4096ff',
};
export default function AppFooter() {
return (<Layout.Footer style={footerStyle}>Footer</Layout.Footer>)
}

View file

@ -0,0 +1,13 @@
import {Layout} from "antd";
const headerStyle = {
textAlign: 'center',
color: '#fff',
paddingInline: 48,
lineHeight: '64px',
backgroundColor: '#4096ff',
};
export default function AppHeader() {
return (<Layout.Header style={headerStyle}>Header</Layout.Header>)
}

View file

@ -0,0 +1,85 @@
import React, { useEffect, useState } from 'react';
import { Avatar, Button, Skeleton, List} from 'antd';
const count = 3;
const fakeDataUrl = `http://localhost:8000/api/users`;
export default function AppZalupa() {
const [initLoading, setInitLoading] = useState(true);
const [loading, setLoading] = useState(false);
const [data, setData] = useState([]);
const [list, setList] = useState([]);
useEffect(() => {
fetch(fakeDataUrl)
.then((res) => res.json())
.then((res) => {
setInitLoading(false);
setData(res.results);
setList(res.results);
});
}, []);
const onLoadMore = () => {
setLoading(true);
setList(
data.concat(
[...new Array(count)].map(() => ({
loading: true,
name: {},
picture: {},
})),
),
);
fetch(fakeDataUrl)
.then((res) => res.json())
.then((res) => {
const newData = data.concat(res.results);
setData(newData);
setList(newData);
setLoading(false);
// Resetting window's offsetTop so as to display react-virtualized demo underfloor.
// In real scene, you can using public method of react-virtualized:
// https://stackoverflow.com/questions/46700726/how-to-use-public-method-updateposition-of-react-virtualized
window.dispatchEvent(new Event('resize'));
});
};
const loadMore =
!initLoading && !loading ? (
<div
style={{
textAlign: 'center',
marginTop: 12,
height: 32,
lineHeight: '32px',
}}
>
<Button onClick={onLoadMore}>loading more</Button>
</div>
) : null;
return (
<List
className="demo-loadmore-list"
loading={initLoading}
itemLayout="horizontal"
loadMore={loadMore}
dataSource={list}
renderItem={(item) => (
<List.Item
actions={[<a key="list-loadmore-edit">edit</a>, <a key="list-loadmore-more">more</a>]}
>
<Skeleton avatar title={false} loading={item.loading} active>
<List.Item.Meta
avatar={<Avatar src={item.picture.large} />}
title={<a href="https://ant.design">{item.name?.last}</a>}
description="Ant Design, a design language for background applications, is refined by Ant UED Team"
/>
<div>content</div>
</Skeleton>
</List.Item>
)}
/>
);
};

View file

@ -0,0 +1,18 @@
import React from 'react';
function ChatMessage({ message }) {
return (
<div className="message">
<div className="message-sender">
<img src={message.avatar_image} alt="Sender Avatar" />
<span>{message.id}</span>
</div>
<div className="message-content">
<p>{message.message}</p>
<span className="message-time">{message.created_at}</span>
</div>
</div>
);
}
export default ChatMessage;

View file

@ -0,0 +1,34 @@
export async function getChatMessages() {
try {
const response = await fetch('http://localhost:8000/api/chat/get_some_messages/2?messages_count=0&messages_to_get=20', {
method: "GET",
credentials: "include"
});
if (!response.ok) {
throw new Error('Failed to fetch chat messages');
}
const data = await response.json();
return data;
} catch (error) {
console.error('Error fetching chat messages:', error);
throw error;
}
}
// Функция для получения данных пользователя из API
export async function getUserData() {
try {
const response = await fetch('http://localhost:8000/api/users/me', {
method: "GET",
credentials: "include"
});
if (!response.ok) {
throw new Error('Failed to fetch user data');
}
const data = await response.json();
return data;
} catch (error) {
console.error('Error fetching user data:', error);
throw error;
}
}

625
src/chat/data.js Normal file
View file

@ -0,0 +1,625 @@
export const cryptoData = {
result: [
{
id: 'bitcoin',
icon: 'https://static.coinstats.app/coins/1650455588819.png',
name: 'Bitcoin',
symbol: 'BTC',
rank: 1,
price: 44870.39834657236,
priceBtc: 1,
volume: 35728788775.15447,
marketCap: 879141227764.5575,
availableSupply: 19592900,
totalSupply: 21000000,
priceChange1h: -0.34,
priceChange1d: 0.94,
priceChange1w: 5.02,
redditUrl: 'https://www.reddit.com/r/Bitcoin/',
websiteUrl: 'http://www.bitcoin.org',
twitterUrl: 'https://twitter.com/bitcoin',
explorers: [
'https://blockchair.com/bitcoin/',
'https://btc.com/',
'https://btc.tokenview.io/',
'https://www.oklink.com/btc',
'https://3xpl.com/bitcoin',
'https://blockchain.coinmarketcap.com/chain/bitcoin',
'https://blockexplorer.one/btc/mainnet',
],
},
{
id: 'ethereum',
icon: 'https://static.coinstats.app/coins/1650455629727.png',
name: 'Ethereum',
symbol: 'ETH',
rank: 2,
price: 2262.9329473372445,
priceBtc: 0.05043730802649077,
volume: 15049137392.625889,
marketCap: 271968761037.10645,
availableSupply: 120184189,
totalSupply: 120184189,
priceChange1h: -0.07,
priceChange1d: 0.42,
priceChange1w: -1.87,
redditUrl: 'https://www.reddit.com/r/ethereum',
websiteUrl: 'https://www.ethereum.org/',
twitterUrl: 'https://twitter.com/ethereum',
contractAddress: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
decimals: 18,
explorers: [
'https://etherscan.io/',
'https://ethplorer.io/',
'https://blockchair.com/ethereum',
'https://eth.tokenview.io/',
'https://www.oklink.com/eth',
'https://3xpl.com/ethereum',
'https://blockchain.coinmarketcap.com/chain/ethereum',
],
},
{
id: 'tether',
icon: 'https://static.coinstats.app/coins/1650455771843.png',
name: 'Tether',
symbol: 'USDT',
rank: 3,
price: 0.9958245177734858,
priceBtc: 0.00002219540265316914,
volume: 40587650892.897285,
marketCap: 93233699508.00995,
availableSupply: 93624627476,
totalSupply: 93624627476,
priceChange1h: -0.22,
priceChange1d: 0.02,
priceChange1w: -0.2,
redditUrl: 'https://www.reddit.com',
websiteUrl: 'https://tether.to/',
twitterUrl: 'https://twitter.com/Tether_to',
contractAddress: '0xdac17f958d2ee523a2206206994597c13d831ec7',
decimals: 18,
explorers: [
'https://etherscan.io/token/0xdac17f958d2ee523a2206206994597c13d831ec7',
'https://ethplorer.io/address/0xdac17f958d2ee523a2206206994597c13d831ec7',
'https://bscscan.com/token/0x55d398326f99059ff775485246999027b3197955',
'https://solscan.io/token/Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB',
'https://polygonscan.com/token/0xc2132d05d31c914a87c6611c10748aeb04b58e8f',
'https://snowtrace.io/token/0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7',
'https://evmexplorer.velas.com/token/0xb44a9b6905af7c801311e8f4e76932ee959c663c',
'https://avascan.info/blockchain/c/address/0x9702230a8ea53601f5cd2dc00fdbc13d4df4a8c7/token',
'https://arbiscan.io/token/0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9',
'https://blockchair.com/ethereum/erc-20/token/0xdac17f958d2ee523a2206206994597c13d831ec7',
'https://www.omniexplorer.info/asset/31',
],
},
{
id: 'binance-coin',
icon: 'https://static.coinstats.app/coins/1666608145347.png',
name: 'BNB',
symbol: 'BNB',
rank: 4,
price: 301.59863198670274,
priceBtc: 0.006722171383726176,
volume: 1632019815.3942976,
marketCap: 46402804362.74094,
availableSupply: 153856150,
totalSupply: 153856150,
priceChange1h: 0.09,
priceChange1d: -1.98,
priceChange1w: -2.93,
redditUrl: 'https://www.reddit.com/r/binance',
websiteUrl: 'https://www.binance.com',
twitterUrl: 'https://twitter.com/binance',
contractAddress: 'BNB',
decimals: 18,
explorers: [
'https://bscscan.com',
'https://explorer.binance.org/',
'https://binance.mintscan.io/',
'https://etherscan.io/token/0xb8c77482e45f1f44de1745f52c74426c631bdd52',
'https://ethplorer.io/address/0xb8c77482e45f1f44de1745f52c74426c631bdd52',
'https://www.oklink.com/bsc',
'https://3xpl.com/bnb',
'https://explorer.energi.network/token/0xc3c19ee91cf3c1f7fbf3716a09d21dc35de0bd6d',
'https://etherscan.io/token/0xB8c77482e45F1F44dE1745F52C74426C631bDD52',
],
},
{
id: 'solana',
icon: 'https://static.coinstats.app/coins/1701234596791.png',
name: 'Solana',
symbol: 'SOL',
rank: 5,
price: 93.7035752645126,
priceBtc: 0.0020885091157300402,
volume: 3591253070.807396,
marketCap: 40461063524.96437,
availableSupply: 431798503,
totalSupply: 566552781,
priceChange1h: -0.98,
priceChange1d: -2.94,
priceChange1w: -11.17,
redditUrl: 'https://www.reddit.com/r/solana',
websiteUrl: 'https://solana.com/',
twitterUrl: 'https://twitter.com/solana',
contractAddress: '0x7dff46370e9ea5f0bad3c4e29711ad50062ea7a4',
decimals: 18,
explorers: [
'https://solscan.io/',
'https://explorer.solana.com/',
'https://solanabeach.io/',
'https://solana.fm/',
'https://www.oklink.com/sol',
],
},
{
id: 'ripple',
icon: 'https://static.coinstats.app/coins/XRPdnqGJ.png',
name: 'XRP',
symbol: 'XRP',
rank: 6,
price: 0.5629434018448091,
priceBtc: 0.000012547145859419824,
volume: 1103177305.849332,
marketCap: 30517408090.486538,
availableSupply: 54210437480,
totalSupply: 99988065643,
priceChange1h: -0.6,
priceChange1d: -1.22,
priceChange1w: -9.34,
redditUrl: 'https://www.reddit.com/r/ripple',
websiteUrl: 'https://ripple.com/currency/',
twitterUrl: 'https://twitter.com/Ripple',
contractAddress: '0x1d2f0da169ceb9fc7b3144628db156f3f6c60dbe',
decimals: 18,
explorers: [
'https://blockchair.com/ripple',
'https://xrpcharts.ripple.com',
'https://xrpscan.com/',
'https://bithomp.com/explorer/',
'https://xrpcharts.ripple.com/#/graph/',
],
},
{
id: 'usd-coin',
icon: 'https://static.coinstats.app/coins/1650455825065.png',
name: 'USDC',
symbol: 'USDC',
rank: 7,
price: 1,
priceBtc: 0.000022259755933599935,
volume: 8964820403,
marketCap: 25343872213,
availableSupply: 25341702291,
totalSupply: 25346562356,
priceChange1h: 0.02,
priceChange1d: -0.05,
priceChange1w: -0.03,
redditUrl: 'https://www.reddit.com',
websiteUrl: 'https://www.circle.com/en/usdc',
twitterUrl: 'https://twitter.com/circle',
contractAddress: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
decimals: 18,
explorers: [
'https://etherscan.io/token/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
'https://stepscan.io/token/0xe3f5a90f9cb311505cd691a46596599aa1a0ad7d',
'https://nearblocks.io/token/17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1',
'https://ethplorer.io/address/0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
'https://basescan.org/token/0x833589fcd6edb6e08f4c7c32d4f71b54bda02913',
'https://arbiscan.io/token/0xaf88d065e77c8cc2239327c5edb3a432268e5831',
'https://hashscan.io/mainnet/token/0x000000000000000000000000000000000006f89a',
'https://bscscan.com/token/0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d',
'https://www.oklink.com/en/okc/token/0xc946daf81b08146b1c7a8da2a851ddf2b3eaaf85',
'https://www.teloscan.io/token/0x818ec0a7fe18ff94269904fced6ae3dae6d6dc0b',
],
},
{
id: 'staked-ether',
icon: 'https://static.coinstats.app/coins/staked-etheruqt.png',
name: 'Lido Staked Ether',
symbol: 'STETH',
rank: 8,
price: 2263.48,
priceBtc: 0.05038451236058478,
volume: 12583680,
marketCap: 20949523852,
availableSupply: 9253636,
totalSupply: 9253636,
priceChange1h: -0.06,
priceChange1d: 0.54,
priceChange1w: -1.67,
redditUrl: 'https://www.reddit.com/r/lidofinance/',
websiteUrl: 'https://www.lido.fi',
twitterUrl: 'https://twitter.com/lidofinance',
contractAddress: '0xae7ab96520de3a18e5e111b5eaab095312d7fe84',
decimals: 18,
explorers: [
'https://etherscan.io/token/0xae7ab96520de3a18e5e111b5eaab095312d7fe84',
'https://ethplorer.io/address/0xae7ab96520de3a18e5e111b5eaab095312d7fe84',
'https://ethereum.dex.guru/token/0xae7ab96520de3a18e5e111b5eaab095312d7fe84',
],
},
{
id: 'cardano',
icon: 'https://static.coinstats.app/coins/CardanojXddT.png',
name: 'Cardano',
symbol: 'ADA',
rank: 9,
price: 0.5071342431985936,
priceBtc: 0.00001130324522654837,
volume: 519686825.9246739,
marketCap: 17781371963.996098,
availableSupply: 35062455755,
totalSupply: 45000000000,
priceChange1h: -0.59,
priceChange1d: -3.31,
priceChange1w: -16.06,
redditUrl: 'https://www.reddit.com/r/cardano',
websiteUrl: 'https://www.cardano.org/en/home/',
twitterUrl: 'https://twitter.com/Cardano_CF',
contractAddress: '0x3ee2200efb3400fabb9aacf31297cbdd1d435d47',
decimals: 18,
explorers: [
'https://cardanoscan.io/',
'https://cardanoexplorer.com/',
'https://blockchair.com/cardano',
'https://adaex.org/',
'https://adastat.net/',
'https://ada.tokenview.io/',
'https://3xpl.com/cardano',
],
},
{
id: 'avalanche-2',
icon: 'https://static.coinstats.app/coins/1675667082696.png',
name: 'Avalanche',
symbol: 'AVAX',
rank: 10,
price: 34.14,
priceBtc: 0.0007599480675731017,
volume: 875720471,
marketCap: 12502585918,
availableSupply: 366597364,
totalSupply: 434630281,
priceChange1h: -0.37,
priceChange1d: -4,
priceChange1w: -13.77,
redditUrl: 'https://www.reddit.com/r/Avax',
websiteUrl: 'https://www.avax.network',
twitterUrl: 'https://twitter.com/avax',
contractAddress: '0xd26649b3eb22eb275326a8cb052d2f4736c863cf',
decimals: 18,
explorers: [
'https://snowtrace.io/',
'https://explorer.avax.network/',
'https://avascan.info/',
'https://www.oklink.com/avax',
'http://avascan.info/',
],
},
{
id: 'dogecoin',
icon: 'https://static.coinstats.app/coins/DogecoinIZai5.png',
name: 'Dogecoin',
symbol: 'DOGE',
rank: 11,
price: 0.0785992655070039,
priceBtc: 0.0000017518571947513752,
volume: 507579314.8695062,
marketCap: 11205796392.058752,
availableSupply: 142568716384,
totalSupply: 142568886384,
priceChange1h: -0.27,
priceChange1d: -2.49,
priceChange1w: -13.21,
redditUrl: 'https://www.reddit.com/r/dogecoin/',
websiteUrl: 'http://dogecoin.com/',
twitterUrl: 'https://twitter.com/dogecoin',
contractAddress: '0xba2ae424d960c26247dd6c32edc70b295c744c43',
decimals: 18,
explorers: [
'https://blockchair.com/dogecoin',
'https://doge.tokenview.io/',
'http://dogechain.info/chain/Dogecoin',
'https://3xpl.com/dogecoin',
],
},
{
id: 'polkadot',
icon: 'https://static.coinstats.app/coins/1641284295533.png',
name: 'Polkadot',
symbol: 'DOT',
rank: 12,
price: 7.151312849814387,
priceBtc: 0.00015939180585280315,
volume: 258441989.1307376,
marketCap: 9414876221.163532,
availableSupply: 1316524171,
totalSupply: 1397470962,
priceChange1h: -0.46,
priceChange1d: -1.52,
priceChange1w: -13.6,
redditUrl: 'https://www.reddit.com/r/dot/',
websiteUrl: 'https://polkadot.network/',
twitterUrl: 'https://twitter.com/Polkadot',
contractAddress: '0x7083609fce4d1d8dc0c979aab8c869ea2c873402',
decimals: 18,
explorers: [
'http://polkascan.io/',
'https://polkadot.subscan.io/',
'https://hubble.figment.io/polkadot/chains/polkadot',
'https://3xpl.com/polkadot',
'https://www.mintscan.io/secret/address/secret1h5d3555tz37crrgl5rppu2np2fhaugq3q8yvv9',
],
},
{
id: 'tron',
icon: 'https://static.coinstats.app/coins/TRONxJljY.png',
name: 'TRON',
symbol: 'TRX',
rank: 13,
price: 0.10315378072933472,
priceBtc: 0.0000022991397155026576,
volume: 110666037.02485974,
marketCap: 9106280268.953682,
availableSupply: 88278686487,
totalSupply: 88278902009,
priceChange1h: -0.52,
priceChange1d: -0.91,
priceChange1w: -3.74,
redditUrl: 'https://www.reddit.com/r/Tronix',
websiteUrl: 'https://tron.network',
twitterUrl: 'https://twitter.com/trondao',
contractAddress: '0x85eac5ac2f758618dfa09bdbe0cf174e7d574d5b',
decimals: 18,
explorers: [
'https://tronscan.org/',
'https://trx.tokenview.io',
'https://www.oklink.com/trx',
'https://tronscan.org/#/',
'https://www.trxplorer.io/',
],
},
{
id: 'chainlink',
icon: 'https://static.coinstats.app/coins/ChainLink0JkIR.png',
name: 'Chainlink',
symbol: 'LINK',
rank: 14,
price: 13.586276299994513,
priceBtc: 0.0003028172812111658,
volume: 360987292.1439634,
marketCap: 7718363172.02487,
availableSupply: 568099971,
totalSupply: 1000000000,
priceChange1h: -0.99,
priceChange1d: -0.35,
priceChange1w: -11.07,
redditUrl: 'https://www.reddit.com/r/Chainlink/',
websiteUrl: 'https://chain.link/',
twitterUrl: 'https://twitter.com/chainlink',
contractAddress: '0x514910771af9ca656af840dff83e8264ecf986ca',
decimals: 18,
explorers: [
'https://etherscan.io/token/0x514910771af9ca656af840dff83e8264ecf986ca',
'https://ethplorer.io/address/0x514910771af9ca656af840dff83e8264ecf986ca',
'https://arbiscan.io/token/0xf97f4df75117a78c1a5a0dbb814af92458539fb4',
'https://explorer.chain.link',
'https://blockscout.com/poa/xdai/tokens/0xE2e73A1c69ecF83F464EFCE6A5be353a37cA09b2/token-transfers',
'https://bscscan.com/token/0xf8a0bf9cf54bb92f17374d9e9a321e6a111a51bd',
'https://polygonscan.com/token/0x53e0bca35ec356bd5dddfebbd1fc0fd03fabad39',
'https://snowtrace.io/token/0x5947bb275c521040051d82396192181b413227a3',
'https://nearblocks.io/token/514910771af9ca656af840dff83e8264ecf986ca.factory.bridge.near',
'https://scan.meter.io/address/0xb3654dc3d10ea7645f8319668e8f54d2574fbdc8',
],
},
{
id: 'matic-network',
icon: 'https://static.coinstats.app/coins/1686037797025.png',
name: 'Polygon',
symbol: 'MATIC',
rank: 15,
price: 0.7939569842755763,
priceBtc: 0.000017696084642194666,
volume: 441938492.27362126,
marketCap: 7370257878.861724,
availableSupply: 9282943566,
totalSupply: 10000000000,
priceChange1h: -0.36,
priceChange1d: -5.76,
priceChange1w: -19.86,
redditUrl: 'https://www.reddit.com/r/maticnetwork/',
websiteUrl: 'https://polygon.technology/',
twitterUrl: 'https://twitter.com/0xPolygon',
contractAddress: '0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0',
decimals: 18,
explorers: [
'https://etherscan.io/token/0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0',
'https://ethplorer.io/address/0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0',
'https://polygonscan.com/token/0x0000000000000000000000000000000000001010',
'https://bscscan.com/token/0xCC42724C6683B7E57334c4E856f4c9965ED682bD',
'https://moonriver.moonscan.io/token/0x682f81e57eaa716504090c3ecba8595fb54561d8',
'https://moonbeam.moonscan.io/token/0x3405A1bd46B85c5C029483FbECf2F3E611026e45',
'https://explorer.energi.network/token/0x98997e1651919faeacee7b96afbb3dfd96cb6036',
'https://www.oklink.com/polygon',
'https://3xpl.com/polygon',
'https://binplorer.com/address/0xcc42724c6683b7e57334c4e856f4c9965ed682bd',
],
},
{
id: 'wrapped-bitcoin',
icon: 'https://static.coinstats.app/coins/wrapped-bitcoinoc1.png',
name: 'Wrapped Bitcoin',
symbol: 'WBTC',
rank: 16,
price: 44950,
priceBtc: 1.000576029215317,
volume: 282639713,
marketCap: 7109744028,
availableSupply: 158169,
totalSupply: 158169,
priceChange1h: -0.13,
priceChange1d: 1.21,
priceChange1w: 5.34,
redditUrl: 'https://www.reddit.com',
websiteUrl: 'https://www.wbtc.network/',
twitterUrl: 'https://twitter.com/WrappedBTC',
contractAddress: '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599',
decimals: 18,
explorers: [
'https://etherscan.io/token/0x2260fac5e5542a773aa44fbcfedf7c193bc2c599',
'https://ethplorer.io/address/0x2260fac5e5542a773aa44fbcfedf7c193bc2c599',
'https://blockscout.com/poa/xdai/tokens/0x8e5bBbb09Ed1ebdE8674Cda39A0c169401db4252/token-transfers',
'https://scan.tomochain.com/tokens/0x503b2ddc059b81788fd1239561596614b27faade',
'https://polygonscan.com/token/0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6',
'https://nearblocks.io/address/2260fac5e5542a773aa44fbcfedf7c193bc2c599.factory.bridge.near#transaction',
'https://cronos-explorer.crypto.org/token/0x062e66477faf219f25d27dced647bf57c3107d52',
'https://snowtrace.io/token/0x50b7545627a5162f82a992c33b87adc75187b218',
'https://explorer.mainnet.aurora.dev/token/0xF4eB217Ba2454613b15dBdea6e5f22276410e89e',
'https://moonriver.moonscan.io/token/0x6ab6d61428fde76768d7b45d8bfeec19c6ef91a8',
],
},
{
id: 'internet-computer',
icon: 'https://static.coinstats.app/coins/internet-computer4kw.png',
name: 'Internet Computer',
symbol: 'ICP',
rank: 17,
price: 13.06,
priceBtc: 0.0002907124124928151,
volume: 313146822,
marketCap: 5945084250,
availableSupply: 454980478,
totalSupply: 512797541,
priceChange1h: 1.1,
priceChange1d: 8.15,
priceChange1w: -2.21,
redditUrl: 'https://www.reddit.com/r/dfinity/',
websiteUrl: 'https://internetcomputer.org/',
twitterUrl: 'https://twitter.com/dfinity',
contractAddress: 'ryjl3-tyaaa-aaaaa-aaaba-cai',
decimals: 18,
explorers: [
'https://dashboard.internetcomputer.org/canister/ryjl3-tyaaa-aaaaa-aaaba-cai',
],
},
{
id: 'shiba-inu',
icon: 'https://static.coinstats.app/coins/1646234478930.png',
name: 'Shiba Inu',
symbol: 'SHIB',
rank: 18,
price: 0.0000092,
priceBtc: 2.047897545891194e-10,
volume: 202179835,
marketCap: 5426691358,
availableSupply: 589291143245961,
totalSupply: 999982388745437,
priceChange1h: 0.03,
priceChange1d: -3.5,
priceChange1w: -11.99,
redditUrl: 'https://www.reddit.com/r/SHIBArmy/',
websiteUrl: 'https://shibatoken.com/',
twitterUrl: 'https://twitter.com/Shibtoken',
contractAddress: '0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce',
decimals: 18,
explorers: [
'https://etherscan.io/token/0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce',
'https://ethplorer.io/address/0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce',
'https://bscscan.com/token/0x2859e4544c4bb03966803b044a93563bd2d0dd4d',
'https://explorer.energi.network/token/0x7fDb933327aa6989ae706001c2EA54BA5E046e79',
'https://ethereum.dex.guru/token/0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce',
],
},
{
id: 'dai',
icon: 'https://static.coinstats.app/coins/1579614462667.png',
name: 'Dai',
symbol: 'DAI',
rank: 19,
price: 0.998881,
priceBtc: 0.000022234847266710236,
volume: 199837010,
marketCap: 5283706975,
availableSupply: 5289625031,
totalSupply: 5289625031,
priceChange1h: -0.14,
priceChange1d: 0.05,
priceChange1w: 0,
redditUrl: 'https://www.reddit.com/r/MakerDAO',
websiteUrl: 'https://makerdao.com/',
twitterUrl: 'https://twitter.com/MakerDAO',
contractAddress: '0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359',
decimals: 18,
explorers: [
'https://etherscan.io/token/0x6b175474e89094c44da98b954eedeac495271d0f',
'https://ethplorer.io/address/0x6b175474e89094c44da98b954eedeac495271d0f',
'https://blockchair.com/ethereum/erc-20/token/0x6b175474e89094c44da98b954eedeac495271d0f',
'https://arbiscan.io/token/0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1',
'https://polygonscan.com/token/0x8f3cf7ad23cd3cadbd9735aff958023239c6a063',
'https://bscscan.com/token/0x1af3f329e8be154074d8769d1ffa4ee058b1dbc3',
'https://snowtrace.io/token/0xd586e7f844cea2f87f50152665bcbc2c279d8d70',
'https://avascan.info/blockchain/c/address/0xd586e7f844cea2f87f50152665bcbc2c279d8d70',
'https://explorer.mainnet.aurora.dev/token/0xe3520349f477a5f6eb06107066048508498a291b/token-transfers',
'https://moonriver.moonscan.io/token/0x80a16016cc4a2e6a2caca8a4a498b1699ff0f844',
'https://etherscan.io/token/0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359',
'https://ethplorer.io/address/0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359',
],
},
{
id: 'litecoin',
icon: 'https://static.coinstats.app/coins/LitecoinGiD2Q.png',
name: 'Litecoin',
symbol: 'LTC',
rank: 20,
price: 65.21315329006374,
priceBtc: 0.001453501264250902,
volume: 415039317.62892365,
marketCap: 4830332264.584919,
availableSupply: 74069908,
totalSupply: 84000000,
priceChange1h: -0.01,
priceChange1d: -0.67,
priceChange1w: -11.42,
redditUrl: 'https://www.reddit.com/r/litecoin/',
websiteUrl: 'http://litecoin.org',
twitterUrl: 'https://twitter.com/LTCFoundation',
contractAddress: '0x21a5230038c8c849d2ffb0d3ce762228ed245237',
decimals: 18,
explorers: [
'https://blockchair.com/litecoin',
'https://chainz.cryptoid.info/ltc/',
'https://bitupper.com/en/explorer/litecoin',
'https://litecoinblockexplorer.net/',
'https://ltc.tokenview.io/',
'https://explorer.energi.network/token/0x21a5230038c8c849d2ffb0d3ce762228ed245237',
'https://www.oklink.com/ltc',
'https://3xpl.com/litecoin',
'http://explorer.litecoin.net/chain/Litecoin',
],
},
],
meta: {
page: 1,
limit: 20,
itemCount: 17965,
pageCount: 899,
hasPreviousPage: false,
hasNextPage: true,
},
}
export const cryptoAssets = [
{
id: 'bitcoin',
amount: 0.02,
price: 26244,
date: new Date(),
},
{
id: 'ethereum',
amount: 5,
price: 2400,
date: new Date(),
},
]

5
src/chat/index.css Normal file
View file

@ -0,0 +1,5 @@
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

7
src/chat/main.jsx Normal file
View file

@ -0,0 +1,7 @@
import { createRoot } from 'react-dom/client'
import App from './App.jsx'
import './index.css'
const root = document.getElementById('root')
createRoot(root).render(<App />)

7
vite.config.js Normal file
View file

@ -0,0 +1,7 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})