-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use dedicated struct for wallet balance. #366
Comments
Hello, can I take this one and work on it? |
Sure give it a shot. |
Hey, I noticed the files mentioned in this issue have changed, especially the variants of the |
Current structure is mostly the same with some name changes. Irrespective of that the new balance structure will look as below. struct Balance {
regular: Amount, #aka seed balance
swap: Amount, #only the incoming swap coin balance
contract: Amount, #all unfinished timelock contract balance.
fidelity: Amount, #this only applies to the maker.
spendable:Amount #seed + swap balance
} You wanna build on top of #380 as some new APIs for calculating the above ones are added there. |
I have started working on the maker cli part and I was wondering if it’s okay to push the incomplete changes for you to take a look. It would be great to know if I’m heading in the right direction before I proceed further. |
Sure, open up a PR. |
Description:
Right now, our cli-apps have many rpc commands for showing balances of each utxo type and their total as shown below :
maker-cli
:coinswap/src/bin/maker-cli.rs
Lines 34 to 40 in ee050ee
taker-cli:
coinswap/src/bin/taker.rs
Lines 68 to 74 in ee050ee
Due to which , these cli-apps now have many rpc commands and could become a bad UX from user perspective as they would have to call different command to see a particular utxo balance.
Also
TotalBalance
rpc command intaker
cli app -> just show the total balance of the wallet -> It doesn't denote that which utxos type contribute to how much balance , which the user manually have to calculate by juggling among these rpc commands.Proposed Solution:
Instead, we can have a dedicated struct for denoting balances of each type as:
This struct would remove redundancy as we just to need to have single rpc command
get-balance
which would give balance of the wallet in this format , describing all the balance info , which a user must need to know.The text was updated successfully, but these errors were encountered: