import type { NextApiRequest , NextApiResponse } from 'next' ; import { getNodeURL } from '@figment-solana/lib' ; import { Connection } from '@solana/web3.js' ; export default async function connect ( req , res ) { try { const { network } = req . body ; const url = getNodeURL ( network ) ; const connection = undefined ; const version = undefined ; res . status ( 200 ) . json ( version [ 'solana-core' ] ) ; } catch ( error ) { let errorMessage = error instanceof Error ? error . message : 'Unknown Error' ; res . status ( 500 ) . json ( errorMessage ) ; } }