Skip to content

Uppercase address in the "action" content causing signature error. #103

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

Closed
nom4dv3 opened this issue Jan 9, 2025 · 2 comments
Closed

Uppercase address in the "action" content causing signature error. #103

nom4dv3 opened this issue Jan 9, 2025 · 2 comments

Comments

@nom4dv3
Copy link

nom4dv3 commented Jan 9, 2025

Bug brief

When calling "spotDeploy" api, if the address list in "userAndWei" involves uppercase, it leads to signature error: L1 error: User or API Wallet 0xe62b09a760b8bd649cc678767fbb74c868b05111 does not exist., which is quite misleading.

How to reproduce

use the following to send api

action = {
        "type": "spotDeploy",
        "userGenesis":{
            "token": TOKEN_ID,
            # note: address should use lowercase, uppercase would cause signature error.
            "userAndWei": [["0xABCDEABCDEABCDEABCDEABCDEABCDEABCDEABCDE","0"]],
            "existingTokenAndWei": []
        }
    }

Suggestions

  1. In the chain node side, use the original message to recover signer address from signature rather the lowercase ones
  2. or, on the sdk side, either support auto toLowercase or throw error when it has uppercase.
@traderben
Copy link
Contributor

The sdk already lowercases addresses that need to be lowercased. You can see similar implementation for the builder code in orders: https://github.com/hyperliquid-dex/hyperliquid-python-sdk/blob/master/hyperliquid/exchange.py#L116
The sdk does not support spotDeploy so this cannot be an existing bug in the sdk.

@nom4dv3
Copy link
Author

nom4dv3 commented Jan 10, 2025

Correct, although suggestion#1 would be a cleaner solution.
Btw, I've added the spotDeploy here #104 , also covered the suggestion#2.

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

No branches or pull requests

2 participants