fix(sdk-core): stamp enterprise-id header on getVaultConfig call#9363
Open
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
Open
fix(sdk-core): stamp enterprise-id header on getVaultConfig call#9363bitgo-ai-agent-dev[bot] wants to merge 1 commit into
bitgo-ai-agent-dev[bot] wants to merge 1 commit into
Conversation
Contributor
ralph-bitgo
Bot
force-pushed
the
defi-496-enterprise-id-header
branch
from
July 27, 2026 15:26
8228319 to
9bc0820
Compare
bitgo-ai-agent-dev
Bot
force-pushed
the
defi-496-enterprise-id-header
branch
from
July 27, 2026 15:26
9bc0820 to
6a45ec4
Compare
ralph-bitgo
Bot
force-pushed
the
defi-496-enterprise-id-header
branch
from
July 27, 2026 15:39
774dfe2 to
ce3d765
Compare
bitgo-ai-agent-dev
Bot
force-pushed
the
defi-496-enterprise-id-header
branch
from
July 27, 2026 15:39
ce3d765 to
02a4e77
Compare
DefiVault.getVaultConfig() was calling the defi-service vault config endpoint without the `enterprise-id` header that defi-service requires. This caused the entire deposit flow to fail for UI clients whose access tokens don't have `accessToken.enterprise` populated as a fallback in WP's auth resolution. Fix: call `.set('enterprise-id', this.wallet.toJSON().enterprise)` on the GET request. The enterprise id is sourced directly from the wallet context via the IWallet.toJSON() accessor — no constructor change needed. Tests: add `enterprise: 'test-enterprise-id'` to mock wallet data, add `set: sinon.stub().returnsThis()` to mockRequest helper, and assert `.set('enterprise-id', 'test-enterprise-id')` is called on the GET. Ticket: DEFI-496 Session-Id: 1434552b-96ce-4eac-9922-cc2288aa5054 Task-Id: ba541f90-9eb1-45ed-a30f-a0605abde178
bitgo-ai-agent-dev
Bot
force-pushed
the
defi-496-enterprise-id-header
branch
from
July 27, 2026 15:41
02a4e77 to
974cd3f
Compare
ralph-bitgo
Bot
force-pushed
the
defi-496-enterprise-id-header
branch
from
July 27, 2026 15:42
974cd3f to
17fd5cb
Compare
bitgo-ai-agent-dev
Bot
force-pushed
the
defi-496-enterprise-id-header
branch
from
July 27, 2026 15:42
17fd5cb to
55a0150
Compare
venkateshv1266
marked this pull request as ready for review
July 27, 2026 16:13
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.
What
.set('enterprise-id', this.wallet.toJSON().enterprise)on thegetVaultConfigGET request to defi-serviceIWallet.toJSON()enterpriseto mock wallet data,setstub tomockRequest, and assertion that the header is sentWhy
DefiVault.getVaultConfig()was calling the defi-service vault config endpoint without theenterprise-idheader that defi-service requires to resolve vault detailsaccessToken.enterprisepopulated, so defi-service received an empty enterprise and returned 404/empty results, causing the entire deposit flow to fail at the first stepTest plan
yarn run unit-test --scope @bitgo/sdk-core(34 passing)getVaultConfigtest asserts.set('enterprise-id', 'test-enterprise-id')is calledTicket: DEFI-496