How to accept USDT, BTC and other coins in a NestJS app: a provider wrapping the SDK, a controller that redirects to the checkout page where the customer picks the coin, and a webhook controller that reads req.rawBody and verifies the HMAC signature.
Step by step
1. Get an API key and a webhook secret
In the Moonvex dashboard go to “Integration” → “Create key” → type “Secret” (sk_live_…). The key is shown only once: store it on your server as MOONVEX_SECRET_KEY. On the same page add a webhook pointing to an https URL on your server and store its signing secret as MOONVEX_WEBHOOK_SECRET. In NestJS you would normally read them through ConfigModule; the example uses process.env for brevity.
npm install @moonvex/node
# .env MOONVEX_SECRET_KEY = sk_live_... MOONVEX_WEBHOOK_SECRET = whsec_...
Enter fullscreen mode
Exit fullscreen mode
2.…