Pārlūkot izejas kodu

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 dienas atpakaļ
vecāks
revīzija
e4bcfc2db1
1 mainītis faili ar 6 papildinājumiem un 2 dzēšanām
  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']