core icon indicating copy to clipboard operation
core copied to clipboard

chore: update stablecoins LD config format

Open micaelae opened this issue 4 months ago • 0 comments

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-level stablecoins.
    • Update PlatformConfigSchema to validate top-level CAIP stablecoins list.
  • Slippage:
    • Refactor getDefaultSlippagePercentage to take srcAssetId, destAssetId, and global stablecoins (CAIP); adjust logic for cross-chain, Solana, and EVM stablecoin pairs.
    • Export getDefaultSlippagePercentage and BRIDGE_DEFAULT_SLIPPAGE from index.
  • Selectors/exports:
    • Remove selectDefaultSlippagePercentage selector and its exports/usages.
  • CAIP formatters:
    • formatAddressToAssetId now always returns a CAIP asset ID; lowercases EVM addresses and uses erc20: vs non‑EVM token:.
    • Improve error messages and deprecate formatAddressToCaipReference in JSDoc; add explicit throws docs.
  • Tests:
    • Update slippage tests to use CAIP asset IDs and new getDefaultSlippagePercentage API.
    • Adjust expectations per updated schemas and utilities.

Written by Cursor Bugbot for commit 80f273579c7ac8352526af1a3232ae579dbbc076. This will update automatically on new commits. Configure here.

micaelae avatar Oct 27 '25 18:10 micaelae