Skip to content

hyperliquid-rust-sdk:The Rust SDK's class_transfer method uses the wrong action type! #183

@zhangzhao2

Description

@zhangzhao2

你好,

在使用 hyperliquid-rust-sdk 的 class_transfer 方法时,发现存在以下问题:

问题描述:

  • 调用 class_transfer() 时返回 HTTP 422 错误
  • 根因:使用了错误的 action type "spotUser",应该使用 "usdClassTransfer"
  • 错误的签名方式:使用了 L1 action 签名,应该使用 EIP-712 签名

我已经完成了修复并测试通过,修改包括:

  1. 新增 UsdClassTransfer 结构体(支持 EIP-712)
  2. 新增 usd_class_transfer() 方法
  3. 将原 class_transfer() 标记为 deprecated

修改文件:

  • src/exchange/actions.rs
  • src/exchange/exchange_client.rs

如果方便,我可以提供:

  • 完整的代码修改
  • 测试用例
  • 与 Python SDK 的对比文档

请问是否可以添加我为贡献者,或者我通过其他方式提交代码?

谢谢!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions