@exodus/assets
Advanced tools
+10
-0
@@ -6,2 +6,12 @@ # Change Log | ||
| ## [11.5.0](https://github.com/ExodusMovement/assets/compare/@exodus/assets@11.4.0...@exodus/assets@11.5.0) (2025-08-29) | ||
| ### Features | ||
| * feat: add metadata to combined assets (#6082) | ||
| ## [11.4.0](https://github.com/ExodusMovement/assets/compare/@exodus/assets@11.3.2...@exodus/assets@11.4.0) (2025-08-04) | ||
@@ -8,0 +18,0 @@ |
+5
-5
| { | ||
| "name": "@exodus/assets", | ||
| "version": "11.4.0", | ||
| "version": "11.5.0", | ||
| "description": "Exodus assets", | ||
@@ -16,3 +16,3 @@ "type": "module", | ||
| "dependencies": { | ||
| "@exodus/asset": "^2.0.3", | ||
| "@exodus/asset": "^2.1.0", | ||
| "@exodus/basic-utils": "^3.0.1", | ||
@@ -26,7 +26,7 @@ "@exodus/bip44-constants": "^195.0.0", | ||
| "devDependencies": { | ||
| "@exodus/assets-base": "^12.3.0", | ||
| "@exodus/assets-base": "^12.4.0", | ||
| "@exodus/binance-lib": "^2.1.0", | ||
| "@exodus/bnbmainnet-meta": "^2.0.3", | ||
| "@exodus/cardano-meta": "^2.1.0", | ||
| "@exodus/combined-assets-meta": "^3.6.0" | ||
| "@exodus/combined-assets-meta": "^3.7.0" | ||
| }, | ||
@@ -48,3 +48,3 @@ "scripts": { | ||
| }, | ||
| "gitHead": "177b7c95d9818222fa9887f7b5698e363e122e31" | ||
| "gitHead": "f15326773ce9f65dbea53ff245960cb7f8b62e9e" | ||
| } |
@@ -182,3 +182,3 @@ /* eslint-disable @exodus/mutable/no-param-reassign-prop-only */ | ||
| const asset = createCombined(assetDef, assets) | ||
| const asset = createCombined(assetDef) | ||
| validateCombinedAssetDef(asset) | ||
@@ -230,3 +230,3 @@ try { | ||
| validateCombinedAssetDef(assetDef) | ||
| const asset = createCombined(assetDef, assets) | ||
| const asset = createCombined(assetDef) | ||
| try { | ||
@@ -233,0 +233,0 @@ assets[name] = asset |
+25
-14
@@ -7,14 +7,29 @@ import { UnitType } from '@exodus/currency' | ||
| const ensureField = (key, assetDef, assets) => { | ||
| const primaryAssetDef = assets[assetDef.combinedAssetNames[0]] | ||
| return !assetDef[key] && primaryAssetDef[key] | ||
| ? { [key]: cloneDeep(primaryAssetDef[key]) } | ||
| : Object.create(null) | ||
| } | ||
| export function createCombined(assetDef) { | ||
| const { | ||
| name, | ||
| ticker, | ||
| displayName, | ||
| displayTicker, | ||
| assetType, | ||
| units, | ||
| combinedAssetNames, | ||
| info, | ||
| primaryColor, | ||
| gradientColors, | ||
| chainBadgeColors, | ||
| } = assetDef | ||
| export function createCombined(assetDef, assets) { | ||
| const { name, ticker, displayName, displayTicker, assetType, units, combinedAssetNames } = | ||
| assetDef | ||
| assert( | ||
| name && ticker && displayName && displayTicker && assetType && units && combinedAssetNames, | ||
| name && | ||
| ticker && | ||
| displayName && | ||
| displayTicker && | ||
| assetType && | ||
| units && | ||
| combinedAssetNames && | ||
| info && | ||
| primaryColor && | ||
| gradientColors && | ||
| chainBadgeColors, | ||
| `mandatory filed missing for combined asset ${JSON.stringify(assetDef)}` | ||
@@ -40,6 +55,2 @@ ) | ||
| isCombined: true, | ||
| ...ensureField('chainBadgeColors', cloned, assets), | ||
| ...ensureField('gradientColors', cloned, assets), | ||
| ...ensureField('info', cloned, assets), | ||
| ...ensureField('primaryColor', cloned, assets), | ||
@@ -46,0 +57,0 @@ properName: displayName, // deprecated, |
475
2.37%31792
-0.19%Updated