diff --git a/src/api/routes/faucets.ts b/src/api/routes/faucets.ts index c9b2b04e8..a0e154bc6 100644 --- a/src/api/routes/faucets.ts +++ b/src/api/routes/faucets.ts @@ -75,7 +75,7 @@ export const FaucetRoutes: FastifyPluginAsync< schema: { operationId: 'run_faucet_btc', summary: 'Add testnet BTC tokens to address', - description: `Add 1 BTC token to the specified testnet BTC address. + description: `Add 0.01 BTC token to the specified testnet BTC address. The endpoint returns the transaction ID, which you can use to view the transaction in a testnet Bitcoin block explorer. The tokens are delivered once the transaction has been included in a block. @@ -89,6 +89,13 @@ export const FaucetRoutes: FastifyPluginAsync< examples: ['2N4M94S1ZPt8HfxydXzL2P7qyzgVq7MHWts'], }) ), + large: Type.Optional( + Type.Boolean({ + description: + 'Request a larger amount of testnet BTC than the default', + default: false, + }) + ), }), body: OptionalNullable( Type.Object({ @@ -125,6 +132,7 @@ export const FaucetRoutes: FastifyPluginAsync< async (req, reply) => { await btcFaucetRequestQueue.add(async () => { const address = req.query.address || req.body?.address; + const tbtcAmount = req.query.large ? 0.5 : 0.01; if (!address) { return await reply.status(400).send({ error: 'address required', @@ -156,7 +164,7 @@ export const FaucetRoutes: FastifyPluginAsync< }); } - const tx = await makeBtcFaucetPayment(btc.networks.regtest, address, 0.5); + const tx = await makeBtcFaucetPayment(btc.networks.regtest, address, tbtcAmount); await fastify.writeDb?.insertFaucetRequest({ ip: `${ip}`, address: address,