This commit is contained in:
Matthias Kretschmann 2024-04-01 03:25:28 +01:00
parent 002dde6efb
commit 78351df926
Signed by: m
GPG Key ID: 606EEEF3C479A91F
9 changed files with 9 additions and 16 deletions

View File

@ -4,14 +4,6 @@ export const runtime = 'edge'
const apiUrl = process.env.WEB3_API_URL const apiUrl = process.env.WEB3_API_URL
const config: RequestInit = {
headers: {
'content-type': 'application/json'
},
method: 'GET',
next: { revalidate: 30 }
}
export async function GET(request: NextRequest) { export async function GET(request: NextRequest) {
const searchParams = request?.nextUrl?.searchParams const searchParams = request?.nextUrl?.searchParams
const tokenIn = searchParams?.get('tokenIn') const tokenIn = searchParams?.get('tokenIn')
@ -26,7 +18,7 @@ export async function GET(request: NextRequest) {
let status let status
try { try {
const res = await fetch(url, config) const res = await fetch(url)
const json = await res.json() const json = await res.json()
data = json data = json

View File

@ -3,5 +3,6 @@
border: 1px solid rgba(var(--foreground-rgb), 0.15); border: 1px solid rgba(var(--foreground-rgb), 0.15);
border-radius: var(--border-radius); border-radius: var(--border-radius);
overflow: hidden; overflow: hidden;
margin: 0 0.25rem; margin: -0.15em 0.25rem 0 0.25rem;
font-size: 0.9em;
} }

View File

@ -1,5 +1,5 @@
import styles from './ResultRow.module.css' import styles from './ResultRow.module.css'
import { formatNumber } from '@/utils' import { formatNumber } from '@/lib/utils'
import { ArrowRightIcon } from '@radix-ui/react-icons' import { ArrowRightIcon } from '@radix-ui/react-icons'
import { TokenLogo } from '../TokenLogo/TokenLogo' import { TokenLogo } from '../TokenLogo/TokenLogo'
import { Token } from '@/types' import { Token } from '@/types'

View File

@ -7,7 +7,7 @@ import { useDebounce } from 'use-debounce'
import stylesShared from './styles.module.css' import stylesShared from './styles.module.css'
import { usePrices } from '@/hooks' import { usePrices } from '@/hooks'
import { FormAmount } from '@/components/FormAmount' import { FormAmount } from '@/components/FormAmount'
import { getTokenBySymbol } from '@/utils' import { getTokenBySymbol } from '@/lib/utils'
export function Buy() { export function Buy() {
const { prices, isValidating, isLoading } = usePrices() const { prices, isValidating, isLoading } = usePrices()

View File

@ -1,7 +1,7 @@
import { Result } from '@/components/ResultRow' import { Result } from '@/components/ResultRow'
import { ratioOceanToAsi, ratioAgixToAsi, ratioFetToAsi } from '@/constants' import { ratioOceanToAsi, ratioAgixToAsi, ratioFetToAsi } from '@/constants'
import { usePrices } from '@/hooks' import { usePrices } from '@/hooks'
import { getTokenBySymbol } from '@/utils' import { getTokenBySymbol } from '@/lib/utils'
import { TokenSymbol } from '@/types' import { TokenSymbol } from '@/types'
import { useQuote } from '@/hooks' import { useQuote } from '@/hooks'

View File

@ -1,5 +1,5 @@
import { tokens } from '@/constants' import { tokens } from '@/constants'
import { fetcher, getTokenAddressBySymbol } from '@/utils' import { fetcher, getTokenAddressBySymbol } from '@/lib/utils'
import useSWR from 'swr' import useSWR from 'swr'
const tokenAddresses = tokens.map((token) => token.address).toString() const tokenAddresses = tokens.map((token) => token.address).toString()

View File

@ -1,5 +1,5 @@
import { TokenSymbol } from '@/types' import { TokenSymbol } from '@/types'
import { getTokenAddressBySymbol, fetcher } from '@/utils' import { getTokenAddressBySymbol, fetcher } from '@/lib/utils'
import useSWR from 'swr' import useSWR from 'swr'
const options = { const options = {

View File

@ -9,7 +9,7 @@ const nextConfig = {
} }
] ]
}, },
webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => { webpack: (config) => {
config.module.rules.push({ config.module.rules.push({
test: /\.md$/, test: /\.md$/,
type: 'asset/source' type: 'asset/source'