feat(): added direction for leverage and wallet storage#11
Draft
UjmaIT wants to merge 1 commit into
Draft
Conversation
Author
|
What do you think about the leverage handling. Regarding the balance handling I think i will go for custom solution in my usecase |
tiagosiebler
approved these changes
Apr 17, 2025
tiagosiebler
left a comment
Member
There was a problem hiding this comment.
It's well thought out, makes a lot of sense to me. Only nitpicky question is about silently swallowing the error in the dump state (and what kind of error you saw here). I'd prefer you logged it. If rogue lib-driven console logs are a concern, could add a config to that fn that allows you to either disable the log and/or throw it
| // Handle in a way that doesn't require console | ||
| return stateString; | ||
| } catch (error) { | ||
| // Silently handle errors |
Member
There was a problem hiding this comment.
Were you seeing exceptions here? Why not log the error?
Comment on lines
256
to
258
| setSymbolLeverage(symbol: string, leverage: number): void { | ||
| this.accountLeverageState[symbol] = leverage; | ||
| this.accountLeverageState[symbol] = { buy: leverage, sell: leverage }; | ||
| } |
Member
There was a problem hiding this comment.
Good that you kept the symbol leverage setter without a side - less friction for upgrading to this
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.
Still in work
Summary
Additional Information
Currently still testing this.
Creating PR for now to know if my code makes sense for you or if we each should go own directions with this.
PR Checklist
As part of the PR, make sure you have:
npm installruns without issue.npm run buildruns without issue.