Repository navigation
fix(sdk-core): allow PA-approved DeFi legs to sign without txParams - #10225
Open
mullapudipruthvik wants to merge 1 commit into
Open
mullapudipruthvik wants to merge 1 commit into
mullapudipruthvik wants to merge 1 commit into
Conversation
Contributor
This was referenced Nov 24, 2026
Contributor
|
|
mullapudipruthvik
force-pushed
the
pruthvikpruthvik/DEFI-1356-defi-earn-bitgojs
branch
from
November 24, 2026 11:12
f646af8 to
80b81b6
Compare
WP persists DeFi intentTypes kebab-case while wallet.sendMany signs with the camelCase txParams.type, and the pendingApproval.approve() re-sign path carries no txParams at all — so the recipients guard fell back to the persisted kebab-case intentType and threw 'Recipient details are required'. resolveEffectiveTxParams now normalizes the kebab intentType to the camelCase txParams.type and reconstructs txParams.defiParams from the flattened intent fields (vaultId/amount, shareTokenAmount for defi-withdraw), mirroring the wrapApprove wrapParams reconstruction. The re-sign therefore both passes the guard and reaches the coin verifier's dedicated DeFi calldata checks, which key on the camelCase type — plain set registration would only have avoided the throw while downgrading verification to a warn. TransactionParams gains the defiParams field; a malformed intent reconstructs nothing and the verifier fails closed. Ticket: DEFI-1356
mullapudipruthvik
force-pushed
the
pruthvikpruthvik/DEFI-1356-defi-earn-bitgojs
branch
from
November 25, 2026 17:02
80b81b6 to
8afaa59
Compare
mullapudipruthvik
marked this pull request as ready for review
November 25, 2026 17:58
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
This branch has not been deployed
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.
Summary
WP persists DeFi intentTypes kebab-case while
wallet.sendManysigns with the camelCasetxParams.type, and thependingApproval.approve()re-sign path carries no txParams at all — so the recipients guard fell back to the persisted kebab-caseintentType(defi-approveetc.) and every DeFi approval re-sign threwRecipient details are required.The fix bridges the two spellings in
resolveEffectiveTxParams: it normalizes the kebab-case intentType to the camelCasetxParams.typeand reconstructstxParams.defiParamsfrom the flattened intent fields (vaultId/amount,shareTokenAmountfordefi-withdraw), mirroring the existing wrapApprove → wrapParams reconstruction. The re-sign therefore both passes the recipients guard and reaches the coin verifier's dedicated DeFi calldata checks, which key on the camelCase type — a plainNO_RECIPIENT_TX_TYPESregistration would only have avoided the throw while downgrading verification to a warn.TransactionParamsgains thedefiParamsfield; a malformed intent reconstructs nothing and the verifier fails closed withmissing required intent parameters.Note: the set keeps only the camelCase DeFi spellings — the normalization is the single bridge for the persisted kebab spelling, pinned by wiring tests through the real sign pipeline. (The wrap-native/unwrap-native dual registration is the older pattern; canonicalizing it is tracked separately.)
Verification
signRequestBase → resolveEffectiveTxParams → verifyTransactionpath asserting the verifier receives the camelCase type + reconstructed defiParams on the no-txParams PA path.Stack
Base of stack PRs #10225–#10230. Stacked-PR order: this PR merges first; the rest rebase onto master.
Ticket: DEFI-1356