|
104 | 104 | {"name": "nonce", "type": "uint64"}, |
105 | 105 | ] |
106 | 106 |
|
| 107 | +PERP_DEX_CLASS_TRANSFER_SIGN_TYPES = [ |
| 108 | + {"name": "hyperliquidChain", "type": "string"}, |
| 109 | + {"name": "dex", "type": "string"}, |
| 110 | + {"name": "token", "type": "string"}, |
| 111 | + {"name": "amount", "type": "string"}, |
| 112 | + {"name": "toPerp", "type": "bool"}, |
| 113 | + {"name": "nonce", "type": "uint64"}, |
| 114 | +] |
| 115 | + |
107 | 116 | TOKEN_DELEGATE_TYPES = [ |
108 | 117 | {"name": "hyperliquidChain", "type": "string"}, |
109 | 118 | {"name": "validator", "type": "address"}, |
@@ -341,6 +350,16 @@ def sign_usd_class_transfer_action(wallet, action, is_mainnet): |
341 | 350 | ) |
342 | 351 |
|
343 | 352 |
|
| 353 | +def sign_perp_dex_class_transfer_action(wallet, action, is_mainnet): |
| 354 | + return sign_user_signed_action( |
| 355 | + wallet, |
| 356 | + action, |
| 357 | + PERP_DEX_CLASS_TRANSFER_SIGN_TYPES, |
| 358 | + "HyperliquidTransaction:PerpDexClassTransfer", |
| 359 | + is_mainnet, |
| 360 | + ) |
| 361 | + |
| 362 | + |
344 | 363 | def sign_convert_to_multi_sig_user_action(wallet, action, is_mainnet): |
345 | 364 | return sign_user_signed_action( |
346 | 365 | wallet, |
@@ -392,7 +411,8 @@ def sign_token_delegate_action(wallet, action, is_mainnet): |
392 | 411 |
|
393 | 412 |
|
394 | 413 | def sign_inner(wallet, data): |
395 | | - signed = wallet.sign_typed_data(full_message=data) |
| 414 | + structured_data = encode_typed_data(full_message=data) |
| 415 | + signed = wallet.sign_message(structured_data) |
396 | 416 | return {"r": to_hex(signed["r"]), "s": to_hex(signed["s"]), "v": signed["v"]} |
397 | 417 |
|
398 | 418 |
|
|
0 commit comments