Skip to content

welsipieters/Centralised-Exchange-Deposits

Repository files navigation

Knaken Deposits Service

This service enables the generation and management of deposit addresses on the Sepolia testnet, providing functionality to generate deposit addresses and retrieve unused ones.

🌐 Deployment Details

🚀 Setup and Installation

1. Clone the Repository

git clone [email protected]:welsipieters/knaken-deposits.git

2. Navigate to the Project Directory

cd knaken-deposits

3. Install Dependencies

yarn install

4. Configure Environment Variables

Duplicate the .env.example file and rename it to .env, then configure the required environment variables.

cp .env.example .env

5. Run the Service

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.

🛠 Available Routes

1. Generate Deposit Addresses

  • 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"
    }

2. Fetch and Mark Unused Deposit Address

  • 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"
    }

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published