@gearbox-protocol/ui-kit 4.0.0-next.7 → 4.0.0-next.9
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.
- package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.cjs +1 -1
- package/dist/cjs/components/detailed-page-title/detailed-page-title-explorer-dropdown.cjs +1 -1
- package/dist/cjs/components/graph/formatters.cjs +1 -1
- package/dist/cjs/locale/en.json.cjs +1 -1
- package/dist/esm/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.js +44 -55
- package/dist/esm/components/detailed-page-title/detailed-page-title-explorer-dropdown.js +50 -41
- package/dist/esm/components/graph/formatters.js +62 -52
- package/dist/esm/locale/en.json.js +1 -0
- package/dist/types/components/composites/tx-preview/confirm/dialog/transactionConfirmShellTypes.d.ts +8 -5
- package/dist/types/components/graph/formatters.d.ts +6 -1
- package/dist/types/locale/en.json.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/components/composites/tx-preview/confirm/dialog/TransactionConfirmShell.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("../../../../client-adapters/styled-dialog-container/styled-dialog-container.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),j=require("../../../../client-adapters/styled-dialog-container/styled-dialog-container.cjs"),C=require("../../../../confirm-menu/confirm-menu.cjs"),q=require("../../../../error-message/error-line-message.cjs");require("react-intl");require("../../../../buttons/button/button.cjs");require("../../../../dialog/dialog-container.cjs");const x=require("../../../../typed-intl/index.cjs");require("react");require("@gearbox-protocol/sdk");const w=require("../../../../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../../../../utils/z-index.cjs");const S=require("../../../../modal/modal.cjs"),T=require("../../../../skeleton/skeleton-stack.cjs"),k=require("../../../../spinner/spinner.cjs"),y=require("../../../../typography/typography.cjs"),p=require("../../../../vspace/vspace.cjs"),P=require("../stepper/ProgressStepper.cjs"),M=require("./computeTransactionConfirmDialogLayout.cjs"),t=require("./constants.cjs");function D(n){const{mode:r,open:c=!0,phase:u="confirm",onClose:l,title:i,titleAddon:d,hideTitleAddonOnResult:s=!0,body:o,className:a,previewClassName:g,"data-testid":h,shellTestId:_}=n;if(r==="dialog"&&!c)return null;const m=o.kind==="ready"?u:"confirm",v=m!=="confirm"&&m!=="awaiting_receipt"&&s?void 0:d,f=e.jsx(j.StyledDialogContainer,{className:w.cn(t.transactionConfirmDialogShellVariants(),r==="dialog"?t.transactionConfirmModalContainerVariants():null,a),"data-testid":h,children:e.jsx(N,{body:o,phase:m,previewClassName:g,testId:_??t.TransactionConfirmDialogTest.root,header:e.jsx(C.ConfirmMenu,{title:i,titleAddon:v,onClose:l})})});return r==="page"?f:e.jsx(S.Modal,{show:!0,onClickOutside:l,zIndexLayer:"MODAL",children:f})}function N({body:n,phase:r,previewClassName:c,testId:u,header:l}){const i=n.kind==="ready"?n.stepper:void 0,d=!!(i&&i.length>0),s=M.computeTransactionConfirmDialogLayout(r,d),o=n.kind==="ready"?L(n,r):void 0,a=n.kind==="ready"?n.execution:void 0;return e.jsxs("div",{className:t.transactionConfirmShellContentVariants(),"data-testid":u,children:[e.jsx("div",{className:"shrink-0",children:l}),e.jsx(p.VSpace,{size:"sm"}),s.showResult&&o?e.jsx("div",{className:"flex min-h-0 flex-1 flex-col","data-testid":t.TransactionConfirmDialogTest.result,children:o}):null,s.showResult?null:e.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[s.showPreview?e.jsx("div",{className:c??t.transactionConfirmPreviewScrollVariants(),children:e.jsx(I,{body:n})}):null,s.showPreview&&s.showExecution&&a?e.jsx(p.VSpace,{size:"md"}):null,s.showExecution&&a?e.jsx("div",{className:"min-w-0 w-full shrink-0","data-testid":t.TransactionConfirmDialogTest.execution,children:a}):null]}),s.showProgressStepper&&i?e.jsxs(e.Fragment,{children:[e.jsx(p.VSpace,{size:"md"}),e.jsx("div",{className:"shrink-0","data-testid":t.TransactionConfirmDialogTest.progress,children:e.jsx(P.ProgressStepper,{tone:"muted",steps:i})})]}):null]})}function I({body:n}){const r=x.useIntlTyped();return n.kind==="loading"?e.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-8",children:[e.jsx(k.Spinner,{}),e.jsx(y.Typography,{variant:"bodySmall",color:"muted",as:"p",children:e.jsx(x.FormattedMessageTyped,{messageId:"components.transactionConfirm.previewLoading"})})]}):n.kind==="error"?e.jsx(q.ErrorLineMessage,{err:n.error,title:n.title??r.formatMessage({messageId:"components.transactionConfirm.previewErrorTitle"})}):n.previewLoading?e.jsx(T.SkeletonStack,{lines:3}):e.jsx(e.Fragment,{children:n.preview})}function L(n,r){if(n.result){if(r==="success")return n.result.success;if(r==="failure")return n.result.failure}}exports.TransactionConfirmShell=D;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("@gearbox-protocol/static"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),s=require("@gearbox-protocol/static"),p=require("react"),d=require("../base-link/base-link.cjs"),m=require("../icon-button/icon-button.cjs"),x=require("../simple-dropdown/simple-dropdown.cjs"),f=require("../simple-dropdown/simple-dropdown-menu-item.cjs"),_=require("../tooltip/simple-tooltip.cjs");require("../tooltip/tooltip.cjs");const g=require("../typed-intl/index.cjs"),q=require("../../hooks/use-media-query.cjs");require("@gearbox-protocol/sdk");const j=require("../../utils/cn.cjs");require("sonner");require("@gearbox-protocol/sdk/common-utils");require("luxon");require("../../utils/z-index.cjs");function D(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(o,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return o.default=t,Object.freeze(o)}const b=D(p),l=b.forwardRef(function({explorerLinks:o,className:n,title:r},c){const a=q.useIsMobile()?32:40,u=()=>r||e.jsx(m.IconButton,{ref:c,buttonType:"outlined",size:a,className:j.cn(n),children:e.jsx("span",{className:"flex items-center justify-center text-foreground",children:e.jsx(s.IconExternal,{size:14})})});return e.jsx(_.SimpleTooltip,{title:e.jsx(x.SimpleDropdown,{title:u(),asChild:!0,placement:"bottom",align:"end",children:o?.map(i=>e.jsx(f.SimpleDropdownMenuItem,{asChild:!0,children:e.jsxs(d.BaseLink,{href:i.url,external:!0,className:"flex items-center gap-2",children:[i.name,e.jsx(s.IconExternal,{size:14,className:"ml-auto",style:{width:14,height:14}})]})},i.url))}),placement:"top",children:e.jsx(g.FormattedMessageTyped,{messageId:"components.openCopyButtons.explorer"})})});l.displayName="DetailedPageTitleExplorerDropdown";exports.DetailedPageTitleExplorerDropdown=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("lightweight-charts"),S=require("luxon"),h=require("../../utils/format-number.cjs"),{MIN_DISPLAY_THRESHOLD:F,MAX_EXPONENTIAL_THRESHOLD:_}=h.FORMAT_CONSTANTS,U=(t,e,o="full")=>{if(h.isBelowDisplayThreshold(t))return e?`<${F}${e}`:`<${F}`;if(t===0)return e?`0${e}`:"0";const r=h.formatNumberWithSuffix(t,{maxExponentialThreshold:_,minimumFractionDigits:0,maximumFractionDigits:o==="short"?1:0,format:o,adaptiveDecimals:o==="short"});return e?`${r}${e}`:r},X=2,I=(t,e)=>{if(h.isBelowDisplayThreshold(t))return e?`<${F}${e}`:`<${F}`;if(t===0)return e?`0${e}`:"0";const o=h.toSignificantDigits(t,X);return e?`${o}${e}`:o},y=4,P=t=>{if(h.isBelowDisplayThreshold(t))return`<${F}`;if(t===0)return"0";const e=Math.round(t),o=Math.abs(t-e);return o>0&&o<.01?t.toFixed(12).replace(/0+$/,"").replace(/\.$/,""):h.toSignificantDigits(t,y)},Y=(t,e)=>{if(h.isBelowDisplayThreshold(t))return e?`<${F} ${e}`:`<${F}`;if(t===0)return e?`0 ${e}`:"0";const o=Number.isInteger(t),r=Math.abs(t),i=o&&r>=1e3,s=Math.round(t),a=Math.abs(t-s);if(a>0&&a<.01&&!i){const $=t.toFixed(12).replace(/0+$/,"").replace(/\.$/,"");return e?`${$} ${e}`:$}const g=h.formatNumberWithSuffix(t,{maxExponentialThreshold:_,minimumFractionDigits:o?0:2,maximumFractionDigits:i?1:o?0:2,format:i?"short":"full",adaptiveDecimals:i});return e?`${g} ${e}`:g},p={"%":I,$:U,token:Y,none:P},C=t=>p[t]||p.token;function q(t,e,o=4){if(t===0)return e?`0 ${e}`:"0";const r=e&&Math.abs(t)>=1e3?0:o,i=t.toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:r});return e?`${i} ${e}`:i}function x(t,e){return!t||e==="none"||e==="token"?t:e==="$"?`$${t}`:e==="%"?`${t}%`:`${t} ${e}`}function N(t){return t.includes("/")?"none":t}function B(t,e,o){const r=o?.yScaleMin;let i=t.length>0?Math.min(...t):0,s=t.length>0?Math.max(...t):0,a=[];const u=()=>{const n=(i+s)/2;let c=1,m="";return n>=1e9?(c=1e9,m="B"):n>=1e6?(c=1e6,m="M"):n>=1e3&&(c=1e3,m="K"),{scale:c,suffix:m}},g=8,$=.02;let A=0;const E=(n,c,m,d)=>{const M=(c>1?n/c:n).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:d,useGrouping:!1});return c>1?`${M}${m}`:M},R=(n,c,m)=>{for(let d=0;d<=g;d++){const T=new Set;let M=!0;for(const D of n){const f=E(D,c,m,d);if(T.has(f)){M=!1;break}T.add(f)}if(M)return d}return g},O=n=>{if(r!==void 0&&n<r)return"";if(n===0)return x("0",N(e));const{scale:c,suffix:m}=u();return x(E(n,c,m,A),N(e))};return{formatter:n=>O(n),tickmarksFormatter:n=>{const{scale:c,suffix:m}=u(),d=s-i,T=d>0?a.filter(f=>Math.abs(f)>=d*$):a,M=n.filter(f=>f!==0&&!(r!==void 0&&f<r));A=R([...M,...T],c,m);const D=new Set;return n.map(f=>{if(r!==void 0&&f<r)return"";const k=f===0?"0":E(f,c,m,A);return!k||D.has(k)?"":(D.add(k),x(k,N(e)))})},updateVisibleRange:n=>{n.length>0&&(i=Math.min(...n),s=Math.max(...n))},updateLastValues:n=>{a=[...n]}}}const H=t=>S.DateTime.fromSeconds(Number(t)).toFormat("dd/LL/yyyy HH:mm"),G=t=>S.DateTime.fromSeconds(Number(t)).toFormat("HH:mm"),V=(t,e)=>I(Number(t),e),L={time:H,"%":V};function W(t){const e=new Map;return(o,r,i)=>{const s=S.DateTime.fromSeconds(Number(o));let a;if(t===0)a=s.toFormat("HH:mm");else switch(r){case l.TickMarkType.Year:a=s.toFormat("yyyy");break;case l.TickMarkType.Month:case l.TickMarkType.DayOfMonth:a=t>365?s.toFormat("dd MMM yyyy"):s.toFormat("dd MMM");break;case l.TickMarkType.Time:case l.TickMarkType.TimeWithSeconds:a=s.toFormat("HH:mm");break;default:a=s.toFormat("dd MMM")}let u=e.get(r);return u||(u=new Set,e.set(r,u)),u.has(a)?" ":(u.add(a),a)}}const w=(t,e)=>{if(t==="time"&&e&&e.length>0){const r=S.DateTime.fromSeconds(Number(e[0].time)),i=S.DateTime.fromSeconds(Number(e[e.length-1].time)),s=r.hasSame(i,"day"),a=s?0:Math.ceil(i.diff(r,"days").days);return{timeFormatter:s?G:H,tickMarkFormatter:W(a)}}const o=L[t]||L.time;return{timeFormatter:o,tickMarkFormatter:r=>o(r,t)}},b=(t,e)=>w(t,e).timeFormatter;exports.createAdaptiveYAxisFormatter=B;exports.formatExactValue=q;exports.getXFormatter=b;exports.getXFormatters=w;exports.getYFormatter=C;exports.withYAxisUnit=x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e={"errors.networkError":"Network error. Can't fetch data","errors.incorrectAddressError":"Incorrect address. Please, check url","errors.noOpenedAccountsError":"You have no opened Credit Accounts. Perhaps, you have recently been liquidated? Check notification centre to see more.","errors.notFound":"Not found","errors.tooManyRequests":"Too many requests","errors.incorrectAddress":"Incorrect address","components.errorMessage.oops":"Oops...","components.networkIndicator.title":"Network","components.infiniteScrollWrapper.showMore":"Show more","components.alertModal.ok":"Ok","components.footer.privacy":"Privacy Notice","components.footer.terms":"Terms of Service","components.footer.disclosure":"Risk Disclosure Statement","components.footer.legalNotice":"Legal Notice","components.footer.legal":"Legal Info","components.footer.gearbox":"Copyright © Gearbox Foundation 2023-2026.","components.footer.built":"Built at ETHGlobal MarketMake hackathon.","components.footer.version":"Version {value}","components.blockSyncPill.syncError":", sync error","components.blockSyncPill.syncedAt":", synced at {time}","components.blockSyncPill.syncing":", syncing…","components.creditAccountHistory.table.protocol":"Protocol","components.creditAccountHistory.table.operation":"Operation","components.creditAccountHistory.table.details":"Details","components.notificationCenter.empty":"No notifications yet","components.notificationCenter.requests":"Requests","components.notificationCenter.recent":"Recent","components.notificationCenter.clear":"Clear all","components.liquidationPrice.check":"Check Area","components.loading.loading":"Loading","components.loading.loadingPercent":"Loading {percent}%","components.loading.wait":"Please wait...","components.smartNumberInput.balance":"Balance","components.smartNumberInput.amountLabel":"Amount","components.smartNumberInput.inputTitle":"Token Amount","components.smartNumberInput.confirm.input":"Input","components.smartNumberInput.selectToken":"Select token","components.tipWindow.title":"Tip","components.healthFactor.low":"Extremely low! This HF may not cover possible oracle deviations.","components.headCell":"Sort by {value}","components.graphView.noData":"Can't get data for this graph","components.filterBlock.reset":"Reset All","components.filterModal.searchPlaceholder":"Search options...","components.filterModal.noOptionsAvailable":"No options available","components.filterModal.noOptionsMatchSearch":"No options match your search","components.filterModal.reset":"Reset","components.filterModal.apply":"Apply","components.APY.tip":"These APYs are derived from the underlying protocols’ APIs and may differ in reality. Check respective protocols for their methodology.","components.creditSessionDetailedLiquidation.graph.noData":"No data","components.creditSessionDetailedLiquidation.graph.legend.point":"Current price","components.creditSessionDetailedLiquidation.graph.legend.area":"Liquidation Area","components.creditSessionDetailedLiquidation.graph.tip.hf":"Health Factor","components.creditSessionDetailedLiquidation.graph.tip.price":"Price","components.creditSessionDetailedLiquidation.table.noData":"No data","components.creditSessionDetailedLiquidation.table.seeGraph":"See graph","components.creditSessionDetailedLiquidation.table.asset":"Asset","components.creditSessionDetailedLiquidation.table.currentPrice":"Current price","components.creditSessionDetailedLiquidation.table.modelPrice":"Model price","components.apyParts.features.points":"Points","components.apyParts.features.incent":"Incent.","components.apyParts.supplyAPY":"Organic APY","components.apyParts.title":"APY type","components.apyParts.supplyAPY.tip":"Yield from lending funds","components.apyParts.tokenYield":"Intrinsic APY","components.apyParts.tokenYield.tip":"Yield from holding wstETH","components.apyParts.extraAPY":"{symbol} Incentive","components.apyParts.extraAPY.tip":"Calculated at the current rate","components.apyParts.totalAPY":"Overall APY","components.apyParts.points":"{symbol} Incentive","components.apyParts.points.condition.crossDeposit":"For cross-chain deposits made via Omni","components.yieldBreakdown.titleNetAtLeverage":"Net APY at {leverage}× Leverage","components.yieldBreakdown.collateralApy":"Collateral APY","components.yieldBreakdown.incentive":"Incentive","components.yieldBreakdown.borrowRate":"Borrow Rate","components.yieldBreakdown.programPoints":"{name} Points","components.yieldBreakdown.points":"Points","components.openCopyButtons.copy":"Copy to clipboard","components.poolAssetsTable.asset":"Name","components.poolAssetsTable.rate":"Effective rate","components.poolAssetsTable.exposure":"Exposure","components.poolAssetsTable.cap":"Cap","components.poolAssetsTable.capUtilization":"Cap utilization","components.poolAssetsTable.usage":"{amount} of {total}","components.poolAssetsTable.head.name":"Credit Manager","components.poolAssetsTable.head.currentDebt":"Current Debt","components.poolAssetsTable.head.assets":"Asset LT","components.poolCreditManagersTable.assets":"{amount} assets","components.creditManagerInfo.title":"Assets and LT’s","components.creditManagerInfo.info.title":"Credit Managers","components.creditManagerInfo.info.copy.tip":"Copy Credit Manager address","components.creditManagerInfo.info.minDebt":"Min debt","components.creditManagerInfo.info.maxDebt":"Max debt","components.creditManagerInfo.info.liquidationFee":"Liquid. fee","components.creditManagerInfo.info.liquidationPremium":"Liquid. premium","components.creditManagerInfo.info.interestFee":"Interest fee","components.creditManagerInfo.info.debtLimit":"Debt limit","components.creditManagerInfo.info.maxEnabledTokens":"Max tokens","dialogs.oraclesAndLTInfo.filter.hide0Quota":"Hide 0-Quota","components.oraclesAndLTInfo.title":"Oracles and LTs","components.oraclesAndLTTable.head.token":"Token","components.oraclesAndLTTable.head.oracles":"Oracles","components.oraclesAndLTTable.head.lt":"LT","components.poolTable.pool":"Market","components.poolTable.market":"Market","components.poolTable.description.universal":"Universal","components.poolTable.supply":"Supply","components.poolTable.borrowed":"Borrowed","components.poolTable.supplyApy":"Supply APY","components.poolTable.supplyApy.tip":"Annual percentage yield that you earn for supplying capital. This number constantly changes as the utilization of the Markets goes up and down","components.poolTable.depositApy":"Deposit APY","components.poolTable.depositApy.tip":"Deposit APY breakdown: base rate, extra rewards, and points","components.poolTable.borrowApy":"Borrow APY","components.poolTable.utilizationApy":"Utilization APY","components.poolTable.borrowApy.tip":"On top of the utilization borrow APY, there is a borrow quota APY for different assets","components.poolTable.utilization":"Utilization","components.poolTable.collateral":"Collateral","components.poolTable.collateral.showAll":"Show All","components.poolTable.balance":"Your Balance","components.poolTable.balance.tip":`You don't earn token rewards, only organic yield. Please migrate liquidity by using "Migrate" flow above.`,"components.poolTable.emptyList":"No Pools found","components.poolTable.notFound.dashboard":"You currently have no open Market positions.","components.poolTable.notFound.list":"No Markets found","components.poolTable.notFound.description.dashboard":"Choose earn above.","components.poolTable.notFound.description.list":"Choose another chain or toggle Show All Markets","components.poolTable.externalApy.tooltipShort":"{value} APY boost when depositing via {name}","components.poolTable.line.rwa.tip":"This is RWA market.","components.rewardsTooltip.without.title":"Without Leverage","components.rewardsTooltip.without.extra":"Extra APY","components.rewardsTooltip.without.extra.tip":"Any deposit through Gearbox","components.rewardsTooltip.with.title":"With {leverage} Leverage","components.rewardsTooltip.with.borrowRate":"{symbol} borrow rate","components.rewardsTooltip.with.quotaRate":"Quota rate","components.rewardsTooltip.with.extra":"+ Extra APR","components.rewardsTooltip.button":"Click to show rewards details","components.strategiesTable.head.name":"Strategy","components.strategiesTable.head.rewards":"Rewards","components.strategiesTable.head.leverage":"Max Leverage","components.strategiesTable.head.earn":"You Can Earn","components.strategiesTable.body.notFound":"No strategy found","components.strategiesTable.line.disabled":"This strategy is currently not available, cause of lack or quota or liquidity. Please contact us on Discord, and we’ll assist you.","components.strategiesTable.line.name.disabled":"This strategy is currently not available","components.strategiesTable.line.points.tip":"For debt nominated in {symbol}","components.strategiesTable.line.points.tipAny":"For debt","components.strategiesTable.line.0slippage":"0-slippage","components.strategiesTable.line.0slippage.tip":"Wrapping/unwrapping happens directly through smart-contracts, so {symbol} deposits and withdrawals don't incur slippage.","components.strategiesTable.line.rwa":"RWA","components.strategiesTable.line.rwa.tip":"This strategy is available on RWA market.","dialogs.common.review":"Review","components.amountInput.max":"Max","components.amountInput.label":"Amount","components.amountInput.balance":"Balance","components.amountInput.selectToken":"Select token","components.amountInput.inputTitle":"Token Amount","components.leverageInput.label":"Leverage","components.leverageInput.reset":"Reset","components.leverageInput.available":"Available leverage","components.healthFactorBlock.label":"Health factor","components.healthFactorBlock.tip":"Health Factor is a numeric representation of your account 'health'. If your health factor drops below 1 or close to it, you might be liquidated.","components.liquidationPriceBlock.label":"Liquidation Price","components.liquidationPriceBlock.tip":"The asset price at which the account's health factor would reach 1 and become eligible for liquidation.","components.timeToLiquidationBlock.label":"Time to liquidation","components.timeToLiquidationBlock.tip":"Time to liquidation estimates how long the account can stay open if prices remain constant and no yield is earned—only accounting for borrow interest accrual.","components.historyChart.error":"Couldn't load chart data","components.historyChart.empty":"No data","components.positionTypeBadge.pool":"LP","components.positionTypeBadge.strategy":"Strategy","components.positionTypeBadge.liquidation":"Liquidation","components.positionStatusBadge.active":"Active","components.positionStatusBadge.repaid":"Repaid","components.titleMeta.unknownCurator":"Curator","components.moreAccordion.more":"More details","components.moreAccordion.less":"Less details","components.poolApyBreakdownCard.title":"APY Breakdown","components.poolApyBreakdownCard.organicApy":"Pool organic APY","components.poolApyBreakdownCard.incentiveApy":"Incentive APY","components.strategyApyBreakdownCard.titleAtLeverage":"APY at {leverage}× Leverage","components.strategyApyBreakdownCard.collateralApy":"Collateral APY","components.strategyApyBreakdownCard.incentiveApy":"Incentive APY","components.strategyApyBreakdownCard.borrowRate":"Borrow Rate","components.strategyApyBreakdownCard.formula":"{base} × {leverage} Lev.","components.leveragePresetChips.label":"Leverage:","components.liquidationParamsTable.lt":"Liquidation threshold","components.liquidationParamsTable.penalty":"Liquidation discount","components.liquidationParamsTable.premium":"Liquidation premium","components.liquidationParamsTable.fee":"Liquidation fee","components.borrowRateBlock.label":"Borrow rate","components.borrowRateBlock.tip":"Borrow rate is displayed for your entire position size in total. You can reduce it in quota management.","components.borrowRateBlock.description":"Your borrow rate consists of the Base Rate plus the Quota Rates for every asset separately.","components.borrowRateBlock.baseRate":"Base Rate for Debt","components.borrowRateBlock.normalization":"Rates normalization","components.borrowRateBlock.normalization.tip":"Borrowers pay {quota} and {utilization}, which have a different base. Therefore, the total borrow rate value is normalized by Account value or Debt amount.","components.transactionConfirm.previewLoading":"Parsing transaction…","components.transactionConfirm.previewErrorTitle":"Preview error"};module.exports=e;
|
|
1
|
+
"use strict";const e={"errors.networkError":"Network error. Can't fetch data","errors.incorrectAddressError":"Incorrect address. Please, check url","errors.noOpenedAccountsError":"You have no opened Credit Accounts. Perhaps, you have recently been liquidated? Check notification centre to see more.","errors.notFound":"Not found","errors.tooManyRequests":"Too many requests","errors.incorrectAddress":"Incorrect address","components.errorMessage.oops":"Oops...","components.networkIndicator.title":"Network","components.infiniteScrollWrapper.showMore":"Show more","components.alertModal.ok":"Ok","components.footer.privacy":"Privacy Notice","components.footer.terms":"Terms of Service","components.footer.disclosure":"Risk Disclosure Statement","components.footer.legalNotice":"Legal Notice","components.footer.legal":"Legal Info","components.footer.gearbox":"Copyright © Gearbox Foundation 2023-2026.","components.footer.built":"Built at ETHGlobal MarketMake hackathon.","components.footer.version":"Version {value}","components.blockSyncPill.syncError":", sync error","components.blockSyncPill.syncedAt":", synced at {time}","components.blockSyncPill.syncing":", syncing…","components.creditAccountHistory.table.protocol":"Protocol","components.creditAccountHistory.table.operation":"Operation","components.creditAccountHistory.table.details":"Details","components.notificationCenter.empty":"No notifications yet","components.notificationCenter.requests":"Requests","components.notificationCenter.recent":"Recent","components.notificationCenter.clear":"Clear all","components.liquidationPrice.check":"Check Area","components.loading.loading":"Loading","components.loading.loadingPercent":"Loading {percent}%","components.loading.wait":"Please wait...","components.smartNumberInput.balance":"Balance","components.smartNumberInput.amountLabel":"Amount","components.smartNumberInput.inputTitle":"Token Amount","components.smartNumberInput.confirm.input":"Input","components.smartNumberInput.selectToken":"Select token","components.tipWindow.title":"Tip","components.healthFactor.low":"Extremely low! This HF may not cover possible oracle deviations.","components.headCell":"Sort by {value}","components.graphView.noData":"Can't get data for this graph","components.filterBlock.reset":"Reset All","components.filterModal.searchPlaceholder":"Search options...","components.filterModal.noOptionsAvailable":"No options available","components.filterModal.noOptionsMatchSearch":"No options match your search","components.filterModal.reset":"Reset","components.filterModal.apply":"Apply","components.APY.tip":"These APYs are derived from the underlying protocols’ APIs and may differ in reality. Check respective protocols for their methodology.","components.creditSessionDetailedLiquidation.graph.noData":"No data","components.creditSessionDetailedLiquidation.graph.legend.point":"Current price","components.creditSessionDetailedLiquidation.graph.legend.area":"Liquidation Area","components.creditSessionDetailedLiquidation.graph.tip.hf":"Health Factor","components.creditSessionDetailedLiquidation.graph.tip.price":"Price","components.creditSessionDetailedLiquidation.table.noData":"No data","components.creditSessionDetailedLiquidation.table.seeGraph":"See graph","components.creditSessionDetailedLiquidation.table.asset":"Asset","components.creditSessionDetailedLiquidation.table.currentPrice":"Current price","components.creditSessionDetailedLiquidation.table.modelPrice":"Model price","components.apyParts.features.points":"Points","components.apyParts.features.incent":"Incent.","components.apyParts.supplyAPY":"Organic APY","components.apyParts.title":"APY type","components.apyParts.supplyAPY.tip":"Yield from lending funds","components.apyParts.tokenYield":"Intrinsic APY","components.apyParts.tokenYield.tip":"Yield from holding wstETH","components.apyParts.extraAPY":"{symbol} Incentive","components.apyParts.extraAPY.tip":"Calculated at the current rate","components.apyParts.totalAPY":"Overall APY","components.apyParts.points":"{symbol} Incentive","components.apyParts.points.condition.crossDeposit":"For cross-chain deposits made via Omni","components.yieldBreakdown.titleNetAtLeverage":"Net APY at {leverage}× Leverage","components.yieldBreakdown.collateralApy":"Collateral APY","components.yieldBreakdown.incentive":"Incentive","components.yieldBreakdown.borrowRate":"Borrow Rate","components.yieldBreakdown.programPoints":"{name} Points","components.yieldBreakdown.points":"Points","components.openCopyButtons.copy":"Copy to clipboard","components.openCopyButtons.explorer":"View in explorer","components.poolAssetsTable.asset":"Name","components.poolAssetsTable.rate":"Effective rate","components.poolAssetsTable.exposure":"Exposure","components.poolAssetsTable.cap":"Cap","components.poolAssetsTable.capUtilization":"Cap utilization","components.poolAssetsTable.usage":"{amount} of {total}","components.poolAssetsTable.head.name":"Credit Manager","components.poolAssetsTable.head.currentDebt":"Current Debt","components.poolAssetsTable.head.assets":"Asset LT","components.poolCreditManagersTable.assets":"{amount} assets","components.creditManagerInfo.title":"Assets and LT’s","components.creditManagerInfo.info.title":"Credit Managers","components.creditManagerInfo.info.copy.tip":"Copy Credit Manager address","components.creditManagerInfo.info.minDebt":"Min debt","components.creditManagerInfo.info.maxDebt":"Max debt","components.creditManagerInfo.info.liquidationFee":"Liquid. fee","components.creditManagerInfo.info.liquidationPremium":"Liquid. premium","components.creditManagerInfo.info.interestFee":"Interest fee","components.creditManagerInfo.info.debtLimit":"Debt limit","components.creditManagerInfo.info.maxEnabledTokens":"Max tokens","dialogs.oraclesAndLTInfo.filter.hide0Quota":"Hide 0-Quota","components.oraclesAndLTInfo.title":"Oracles and LTs","components.oraclesAndLTTable.head.token":"Token","components.oraclesAndLTTable.head.oracles":"Oracles","components.oraclesAndLTTable.head.lt":"LT","components.poolTable.pool":"Market","components.poolTable.market":"Market","components.poolTable.description.universal":"Universal","components.poolTable.supply":"Supply","components.poolTable.borrowed":"Borrowed","components.poolTable.supplyApy":"Supply APY","components.poolTable.supplyApy.tip":"Annual percentage yield that you earn for supplying capital. This number constantly changes as the utilization of the Markets goes up and down","components.poolTable.depositApy":"Deposit APY","components.poolTable.depositApy.tip":"Deposit APY breakdown: base rate, extra rewards, and points","components.poolTable.borrowApy":"Borrow APY","components.poolTable.utilizationApy":"Utilization APY","components.poolTable.borrowApy.tip":"On top of the utilization borrow APY, there is a borrow quota APY for different assets","components.poolTable.utilization":"Utilization","components.poolTable.collateral":"Collateral","components.poolTable.collateral.showAll":"Show All","components.poolTable.balance":"Your Balance","components.poolTable.balance.tip":`You don't earn token rewards, only organic yield. Please migrate liquidity by using "Migrate" flow above.`,"components.poolTable.emptyList":"No Pools found","components.poolTable.notFound.dashboard":"You currently have no open Market positions.","components.poolTable.notFound.list":"No Markets found","components.poolTable.notFound.description.dashboard":"Choose earn above.","components.poolTable.notFound.description.list":"Choose another chain or toggle Show All Markets","components.poolTable.externalApy.tooltipShort":"{value} APY boost when depositing via {name}","components.poolTable.line.rwa.tip":"This is RWA market.","components.rewardsTooltip.without.title":"Without Leverage","components.rewardsTooltip.without.extra":"Extra APY","components.rewardsTooltip.without.extra.tip":"Any deposit through Gearbox","components.rewardsTooltip.with.title":"With {leverage} Leverage","components.rewardsTooltip.with.borrowRate":"{symbol} borrow rate","components.rewardsTooltip.with.quotaRate":"Quota rate","components.rewardsTooltip.with.extra":"+ Extra APR","components.rewardsTooltip.button":"Click to show rewards details","components.strategiesTable.head.name":"Strategy","components.strategiesTable.head.rewards":"Rewards","components.strategiesTable.head.leverage":"Max Leverage","components.strategiesTable.head.earn":"You Can Earn","components.strategiesTable.body.notFound":"No strategy found","components.strategiesTable.line.disabled":"This strategy is currently not available, cause of lack or quota or liquidity. Please contact us on Discord, and we’ll assist you.","components.strategiesTable.line.name.disabled":"This strategy is currently not available","components.strategiesTable.line.points.tip":"For debt nominated in {symbol}","components.strategiesTable.line.points.tipAny":"For debt","components.strategiesTable.line.0slippage":"0-slippage","components.strategiesTable.line.0slippage.tip":"Wrapping/unwrapping happens directly through smart-contracts, so {symbol} deposits and withdrawals don't incur slippage.","components.strategiesTable.line.rwa":"RWA","components.strategiesTable.line.rwa.tip":"This strategy is available on RWA market.","dialogs.common.review":"Review","components.amountInput.max":"Max","components.amountInput.label":"Amount","components.amountInput.balance":"Balance","components.amountInput.selectToken":"Select token","components.amountInput.inputTitle":"Token Amount","components.leverageInput.label":"Leverage","components.leverageInput.reset":"Reset","components.leverageInput.available":"Available leverage","components.healthFactorBlock.label":"Health factor","components.healthFactorBlock.tip":"Health Factor is a numeric representation of your account 'health'. If your health factor drops below 1 or close to it, you might be liquidated.","components.liquidationPriceBlock.label":"Liquidation Price","components.liquidationPriceBlock.tip":"The asset price at which the account's health factor would reach 1 and become eligible for liquidation.","components.timeToLiquidationBlock.label":"Time to liquidation","components.timeToLiquidationBlock.tip":"Time to liquidation estimates how long the account can stay open if prices remain constant and no yield is earned—only accounting for borrow interest accrual.","components.historyChart.error":"Couldn't load chart data","components.historyChart.empty":"No data","components.positionTypeBadge.pool":"LP","components.positionTypeBadge.strategy":"Strategy","components.positionTypeBadge.liquidation":"Liquidation","components.positionStatusBadge.active":"Active","components.positionStatusBadge.repaid":"Repaid","components.titleMeta.unknownCurator":"Curator","components.moreAccordion.more":"More details","components.moreAccordion.less":"Less details","components.poolApyBreakdownCard.title":"APY Breakdown","components.poolApyBreakdownCard.organicApy":"Pool organic APY","components.poolApyBreakdownCard.incentiveApy":"Incentive APY","components.strategyApyBreakdownCard.titleAtLeverage":"APY at {leverage}× Leverage","components.strategyApyBreakdownCard.collateralApy":"Collateral APY","components.strategyApyBreakdownCard.incentiveApy":"Incentive APY","components.strategyApyBreakdownCard.borrowRate":"Borrow Rate","components.strategyApyBreakdownCard.formula":"{base} × {leverage} Lev.","components.leveragePresetChips.label":"Leverage:","components.liquidationParamsTable.lt":"Liquidation threshold","components.liquidationParamsTable.penalty":"Liquidation discount","components.liquidationParamsTable.premium":"Liquidation premium","components.liquidationParamsTable.fee":"Liquidation fee","components.borrowRateBlock.label":"Borrow rate","components.borrowRateBlock.tip":"Borrow rate is displayed for your entire position size in total. You can reduce it in quota management.","components.borrowRateBlock.description":"Your borrow rate consists of the Base Rate plus the Quota Rates for every asset separately.","components.borrowRateBlock.baseRate":"Base Rate for Debt","components.borrowRateBlock.normalization":"Rates normalization","components.borrowRateBlock.normalization.tip":"Borrowers pay {quota} and {utilization}, which have a different base. Therefore, the total borrow rate value is normalized by Account value or Debt amount.","components.transactionConfirm.previewLoading":"Parsing transaction…","components.transactionConfirm.previewErrorTitle":"Preview error"};module.exports=e;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
1
|
+
import { jsx as r, jsxs as l, Fragment as v } from "react/jsx-runtime";
|
|
2
2
|
import { StyledDialogContainer as S } from "../../../../client-adapters/styled-dialog-container/styled-dialog-container.js";
|
|
3
3
|
import { ConfirmMenu as k } from "../../../../confirm-menu/confirm-menu.js";
|
|
4
4
|
import { ErrorLineMessage as T } from "../../../../error-message/error-line-message.js";
|
|
@@ -13,121 +13,110 @@ import "sonner";
|
|
|
13
13
|
import "@gearbox-protocol/sdk/common-utils";
|
|
14
14
|
import "luxon";
|
|
15
15
|
import "../../../../../utils/z-index.js";
|
|
16
|
-
import { Modal as
|
|
17
|
-
import { SkeletonStack as
|
|
16
|
+
import { Modal as M } from "../../../../modal/modal.js";
|
|
17
|
+
import { SkeletonStack as L } from "../../../../skeleton/skeleton-stack.js";
|
|
18
18
|
import { Spinner as A } from "../../../../spinner/spinner.js";
|
|
19
19
|
import { Typography as D } from "../../../../typography/typography.js";
|
|
20
|
-
import { VSpace as
|
|
20
|
+
import { VSpace as f } from "../../../../vspace/vspace.js";
|
|
21
21
|
import { ProgressStepper as V } from "../stepper/ProgressStepper.js";
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
|
|
25
|
-
function ce(e) {
|
|
22
|
+
import { computeTransactionConfirmDialogLayout as z } from "./computeTransactionConfirmDialogLayout.js";
|
|
23
|
+
import { TransactionConfirmDialogTest as m, transactionConfirmModalContainerVariants as E, transactionConfirmDialogShellVariants as R, transactionConfirmShellContentVariants as j, transactionConfirmPreviewScrollVariants as y } from "./constants.js";
|
|
24
|
+
function me(e) {
|
|
26
25
|
const {
|
|
27
26
|
mode: t,
|
|
28
27
|
open: c = !0,
|
|
29
|
-
phase:
|
|
30
|
-
onClose:
|
|
28
|
+
phase: d = "confirm",
|
|
29
|
+
onClose: a,
|
|
31
30
|
title: n,
|
|
32
|
-
titleAddon:
|
|
31
|
+
titleAddon: p,
|
|
33
32
|
hideTitleAddonOnResult: i = !0,
|
|
34
33
|
body: o,
|
|
35
34
|
className: s,
|
|
36
|
-
previewClassName:
|
|
35
|
+
previewClassName: g,
|
|
37
36
|
"data-testid": w,
|
|
38
37
|
shellTestId: x
|
|
39
38
|
} = e;
|
|
40
39
|
if (t === "dialog" && !c) return null;
|
|
41
|
-
const
|
|
40
|
+
const u = o.kind === "ready" ? d : "confirm", C = u !== "confirm" && u !== "awaiting_receipt" && i ? void 0 : p, h = /* @__PURE__ */ r(
|
|
42
41
|
S,
|
|
43
42
|
{
|
|
44
43
|
className: I(
|
|
45
|
-
|
|
46
|
-
t === "dialog" ?
|
|
44
|
+
R(),
|
|
45
|
+
t === "dialog" ? E() : null,
|
|
47
46
|
s
|
|
48
47
|
),
|
|
49
48
|
"data-testid": w,
|
|
50
49
|
children: /* @__PURE__ */ r(
|
|
51
|
-
|
|
50
|
+
O,
|
|
52
51
|
{
|
|
53
52
|
body: o,
|
|
54
|
-
phase:
|
|
55
|
-
previewClassName:
|
|
56
|
-
testId: x ??
|
|
53
|
+
phase: u,
|
|
54
|
+
previewClassName: g,
|
|
55
|
+
testId: x ?? m.root,
|
|
57
56
|
header: /* @__PURE__ */ r(
|
|
58
57
|
k,
|
|
59
58
|
{
|
|
60
59
|
title: n,
|
|
61
60
|
titleAddon: C,
|
|
62
|
-
onClose:
|
|
61
|
+
onClose: a
|
|
63
62
|
}
|
|
64
63
|
)
|
|
65
64
|
}
|
|
66
65
|
)
|
|
67
66
|
}
|
|
68
67
|
);
|
|
69
|
-
return t === "page" ?
|
|
68
|
+
return t === "page" ? h : /* @__PURE__ */ r(M, { show: !0, onClickOutside: a, zIndexLayer: "MODAL", children: h });
|
|
70
69
|
}
|
|
71
|
-
function
|
|
70
|
+
function O({
|
|
72
71
|
body: e,
|
|
73
72
|
phase: t,
|
|
74
73
|
previewClassName: c,
|
|
75
|
-
testId:
|
|
76
|
-
header:
|
|
74
|
+
testId: d,
|
|
75
|
+
header: a
|
|
77
76
|
}) {
|
|
78
|
-
const n = e.kind === "ready" ? e.stepper : void 0,
|
|
79
|
-
return /* @__PURE__ */
|
|
77
|
+
const n = e.kind === "ready" ? e.stepper : void 0, p = !!(n && n.length > 0), i = z(t, p), o = e.kind === "ready" ? B(e, t) : void 0, s = e.kind === "ready" ? e.execution : void 0;
|
|
78
|
+
return /* @__PURE__ */ l(
|
|
80
79
|
"div",
|
|
81
80
|
{
|
|
82
|
-
className:
|
|
83
|
-
"data-testid":
|
|
81
|
+
className: j(),
|
|
82
|
+
"data-testid": d,
|
|
84
83
|
children: [
|
|
85
|
-
/* @__PURE__ */ r("div", { className: "shrink-0", children:
|
|
86
|
-
/* @__PURE__ */ r(
|
|
84
|
+
/* @__PURE__ */ r("div", { className: "shrink-0", children: a }),
|
|
85
|
+
/* @__PURE__ */ r(f, { size: "sm" }),
|
|
87
86
|
i.showResult && o ? /* @__PURE__ */ r(
|
|
88
87
|
"div",
|
|
89
88
|
{
|
|
90
89
|
className: "flex min-h-0 flex-1 flex-col",
|
|
91
|
-
"data-testid":
|
|
90
|
+
"data-testid": m.result,
|
|
92
91
|
children: o
|
|
93
92
|
}
|
|
94
93
|
) : null,
|
|
95
|
-
i.showResult ? null : /* @__PURE__ */
|
|
94
|
+
i.showResult ? null : /* @__PURE__ */ l("div", { className: "flex min-h-0 flex-1 flex-col", children: [
|
|
96
95
|
i.showPreview ? /* @__PURE__ */ r(
|
|
97
96
|
"div",
|
|
98
97
|
{
|
|
99
|
-
className: c ??
|
|
100
|
-
children: /* @__PURE__ */ r(
|
|
98
|
+
className: c ?? y(),
|
|
99
|
+
children: /* @__PURE__ */ r(F, { body: e })
|
|
101
100
|
}
|
|
102
101
|
) : null,
|
|
103
|
-
i.showPreview && i.showExecution && s ? /* @__PURE__ */ r(
|
|
102
|
+
i.showPreview && i.showExecution && s ? /* @__PURE__ */ r(f, { size: "md" }) : null,
|
|
104
103
|
i.showExecution && s ? /* @__PURE__ */ r(
|
|
105
104
|
"div",
|
|
106
105
|
{
|
|
107
106
|
className: "min-w-0 w-full shrink-0",
|
|
108
|
-
"data-testid":
|
|
107
|
+
"data-testid": m.execution,
|
|
109
108
|
children: s
|
|
110
109
|
}
|
|
111
110
|
) : null
|
|
112
111
|
] }),
|
|
113
|
-
i.showProgressStepper && n ? /* @__PURE__ */
|
|
114
|
-
/* @__PURE__ */ r(
|
|
112
|
+
i.showProgressStepper && n ? /* @__PURE__ */ l(v, { children: [
|
|
113
|
+
/* @__PURE__ */ r(f, { size: "md" }),
|
|
115
114
|
/* @__PURE__ */ r(
|
|
116
115
|
"div",
|
|
117
116
|
{
|
|
118
117
|
className: "shrink-0",
|
|
119
|
-
"data-testid":
|
|
120
|
-
children: /* @__PURE__ */ r(
|
|
121
|
-
V,
|
|
122
|
-
{
|
|
123
|
-
tone: "muted",
|
|
124
|
-
steps: n.steps.map((a) => ({
|
|
125
|
-
id: a.id,
|
|
126
|
-
status: a.status,
|
|
127
|
-
label: n.renderLabel(a)
|
|
128
|
-
}))
|
|
129
|
-
}
|
|
130
|
-
)
|
|
118
|
+
"data-testid": m.progress,
|
|
119
|
+
children: /* @__PURE__ */ r(V, { tone: "muted", steps: n })
|
|
131
120
|
}
|
|
132
121
|
)
|
|
133
122
|
] }) : null
|
|
@@ -135,11 +124,11 @@ function F({
|
|
|
135
124
|
}
|
|
136
125
|
);
|
|
137
126
|
}
|
|
138
|
-
function
|
|
127
|
+
function F({
|
|
139
128
|
body: e
|
|
140
129
|
}) {
|
|
141
130
|
const t = N();
|
|
142
|
-
return e.kind === "loading" ? /* @__PURE__ */
|
|
131
|
+
return e.kind === "loading" ? /* @__PURE__ */ l("div", { className: "flex flex-col items-center justify-center gap-3 py-8", children: [
|
|
143
132
|
/* @__PURE__ */ r(A, {}),
|
|
144
133
|
/* @__PURE__ */ r(D, { variant: "bodySmall", color: "muted", as: "p", children: /* @__PURE__ */ r(P, { messageId: "components.transactionConfirm.previewLoading" }) })
|
|
145
134
|
] }) : e.kind === "error" ? /* @__PURE__ */ r(
|
|
@@ -150,14 +139,14 @@ function B({
|
|
|
150
139
|
messageId: "components.transactionConfirm.previewErrorTitle"
|
|
151
140
|
})
|
|
152
141
|
}
|
|
153
|
-
) : e.previewLoading ? /* @__PURE__ */ r(
|
|
142
|
+
) : e.previewLoading ? /* @__PURE__ */ r(L, { lines: 3 }) : /* @__PURE__ */ r(v, { children: e.preview });
|
|
154
143
|
}
|
|
155
|
-
function
|
|
144
|
+
function B(e, t) {
|
|
156
145
|
if (e.result) {
|
|
157
146
|
if (t === "success") return e.result.success;
|
|
158
147
|
if (t === "failure") return e.result.failure;
|
|
159
148
|
}
|
|
160
149
|
}
|
|
161
150
|
export {
|
|
162
|
-
|
|
151
|
+
me as TransactionConfirmShell
|
|
163
152
|
};
|
|
@@ -1,59 +1,68 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { IconExternal as
|
|
3
|
-
import * as
|
|
4
|
-
import { BaseLink as
|
|
1
|
+
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { IconExternal as o } from "@gearbox-protocol/static";
|
|
3
|
+
import * as s from "react";
|
|
4
|
+
import { BaseLink as a } from "../base-link/base-link.js";
|
|
5
5
|
import { IconButton as d } from "../icon-button/icon-button.js";
|
|
6
6
|
import { SimpleDropdown as c } from "../simple-dropdown/simple-dropdown.js";
|
|
7
7
|
import { SimpleDropdownMenuItem as f } from "../simple-dropdown/simple-dropdown-menu-item.js";
|
|
8
|
-
import {
|
|
8
|
+
import { SimpleTooltip as u } from "../tooltip/simple-tooltip.js";
|
|
9
|
+
import "../tooltip/tooltip.js";
|
|
10
|
+
import { FormattedMessageTyped as h } from "../typed-intl/index.js";
|
|
11
|
+
import { useIsMobile as x } from "../../hooks/use-media-query.js";
|
|
9
12
|
import "@gearbox-protocol/sdk";
|
|
10
|
-
import { cn as
|
|
13
|
+
import { cn as g } from "../../utils/cn.js";
|
|
11
14
|
import "sonner";
|
|
12
15
|
import "@gearbox-protocol/sdk/common-utils";
|
|
13
16
|
import "luxon";
|
|
14
17
|
import "../../utils/z-index.js";
|
|
15
|
-
const
|
|
16
|
-
const
|
|
18
|
+
const D = s.forwardRef(function({ explorerLinks: r, className: i, title: m }, n) {
|
|
19
|
+
const l = x() ? 32 : 40;
|
|
17
20
|
return /* @__PURE__ */ e(
|
|
18
|
-
|
|
21
|
+
u,
|
|
19
22
|
{
|
|
20
|
-
title:
|
|
21
|
-
|
|
23
|
+
title: /* @__PURE__ */ e(
|
|
24
|
+
c,
|
|
22
25
|
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
title: m || /* @__PURE__ */ e(
|
|
27
|
+
d,
|
|
28
|
+
{
|
|
29
|
+
ref: n,
|
|
30
|
+
buttonType: "outlined",
|
|
31
|
+
size: l,
|
|
32
|
+
className: g(i),
|
|
33
|
+
children: /* @__PURE__ */ e("span", { className: "flex items-center justify-center text-foreground", children: /* @__PURE__ */ e(o, { size: 14 }) })
|
|
34
|
+
}
|
|
35
|
+
),
|
|
36
|
+
asChild: !0,
|
|
37
|
+
placement: "bottom",
|
|
38
|
+
align: "end",
|
|
39
|
+
children: r?.map((t) => /* @__PURE__ */ e(f, { asChild: !0, children: /* @__PURE__ */ p(
|
|
40
|
+
a,
|
|
41
|
+
{
|
|
42
|
+
href: t.url,
|
|
43
|
+
external: !0,
|
|
44
|
+
className: "flex items-center gap-2",
|
|
45
|
+
children: [
|
|
46
|
+
t.name,
|
|
47
|
+
/* @__PURE__ */ e(
|
|
48
|
+
o,
|
|
49
|
+
{
|
|
50
|
+
size: 14,
|
|
51
|
+
className: "ml-auto",
|
|
52
|
+
style: { width: 14, height: 14 }
|
|
53
|
+
}
|
|
54
|
+
)
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
) }, t.url))
|
|
29
58
|
}
|
|
30
59
|
),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
align: "end",
|
|
34
|
-
children: o?.map((r) => /* @__PURE__ */ e(f, { asChild: !0, children: /* @__PURE__ */ s(
|
|
35
|
-
p,
|
|
36
|
-
{
|
|
37
|
-
href: r.url,
|
|
38
|
-
external: !0,
|
|
39
|
-
className: "flex items-center gap-2",
|
|
40
|
-
children: [
|
|
41
|
-
r.name,
|
|
42
|
-
/* @__PURE__ */ e(
|
|
43
|
-
t,
|
|
44
|
-
{
|
|
45
|
-
size: 14,
|
|
46
|
-
className: "ml-auto",
|
|
47
|
-
style: { width: 14, height: 14 }
|
|
48
|
-
}
|
|
49
|
-
)
|
|
50
|
-
]
|
|
51
|
-
}
|
|
52
|
-
) }, r.url))
|
|
60
|
+
placement: "top",
|
|
61
|
+
children: /* @__PURE__ */ e(h, { messageId: "components.openCopyButtons.explorer" })
|
|
53
62
|
}
|
|
54
63
|
);
|
|
55
64
|
});
|
|
56
|
-
|
|
65
|
+
D.displayName = "DetailedPageTitleExplorerDropdown";
|
|
57
66
|
export {
|
|
58
|
-
|
|
67
|
+
D as DetailedPageTitleExplorerDropdown
|
|
59
68
|
};
|
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import { TickMarkType as g } from "lightweight-charts";
|
|
2
2
|
import { DateTime as S } from "luxon";
|
|
3
|
-
import { isBelowDisplayThreshold as x, FORMAT_CONSTANTS as
|
|
4
|
-
const { MIN_DISPLAY_THRESHOLD: M, MAX_EXPONENTIAL_THRESHOLD:
|
|
3
|
+
import { isBelowDisplayThreshold as x, FORMAT_CONSTANTS as P, toSignificantDigits as I, formatNumberWithSuffix as p } from "../../utils/format-number.js";
|
|
4
|
+
const { MIN_DISPLAY_THRESHOLD: M, MAX_EXPONENTIAL_THRESHOLD: H } = P, w = (t, e, o = "full") => {
|
|
5
5
|
if (x(t))
|
|
6
6
|
return e ? `<${M}${e}` : `<${M}`;
|
|
7
7
|
if (t === 0)
|
|
8
8
|
return e ? `0${e}` : "0";
|
|
9
|
-
const r =
|
|
10
|
-
maxExponentialThreshold:
|
|
9
|
+
const r = p(t, {
|
|
10
|
+
maxExponentialThreshold: H,
|
|
11
11
|
minimumFractionDigits: 0,
|
|
12
12
|
maximumFractionDigits: o === "short" ? 1 : 0,
|
|
13
13
|
format: o,
|
|
14
14
|
adaptiveDecimals: o === "short"
|
|
15
15
|
});
|
|
16
16
|
return e ? `${r}${e}` : r;
|
|
17
|
-
},
|
|
17
|
+
}, C = 2, R = (t, e) => {
|
|
18
18
|
if (x(t))
|
|
19
19
|
return e ? `<${M}${e}` : `<${M}`;
|
|
20
20
|
if (t === 0)
|
|
21
21
|
return e ? `0${e}` : "0";
|
|
22
|
-
const o =
|
|
22
|
+
const o = I(t, C);
|
|
23
23
|
return e ? `${o}${e}` : o;
|
|
24
|
-
},
|
|
24
|
+
}, Y = 4, G = (t) => {
|
|
25
25
|
if (x(t))
|
|
26
26
|
return `<${M}`;
|
|
27
27
|
if (t === 0)
|
|
28
28
|
return "0";
|
|
29
29
|
const e = Math.round(t), o = Math.abs(t - e);
|
|
30
|
-
return o > 0 && o < 0.01 ? t.toFixed(12).replace(/0+$/, "").replace(/\.$/, "") :
|
|
31
|
-
},
|
|
30
|
+
return o > 0 && o < 0.01 ? t.toFixed(12).replace(/0+$/, "").replace(/\.$/, "") : I(t, Y);
|
|
31
|
+
}, V = (t, e) => {
|
|
32
32
|
if (x(t))
|
|
33
33
|
return e ? `<${M} ${e}` : `<${M}`;
|
|
34
34
|
if (t === 0)
|
|
35
35
|
return e ? `0 ${e}` : "0";
|
|
36
36
|
const o = Number.isInteger(t), r = Math.abs(t), i = o && r >= 1e3, s = Math.round(t), a = Math.abs(t - s);
|
|
37
37
|
if (a > 0 && a < 0.01 && !i) {
|
|
38
|
-
const
|
|
39
|
-
return e ? `${
|
|
38
|
+
const D = t.toFixed(12).replace(/0+$/, "").replace(/\.$/, "");
|
|
39
|
+
return e ? `${D} ${e}` : D;
|
|
40
40
|
}
|
|
41
|
-
const F =
|
|
42
|
-
maxExponentialThreshold:
|
|
41
|
+
const F = p(t, {
|
|
42
|
+
maxExponentialThreshold: H,
|
|
43
43
|
minimumFractionDigits: o ? 0 : 2,
|
|
44
44
|
maximumFractionDigits: i ? 1 : o ? 0 : 2,
|
|
45
45
|
format: i ? "short" : "full",
|
|
@@ -47,12 +47,12 @@ const { MIN_DISPLAY_THRESHOLD: M, MAX_EXPONENTIAL_THRESHOLD: I } = X, P = (t, e,
|
|
|
47
47
|
});
|
|
48
48
|
return e ? `${F} ${e}` : F;
|
|
49
49
|
}, N = {
|
|
50
|
-
"%":
|
|
51
|
-
$:
|
|
52
|
-
token:
|
|
53
|
-
none:
|
|
54
|
-
},
|
|
55
|
-
function
|
|
50
|
+
"%": R,
|
|
51
|
+
$: w,
|
|
52
|
+
token: V,
|
|
53
|
+
none: G
|
|
54
|
+
}, v = (t) => N[t] || N.token;
|
|
55
|
+
function tt(t, e, o = 4) {
|
|
56
56
|
if (t === 0)
|
|
57
57
|
return e ? `0 ${e}` : "0";
|
|
58
58
|
const r = e && Math.abs(t) >= 1e3 ? 0 : o, i = t.toLocaleString("en-US", {
|
|
@@ -61,14 +61,20 @@ function Z(t, e, o = 4) {
|
|
|
61
61
|
});
|
|
62
62
|
return e ? `${i} ${e}` : i;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function k(t, e) {
|
|
65
|
+
return !t || e === "none" || e === "token" ? t : e === "$" ? `$${t}` : e === "%" ? `${t}%` : `${t} ${e}`;
|
|
66
|
+
}
|
|
67
|
+
function L(t) {
|
|
68
|
+
return t.includes("/") ? "none" : t;
|
|
69
|
+
}
|
|
70
|
+
function et(t, e, o) {
|
|
65
71
|
const r = o?.yScaleMin;
|
|
66
72
|
let i = t.length > 0 ? Math.min(...t) : 0, s = t.length > 0 ? Math.max(...t) : 0, a = [];
|
|
67
73
|
const u = () => {
|
|
68
74
|
const n = (i + s) / 2;
|
|
69
75
|
let c = 1, m = "";
|
|
70
76
|
return n >= 1e9 ? (c = 1e9, m = "B") : n >= 1e6 ? (c = 1e6, m = "M") : n >= 1e3 && (c = 1e3, m = "K"), { scale: c, suffix: m };
|
|
71
|
-
}, F = 8,
|
|
77
|
+
}, F = 8, D = 0.02;
|
|
72
78
|
let A = 0;
|
|
73
79
|
const E = (n, c, m, d) => {
|
|
74
80
|
const h = (c > 1 ? n / c : n).toLocaleString("en-US", {
|
|
@@ -77,45 +83,48 @@ function v(t, e, o) {
|
|
|
77
83
|
useGrouping: !1
|
|
78
84
|
});
|
|
79
85
|
return c > 1 ? `${h}${m}` : h;
|
|
80
|
-
},
|
|
86
|
+
}, U = (n, c, m) => {
|
|
81
87
|
for (let d = 0; d <= F; d++) {
|
|
82
|
-
const
|
|
88
|
+
const $ = /* @__PURE__ */ new Set();
|
|
83
89
|
let h = !0;
|
|
84
|
-
for (const
|
|
85
|
-
const f = E(
|
|
86
|
-
if (
|
|
90
|
+
for (const T of n) {
|
|
91
|
+
const f = E(T, c, m, d);
|
|
92
|
+
if ($.has(f)) {
|
|
87
93
|
h = !1;
|
|
88
94
|
break;
|
|
89
95
|
}
|
|
90
|
-
|
|
96
|
+
$.add(f);
|
|
91
97
|
}
|
|
92
98
|
if (h) return d;
|
|
93
99
|
}
|
|
94
100
|
return F;
|
|
95
|
-
},
|
|
101
|
+
}, X = (n) => {
|
|
96
102
|
if (r !== void 0 && n < r) return "";
|
|
97
|
-
if (n === 0) return "0";
|
|
103
|
+
if (n === 0) return k("0", L(e));
|
|
98
104
|
const { scale: c, suffix: m } = u();
|
|
99
|
-
return
|
|
105
|
+
return k(
|
|
106
|
+
E(n, c, m, A),
|
|
107
|
+
L(e)
|
|
108
|
+
);
|
|
100
109
|
};
|
|
101
110
|
return {
|
|
102
|
-
formatter: (n) =>
|
|
111
|
+
formatter: (n) => X(n),
|
|
103
112
|
tickmarksFormatter: (n) => {
|
|
104
|
-
const { scale: c, suffix: m } = u(), d = s - i,
|
|
105
|
-
(f) => Math.abs(f) >= d *
|
|
113
|
+
const { scale: c, suffix: m } = u(), d = s - i, $ = d > 0 ? a.filter(
|
|
114
|
+
(f) => Math.abs(f) >= d * D
|
|
106
115
|
) : a, h = n.filter(
|
|
107
116
|
(f) => f !== 0 && !(r !== void 0 && f < r)
|
|
108
117
|
);
|
|
109
|
-
A =
|
|
110
|
-
[...h,
|
|
118
|
+
A = U(
|
|
119
|
+
[...h, ...$],
|
|
111
120
|
c,
|
|
112
121
|
m
|
|
113
122
|
);
|
|
114
|
-
const
|
|
123
|
+
const T = /* @__PURE__ */ new Set();
|
|
115
124
|
return n.map((f) => {
|
|
116
125
|
if (r !== void 0 && f < r) return "";
|
|
117
|
-
const
|
|
118
|
-
return !
|
|
126
|
+
const l = f === 0 ? "0" : E(f, c, m, A);
|
|
127
|
+
return !l || T.has(l) ? "" : (T.add(l), k(l, L(e)));
|
|
119
128
|
});
|
|
120
129
|
},
|
|
121
130
|
updateVisibleRange: (n) => {
|
|
@@ -126,11 +135,11 @@ function v(t, e, o) {
|
|
|
126
135
|
}
|
|
127
136
|
};
|
|
128
137
|
}
|
|
129
|
-
const
|
|
130
|
-
time:
|
|
131
|
-
"%":
|
|
138
|
+
const O = (t) => S.fromSeconds(Number(t)).toFormat("dd/LL/yyyy HH:mm"), W = (t) => S.fromSeconds(Number(t)).toFormat("HH:mm"), q = (t, e) => R(Number(t), e), _ = {
|
|
139
|
+
time: O,
|
|
140
|
+
"%": q
|
|
132
141
|
};
|
|
133
|
-
function
|
|
142
|
+
function B(t) {
|
|
134
143
|
const e = /* @__PURE__ */ new Map();
|
|
135
144
|
return (o, r, i) => {
|
|
136
145
|
const s = S.fromSeconds(Number(o));
|
|
@@ -160,26 +169,27 @@ function W(t) {
|
|
|
160
169
|
return u || (u = /* @__PURE__ */ new Set(), e.set(r, u)), u.has(a) ? " " : (u.add(a), a);
|
|
161
170
|
};
|
|
162
171
|
}
|
|
163
|
-
const
|
|
172
|
+
const y = (t, e) => {
|
|
164
173
|
if (t === "time" && e && e.length > 0) {
|
|
165
174
|
const r = S.fromSeconds(Number(e[0].time)), i = S.fromSeconds(
|
|
166
175
|
Number(e[e.length - 1].time)
|
|
167
176
|
), s = r.hasSame(i, "day"), a = s ? 0 : Math.ceil(i.diff(r, "days").days);
|
|
168
177
|
return {
|
|
169
|
-
timeFormatter: s ?
|
|
170
|
-
tickMarkFormatter:
|
|
178
|
+
timeFormatter: s ? W : O,
|
|
179
|
+
tickMarkFormatter: B(a)
|
|
171
180
|
};
|
|
172
181
|
}
|
|
173
182
|
const o = _[t] || _.time;
|
|
174
183
|
return {
|
|
175
184
|
timeFormatter: o,
|
|
176
|
-
tickMarkFormatter: (r) => o(r,
|
|
185
|
+
tickMarkFormatter: (r) => o(r, t)
|
|
177
186
|
};
|
|
178
|
-
},
|
|
187
|
+
}, rt = (t, e) => y(t, e).timeFormatter;
|
|
179
188
|
export {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
189
|
+
et as createAdaptiveYAxisFormatter,
|
|
190
|
+
tt as formatExactValue,
|
|
191
|
+
rt as getXFormatter,
|
|
192
|
+
y as getXFormatters,
|
|
193
|
+
v as getYFormatter,
|
|
194
|
+
k as withYAxisUnit
|
|
185
195
|
};
|
|
@@ -76,6 +76,7 @@ const e = {
|
|
|
76
76
|
"components.yieldBreakdown.programPoints": "{name} Points",
|
|
77
77
|
"components.yieldBreakdown.points": "Points",
|
|
78
78
|
"components.openCopyButtons.copy": "Copy to clipboard",
|
|
79
|
+
"components.openCopyButtons.explorer": "View in explorer",
|
|
79
80
|
"components.poolAssetsTable.asset": "Name",
|
|
80
81
|
"components.poolAssetsTable.rate": "Effective rate",
|
|
81
82
|
"components.poolAssetsTable.exposure": "Exposure",
|
package/dist/types/components/composites/tx-preview/confirm/dialog/transactionConfirmShellTypes.d.ts
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { ProgressStepperStep } from '../stepper/ProgressStepper';
|
|
3
3
|
import { TransactionConfirmPhase } from './transactionConfirmPhase';
|
|
4
4
|
/**
|
|
5
5
|
* How the card is framed. The body is identical in both: `page` drops the card
|
|
6
6
|
* into page flow, `dialog` puts the same card inside a modal.
|
|
7
7
|
*/
|
|
8
8
|
export type TransactionConfirmShellMode = "page" | "dialog";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Pre-labelled, ready-to-render steps. The slot no longer restricts step ids
|
|
11
|
+
* to the execution union: session-plan steppers (agreement/approve/confirm
|
|
12
|
+
* plus a delayed request/complete tail) carry their own ids and labels, and
|
|
13
|
+
* visibility is the caller's decision — omit the slot to hide the stepper.
|
|
14
|
+
*/
|
|
15
|
+
export type TransactionConfirmShellStepper = ReadonlyArray<ProgressStepperStep>;
|
|
13
16
|
/**
|
|
14
17
|
* Shown instead of preview and execution once the phase is terminal.
|
|
15
18
|
*
|
|
@@ -22,13 +22,18 @@ export interface AdaptiveYAxisFormatterOptions {
|
|
|
22
22
|
*/
|
|
23
23
|
yScaleMin?: number;
|
|
24
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Compact unit on an already-formatted axis tick. Generic `"token"` / `"none"`
|
|
27
|
+
* stay bare so charts without a real unit don't render a placeholder.
|
|
28
|
+
*/
|
|
29
|
+
export declare function withYAxisUnit(label: string, unit: YMeasureUnits): string;
|
|
25
30
|
/**
|
|
26
31
|
* Creates an adaptive Y-axis formatter that determines precision dynamically
|
|
27
32
|
* based on visible range to ensure unique labels on the axis.
|
|
28
33
|
* Data point values (like current price label) are shown with full precision.
|
|
29
34
|
* Returns both the formatter and update functions.
|
|
30
35
|
*/
|
|
31
|
-
export declare function createAdaptiveYAxisFormatter(initialValues: number[],
|
|
36
|
+
export declare function createAdaptiveYAxisFormatter(initialValues: number[], unit: YMeasureUnits, options?: AdaptiveYAxisFormatterOptions): {
|
|
32
37
|
formatter: (price: number) => string;
|
|
33
38
|
tickmarksFormatter: (prices: number[]) => string[];
|
|
34
39
|
updateVisibleRange: (visibleValues: number[]) => void;
|
|
@@ -94,6 +94,7 @@ declare const _default: {
|
|
|
94
94
|
"components.yieldBreakdown.points": "Points",
|
|
95
95
|
|
|
96
96
|
"components.openCopyButtons.copy": "Copy to clipboard",
|
|
97
|
+
"components.openCopyButtons.explorer": "View in explorer",
|
|
97
98
|
|
|
98
99
|
"components.poolAssetsTable.asset": "Name",
|
|
99
100
|
"components.poolAssetsTable.rate": "Effective rate",
|