This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { FrameRequest, getFrameMessage, getFrameHtmlResponse } from '@coinbase/onchainkit'; | |
import { NextRequest, NextResponse } from 'next/server'; | |
import { NEXT_PUBLIC_URL } from '../../config'; | |
import { getChartOptions } from '../lib/getChartOptions'; | |
import { throwErr } from '../lib/throwErr'; | |
async function getResponse(req: NextRequest): Promise<NextResponse> { | |
let text: string | undefined = ''; | |
let pool: any | undefined = {}; | |
let chain: string = ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { getFrameMetadata } from '@coinbase/onchainkit'; | |
import type { Metadata } from 'next'; | |
import { NEXT_PUBLIC_URL } from './config'; | |
const frameMetadata = getFrameMetadata({ | |
buttons: [ | |
{ | |
label: 'Trending Crypto Pools', | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Crypto Predictor</title> | |
</head> | |
<body> | |
<h1>Crypto Predictor</h1> | |
<form method="POST"> | |
<label for="coin_id">Coin ID:</label><br> | |
<select id="coin_id" name="coin_id"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, jsonify, render_template, request | |
import requests | |
import json | |
import numpy as np | |
from sklearn.linear_model import LinearRegression | |
import time | |
from sklearn.preprocessing import MinMaxScaler | |
from datetime import datetime, timedelta | |
app = Flask(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from telegram import Update | |
from telegram.ext import ApplicationBuilder, CommandHandler, ContextTypes | |
import requests | |
import json | |
# Define your CoinGecko API key | |
api_key = 'YOUR_COINGECKO_API_KEY' | |
# Function to fetch cryptocurrency data from CoinGecko | |
def get_crypto_data(crypto): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const axios = require('axios'); | |
const app = express(); | |
app.get('/api/v3/coins/:id/history', (req, res) => { | |
const url = `https://api.coingecko.com/api/v3/coins/${req.params.id}/history`; | |
axios.get(url, { | |
params: req.query, | |
headers: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return ( | |
<div className="App"> | |
<header className="App-header"> | |
<NewsTicker /> | |
<h1>Crypto Dashboard</h1> | |
{loading ? ( | |
<p>Loading...</p> | |
) : ( | |
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', width: '100%', height: '100vh' }}> | |
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', width: '100%', height: '100%' }}> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
font-family: Arial, sans-serif; | |
} | |
.App { | |
text-align: center; | |
} | |
.App-header { | |
background-color: #ffffff; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect, useState } from 'react'; | |
import axios from 'axios'; | |
import Marquee from 'react-marquee-slider'; | |
function NewsTicker() { | |
const [news, setNews] = useState([]); | |
const [isLoading, setIsLoading] = useState(true); | |
const [error, setError] = useState(null); | |
useEffect(() => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const handleCoinSelect = (id) => { | |
setLoading(true); | |
const selected = coins.find(coin => coin.id === id); | |
setSelectedCoin(selected); | |
// Fetch historical data for the selected date range | |
const promises = []; | |
const date = new Date(startDate); | |
while (date <= endDate) { | |
const formattedDate = `${date.getDate()}-${date.getMonth() + 1}-${date.getFullYear()}`; |
NewerOlder