Skip to content

Conversation

@kfastov
Copy link
Contributor

@kfastov kfastov commented Sep 22, 2025

Summary

  • replace the deprecated SpotUser/ClassTransfer payload with the UsdClassTransfer typed-data schema expected by the API
  • sign the action via sign_typed_data and post it as Actions::UsdClassTransfer
  • surface the Hyperliquid chain metadata and reuse the typed-data nonce when submitting the request

Problem

Running cargo run --bin class_transfer (or calling ExchangeClient::class_transfer) against master returns a 422 from Hyperliquid:

Client error: status code: 422, error code: None, error message: Failed to deserialize the JSON body into the target type, error data: Some("expected value at line 1 column 1")

Hyperliquid migrated USD class transfers away from the SpotUser L1 action; the SDK is still sending that outdated payload, so the exchange rejects it before signature verification.

Testing

  • cargo test
  • RUST_LOG=info cargo run --bin class_transfer (now reaches the exchange and fails with the expected "Insufficient balance for withdrawal" response because the demo wallet is empty)

@kfastov kfastov force-pushed the fix/usd-class-transfer branch from 3c30e3f to 5af799f Compare October 21, 2025 11:00
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