oasisprotocol / oasisprotocol/cli
Support relative amount for tokens and shares
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 80
- Forks
- 23
- Avg merge
- 9h 43m
- Merged PRs (30d)
- 3
Description
Currently, there is no simple way to empty your account apart from copying and pasting the amount and subtracting the fee. One way to solve this is to support both the absolute number of tokens to transfer or the relative share of your account:
oasis account transfer <amount|share%> <to> [flags]
CLI would compute the correct amount by querying the account balance, compute the relative amount, compute the fee and subtract the fee from the relative amount.
In the case above, one could empty the account by invoking:
oasis account transfer 100% my_cold_wallet
The relative amount could as well be implemented for deposits, withdrawals, allowances, delegations and the same for the ParaTime-layer transactions. The undelegate command could also use the relative amount of shares.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the account transfer CLI entry point and trace how balances, relative amounts, and transaction fees are calculated. Define the supported amount-or-share syntax and determine how it should apply to transfers and the other listed operations; done means relative percentages and shares work correctly, including fee subtraction and emptying an account.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- blockchain, cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100