feat(bridge-controller): expose metabridge discount type#9305
Merged
Conversation
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
…count-type # Conflicts: # packages/bridge-controller/CHANGELOG.md
SteP-n-s
approved these changes
Jun 30, 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.
Summary
quote.feeData.metabridge.discountTypethrough quote validation as an optional nullable string so clients can handle future discount types without losing quotes.Test plan
yarn workspace @metamask/bridge-controller test --runInBand --testPathPattern=src/utils/validators.test.ts --collectCoverage=falsegit diff --checkNote
Low Risk
Additive optional schema field and public enum export; no changes to quote handling logic beyond accepting an extra fee field.
Overview
Adds a
DiscountTypeenum (vip,promo,dao) and exports it from@metamask/bridge-controllerso clients can recognize known MetaBridge discount labels.FeeDataSchemanow accepts an optional, nullablediscountTypestring on metabridge fee entries (quote.feeData.metabridge.discountType). Validation stays permissive—unknown future string values still pass—so quotes are not dropped when the API adds new discount types.FeeDatatypes pick up the field via the existing schema inference.Validator tests cover absent/null/known/future
discountTypevalues, rejection of non-strings, and fullvalidateQuoteResponseV1with a promo discount. Changelog updated under Unreleased.Reviewed by Cursor Bugbot for commit 8373c05. Bugbot is set up for automated code reviews on this repo. Configure here.