Skip to content

Commit 9e06790

Browse files
committed
refactor(api): remove deprecated wallet balance and snapshot endpoints
- Deleted the balance, snapshots, and wallets API endpoints to streamline the codebase. - Updated README to reflect the consolidation of snapshot functionality into a single endpoint. - Improved overall documentation clarity regarding the batch processing system.
1 parent 616325e commit 9e06790

File tree

4 files changed

+6
-520
lines changed

4 files changed

+6
-520
lines changed

src/pages/api/v1/stats/README.md

Lines changed: 6 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,115 +1,23 @@
11
# Stats API Routes
22

3-
This directory contains the API routes for handling wallet balance snapshots using a batch processing system to avoid timeout issues.
3+
This directory contains the API route for handling wallet balance snapshots using a batch processing system to avoid timeout issues.
44

5-
## Recent Updates
5+
## Overview
66

7-
This batch processing system addresses timeout issues when processing large numbers of wallets:
7+
The batch processing system addresses timeout issues when processing large numbers of wallets by:
88

99
- **Solves**: Timeout issues with large wallet counts
1010
- **Improves**: Reliability, monitoring, and error handling
1111
- **Adds**: Comprehensive progress tracking and TVL reporting
12+
- **Consolidates**: All snapshot functionality into a single, efficient endpoint
1213

1314
## Authentication
1415

15-
All endpoints require authentication using the `SNAPSHOT_AUTH_TOKEN` environment variable:
16+
The endpoint requires authentication using the `SNAPSHOT_AUTH_TOKEN` environment variable:
1617
- **Header**: `Authorization: Bearer <token>`
1718
- **Environment Variable**: `SNAPSHOT_AUTH_TOKEN`
1819

19-
## Routes
20-
21-
### `/api/v1/stats/wallets`
22-
- **Method**: GET
23-
- **Purpose**: Returns all wallet information for batch processing
24-
- **Authentication**: Required (Bearer token)
25-
- **Response**:
26-
```json
27-
{
28-
"wallets": [
29-
{
30-
"walletId": "string",
31-
"walletName": "string",
32-
"description": "string|null",
33-
"signersAddresses": ["string"],
34-
"signersStakeKeys": ["string"],
35-
"signersDRepKeys": ["string"],
36-
"signersDescriptions": ["string"],
37-
"numRequiredSigners": number,
38-
"verified": ["string"],
39-
"scriptCbor": "string",
40-
"stakeCredentialHash": "string|null",
41-
"type": "string",
42-
"isArchived": boolean,
43-
"clarityApiKey": "string|null",
44-
"network": number
45-
}
46-
],
47-
"walletCount": number,
48-
"activeWalletCount": number,
49-
"archivedWalletCount": number
50-
}
51-
```
52-
53-
### `/api/v1/stats/balance`
54-
- **Method**: GET
55-
- **Purpose**: Fetches balance for a single wallet (used internally by batch processing)
56-
- **Authentication**: Required (Bearer token)
57-
- **Query Parameters**:
58-
- `walletId` (required) - Wallet ID
59-
- `walletName` (required) - Wallet name
60-
- `signersAddresses` (required) - JSON array of signer addresses
61-
- `numRequiredSigners` (required) - Number of required signers
62-
- `type` (required) - Wallet type
63-
- `stakeCredentialHash` (optional) - Stake credential hash
64-
- `isArchived` (required) - Whether wallet is archived
65-
- `network` (required) - Network ID (0=testnet, 1=mainnet)
66-
- **Response**:
67-
```json
68-
{
69-
"walletBalance": {
70-
"walletId": "string",
71-
"walletName": "string",
72-
"address": "string",
73-
"balance": {
74-
"lovelace": "string",
75-
"assetId": "quantity"
76-
},
77-
"adaBalance": number,
78-
"isArchived": boolean
79-
}
80-
}
81-
```
82-
83-
### `/api/v1/stats/snapshots`
84-
- **Method**: POST
85-
- **Purpose**: Stores balance snapshots in the database
86-
- **Authentication**: Required (Bearer token)
87-
- **Content-Type**: `application/json`
88-
- **Body**:
89-
```json
90-
{
91-
"walletBalances": [
92-
{
93-
"walletId": "string",
94-
"walletName": "string",
95-
"address": "string",
96-
"balance": {
97-
"lovelace": "string",
98-
"assetId": "quantity"
99-
},
100-
"adaBalance": number,
101-
"isArchived": boolean
102-
}
103-
]
104-
}
105-
```
106-
- **Response**:
107-
```json
108-
{
109-
"snapshotsStored": number,
110-
"totalWallets": number
111-
}
112-
```
20+
## Route
11321

11422
### `/api/v1/stats/run-snapshots-batch`
11523
- **Method**: POST

src/pages/api/v1/stats/balance.ts

Lines changed: 0 additions & 184 deletions
This file was deleted.

0 commit comments

Comments
 (0)