@gearbox-protocol/ui-kit 3.14.0-next.66 → 3.14.0-next.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/cjs/components/assets-list-cell/assets-list-cell.cjs +1 -1
  2. package/dist/cjs/components/block-sync/block-sync.cjs +1 -1
  3. package/dist/cjs/components/block-sync-pill/block-sync-pill.cjs +1 -1
  4. package/dist/cjs/components/breakpoint-provider.cjs +1 -0
  5. package/dist/cjs/components/checkbox/checkbox-labeled.cjs +1 -1
  6. package/dist/cjs/components/client-adapters/styled-rounded-image/styled-rounded-image.cjs +1 -1
  7. package/dist/cjs/components/complex-input/complex-input.cjs +1 -1
  8. package/dist/cjs/components/composites/index.cjs +1 -1
  9. package/dist/cjs/components/composites/pool-assets-table/pool-assets-table-head.cjs +1 -1
  10. package/dist/cjs/components/composites/pool-credit-managers-table/pool-credit-managers-table-head.cjs +1 -1
  11. package/dist/cjs/components/composites/pool-table/columns.cjs +1 -1
  12. package/dist/cjs/components/composites/strategies-table/columns.cjs +1 -1
  13. package/dist/cjs/components/composites/strategies-table/components/cells/cells.cjs +1 -1
  14. package/dist/cjs/components/composites/strategies-table/components/cells/index.cjs +1 -1
  15. package/dist/cjs/components/composites/strategies-table/components/index.cjs +1 -1
  16. package/dist/cjs/components/composites/strategies-table/components/points-feature/points-feature.cjs +1 -1
  17. package/dist/cjs/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.cjs +1 -1
  18. package/dist/cjs/components/composites/strategies-table/components/strategies-table.cjs +1 -1
  19. package/dist/cjs/components/composites/strategies-table/index.cjs +1 -1
  20. package/dist/cjs/components/composites/strategies-table/types/index.cjs +1 -1
  21. package/dist/cjs/components/composites/strategies-table/types/rewards-cell.cjs +1 -0
  22. package/dist/cjs/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.cjs +1 -1
  23. package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.cjs +1 -1
  24. package/dist/cjs/components/compound-apy/compound-apy-legacy.cjs +1 -0
  25. package/dist/cjs/components/compound-apy/compound-apy.cjs +1 -1
  26. package/dist/cjs/components/compound-apy/index.cjs +1 -1
  27. package/dist/cjs/components/detailed-page-title/detailed-page-title.cjs +1 -1
  28. package/dist/cjs/components/index.cjs +1 -1
  29. package/dist/cjs/components/markdown-viewer/markdown-viewer.cjs +1 -1
  30. package/dist/cjs/components/pool-apy-tooltip/apy-tooltip.cjs +1 -0
  31. package/dist/cjs/components/pool-apy-tooltip/index.cjs +1 -1
  32. package/dist/cjs/components/pool-apy-tooltip/pool-apy-tooltip.cjs +1 -1
  33. package/dist/cjs/components/time-to-liquidation/time-to-liquidation.cjs +1 -1
  34. package/dist/cjs/components/token-icon/token-icon.cjs +1 -1
  35. package/dist/cjs/components/token-symbol/index.cjs +1 -1
  36. package/dist/cjs/components/token-symbol/token-symbol.cjs +1 -1
  37. package/dist/cjs/components/tokens-list-cell/tokens-list-cell.cjs +1 -1
  38. package/dist/cjs/components/with-copy/with-copy.cjs +1 -1
  39. package/dist/cjs/components/yield-breakdown-tooltip/index.cjs +1 -0
  40. package/dist/cjs/components/yield-breakdown-tooltip/yield-breakdown-tooltip.cjs +1 -0
  41. package/dist/cjs/hooks/use-debounce-call.cjs +1 -1
  42. package/dist/cjs/hooks/use-media-query.cjs +1 -1
  43. package/dist/cjs/index.cjs +1 -1
  44. package/dist/cjs/locale/en.json.cjs +1 -1
  45. package/dist/cjs/types/common.cjs +1 -1
  46. package/dist/cjs/utils/apy-breakdown.cjs +1 -0
  47. package/dist/cjs/utils/bps.cjs +1 -0
  48. package/dist/cjs/utils/index.cjs +1 -1
  49. package/dist/cjs/utils/token-icon-source.cjs +1 -0
  50. package/dist/esm/components/assets-list-cell/assets-list-cell.js +132 -206
  51. package/dist/esm/components/block-sync/block-sync.js +5 -4
  52. package/dist/esm/components/block-sync-pill/block-sync-pill.js +5 -4
  53. package/dist/esm/components/breakpoint-provider.js +67 -0
  54. package/dist/esm/components/checkbox/checkbox-labeled.js +3 -2
  55. package/dist/esm/components/client-adapters/styled-rounded-image/styled-rounded-image.js +3 -2
  56. package/dist/esm/components/complex-input/complex-input.js +5 -4
  57. package/dist/esm/components/composites/index.js +86 -81
  58. package/dist/esm/components/composites/pool-assets-table/pool-assets-table-head.js +3 -2
  59. package/dist/esm/components/composites/pool-credit-managers-table/pool-credit-managers-table-head.js +3 -2
  60. package/dist/esm/components/composites/pool-table/columns.js +61 -60
  61. package/dist/esm/components/composites/strategies-table/columns.js +55 -86
  62. package/dist/esm/components/composites/strategies-table/components/cells/cells.js +150 -110
  63. package/dist/esm/components/composites/strategies-table/components/cells/index.js +7 -5
  64. package/dist/esm/components/composites/strategies-table/components/index.js +32 -30
  65. package/dist/esm/components/composites/strategies-table/components/points-feature/points-feature.js +35 -32
  66. package/dist/esm/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.js +91 -224
  67. package/dist/esm/components/composites/strategies-table/components/strategies-table.js +26 -24
  68. package/dist/esm/components/composites/strategies-table/index.js +36 -31
  69. package/dist/esm/components/composites/strategies-table/types/index.js +5 -1
  70. package/dist/esm/components/composites/strategies-table/types/rewards-cell.js +40 -0
  71. package/dist/esm/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.js +32 -189
  72. package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmModalView.js +5 -4
  73. package/dist/esm/components/compound-apy/compound-apy-legacy.js +127 -0
  74. package/dist/esm/components/compound-apy/compound-apy.js +56 -245
  75. package/dist/esm/components/compound-apy/index.js +4 -2
  76. package/dist/esm/components/detailed-page-title/detailed-page-title.js +25 -180
  77. package/dist/esm/components/index.js +805 -787
  78. package/dist/esm/components/markdown-viewer/markdown-viewer.js +5 -4
  79. package/dist/esm/components/pool-apy-tooltip/apy-tooltip.js +155 -0
  80. package/dist/esm/components/pool-apy-tooltip/index.js +4 -2
  81. package/dist/esm/components/pool-apy-tooltip/pool-apy-tooltip.js +3 -3
  82. package/dist/esm/components/time-to-liquidation/time-to-liquidation.js +3 -2
  83. package/dist/esm/components/token-icon/token-icon.js +72 -58
  84. package/dist/esm/components/token-symbol/index.js +2 -3
  85. package/dist/esm/components/token-symbol/token-symbol.js +41 -62
  86. package/dist/esm/components/tokens-list-cell/tokens-list-cell.js +35 -192
  87. package/dist/esm/components/with-copy/with-copy.js +5 -4
  88. package/dist/esm/components/yield-breakdown-tooltip/index.js +4 -0
  89. package/dist/esm/components/yield-breakdown-tooltip/yield-breakdown-tooltip.js +222 -0
  90. package/dist/esm/hooks/use-debounce-call.js +3 -2
  91. package/dist/esm/hooks/use-media-query.js +49 -16
  92. package/dist/esm/index.js +974 -946
  93. package/dist/esm/locale/en.json.js +9 -2
  94. package/dist/esm/types/common.js +1 -6
  95. package/dist/esm/utils/apy-breakdown.js +18 -0
  96. package/dist/esm/utils/bps.js +4 -0
  97. package/dist/esm/utils/index.js +105 -95
  98. package/dist/esm/utils/token-icon-source.js +48 -0
  99. package/dist/globals.css +1 -1
  100. package/dist/types/components/assets-list-cell/assets-list-cell.d.ts +44 -4
  101. package/dist/types/components/breakpoint-provider.d.ts +56 -0
  102. package/dist/types/components/composites/pool-table/pool-table-backend-contract.types.d.ts +1 -1
  103. package/dist/types/components/composites/strategies-table/components/cells/cells.d.ts +34 -3
  104. package/dist/types/components/composites/strategies-table/components/points-feature/points-feature.d.ts +14 -10
  105. package/dist/types/components/composites/strategies-table/components/rewards-tooltip/tooltip-content.d.ts +10 -13
  106. package/dist/types/components/composites/strategies-table/index.d.ts +1 -1
  107. package/dist/types/components/composites/strategies-table/types/index.d.ts +1 -0
  108. package/dist/types/components/composites/strategies-table/types/rewards-cell.d.ts +48 -0
  109. package/dist/types/components/composites/strategies-table/types/rewards-tooltip.d.ts +37 -32
  110. package/dist/types/components/composites/strategies-table/types/table.d.ts +27 -12
  111. package/dist/types/components/composites/tx-preview/confirm/amounts/TransactionConfirmAmountField.d.ts +3 -3
  112. package/dist/types/components/compound-apy/compound-apy-legacy.d.ts +109 -0
  113. package/dist/types/components/compound-apy/compound-apy.d.ts +18 -94
  114. package/dist/types/components/compound-apy/index.d.ts +1 -0
  115. package/dist/types/components/index.d.ts +3 -1
  116. package/dist/types/components/points-icon/index.d.ts +1 -1
  117. package/dist/types/components/points-icon/points-icon.d.ts +13 -2
  118. package/dist/types/components/pool-apy-tooltip/apy-tooltip.d.ts +20 -0
  119. package/dist/types/components/pool-apy-tooltip/index.d.ts +1 -0
  120. package/dist/types/components/pool-apy-tooltip/pool-apy-tooltip.d.ts +18 -1
  121. package/dist/types/components/token-icon/token-icon.d.ts +11 -2
  122. package/dist/types/components/token-symbol/token-symbol.d.ts +4 -4
  123. package/dist/types/components/yield-breakdown-tooltip/index.d.ts +1 -0
  124. package/dist/types/components/yield-breakdown-tooltip/yield-breakdown-tooltip.d.ts +32 -0
  125. package/dist/types/hooks/use-media-query.d.ts +5 -1
  126. package/dist/types/index.d.ts +2 -0
  127. package/dist/types/locale/en.json.d.ts +10 -2
  128. package/dist/types/types/common.d.ts +5 -11
  129. package/dist/types/utils/apy-breakdown.d.ts +18 -0
  130. package/dist/types/utils/bps.d.ts +3 -0
  131. package/dist/types/utils/index.d.ts +3 -0
  132. package/dist/types/utils/token-icon-source.d.ts +28 -0
  133. package/package.json +2 -2
