Skip to content

Conversation

BillyWooo
Copy link
Contributor

Replace the old SpotUser/ClassTransfer implementation with a new UsdClassTransfer action that uses proper EIP-712 typed data signing. This aligns with the Hyperliquid API's expected signature format, aswell as keeping alignment with hyperliquid-python-sdk.

Key changes:

  • Add UsdClassTransfer struct with EIP-712 implementation
  • Remove deprecated SpotUser and ClassTransfer structs
  • Update usd_class_transfer() to use sign_typed_data instead of sign_l1_action
  • Handle vault_address properly (set to None for usdClassTransfer actions)
  • Support subaccount suffix in amount string for vault transfers
  • Add comprehensive tests for signing with mainnet/testnet and vault scenarios

Replace the old SpotUser/ClassTransfer implementation with a new
UsdClassTransfer action that uses proper EIP-712 typed data signing.
This aligns with the Hyperliquid API's expected signature format, aswell as keeping alignment with hyperliquid-python-sdk.

Key changes:
- Add UsdClassTransfer struct with EIP-712 implementation
- Remove deprecated SpotUser and ClassTransfer structs
- Update usd_class_transfer() to use sign_typed_data instead of sign_l1_action
- Handle vault_address properly (set to None for usdClassTransfer actions)
- Support subaccount suffix in amount string for vault transfers
- Add comprehensive tests for signing with mainnet/testnet and vault scenarios
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.

1 participant