-
Notifications
You must be signed in to change notification settings - Fork 20
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
Feat: enable vault withdraw all collateral #727
Feat: enable vault withdraw all collateral #727
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. Would it be useful to provide a canWithdrawAll
or something for the UI? Or can UI easily detect that already?
|
I tried a few angles with the existing test redeem utility code but had no luck. Or at least it didn't settle immediately. |
There are a few methods that should do the trick already. The two first that come to mind are:
const vaultExt = await vaultsApi.get(vaultAccountId, collateralCurrency));
const issuedAmount = vaultExt.getBackedTokens(); // includes to-be-issued (Link to signature for get, and link to getBackedTokens) |
Yea that's right (but u could just sudo-mint some if you don't mind some state inconsistencies) |
Thanks for the self redeem tip! |
Resolves #725
Added new endpoints to easier withdraw all collateral for vaults.
Note: Tested manually.
No integration test case sadly, because all the spun up and funded vaults end up with some tokens issued or to-be-issued left over from previous non-idempotent test cases.