core
core copied to clipboard
chore: update stablecoins LD config format
Explanation
References
Fixes https://github.com/MetaMask/core/pull/6616
Checklist
- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
- [ ] I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
- [ ] I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes
[!NOTE] Moves stablecoin config to a top-level CAIP asset list and updates slippage, selectors, validators, and CAIP formatting accordingly.
- Feature flags/config:
- Add
stablecoins: CaipAssetType[]to platform config and default config; remove chain-levelstablecoins.- Update
PlatformConfigSchemato validate top-level CAIP stablecoins list.- Slippage:
- Refactor
getDefaultSlippagePercentageto takesrcAssetId,destAssetId, and globalstablecoins(CAIP); adjust logic for cross-chain, Solana, and EVM stablecoin pairs.- Export
getDefaultSlippagePercentageandBRIDGE_DEFAULT_SLIPPAGEfrom index.- Selectors/exports:
- Remove
selectDefaultSlippagePercentageselector and its exports/usages.- CAIP formatters:
formatAddressToAssetIdnow always returns a CAIP asset ID; lowercases EVM addresses and useserc20:vs non‑EVMtoken:.- Improve error messages and deprecate
formatAddressToCaipReferencein JSDoc; add explicit throws docs.- Tests:
- Update slippage tests to use CAIP asset IDs and new
getDefaultSlippagePercentageAPI.- Adjust expectations per updated schemas and utilities.
Written by Cursor Bugbot for commit 80f273579c7ac8352526af1a3232ae579dbbc076. This will update automatically on new commits. Configure here.