fix: auto-convert wallet address to EIP-55 checksum format for Lighter API

This commit is contained in:
tinkle-community
2025-12-16 16:48:56 +08:00
parent e4d9ea032d
commit 96d3ab6cc5
2 changed files with 50 additions and 1 deletions

View File

@@ -99,6 +99,10 @@ func NewLighterTraderV2(walletAddr, apiKeyPrivateKeyHex string, apiKeyIndex int,
return nil, fmt.Errorf("wallet address is required")
}
// Convert to checksum address (Lighter API is case-sensitive)
walletAddr = ToChecksumAddress(walletAddr)
logger.Infof("Using checksum address: %s", walletAddr)
// 2. Validate API Key
if apiKeyPrivateKeyHex == "" {
return nil, fmt.Errorf("API Key private key is required")