Skip to content

Commit fe7c7e7

Browse files
authored
Merge pull request #9 from ChipaDevTeam/copilot/fix-check-balance-errors
Fix balance check and trading transaction 404 errors
2 parents 27e4647 + 115590b commit fe7c7e7

File tree

2 files changed

+58
-1
lines changed

2 files changed

+58
-1
lines changed

ENDPOINT_FIX_SUMMARY.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Endpoint Fix Summary
2+
3+
## Issue
4+
Users were experiencing 404 errors when calling:
5+
- `client.GetBalance()` - Balance check method
6+
- `client.buy_token()` - Buy transaction method
7+
- Other trading-related endpoints
8+
9+
Error messages:
10+
```
11+
{'success': False, 'error': 'Failed to get buy transaction: 404 - <html><body><h1>File Not Found</h1><hr><i>uWebSockets/20 Server</i></body></html>'}
12+
```
13+
14+
## Root Cause
15+
The SDK was using `https://api6.axiom.trade` as the base URL for balance and trading endpoints, but the actual Axiom Trade application uses `https://axiom.trade/api`.
16+
17+
## Fix Applied
18+
Changed `BASE_URL_API` in `axiomtradeapi/content/endpoints.py`:
19+
- **Before:** `BASE_URL_API = "https://api6.axiom.trade"`
20+
- **After:** `BASE_URL_API = "https://axiom.trade/api"`
21+
22+
## Impact
23+
This fix affects the following endpoints:
24+
25+
### Balance Endpoints
26+
- `/sol-balance``https://axiom.trade/api/sol-balance`
27+
- `/batched-sol-balance``https://axiom.trade/api/batched-sol-balance`
28+
- `/token-balance``https://axiom.trade/api/token-balance`
29+
30+
### Trading Endpoints
31+
- `/buy``https://axiom.trade/api/buy`
32+
- `/sell``https://axiom.trade/api/sell`
33+
- `/send-transaction``https://axiom.trade/api/send-transaction`
34+
35+
## Affected Methods
36+
37+
### Default Client (`AxiomTradeClient`)
38+
These methods in the default `AxiomTradeClient` class are now fixed:
39+
- `GetBalance()` - Get balance for a single wallet
40+
- `GetBatchedBalance()` - Get balances for multiple wallets
41+
- `buy_token()` - Buy tokens
42+
- `sell_token()` - Sell tokens
43+
- `get_token_balance()` - Get token balance
44+
45+
### Enhanced Client (`EnhancedAxiomTradeClient`)
46+
These methods in the enhanced client are now fixed:
47+
- `get_sol_balance()` - Get SOL balance
48+
- `get_token_balance()` - Get token balance
49+
50+
## Verification
51+
All endpoint URLs have been verified to match the expected format used by the Axiom Trade web application.
52+
53+
## Notes
54+
- Authentication endpoints (like `refresh_access_token` at `api9.axiom.trade`) continue to use their respective base URLs - these were already working correctly
55+
- Trending tokens endpoint (`/meme-trending` at `api6.axiom.trade`) remains unchanged - this was already working correctly
56+
- Portfolio endpoint (`/portfolio` at `api6.axiom.trade`) remains unchanged - this was already working correctly
57+
- **Only balance and trading endpoints** were affected by this fix, as they are the ones that should use `https://axiom.trade/api`

axiomtradeapi/content/endpoints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class Endpoints:
22
# Base Urls
3-
BASE_URL_API = "https://api6.axiom.trade"
3+
BASE_URL_API = "https://axiom.trade/api"
44
BASE_URL = "https://axiom.trade"
55

66
# Endpoints

0 commit comments

Comments
 (0)