-
Python3: Ensure you have Python3 installed. You can download and install it from the official Python website.
-
Pipenv: After installing Python3, you'll need to install Pipenv. This can be done via pip:
pip install pipenv
-
Open your terminal or command prompt.
-
Clone dealer repo E.g.
git clone https://github.com/leverex-io/SDK.git cd SDK git fetch && git pull && git submodule update --init --recursive
-
Navigate to the
utilsdirectory:cd utils -
Create pip env E.g.
pipenv install --python 3.10 -r requirements.txt
-
Use the
autheid_upload_key.shscript to generate and register a new key. The script requires the following parameters:- Environment (e.g.,
dev), list of supported environment: dev, uat, prod, devprem - API key name (e.g.,
api_key_1), arbitrary key name - Account email (e.g.,
my*account@mail.com), this is about autheid account, it also has to be registered in the system you create dealer key for, e.g. https://dev.leverex.io fordevenvironment, https://testnet.leverex.io foruatenvironment, https://leverex.io forprodenvironment
Here's how you run it:
./autheid_upload_key.sh [environment] [api_key_name] [account_email]
Example:
./autheid_upload_key.sh dev api_key_1 my*account@mail.com - Environment (e.g.,
-
Ask account owner to sign a request (generated by the script) in autheid app
Running the above command will:
- Generate and register a new key for the account
my*account@mail.comin thedevenvironment. - Store the generated key in the
dev/api_key_1/key.pemfile.
- Generate and register a new key for the account
The dealer web UI listens on 127.0.0.1 by default. Do not expose port 5000 publicly in production; use a reverse proxy with TLS if remote access is required.
All /api/* endpoints require a shared secret via the DEALER_API_TOKEN environment variable. Clients must send Authorization: Bearer <token> (or X-Dealer-Api-Token). If DEALER_API_TOKEN is unset, API requests are rejected unless DEALER_DEV_MODE=true (local development only).
For Docker, docker-compose.yaml binds the host port as 127.0.0.1:5000:5000 and sets DEALER_BIND_HOST=0.0.0.0 inside the container.
Optional: set DEALER_CORS_ORIGINS to a comma-separated allowlist if cross-origin API access is needed (default: same-origin only).