Learn how to send Bitcoin using Vercel Edge Functions.
app/api/send/route.ts
that makes a payment to a Lightning Address (e.g. andre@zbd.gg) with the following code:
http://localhost:3000/api/send
should return a JSON response with the payment sent message.
You can also test this using curl command:
status
of completed
to know that the payment settled successfully.
processing
. This is expected — use the callbackUrl
property to receive updates about your payments.https://project-name.vercel.app/api/send
should now return this in production.
You can also test this using curl command: