feat(Lighter): auto-fetch account index by address if subaccount not used#34
Open
SoYuCry wants to merge 1 commit intoyour-quantguy:mainfrom
Open
feat(Lighter): auto-fetch account index by address if subaccount not used#34SoYuCry wants to merge 1 commit intoyour-quantguy:mainfrom
SoYuCry wants to merge 1 commit intoyour-quantguy:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🧠 背景
许多用户在运行 Lighter 策略时,会被环境变量配置中的
LIGHTER_ACCOUNT_INDEX搞懵。实际上,大部分用户并没有创建子账户,只是使用主账户进行交易。
在这种情况下,强制要求他们手动去网页查找
account_index既繁琐又容易出错。🚀 改动内容
LIGHTER_ACCOUNT_INDEX时,自动通过LIGHTER_ADDRESS获取主账户的account_index。API_KEY_PRIVATE_KEY。LIGHTER_ACCOUNT_INDEX和LIGHTER_ADDRESS二选一。account_index,使调试信息更直观。✅ 测试结果
已通过单测。
验证了以下场景:
account_index时自动根据钱包获取;LIGHTER_ACCOUNT_INDEX时逻辑不受影响;