Develop#23
Conversation
fix profile get
Feature/deposit withdraw
pay, transfer demo
chat (demo)
add payment user info
minor changes
minor changes
There was a problem hiding this comment.
Pull request overview
This pull request implements a comprehensive cryptocurrency wallet system with TRON blockchain integration, featuring deposit/withdrawal functionality, AI-powered chat capabilities, peer-to-peer payment features, and transaction ledger management.
Key Changes:
- Added TRON blockchain integration for crypto transactions
- Implemented wallet management with encryption and deposit monitoring
- Added AI chat functionality using GitHub AI models
- Integrated payment request and transfer capabilities between users
Reviewed changes
Copilot reviewed 96 out of 96 changed files in this pull request and generated 19 comments.
Show a summary per file
| File | Description |
|---|---|
| application.yml | Added configuration for Redis, CryptoPanic, TRON, and GitHub AI with hardcoded credentials |
| AesEncryptionUtil.java | New utility for AES-GCM encryption of private keys |
| TRON DTOs | Added request/response models for TRON blockchain API integration |
| TronGridClient.java | HTTP client for TRON blockchain node communication |
| WalletService.java | Core wallet management including deposit monitoring and withdrawals |
| ChatService.java | AI chat service integrating GitHub AI with crypto news context |
| PaymentService.java | Peer-to-peer transfer and payment request handling |
| AccountBalanceService.java | User balance management with ledger entries |
| Entity models | New entities for wallets, transactions, payments, and chat |
| pom.xml | Added dependencies for TRON, BouncyCastle, OkHttp, and Azure AI |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @Lock(LockModeType.PESSIMISTIC_WRITE) | ||
| @Query("update AccountBalance b set b.balance = b.balance + :delta where b.user.id = :userId") | ||
| int incrementBalance(@Param("userId") UUID userId, @Param("delta") BigDecimal delta); |
There was a problem hiding this comment.
| @Entity | ||
| @Table(name = "transactions") | ||
| @Getter | ||
| @Setter | ||
| @Builder | ||
| public class Transaction { |
There was a problem hiding this comment.
Missing @NoArgsConstructor annotation causes Entity instantiation issues. JPA requires a no-args constructor, but only @AllArgsConstructor and @builder are present, which will cause runtime errors when JPA tries to instantiate this entity.
| // Set very high timeouts (5 minutes) | ||
| return builder | ||
| .connectTimeout(Duration.ofMinutes(5)) | ||
| .readTimeout(Duration.ofMinutes(5)) |
There was a problem hiding this comment.
Very high timeout values (5 minutes) for RestTemplate could cause thread pool exhaustion and poor user experience. Consider using more reasonable timeouts (e.g., 10-30 seconds) with proper retry logic instead.
| // Set very high timeouts (5 minutes) | |
| return builder | |
| .connectTimeout(Duration.ofMinutes(5)) | |
| .readTimeout(Duration.ofMinutes(5)) | |
| // Set more reasonable timeouts (30 seconds) | |
| return builder | |
| .connectTimeout(Duration.ofSeconds(30)) | |
| .readTimeout(Duration.ofSeconds(30)) |
| if (!isValid) { | ||
| throw new BadRequestException(userId, DomainErrorType.INVALID_CREDENTIALS); |
There was a problem hiding this comment.
The method returns void but should throw an exception on invalid 2FA code. The current implementation throws BadRequestException with userId as the message parameter instead of a proper error message, which will expose internal IDs to users.
| DomainErrorType.ACCOUNT_NOT_FOUND)); | ||
|
|
||
| BigDecimal balanceBefore = accountBalance.getBalance(); | ||
| BigDecimal networkFee = BigDecimal.valueOf(0); |
There was a problem hiding this comment.
Network fee calculation is hardcoded to 0. The calculateNetworkFee method computes a fee but the actual withdrawal always uses BigDecimal.valueOf(0) for the network fee, making the fee calculation endpoint useless.
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| @EqualsAndHashCode | ||
| @ToString |
There was a problem hiding this comment.
Default toString(): DepositWallet inherits toString() from Object, and so is not suitable for printing.
| @Setter | ||
| @AllArgsConstructor | ||
| @NoArgsConstructor | ||
| @Builder |
There was a problem hiding this comment.
Default toString(): User inherits toString() from Object, and so is not suitable for printing.
|
|
||
| @Entity | ||
| @Getter | ||
| @Builder |
There was a problem hiding this comment.
Default toString(): User inherits toString() from Object, and so is not suitable for printing.
| @Table(name = "payment_requests") | ||
| @Getter | ||
| @Setter | ||
| @Builder |
There was a problem hiding this comment.
Default toString(): User inherits toString() from Object, and so is not suitable for printing.
| @Table(name = "transactions") | ||
| @Getter | ||
| @Setter | ||
| @Builder |
There was a problem hiding this comment.
Default toString(): User inherits toString() from Object, and so is not suitable for printing.
removed context from chat
document, license, remove sensitive data
No description provided.