feat(sdk-core): add withdrawFromVault() to DefiVault#9229
Merged
sachinBitgo merged 1 commit intoJul 14, 2026
Merged
Conversation
Contributor
db0f2a6 to
948347d
Compare
OttoAllmendinger
requested changes
Jul 10, 2026
cc8533e to
053bfc2
Compare
OttoAllmendinger
requested changes
Jul 13, 2026
053bfc2 to
f8f5489
Compare
OttoAllmendinger
approved these changes
Jul 14, 2026
Venkat-Annavazzala
approved these changes
Jul 14, 2026
kamleshmugdiya
approved these changes
Jul 14, 2026
0xPrabh
approved these changes
Jul 14, 2026
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.
Description
Adds
withdrawFromVault()to theDefiVaultSDK class, completing the ERC-4626 vault lifecycle alongside the existingdepositToVault()/resumeDeposit()methods.What changed:
DefiVault.withdrawFromVault(params)— issues a singlesendManycall withtype: 'defiWithdraw'and returns{ operationId, txRequestId }. The withdrawal state machine is simpler than deposit (no approve step):CREATED → WITHDRAW_TX_REQUESTED → WITHDRAW_SIGNED → WITHDRAW_CONFIRMED → COMPLETED.IDefiVault— newwithdrawFromVaultmethod signature; newWithdrawFromVaultOptionsandWithdrawResulttypes exported fromiDefiVault.ts.mpcUtils.ts— addeddefi-withdrawintent case. Maps SDKamount→shareTokenAmountper theDefiWithdrawIntentschema inpublic-types(vault share tokens, not underlying asset units).recipientUtils.ts— addeddefiWithdrawtoNO_RECIPIENT_TX_TYPES(recipients/calldata are built server-side fromdefiParams).wallet.ts— addeddefiWithdrawcase insendManyintent dispatch.baseTypes.ts— addedshareTokenAmount?: stringtoDefiIntentFields; removedclientIdempotencyKey(cleanup).commitlint.config.js— addedDEFI-to recognized issue prefixes.examples/ts/defi-vault-deposit.tsandexamples/ts/defi-vault-withdraw.tsfor manual staging tests.Removed:
clientIdempotencyKeyfrom the deposit flow (not used server-side, cleaned up to reduce surface area).Issue
DEFI-237
Type of change
How Has This Been Tested?
modules/sdk-core/test/unit/bitgo/defi/defiVault.tscovering:sendManycalled with correctdefiWithdrawargs;operationId+txRequestIdreturnedapiVersion(unsignedTxs)operationIdextraction pathoperationIdin response throwswalletPassphraseforwarded correctlyvaultId/amountexamples/ts/defi-vault-withdraw.ts)Checklist
DEFI-237was included in the commit message as a reference