Changes to the Stacks Blockchain API testnet STX faucet

Greetings, Stacks developers.

With the release of v7.3.5 of the Stacks Blockchain API, we will be introducing a change to the testnet STX faucet endpoint that may affect existing users. Specifically, we will remove the ability to provide the receiving STX address via the POST body. We will only continue supporting these arguments via query parameters.

After this change goes live, providing a POST body will return a HTTP 400 error with a helpful message:

$ curl -X POST "<http://127.0.0.1:3999/extended/v1/faucets/stx>" \\
     -H "Content-Type: application/json" \\
     -d '{"address": "ST12KYHMD4GJZJHAPM4VC0VZTB4FEWTQSY74YHEYN", "stacking": true}'
{
  "error": "POST body is no longer supported, parameters must be passed as query parameters, e.g. <http://127.0.0.1:3999/extended/v1/faucets/stx?address=ST12KYHMD4GJZJHAPM4VC0VZTB4FEWTQSY74YHEYN&stacking=true>",
  "help": "Example curl request: curl -X POST '<http://127.0.0.1:3999/extended/v1/faucets/stx?address=ST12KYHMD4GJZJHAPM4VC0VZTB4FEWTQSY74YHEYN&stacking=true>'",
  "success": false
}

Using URL query parameters will continue to work as expected:

$ curl -X POST '<http://127.0.0.1:3999/extended/v1/faucets/stx?address=ST12KYHMD4GJZJHAPM4VC0VZTB4FEWTQSY74YHEYN&stacking=true>'
{
  "success": true,
  "txId": "0x7ebf6932f0f7e9f9f29c2076798e7c4ac7a163f82215fe2bd6a08d8b01058350",
  "txRaw": "80800000000400164247d6f2b425ac5771423ae6c80c754f7172b0000000000000000000000000000000b40001ef33d2b1622a50b796f5848a402cf9a7d3c60ff723c22a2c0a17b641d9fa61b676fa53aefb47254f5dc93c60ae2e8a2bc1363f520dbae04bb5a086cf68e910c603020000000000051a453f468d2425f94556a136c06ffa591eee6af9f10007fe8f3d59100046617563657400000000000000000000000000000000000000000000000000000000"
}

This change will allow our team to tweak the faucet rate limits to accommodate all developers who want to get their hands on some testnet STX for writing applications.

We are planning to deploy this change to our testnet production enviroments late next week.

Thank you for your understanding and cooperation as we continue to improve the Stacks Blockchain API to deliver a more secure and efficient experience for all users.

Rafael

5 Likes

This is exciting, Rafa! Is there a straightforward process for builders to join the testnet token list? Have you come across applications that onboard users directly through their own UI, integrating testnet token acquisition within their apps?

1 Like