浏览代码

Update HyperliquidClient to include wallet address in CCXT configuration - Modified the initialization of the Hyperliquid API client to add support for walletAddress, ensuring compatibility with CCXT. Adjusted the handling of privateKey and secret to streamline configuration and improve clarity.

Carles Sentis 5 天之前
父节点
当前提交
e4bcfc2db1
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      src/hyperliquid_client.py

+ 6 - 2
src/hyperliquid_client.py

@@ -53,12 +53,16 @@ class HyperliquidClient:
                 
                 # Initialize with Hyperliquid-specific CCXT format
                 ccxt_config = {
-                    'privateKey': self.config.get('privateKey') or self.config.get('apiKey'),
+                    'apiKey': self.config.get('apiKey'),
                     'testnet': self.config.get('testnet', False),
                     'sandbox': self.config.get('sandbox', False),
                 }
                 
-                # Add secret if available (though Hyperliquid might not need it)
+                # Add walletAddress - this is required by CCXT Hyperliquid
+                if self.config.get('walletAddress'):
+                    ccxt_config['walletAddress'] = self.config['walletAddress']
+                
+                # Add secret if available
                 if self.config.get('secret'):
                     ccxt_config['secret'] = self.config['secret']