This document outlines the APIs provided by our cryptocurrency trading system, which supports Binance and Ethereum networks. The system supports the following tokens: USDT, USDC, ETH, and BNB. Go to EXZI Frontend
Endpoint: /user/sign-in
Method: POST
Allows the user to log in successfully.
Parameters:
email(string): The user's email.password(string): The user's password.
Endpoint: /user/sign-up
Method: POST
Allows the user to successfully register to the system.
Parameters:
name(string): The user's name.email(string): The user's email.password(string): The user's password.passwordConfirmation(string): Confirmation of the user's password.
Endpoint: /user/getUserById
Method: GET
Returns the user's information.
Headers:
Authorization(string): The access token.
Endpoint: /jwt/refresh
Method: POST
Generates new access tokens and refresh tokens for the user.
Headers:
Authorization(string): The refresh token.
Endpoint: /wallet/create-wallet
Method: POST
Creates an Ethereum wallet for the user.
Endpoint: /wallet/getWalletByUserId
Method: GET
Gets the information of the user's wallet.
Endpoint: /wallet/withdraw
Method: POST
Allows the user to send the desired amount of tokens from the wallet previously created in the system to another wallet.
Parameters:
token(string): The token to withdraw (e.g., USDT, USDC, ETH, BNB).amount(number): The amount of tokens to withdraw.to(string): The address of the destination wallet.network(string): The network for token.
Endpoint: /wallet/balance
Method: GET
Allows the user to see the balance of the tokens in their wallet within the system.
Endpoint: /trade/buy-and-sell
Method: POST
Allows the user to buy and sell tokens with their wallet in the system.
Parameters:
network(string): The network for the token.tokens(array): The tokens to trade (e.g., USDT, USDC, ETH, BNB).amount(number): The amount of tokens to buy or sell.
Endpoint: /trade/history
Method: GET
Allows the user to obtain records of their buy and sell transactions.
The system supports the following networks and tokens:
-
Binance Network:
- USDT
- USDC
- BNB
- ETH
-
Ethereum Network:
- USDT
- USDC
- ETH
- Typescript
- Javascript
- Express.js
- Zod
- Ethers
- Web3.js
- Helmet
- Mongo DB
- Cors
- Uniswap SDK
- Truffle
- Openzeppelin Contracts
- Node RSA
- Json Web Token
- Bcrypt
- Lodash
- Winston
- UUID
- Supertest
- Jest
The system is built using Node version v20.11.1.
- Normally important information such as
.envandrsa_key.pemshould not be added to GitHub projects, but I added it so that the application can be run by everyone. - Additionally, unit tests have been written for APIs.
- Clone the repository:
git clone https://github.com/kmlcnclk/exzi-case-study-backend.git
- Install dependencies:
cd exzi-case-study-backend npm install - Run the application:
npm run dev
Feel free to submit issues or pull requests for improvements and bug fixes.
This project is licensed under the MIT License.
This documentation provides a comprehensive guide to using the APIs within our cryptocurrency trading system. For further details or support, please refer to the project's GitHub repository.