-
Notifications
You must be signed in to change notification settings - Fork 18
P 1729 add one more hyperliquidaction type sendasset #3758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
P 1729 add one more hyperliquidaction type sendasset #3758
Conversation
Extend omni_getHyperliquidSignatureData with support for the SendAsset action type, enabling generalized token transfers across perp DEXs, spot balances, users, and subaccounts (testnet-only feature). Changes: - Add SendAsset variant to HyperliquidActionType enum with fields for destination, source_dex, destination_dex, token, amount, and from_sub_account - Add SendAsset variant to HyperliquidAction response enum - Implement SendAsset action handler with address validation for destination and optional from_sub_account - Import SendAsset struct from hyperliquid-rust-sdk - Update SDK dependency to BillyWooo/hyperliquid-rust-sdk branch usdClassTransfer_sendAsset - Add comprehensive tests: signature generation, JSON deserialization, and sub-account handling The implementation follows the same patterns as existing actions (ApproveAgent, Withdraw3, ApproveBuilderFee), ensuring consistency with EIP-712 signature generation and error handling.
Claude finished @BillyWooo's task —— View job Code Review for SendAsset ImplementationComprehensive analysis of the SendAsset action type implementation for HyperliquidSignatureData. Todo List:
📋 Overall AssessmentThe implementation is well-structured and follows established patterns in the codebase. The code quality is high with proper error handling, validation, and comprehensive testing. ✅ Strengths
🔍 Detailed ReviewCode Quality: Excellent
Security Analysis: Good
Performance Considerations: Optimal
Test Coverage: Comprehensive
🔧 Minor Suggestions
🚨 Issues Found: None CriticalNo critical bugs, security vulnerabilities, or performance issues identified. The implementation is production-ready. 📝 Specific Code CommentsFile: SendAsset {
destination: String,
source_dex: String,
destination_dex: String,
token: String,
amount: String,
from_sub_account: String,
}, ✅ Good: All fields properly typed as String for JSON compatibility File: if !from_sub_account.is_empty() {
let _ = validate_ethereum_address(&from_sub_account, "from_sub_account")
.map_err(|e| e.to_error_object())?;
} ✅ Excellent: Smart conditional validation - only validates when sub-account is specified File: 🎯 Final RecommendationAPPROVE - This is a high-quality implementation that:
The code is ready for production deployment on testnets as intended. |
let _ = validate_ethereum_address(&destination, "destination") | ||
.map_err(|e| e.to_error_object())?; | ||
// Validate from_sub_account if it's not empty | ||
if !from_sub_account.is_empty() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This if seems redundant, validate_ethereum_address
would fail anyways
Extend omni_getHyperliquidSignatureData with support for the SendAsset action type, enabling generalized token transfers across perp DEXs, spot balances, users, and subaccounts (testnet-only feature).
Changes:
The implementation follows the same patterns as existing actions (ApproveAgent, Withdraw3, ApproveBuilderFee), ensuring consistency with EIP-712 signature generation and error handling.
This is not yet merged on official hyperliquid-rust-sdk. So use fork repo branch.