https://github.com/dnesbala/ton-transaction-api
TON API for fetching user transactions & getting user balance
https://github.com/dnesbala/ton-transaction-api
express mikro-orm nodejs typescript zod
Last synced: 19 days ago
JSON representation
TON API for fetching user transactions & getting user balance
- Host: GitHub
- URL: https://github.com/dnesbala/ton-transaction-api
- Owner: dnesbala
- Created: 2024-11-25T12:33:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-11T10:57:01.000Z (over 1 year ago)
- Last Synced: 2025-02-05T12:33:50.072Z (about 1 year ago)
- Topics: express, mikro-orm, nodejs, typescript, zod
- Language: TypeScript
- Homepage:
- Size: 185 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TON Transaction API
A Node.js and TypeScript API for fetching user transactions and retrieving user wallet balances on the TON blockchain.
## Features
- **Fetch Transactions**: Retrieve transaction history for a given account address and date.
- **Get Wallet Balance**: Check the wallet balance for a specific account address.
## API Endpoints
### Fetch Transactions
**GET** `/api/transactions?accountAddress=&date=`
- Retrieves transactions for a given account address and date.
### Get Wallet Balance
**GET** `/api/transactions/wallet-balance/`
- Retrieves the wallet balance for a specified account address.
## Setup
### Prerequisites
- [Node.js](https://nodejs.org/) (version 16 or later)
- [TypeScript](https://www.typescriptlang.org/)
### Installation
1. Clone the repository:
```bash
git clone https://github.com/dnesbala/ton-transaction-api
cd ton-transaction-api
```
2. Install dependencies:
```bash
npm install
```
3. Configure environment variables:
- Copy the `env.example` file to `.env` at the project root.
- Update the values as required.
```bash
cp env.example .env
```
### Run the Project
- Development mode:
```bash
npm run dev
```
- Production mode:
```bash
npm run build
npm start
```
## Project Structure
- **src/**: Contains the main application code.
- **controllers/**: API controllers for handling requests.
- **services/**: Business logic and interaction with TON blockchain.
- **repositories/**: Database and ORM configurations.
- **env.example**: Example environment file with all required configuration variables.
- **dist/**: Compiled production code (generated after `npm run build`).
## Environment Variables
The `.env` file should include:
```
DB_NAME=
DB_USER=
DB_PASSWORD=
DB_HOST=
DB_PORT=
```