Skip to content

Develop#23

Merged
Amir-HShahi merged 26 commits into
masterfrom
develop
Feb 18, 2026
Merged

Develop#23
Amir-HShahi merged 26 commits into
masterfrom
develop

Conversation

@Amir-HShahi
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings January 8, 2026 13:10
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +24 to +26
@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);
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SQL injection vulnerability potential. The @query annotation with string concatenation in update statement could be vulnerable if not properly parameterized. Additionally, the @lock annotation on an update query is not valid - locks only apply to SELECT queries.

Copilot uses AI. Check for mistakes.
Comment on lines +17 to +22
@Entity
@Table(name = "transactions")
@Getter
@Setter
@Builder
public class Transaction {
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +15 to +18
// Set very high timeouts (5 minutes)
return builder
.connectTimeout(Duration.ofMinutes(5))
.readTimeout(Duration.ofMinutes(5))
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
// 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))

Copilot uses AI. Check for mistakes.
Comment on lines +47 to +48
if (!isValid) {
throw new BadRequestException(userId, DomainErrorType.INVALID_CREDENTIALS);
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
DomainErrorType.ACCOUNT_NOT_FOUND));

BigDecimal balanceBefore = accountBalance.getBalance();
BigDecimal networkFee = BigDecimal.valueOf(0);
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode
@ToString
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default toString(): DepositWallet inherits toString() from Object, and so is not suitable for printing.

Copilot uses AI. Check for mistakes.
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Builder
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default toString(): User inherits toString() from Object, and so is not suitable for printing.

Copilot uses AI. Check for mistakes.

@Entity
@Getter
@Builder
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default toString(): User inherits toString() from Object, and so is not suitable for printing.

Copilot uses AI. Check for mistakes.
@Table(name = "payment_requests")
@Getter
@Setter
@Builder
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default toString(): User inherits toString() from Object, and so is not suitable for printing.

Copilot uses AI. Check for mistakes.
@Table(name = "transactions")
@Getter
@Setter
@Builder
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default toString(): User inherits toString() from Object, and so is not suitable for printing.

Copilot uses AI. Check for mistakes.
@Amir-HShahi Amir-HShahi merged commit 1a8f319 into master Feb 18, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants