import type { NextApiRequest , NextApiResponse } from 'next' ; import { getNodeUrl } from '@figment-celo/lib' ; import { newKit } from '@celo/contractkit' ; export default async function transfer ( req , res ) { try { const { secret , amount , recipient , address , network } = req . body ; const url = getNodeUrl ( network ) ; const kit = newKit ( url ) ; undefined ; const celoToken = undefined ; const celotx = undefined ; const celoReceipt = await celotx . waitReceipt ( ) ; res . status ( 200 ) . json ( celoReceipt . transactionHash ) ; } catch ( error ) { let errorMessage = error instanceof Error ? error . message : 'Unknown Error' ; res . status ( 500 ) . json ( errorMessage ) ; } }