@@ -67,6 +67,15 @@ const e = {
67
67
  "components.apyParts.totalAPY": "Overall APY",
68
68
  "components.apyParts.points": "{symbol} Incentive",
69
69
  "components.apyParts.points.condition.crossDeposit": "For cross-chain deposits made via Omni",
70
+ "components.yieldBreakdown.title": "Yield Breakdown",
71
+ "components.yieldBreakdown.atLeverage": "at {leverage}× leverage",
72
+ "components.yieldBreakdown.baseYield": "Base Yield",
73
+ "components.yieldBreakdown.incentiveYield": "Incentive Yield",
74
+ "components.yieldBreakdown.borrowRate": "Borrow Rate",
75
+ "components.yieldBreakdown.baseRate": "Base Rate",
76
+ "components.yieldBreakdown.additionalRate": "Additional Rate",
77
+ "components.yieldBreakdown.netYield": "Net Yield",
78
+ "components.yieldBreakdown.points": "Points",
70
79
  "components.openCopyButtons.copy": "Copy to clipboard",
71
80
  "components.poolAssetsTable.asset": "Asset",
72
81
  "components.poolAssetsTable.rate": "Effective rate",
@@ -121,8 +130,6 @@ const e = {
121
130
  "components.rewardsTooltip.with.title": "With {leverage} Leverage",
122
131
  "components.rewardsTooltip.with.borrowRate": "{symbol} borrow rate",
123
132
  "components.rewardsTooltip.with.quotaRate": "Quota rate",
124
- "components.rewardsTooltip.with.bonusAPY.title": "Target Bonuses Yield",
125
- "components.rewardsTooltip.with.bonusAPY.tip": "Expected Bonuses APY is calculated by the Asset Issuer and represents the expected value to be paid out in points.",
126
133
  "components.rewardsTooltip.with.extra": "+ Extra APR",
127
134
  "components.rewardsTooltip.button": "Click to show rewards details",
128
135
  "components.strategiesTable.head.name": "Strategy",
@@ -1,6 +1 @@
1
- function n(o) {
2
- return typeof o == "object" && o !== null && "kind" in o && o.kind === "composite";
3
- }
4
- export {
5
- n as isIconComposite
6
- };
1
+
@@ -0,0 +1,18 @@
1
+ function o(t) {
2
+ return t.totalApy ?? t.organicApy;
3
+ }
4
+ function r(t) {
5
+ return (t.rewards ?? []).flatMap((n) => n.kind === "token" ? [n] : []);
6
+ }
7
+ function e(t) {
8
+ return (t.rewards ?? []).flatMap((n) => n.kind === "point" ? n.points : []);
9
+ }
10
+ function i(t) {
11
+ return r(t).filter((n) => (n.supplyApr ?? 0) > 0);
12
+ }
13
+ export {
14
+ e as pointProgramsOf,
15
+ i as positiveTokenRewardsOf,
16
+ r as tokenRewardsOf,
17
+ o as totalApyOf
18
+ };
@@ -0,0 +1,4 @@
1
+ const o = (e) => e / 100;
2
+ export {
3
+ o as bpsToPercent
4
+ };
@@ -1,97 +1,107 @@
1
- import { generateId as t, useFormFieldIds as r } from "./a11y.js";
2
- import { bnToInputView as m } from "./bn-to-input-view.js";
3
- import { bnToPrettyView as n } from "./bn-to-pretty-view.js";
4
- import { cn as l, cn as f } from "./cn.js";
5
- import { generateColorsFromBase as x, getCSSVariable as T, hexToRgba as c, hslToHex as g, resolveCSSColor as S } from "./colors.js";
6
- import { copyToClipboard as d } from "./copy.js";
7
- import { convertPercent as N, formatBytecodeSize as b, formatBytecodeVersion as A, formatTimestamp as I, shortenHash as v, significantTrunc as L } from "./format.js";
8
- import { formatAssetAmount as y } from "./format-asset-amount.js";
9
- import { formatMoney as F, formatMoneyAmount as k, formatPercentAmount as w, percentTemplate as D, percentageTemplate as V } from "./format-money.js";
10
- import { FORMAT_CONSTANTS as M, formatNumberWithSuffix as _, formatPrice as E, getAdaptiveDecimals as H, isBelowDisplayThreshold as W, isEffectivelyZero as Z, toSignificantDigits as z } from "./format-number.js";
11
- import { slippageTemplate as R } from "./format-slippage.js";
12
- import { allLoaded as q, loadingProgress as U, round5 as j } from "./loading.js";
13
- import { decimalsToStep as J, findClosestPoint as K, formatWithDecimals as Q, formatWithoutDecimals as Y, splitInterval as $, validateMinMax as ee } from "./math.js";
14
- import { getNetworkIcon as te } from "./network-icons.js";
15
- import { bnToLiquidationPriceView as ae, isPositiveFloat as me, parseInputToBN as ie, parseSmallNumber as ne } from "./parse-input-to-bn.js";
16
- import { pluralize as le, selectPluralString as fe } from "./plural.js";
17
- import { getAvailableRanges as xe } from "./ranges.js";
18
- import { extractTextFromLabel as ce, serializeValue as ge } from "./react.js";
19
- import { searchInString as ue } from "./search.js";
20
- import { createTokenSearchFilter as he, searchInToken as Ne } from "./search-in-token.js";
21
- import { shortSHA as Ae } from "./short-sha.js";
22
- import { isLongString as ve, shortenString as Le } from "./shorten-string.js";
23
- import { negativeTokenTemplate as ye, tokenTemplate as Ce, tokenTemplateNumber as Fe, tokenTemplateString as ke } from "./templates.js";
24
- import { TTL_CONSTANTS as De, getTTLZones as Ve, ttlFromTimestamp as Be, ttlLeft as Me, ttlLeftHuman as _e } from "./ttl.js";
25
- import { openInNewWindow as He } from "./window.js";
26
- import { Z_INDEX as Ze, Z_INDEX_VALUES as ze } from "./z-index.js";
1
+ import { generateId as r, useFormFieldIds as t } from "./a11y.js";
2
+ import { pointProgramsOf as m, positiveTokenRewardsOf as n, tokenRewardsOf as i, totalApyOf as p } from "./apy-breakdown.js";
3
+ import { bnToInputView as l } from "./bn-to-input-view.js";
4
+ import { bnToPrettyView as T } from "./bn-to-pretty-view.js";
5
+ import { bpsToPercent as c } from "./bps.js";
6
+ import { cn as S, cn as d } from "./cn.js";
7
+ import { generateColorsFromBase as h, getCSSVariable as b, hexToRgba as A, hslToHex as I, resolveCSSColor as N } from "./colors.js";
8
+ import { copyToClipboard as P } from "./copy.js";
9
+ import { convertPercent as y, formatBytecodeSize as w, formatBytecodeVersion as L, formatTimestamp as C, shortenHash as F, significantTrunc as D } from "./format.js";
10
+ import { formatAssetAmount as V } from "./format-asset-amount.js";
11
+ import { formatMoney as M, formatMoneyAmount as R, formatPercentAmount as _, percentTemplate as E, percentageTemplate as H } from "./format-money.js";
12
+ import { FORMAT_CONSTANTS as Z, formatNumberWithSuffix as z, formatPrice as U, getAdaptiveDecimals as X, isBelowDisplayThreshold as q, isEffectivelyZero as j, toSignificantDigits as G } from "./format-number.js";
13
+ import { slippageTemplate as K } from "./format-slippage.js";
14
+ import { allLoaded as Y, loadingProgress as $, round5 as ee } from "./loading.js";
15
+ import { decimalsToStep as re, findClosestPoint as te, formatWithDecimals as ae, formatWithoutDecimals as me, splitInterval as ne, validateMinMax as ie } from "./math.js";
16
+ import { getNetworkIcon as fe } from "./network-icons.js";
17
+ import { bnToLiquidationPriceView as se, isPositiveFloat as Te, parseInputToBN as xe, parseSmallNumber as ce } from "./parse-input-to-bn.js";
18
+ import { pluralize as Se, selectPluralString as de } from "./plural.js";
19
+ import { getAvailableRanges as he } from "./ranges.js";
20
+ import { extractTextFromLabel as Ae, serializeValue as Ie } from "./react.js";
21
+ import { searchInString as ke } from "./search.js";
22
+ import { createTokenSearchFilter as ve, searchInToken as ye } from "./search-in-token.js";
23
+ import { shortSHA as Le } from "./short-sha.js";
24
+ import { isLongString as Fe, shortenString as De } from "./shorten-string.js";
25
+ import { negativeTokenTemplate as Ve, tokenTemplate as Be, tokenTemplateNumber as Me, tokenTemplateString as Re } from "./templates.js";
26
+ import { getTokenIcon as Ee, parseShareTokenUnderlying as He } from "./token-icon-source.js";
27
+ import { TTL_CONSTANTS as Ze, getTTLZones as ze, ttlFromTimestamp as Ue, ttlLeft as Xe, ttlLeftHuman as qe } from "./ttl.js";
28
+ import { openInNewWindow as Ge } from "./window.js";
29
+ import { Z_INDEX as Ke, Z_INDEX_VALUES as Qe } from "./z-index.js";
27
30
  export {
28
- M as FORMAT_CONSTANTS,
29
- De as TTL_CONSTANTS,
30
- Ze as Z_INDEX,
31
- ze as Z_INDEX_VALUES,
32
- q as allLoaded,
33
- m as bnToInputView,
34
- ae as bnToLiquidationPriceView,
35
- n as bnToPrettyView,
36
- l as cn,
37
- N as convertPercent,
38
- d as copyToClipboard,
39
- he as createTokenSearchFilter,
40
- J as decimalsToStep,
41
- f as default,
42
- ce as extractTextFromLabel,
43
- K as findClosestPoint,
44
- y as formatAssetAmount,
45
- b as formatBytecodeSize,
46
- A as formatBytecodeVersion,
47
- F as formatMoney,
48
- k as formatMoneyAmount,
49
- _ as formatNumberWithSuffix,
50
- w as formatPercentAmount,
51
- E as formatPrice,
52
- I as formatTimestamp,
53
- Q as formatWithDecimals,
54
- Y as formatWithoutDecimals,
55
- x as generateColorsFromBase,
56
- t as generateId,
57
- H as getAdaptiveDecimals,
58
- xe as getAvailableRanges,
59
- T as getCSSVariable,
60
- te as getNetworkIcon,
61
- Ve as getTTLZones,
62
- c as hexToRgba,
63
- g as hslToHex,
64
- W as isBelowDisplayThreshold,
65
- Z as isEffectivelyZero,
66
- ve as isLongString,
67
- me as isPositiveFloat,
68
- U as loadingProgress,
69
- ye as negativeTokenTemplate,
70
- He as openInNewWindow,
71
- ie as parseInputToBN,
72
- ne as parseSmallNumber,
73
- D as percentTemplate,
74
- V as percentageTemplate,
75
- le as pluralize,
76
- S as resolveCSSColor,
77
- j as round5,
78
- ue as searchInString,
79
- Ne as searchInToken,
80
- fe as selectPluralString,
81
- ge as serializeValue,
82
- Ae as shortSHA,
83
- v as shortenHash,
84
- Le as shortenString,
85
- L as significantTrunc,
86
- R as slippageTemplate,
87
- $ as splitInterval,
88
- z as toSignificantDigits,
89
- Ce as tokenTemplate,
90
- Fe as tokenTemplateNumber,
91
- ke as tokenTemplateString,
92
- Be as ttlFromTimestamp,
93
- Me as ttlLeft,
94
- _e as ttlLeftHuman,
95
- r as useFormFieldIds,
96
- ee as validateMinMax
31
+ Z as FORMAT_CONSTANTS,
32
+ Ze as TTL_CONSTANTS,
33
+ Ke as Z_INDEX,
34
+ Qe as Z_INDEX_VALUES,
35
+ Y as allLoaded,
36
+ l as bnToInputView,
37
+ se as bnToLiquidationPriceView,
38
+ T as bnToPrettyView,
39
+ c as bpsToPercent,
40
+ S as cn,
41
+ y as convertPercent,
42
+ P as copyToClipboard,
43
+ ve as createTokenSearchFilter,
44
+ re as decimalsToStep,
45
+ d as default,
46
+ Ae as extractTextFromLabel,
47
+ te as findClosestPoint,
48
+ V as formatAssetAmount,
49
+ w as formatBytecodeSize,
50
+ L as formatBytecodeVersion,
51
+ M as formatMoney,
52
+ R as formatMoneyAmount,
53
+ z as formatNumberWithSuffix,
54
+ _ as formatPercentAmount,
55
+ U as formatPrice,
56
+ C as formatTimestamp,
57
+ ae as formatWithDecimals,
58
+ me as formatWithoutDecimals,
59
+ h as generateColorsFromBase,
60
+ r as generateId,
61
+ X as getAdaptiveDecimals,
62
+ he as getAvailableRanges,
63
+ b as getCSSVariable,
64
+ fe as getNetworkIcon,
65
+ ze as getTTLZones,
66
+ Ee as getTokenIcon,
67
+ A as hexToRgba,
68
+ I as hslToHex,
69
+ q as isBelowDisplayThreshold,
70
+ j as isEffectivelyZero,
71
+ Fe as isLongString,
72
+ Te as isPositiveFloat,
73
+ $ as loadingProgress,
74
+ Ve as negativeTokenTemplate,
75
+ Ge as openInNewWindow,
76
+ xe as parseInputToBN,
77
+ He as parseShareTokenUnderlying,
78
+ ce as parseSmallNumber,
79
+ E as percentTemplate,
80
+ H as percentageTemplate,
81
+ Se as pluralize,
82
+ m as pointProgramsOf,
83
+ n as positiveTokenRewardsOf,
84
+ N as resolveCSSColor,
85
+ ee as round5,
86
+ ke as searchInString,
87
+ ye as searchInToken,
88
+ de as selectPluralString,
89
+ Ie as serializeValue,
90
+ Le as shortSHA,
91
+ F as shortenHash,
92
+ De as shortenString,
93
+ D as significantTrunc,
94
+ K as slippageTemplate,
95
+ ne as splitInterval,
96
+ G as toSignificantDigits,
97
+ i as tokenRewardsOf,
98
+ Be as tokenTemplate,
99
+ Me as tokenTemplateNumber,
100
+ Re as tokenTemplateString,
101
+ p as totalApyOf,
102
+ Ue as ttlFromTimestamp,
103
+ Xe as ttlLeft,
104
+ qe as ttlLeftHuman,
105
+ t as useFormFieldIds,
106
+ ie as validateMinMax
97
107
  };
@@ -0,0 +1,48 @@
1
+ import { getStatic as s } from "./static.js";
2
+ const f = s("/tokens/templates/diesel.svg"), l = s("/logo/logo_symbol.png"), n = /V\d+$/, o = "_OLD", u = [
3
+ { prefix: "farmd", requiresVersion: !1 },
4
+ { prefix: "wd", requiresVersion: !1 },
5
+ { prefix: "sd", requiresVersion: !0 },
6
+ { prefix: "d", requiresVersion: !0 }
7
+ ];
8
+ function c(e) {
9
+ for (const { prefix: i, requiresVersion: t } of u) {
10
+ if (!e.startsWith(i)) continue;
11
+ let r = e.slice(i.length);
12
+ if (r.endsWith(o) && (r = r.slice(0, -o.length)), n.test(r))
13
+ r = r.replace(n, "");
14
+ else if (t)
15
+ continue;
16
+ if (r) return r;
17
+ }
18
+ }
19
+ function d(e) {
20
+ return {
21
+ kind: "composite",
22
+ preset: "centered_foreground",
23
+ scaleFactor: 0.74,
24
+ layers: [
25
+ {
26
+ type: "url",
27
+ url: f
28
+ },
29
+ {
30
+ type: "symbol",
31
+ symbol: e
32
+ }
33
+ ]
34
+ };
35
+ }
36
+ function g(e) {
37
+ if (e === void 0) return;
38
+ const i = typeof e == "string" ? e : e.symbol;
39
+ if (!i) return;
40
+ if (i === "GEAR")
41
+ return { icon: l };
42
+ const t = c(i);
43
+ return t ? d(t) : i;
44
+ }
45
+ export {
46
+ g as getTokenIcon,
47
+ c as parseShareTokenUnderlying
48
+ };