This service enables the generation and management of deposit addresses on the Sepolia testnet, providing functionality to generate deposit addresses and retrieve unused ones.
- Contract Address: 0xa2722d5053f25df4006ffd56647273ac24d0af15 on Sepolia testnet.
- Deployment Transaction: View on Etherscan
git clone [email protected]:welsipieters/knaken-deposits.git
cd knaken-deposits
yarn install
Duplicate the .env.example
file and rename it to .env
, then configure the required environment variables.
cp .env.example .env
yarn run serve
The service will be accessible at http://localhost:[PORT]
, replacing [PORT]
with the configured port in your .env
file or the application’s default port.
- Endpoint:
/deposit-addresses/generate/:count
- Method:
POST
- Description: Generates the specified number of deposit addresses.
- Parameters:
count
(path) – The number of deposit addresses to generate. Must be a positive integer.
Responses:
200 OK
{ "success": true, "txHash": "0x1234abcd..." }
400 Bad Request
{ "success": false, "message": "Invalid count parameter" }
500 Internal Server Error
{ "success": false, "message": "Internal Server Error" }
- Endpoint:
/deposit-addresses/unused
- Method:
GET
- Description: Retrieves and marks an unused deposit address as used.
Responses:
200 OK
{ "success": true, "address": "0x1234abcd..." }
404 Not Found
{ "success": false, "message": "No unused address found" }
500 Internal Server Error
{ "success": false, "message": "Internal Server Error" }