A Node.js and TypeScript API for fetching user transactions and retrieving user wallet balances on the TON blockchain.
- Fetch Transactions: Retrieve transaction history for a given account address and date.
- Get Wallet Balance: Check the wallet balance for a specific account address.
GET /api/transactions?accountAddress=<accountAddress>&date=<date>
- Retrieves transactions for a given account address and date.
GET /api/transactions/wallet-balance/<accountAddress>
- Retrieves the wallet balance for a specified account address.
- Node.js (version 16 or later)
- TypeScript
-
Clone the repository:
git clone https://github.com/dnesbala/ton-transaction-api cd ton-transaction-api
-
Install dependencies:
npm install
-
Configure environment variables:
-
Copy the
env.example
file to.env
at the project root. -
Update the values as required.
cp env.example .env
-
-
Development mode:
npm run dev
-
Production mode:
npm run build npm start
- 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
).
The .env
file should include:
DB_NAME=
DB_USER=
DB_PASSWORD=
DB_HOST=
DB_PORT=