{"version":3,"sources":["../../index.ts","../../../src/EthersLiquityConnection.ts","../../../src/Decimal.ts","../../../src/_utils.ts","../../../src/constants.ts","../../../../src/hooks/useLiquityStore.ts","../../../src/WebSocketAugmentedProvider.ts","../../../src/WebSocketProvider.ts","../../../src/contracts.ts","../../../src/ReadableEthersLiquity.ts","../../../src/BlockPolledLiquityStore.ts","../../../src/PopulatableEthersLiquity.ts","../../../src/SendableEthersLiquity.ts","../../../../src/components/LiquityStoreProvider.tsx","../../../../src/utils/equals.ts","../../../src/BatchedProvider.ts","../../../src/Trove.ts","../../../src/StabilityDeposit.ts","../../../src/LQTYStake.ts","../../../src/Fees.ts","../../../src/TransactableLiquity.ts","../../../src/SendableLiquity.ts","../../../src/LiquityStore.ts","../../../src/_CachedReadableLiquity.ts","../../../src/_Multicall.ts","../../../src/ObservableEthersLiquity.ts","../../../src/parseLogs.ts","../../../src/EthersLiquity.ts","../../../../src/hooks/useLiquityReducer.ts","../../../../src/hooks/useLiquitySelector.ts","config/index.ts","hooks/LiquityContext.tsx","connectors/injectedConnector.ts","components/Icon.tsx","components/Dialog.tsx","components/RetryDialog.tsx","components/WaitingDialog.tsx","components/ConnectionConfirmationDialog.tsx","components/MetaMaskIcon.tsx","components/Modal.tsx","components/WalletConnector.tsx","hooks/useAuthorizedConnection.ts","components/Tooltip.tsx","components/Transaction.tsx","theme.ts","testUtils/DisposableWalletProvider.ts","strings.ts","utils/shortenAddress.ts","components/UserAccount.tsx","components/Stability/context/fetchLqtyPrice.ts","components/InfoIcon.tsx","components/Statistic.tsx","components/SystemStats.tsx","components/SystemStatsPopup.tsx","components/LiquityLogo.tsx","images/networks/base.svg","images/networks/fuse.svg","images/networks/telos.svg","images/networks/taraxa.png","images/networks/artela.png","components/NetworkSwitcher.tsx","components/Nav.tsx","images/networks/meter-white.svg","images/networks/taiko.svg","components/Sidebar/SidebarConfig.tsx","components/Sidebar/invalidPaths.tsx","components/Sidebar/Sidebar.tsx","components/SideNav.tsx","components/Header.tsx","components/PageSwitcher/PageSwitcher.tsx","components/InfoMessage.tsx","components/Farm/context/FarmViewContext.tsx","components/Farm/views/RemainingLQTY.tsx","components/Badge.tsx","components/Farm/context/fetchPrices.ts","components/Farm/views/Yield.tsx","components/Farm/views/Inactive/Inactive.tsx","components/Trove/Editor.tsx","components/LoadingOverlay.tsx","components/Farm/context/useValidationState.ts","components/Farm/views/Confirm.tsx","components/ActionDescription.tsx","components/Farm/views/Description.tsx","components/Farm/views/Approve.tsx","components/ErrorDescription.tsx","components/Farm/views/Validation.tsx","components/Farm/views/Staking/Staking.tsx","components/Farm/views/Adjusting/Adjusting.tsx","components/Farm/views/Active/ClaimReward.tsx","components/Farm/views/UnstakeAndClaim.tsx","components/Farm/views/Active/Active.tsx","components/Farm/views/Disabled/Disabled.tsx","components/Farm/Farm.tsx","pages/Farm.tsx","components/LiquidationManager.tsx","components/Abbreviation.tsx","components/RiskyTroves.tsx","pages/RiskyTrovesPage.tsx","components/Redemption/DisabledRedemption.tsx","components/Redemption/RedemptionAction.tsx","components/Redemption/RedemptionManager.tsx","components/Redemption/Redemption.tsx","pages/RedemptionPage.tsx","components/Trove/CollateralRatio.tsx","components/Trove/TroveEditor.tsx","components/Trove/TroveAction.tsx","components/Trove/context/TroveViewContext.tsx","components/Trove/validation/validateTroveChange.tsx","components/Trove/TroveManager.tsx","components/Trove/ReadOnlyTrove.tsx","components/Trove/NoTrove.tsx","hooks/useStableTroveChange.ts","components/Warning.tsx","components/Trove/ExpensiveTroveChangeWarning.tsx","components/Trove/Opening.tsx","components/Trove/Adjusting.tsx","components/CollateralSurplusAction.tsx","components/Trove/RedeemedTrove.tsx","components/Trove/LiquidatedTrove.tsx","components/Trove/Trove.tsx","components/Stability/StabilityDepositEditor.tsx","components/Stability/StabilityDepositAction.tsx","components/Stability/context/StabilityViewContext.tsx","components/Stability/StabilityActionDescription.tsx","components/Stability/validation/validateStabilityDepositChange.tsx","components/Stability/StabilityDepositManager.tsx","components/Stability/actions/ClaimAndMove.tsx","components/Stability/actions/ClaimRewards.tsx","components/Stability/RemainingLQTY.tsx","components/Stability/Yield.tsx","components/Stability/ActiveDeposit.tsx","components/Stability/NoDeposit.tsx","components/Stability/Stability.tsx","components/Staking/context/StakingViewContext.tsx","components/Staking/StakingGainsAction.tsx","components/Staking/ReadOnlyStake.tsx","components/Staking/StakingEditor.tsx","components/Staking/StakingManagerAction.tsx","components/Staking/StakingManager.tsx","components/Staking/NoStake.tsx","components/Staking/Staking.tsx","pages/StakingPage.tsx","pages/StabilityPoolPage.tsx","pages/TrovePage.tsx","pages/StatsPage.tsx","components/Trove/context/TroveViewProvider.tsx","components/Stability/context/StabilityViewProvider.tsx","components/Staking/context/StakingViewProvider.tsx","components/Farm/context/transitions.ts","components/Farm/context/FarmViewProvider.tsx","LiquityFrontend.tsx","App.tsx","index.tsx"],"names":["__exportStar","exports","WebSocketProvider","address","overrides","a","readable","defaultConfig","frontendTag","AddressZero","hasKey","o","k","parseConfig","json","config","isAddress","getAddress","console","error","log","infuraApiKey","testnetOnly","configPromise","undefined","fetchConfig","fetch","response","ok","Error","status","getConfig","LiquityContext","createContext","LiquityProvider","children","loader","unsupportedNetworkFallback","unsupportedMainnetFallback","useWeb3React","provider","library","account","chainId","useState","setConfig","collateral","setCollateral","connection","useMemo","_connectByChainId","getSigner","userAddress","useStore","useEffect","then","liquity","EthersLiquity","_from","store","logging","Provider","value","useLiquity","liquityContext","useContext","injectedConnector","InjectedConnector","add","faCircleNotch","faCheck","faCheckCircle","faExclamationTriangle","faInfoCircle","faTimes","faTrash","faChartLine","faRedo","faHistory","faChevronLeft","faChevronRight","faClipboard","faClipboardCheck","faUserCircle","faWallet","faExternalLinkAlt","faCog","faPlug","faExclamationCircle","faAngleUp","faAngleDoubleUp","faAngleDown","faAngleDoubleDown","faPen","faHandPaper","faHeartbeat","faBars","faQuestionCircle","getIcon","name","Icon","style","rest","icon","iconFromIntent","intent","color","aria-label","Dialog","title","cancelLabel","onCancel","sx","p","borderRadius","height","bg","justifyContent","alignItems","borderBottom","borderColor","pb","as","textAlign","fontSize","px","variant","onClick","size","RetryDialog","retryLabel","onRetry","borderTop","flexDirection","mr","mb","width","WaitingDialog","waitReason","ConnectionConfirmationDialog","fontWeight","MetaMaskIcon","viewBox","fill","xmlns","d","x","y","Modal","encodedDappUrl","encodeURIComponent","encodedUrl","connectionReducer","state","action","type","connector","message","match","warn","WalletConnector","activate","deactivate","active","triedAuthorizedConnection","tried","setTried","isAuthorized","tryToActivateIfAuthorized","useAuthorizedConnection","useReducer","connectionState","dispatch","isMetaMask","window","ethereum","detectMetaMask","ml","location","href","mt","lineHeight","target","Tooltip","placement","event","useRef","show","setShow","referenceElement","setReferenceElement","popperElement","setPopperElement","usePopper","styles","attributes","React","cloneElement","Children","only","onMouseOver","current","onMouseOut","setTimeout","ref","popper","circularProgressbarStyle","strokeLinecap","pathColor","trailColor","slowProgress","strokeWidth","buildStyles","pathTransitionDuration","fastProgress","TransactionContext","TransactionProvider","transactionState","useTransactionState","useMyTransactionState","myId","id","useTransactionFunction","send","setTransactionState","useCallback","tx","includes","Transaction","tooltip","tooltipPlacement","showFailure","requires","sendTransaction","trigger","failureReasons","filter","map","push","clonedTrigger","length","disabled","tryToGetRevertReason","call","blockNumber","result","hexDataLength","hexDataSlice","defaultAbiCoder","decode","Donut","memo","CircularProgressbarWithChildren","TransactionProgressDonut","setValue","maxValue","spin","TransactionMonitor","cancelled","finished","txHash","rawSentTransaction","hash","waitForConfirmation","waitForReceipt","receipt","confirmations","rawReceipt","reason","EthersTransactionCancelledError","pl","position","bottom","overflow","zIndex","baseColors","colors","primary","secondary","accent","success","warning","danger","dangerHover","info","invalid","text","background","muted","buttonBase","display","cursor","button","py","border","opacity","buttonOutline","hoverColor","iconButton","padding","cardHeadingFontSize","cardGapX","cardGapY","card","boxShadow","infoCard","h2","formBase","flexShrink","formCell","modalOverlay","left","top","headerGradient","theme","breakpoints","space","fonts","body","join","heading","monospace","fontSizes","fontWeights","light","medium","bold","lineHeights","borders","shadows","fontFamily","buttons","outline","cancel","dangerIcon","titleIcon","cards","pr","infoPopup","right","overflowY","forms","label","unit","input","flex","editor","layout","header","footer","minHeight","main","maxWidth","mx","columns","flexWrap","justifyItems","actions","disabledOverlay","modal","infoOverlay","infoMessage","m","minWidth","sidenav","badge","backgroundColor","root","textDecoration","links","nav","textTransform","letterSpacing","DisposableWalletProvider","url","funderPrivateKey","ethAmount","wallet","funderWallet","haveFunded","this","Wallet","createRandom","Decimal","from","find","toLowerCase","to","hex","gas","hexlify","method","params","fund","Promise","all","nonce","findWallet","signTransaction","gasLimit","headers","JSON","stringify","jsonrpc","Object","assign","COIN","GT","LP","shortenAddress","substr","select","accountBalance","lusdBalance","lqtyBalance","UserAccount","useLiquitySelector","i","currency","balance","prettify","fetchMSTPrice","data","mstPrice","usd","lqtyPriceUSD","fetchTLOSYield","TLOSYield","telos","fetchFUSEYield","FUSEYield","fuse","fetchMSTMcap","mcap","mul","MstMcapUSD","fetchMeridianTVL","TVLUSD","InfoIcon","interactive","content","Statistic","selectBalances","numberOfTroves","price","total","lusdInStabilityPool","borrowingRate","redemptionRate","totalStakedLQTY","frontend","kickbackRate","SystemStats","showBalances","version","deploymentDate","lqtyPrice","setLqtyPrice","mstMcap","setMSTMcap","setTVLUSD","Balances","decimals","lusdInStabilityPoolPct","debt","nonZero","Percent","div","totalCollateralRatioPct","collateralRatio","borrowingFeePct","toString","shorten","shorten_4","collateralRatioIsBelowCritical","SystemStatsPopup","systemStatsOpen","setSystemStatsOpen","systemStatsOverlayRef","pt","e","LiquityLogo","boxProps","rel","src","SwitchNetwork","newNetwork","request","updatedProvider","ethers","providers","Web3Provider","currentNetworkId","NetworkSwitcher","networks","logo","baseLogo","telosLogo","fuseLogo","taraxaLogo","artelaLogo","availableNetworks","selectedNetwork","setSelectedNetwork","currentNetwork","net","options","onChange","selectedOption","components","Option","props","alt","marginRight","SingleValue","container","provided","Nav","BASE_MAINNET","TAIKO_MAINNET","menuConfig","FaCoins","path","subMenu","networkId","subSubMenu","FaHandshake","meterLogo","taikoLogo","FaChartLine","FaExchangeAlt","FaSeedling","FaArchway","FaArrowAltCircleUp","FaDollarSign","FaRegChartBar","FaEllipsisH","invalidPaths","network","isInvalidPath","isInvalid","some","invalidPath","alert","Sidebar","isExpanded","setIsExpanded","activeSubMenu","setActiveSubMenu","activeSubSubMenu","setActiveSubSubMenu","history","useHistory","toggleExpandOpen","isSmallScreen","innerWidth","handleResize","handleItemClick","targetChainId","isSubSubMenu","newPath","hashPath","basePath","split","replace","slice","open","handleMenuItemClick","item","matchMedia","matches","className","onMouseEnter","onMouseLeave","index","handleArrowClick","subItem","subIndex","handleSubArrowClick","subSubItem","subSubIndex","SideNav","isVisible","setIsVisible","overlay","handleOutsideClick","contains","document","addEventListener","removeEventListener","Header","isFrontendRegistered","paddingRight","transform","PageSwitcher","useLocation","pathname","activePage","setActivePage","handlePageChange","InfoMessage","FarmViewContext","useFarmView","context","selector","remainingLiquidityMiningLQTYReward","RemainingLQTY","Badge","uniswapQuery","lqtyTokenAddress","uniTokenAddress","fetchPrices","query","variables","reject","errors","token","derivedETH","pair","reserveUSD","totalSupply","bundle","ethPrice","ethPriceUSD","uniLpPriceUSD","totalStakedUniTokens","Yield","addresses","liquidityMiningLQTYRewardRate","uniLpPrice","setUniLpPrice","hasZeroValue","isZero","daysRemaining","remainingLqtyInUSD","totalStakedUniLpInUSD","yieldPercentage","Inactive","dispatchEvent","handleStakePressed","Row","labelId","labelFor","infoIcon","htmlFor","PendingAmount","startsWith","StaticAmounts","inputId","labelledBy","amount","pendingAmount","pendingColor","aria-labelledby","staticStyle","flexGrow","editableStyle","StaticRow","DisabledEditableRow","EditableRow","editingState","editedAmount","setEditedAmount","maxAmount","maxedOut","editing","setEditing","setInvalid","autoFocus","step","defaultValue","onBlur","stopPropagation","LoadingOverlay","uniTokenBalance","uniTokenAllowance","liquidityMiningStake","useValidationState","isWithdrawing","gt","amountChanged","sub","maximumStake","hasSetMaximumStake","eq","isValid","hasApproved","hasEnoughUniToken","gte","transactionId","Confirm","transactionAction","unstakeUniTokens","bind","stakeUniTokens","shouldDisable","ActionDescription","Amount","whiteSpace","Description","Approve","approveUniTokens","ErrorDescription","Validation","Staking","setAmount","isDirty","isTransactionPending","handleCancelPressed","nextTotalStakedUniTokens","poolShare","mulDiv","infinite","liquidityMiningLQTYReward","Adjusting","maximumAmount","hasSetMaximumAmount","originalPoolShare","poolShareChange","Difference","between","concat","positive","ClaimReward","withdrawLQTYRewardFromLiquidityMining","UnstakeAndClaim","exitLiquidityMining","Active","handleAdjustPressed","hasStakeAndRewards","Disabled","hasStake","Farm","view","LiquidationManager","numberOfTrovesToLiquidate","setNumberOfTrovesToLiquidate","min","liquidateUpTo","parseInt","Abbreviation","short","rowHeight","liquidatableInNormalMode","trove","collateralRatioIsBelowMinimum","liquidatableInRecoveryMode","totalCollateralRatio","MINIMUM_COLLATERAL_RATIO","lt","lte","blockTag","recoveryMode","RiskyTroves","pageSize","loading","setLoading","troves","setTroves","reload","setReload","forceReload","page","setPage","numberOfPages","Math","ceil","clampedPage","mounted","getTroves","first","sortedBy","startingAt","copied","setCopied","isEmpty","ownerAddress","onCopy","CRITICAL_COLLATERAL_RATIO","liquidate","RiskyTrovesPage","DisabledRedemption","disabledDays","unlockDate","toLocaleString","RedemptionAction","lusdAmount","maxRedemptionRate","redeemLUSD","mcrPercent","fees","RedemptionManager","ZERO","setLUSDAmount","changePending","setChangePending","dirty","feePct","ethFee","myTransactionState","canRedeem","description","selectBlockTimestamp","blockTimestamp","Redemption","bootstrapPeriod","bootstrapPeriodDays","round","bootstrapEndTime","getTime","bootstrapEndDate","Date","RedemptionPage","CollateralRatio","change","collateralRatioPct","changePct","absoluteValue","negative","nonZeroish","TroveEditor","original","edited","fee","collateral_tag","originalCollateralRatio","collateralRatioChange","LUSD_LIQUIDATION_RESERVE","TroveAction","maxBorrowingRate","borrowingFeeDecayToleranceMinutes","openTrove","closeTrove","adjustTrove","TroveViewContext","useTroveView","ccrPercent","TroveChangeDescription","depositCollateral","borrowLUSD","repayLUSD","withdrawCollateral","selectForTroveChangeValidation","validateTroveChange","originalTrove","adjustedTrove","selectedState","whatChanged","resultingTrove","apply","wouldTriggerRecoveryMode","subtract","LUSD_MINIMUM_DEBT","errorDescription","validateTroveCreation","validateTroveClosure","validateTroveAdjustment","LUSD_MINIMUM_NET_DEBT","isOpenableInRecoveryMode","init","Trove","debtDirty","addedMinimumDebt","reduceWith","reduce","addMinimumDebt","removeMinimumDebt","finishChange","revert","newCollateral","newValue","newState","setDebt","changeCommitted","stateChange","troveBeforeRedistribution","feeFrom","validationContext","transactionIdPrefix","transactionIdMatcher","RegExp","TroveManager","useLiquityReducer","validChange","handleCancel","openingNewTrove","ReadOnlyTrove","handleAdjustTrove","handleCloseTrove","NoTrove","handleOpenTrove","paramsEq","b","useStableTroveChange","troveChange","stableTroveChange","setStableTroveChange","Warning","ExpensiveTroveChangeWarning","gasEstimationState","setGasEstimationState","timeoutId","populate","populatedTx","rawPopulatedTransaction","clearTimeout","gasHeadroom","EMPTY_TROVE","TRANSACTION_ID","GAS_ROOM_ETH","Opening","borrowAmount","setBorrowAmount","totalDebt","maxCollateral","collateralMaxedOut","reset","previousTrove","netDebt","setNetDebt","nextCollateral","unsavedChanges","applyUnsavedCollateralChanges","nextNetDebt","applyUnsavedNetDebtChanges","isDebtIncrease","debtIncreaseAmount","updatedTrove","availableEth","collateralSurplusBalance","CollateralSurplusAction","myTransactionId","claimCollateralSurplus","hasSurplusCollateral","RedeemedTrove","LiquidatedTrove","StabilityDepositEditor","originalDeposit","editedLUSD","currentLUSD","lusdInStabilityPoolAfterChange","newPoolShare","collateralGain","lqtyReward","selectFrontendRegistered","StabilityDepositAction","depositLUSD","depositLUSDInStabilityPool","withdrawLUSDFromStabilityPool","withdrawLUSD","StabilityViewContext","useStabilityView","StabilityActionDescription","selectForStabilityDepositChangeValidation","ownFrontend","haveUndercollateralizedTroves","haveOwnFrontend","stabilityDeposit","updatedDeposit","initialLUSD","StabilityDepositManager","validateStabilityDepositChange","makingNewDeposit","ClaimAndMove","transferCollateralGainToTrove","ClaimRewards","withdrawGainsFromStabilityPool","remainingStabilityPoolLQTYReward","dailyIssuanceFraction","tlosYield","setTLOSYield","fuseYield","setFUSEYield","telosYield","aprPercentage","baseYield","ActiveDeposit","handleAdjustDeposit","hasReward","hasGain","hasTrove","isWaitingForTransaction","NoDeposit","Stability","StakingViewContext","useStakingView","selectLQTYStake","lqtyStake","StakingGainsAction","lusdGain","withdrawGainsFromStaking","ReadOnlyStake","stakedLQTY","StakingEditor","originalStake","editedLQTY","totalStakedLQTYAfterChange","StakingManagerAction","stakeLQTY","unstakeLQTY","updatedStake","selectLQTYBalance","StakingManagerActionDescription","StakingManager","dispatchStakingViewAction","isIncreasing","makingNewStake","NoStake","StakingPage","activeTab","renderContent","StabilityPoolPage","TrovePage","StatsPage","transitions","NONE","OPEN_TROVE_PRESSED","TROVE_OPENED","LIQUIDATED","TROVE_SURPLUS_COLLATERAL_CLAIMED","REDEEMED","OPENING","CANCEL_ADJUST_TROVE_PRESSED","ADJUSTING","TROVE_ADJUSTED","TROVE_CLOSED","TROVE_LIQUIDATED","TROVE_REDEEMED","CLOSING","ACTIVE","ADJUST_TROVE_PRESSED","CLOSE_TROVE_PRESSED","troveStatusEvents","closedByOwner","closedByLiquidation","closedByRedemption","TroveViewProvider","troveStatus","getInitialView","setView","viewRef","nextView","transition","DEPOSIT_PRESSED","DEPOSITING","CANCEL_PRESSED","DEPOSIT_CONFIRMED","REWARDS_CLAIMED","ADJUST_DEPOSIT_PRESSED","DEPOSIT_EMPTIED","StabilityViewProvider","adjusting","oldStake","oldState","StakingViewProvider","stakingTransactionState","INACTIVE","STAKE_PRESSED","STAKING","STAKE_CONFIRMED","STAKE_APPROVED","ADJUST_PRESSED","CLAIM_REWARD_CONFIRMED","UNSTAKE_AND_CLAIM_CONFIRMED","UNSTAKE_CONFIRMED","DISABLED","FarmViewProvider","LiquityFrontend","marginLeft","exact","autoRefreshOnNetworkChange","process","REACT_APP_DEMO_MODE","hostname","EthersWeb3ReactProvider","getLibrary","BatchedWebSocketAugmentedWeb3Provider","UnsupportedMainnetFallback","App","ReactDOM","render","StrictMode","getElementById"],"mappings":"ogBAAA,YACA,WACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACA,YACAA,EAAa,EAAb,S,2ZAZA,YAEA,YACA,YACA,a,miBCHA,IAAI,EAAJ,MAEA,OAEA,YAIA,YACA,YACA,YACA,YAGA,YAEA,YAEA,YAGA,SAGA,SAOA,SAEM,EAAM,UAEN,EAAW,UAGd,UAAQ,QAAU,WAHJ,IAMd,UAAc,QAAU,WANV,IAOd,UAAa,QAAU,WAPT,IAQd,UAAa,QAAU,WART,IASd,UAAe,QAAU,WATX,IAUd,UAAe,QAAU,WAVX,IAWd,UAAe,QAAU,WAXX,GAkBH,OAAR,OAAkB,EAAI,QAAU,GAAQ,IAiExC,EAAiB,SACrB,EACA,EACA,EACA,EAJqB,EAWrB,GACoC,IANlC,EAMkC,EANlC,eACA,EAKkC,EALlC,6BACA,EAIkC,EAJlC,8BACG,EAG+B,uFACpC,GACE,QAC4B,IAA5B,EAAe,WACd,EAAkB,SAAS,EAAe,UAE3C,MAAM,IAAI,MAAJ,iCAAoC,EAAe,WAG3D,OAAc,KACZ,WACA,SACA,aACA,aACA,eAAgB,IAAI,KAAK,GACzB,6BAA8B,UAAQ,KAAK,GAC3C,8BAA+B,UAAQ,KAAK,IACzC,GACA,IAKM,gBAAgB,SAAC,GAAD,OAC1B,EAAgD,YAEnD,IAAM,EAAe,SAAC,GAAD,OAClB,EAAgD,YAE7C,EAAwB,qBAAG,WAGpB,qBAAqB,SAChC,GAEmB,QADnB,EACmB,uDADE,SACF,OAE4D,QAF5D,EAEK,QAFL,EAEnB,EAAa,UAAW,eAAE,yBAAyB,CAAE,aAAY,KAAK,oBAAS,QAC/E,eAAa,GAAY,SAAS,GAAU,KAAK,IAGtC,iBAAiB,SAAC,GAAqD,aAC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QACNua,KAAM,oCACN3B,KAAME,GACN4B,WAAY,CACV,CAAE1a,KAAM,QAASua,KAAM,KACvB,CAAEva,KAAM,iBAAkBua,KAAM,SAChC,CAAEva,KAAM,UAAWua,KAAM,YACzB,CAAEva,KAAM,eAAgBua,KAAM,iBAC9B,CAAEva,KAAM,cAAeua,KAAM,iBAGjC,CACEE,UAxEe,IAyEfza,KAAM,SACNua,KAAM,oCACN3B,KAAMI,GACN0B,WAAY,CACV,CAAE1a,KAAM,QAASua,KAAM,KACvB,CAAEva,KAAM,iBAAkBua,KAAM,SAChC,CAAEva,KAAM,UAAWua,KAAM,YACzB,CAAEva,KAAM,eAAgBua,KAAM,iBAC9B,CAAEva,KAAM,cAAeua,KAAM,iBAGjC,CACEE,UApFe,MAqFfza,KAAM,SACNua,KAAM,oCACN3B,KAAMK,GACNyB,WAAY,CACV,CAAE1a,KAAM,QAASua,KAAM,KACvB,CAAEva,KAAM,iBAAkBua,KAAM,SAChC,CAAEva,KAAM,UAAWua,KAAM,YACzB,CAAEva,KAAM,eAAgBua,KAAM,iBAC9B,CAAEva,KAAM,cAAeua,KAAM,mBAKrC,CACEna,KAAMua,KACNja,MAAO,cACP6Z,KAAM,oCACNC,QAAS,CACP,CACEC,UA7Ga,IA8Gbza,KAAM,OACNua,KAAM,oCACN3B,KAAMG,IAER,CACE0B,UAlHc,GAmHdza,KAAM,QACNua,KAAM,oCACN3B,KAAMgC,IAER,CACEH,UAvHc,GAwHdza,KAAM,QACNua,KAAM,oCACN3B,KAAME,IAER,CACE2B,UAAWL,GACXpa,KAAM,QACNua,KAAM,oCACN3B,KAAMiC,IAER,CACEJ,UAjIe,IAkIfza,KAAM,SACNua,KAAM,oCACN3B,KAAMI,IAER,CACEyB,UAtIe,MAuIfza,KAAM,SACNua,KAAM,oCACN3B,KAAMK,MAIZ,CACE7Y,KAAM0a,KACNpa,MAAO,QACP6Z,KAAM,4CACNC,QAAS,CACP,CACEC,UAAWN,GACXna,KAAM,OACNua,KAAM,4CACN3B,KAAMC,IAER,CACE4B,UA7Jc,GA8Jdza,KAAM,QACNua,KAAM,4CACN3B,KAAMgC,MAIZ,CACExa,KAAM2a,KACNra,MAAO,OACP6Z,KAAM,oCACNC,QAAS,CACP,CACEC,UAzKc,GA0Kdza,KAAM,QACNua,KAAM,oCACN3B,KAAME,MAIZ,CACE1Y,KAAM4a,KACNta,MAAO,YACP6Z,KAAM,+CACNC,QAAS,CACP,CACEC,UAAWN,GACXna,KAAM,OACNua,KAAM,+CACN3B,KAAMC,IAER,CACE4B,UA9La,IA+Lbza,KAAM,OACNua,KAAM,+CACN3B,KAAMG,IAER,CACE0B,UAnMc,GAoMdza,KAAM,QACNua,KAAM,+CACN3B,KAAMgC,IAER,CACEH,UAxMc,GAyMdza,KAAM,QACNua,KAAM,+CACN3B,KAAME,IAER,CACE2B,UAAWL,GACXpa,KAAM,QACNua,KAAM,+CACN3B,KAAMiC,MAIZ,CACEza,KAAM6a,KACNva,MAAO,aACP6Z,KAAM,yCAER,CACEna,KAAM8a,KACNxa,MAAO,UACP6Z,KAAM,+CAER,CACEna,KAAM+a,KACNza,MAAO,WACP6Z,KAAM,+CAER,CACEna,KAAMgb,KACN1a,MAAO,YACP6Z,KAAM,GACNC,QAAS,CACP,CACEC,UAAW,EACXza,KAAM,QACNua,KAAM,+CAGR,CACEE,UAAW,EACXza,KAAM,SACNua,KAAM,gDAKZ,CACEna,KAAMib,KACN3a,MAAO,OACP6Z,KAAM,GACNC,QAAS,CACP,CACEC,UAAW,EACXza,KAAM,SACNua,KAAM,+CAGR,CACEE,UAAW,EACXza,KAAM,YACNua,KAAM,kDAGR,CACEE,UAAW,EACXza,KAAM,OACNua,KAAM,qCAGR,CACEE,UAAW,EACXza,KAAM,SACNua,KAAM,qCAGR,CACEE,UAAW,EACXza,KAAM,aACNua,KAAM,kDAGR,CACEE,UAAW,EACXza,KAAM,kBACNua,KAAM,GACNG,WAAY,CACV,CAAE1a,KAAM,aAAcua,KAAM,wBAC5B,CAAE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ASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,GAAD,MAEF9e,SAAS+e,eAAe,W","file":"static/js/main.871ffe01.chunk.js","sourcesContent":["\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(require(\"./src/BatchedProvider\"), exports);\n__exportStar(require(\"./src/WebSocketAugmentedProvider\"), exports);\n__exportStar(require(\"./src/WebSocketProvider\"), exports);\n//# sourceMappingURL=index.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._connect = exports._connectByChainId = exports._connectToDeployment = exports.UnsupportedNetworkError = exports._usingStore = exports._requireFrontendAddress = exports._requireAddress = exports._getProvider = exports._requireSigner = exports._getBlockTimestamp = exports._getContracts = void 0;\nconst abstract_signer_1 = require(\"@ethersproject/abstract-signer\");\nconst lib_base_1 = require(\"@liquity/lib-base\");\nconst dev_json_1 = __importDefault(require(\"../deployments/dev.json\"));\nconst telos_mainnet_json_1 = __importDefault(require(\"../deployments/telos_mainnet.json\"));\nconst fuse_testnet_json_1 = __importDefault(require(\"../deployments/fuse_testnet.json\"));\nconst artela_testnet_json_1 = __importDefault(require(\"../deployments/artela_testnet.json\"));\nconst taraxa_testnet_json_1 = __importDefault(require(\"../deployments/taraxa_testnet.json\"));\n// import taraxa_mainnet from \"../deployments/taraxa_mainnet.json\";\nconst zklink_testnet_json_1 = __importDefault(require(\"../deployments/zklink_testnet.json\"));\nconst base_mainnet_json_1 = __importDefault(require(\"../deployments/base_mainnet.json\"));\nconst mainnet_json_1 = __importDefault(require(\"../deployments/mainnet.json\"));\nconst _utils_1 = require(\"./_utils\");\nconst contracts_1 = require(\"./contracts\");\nconst _Multicall_1 = require(\"./_Multicall\");\nconst dev = dev_json_1.default;\nconst deployments = {\n [mainnet_json_1.default.chainId]: mainnet_json_1.default,\n // [ropsten.chainId]: ropsten,\n // [rinkeby.chainId]: rinkeby,\n [telos_mainnet_json_1.default.chainId]: telos_mainnet_json_1.default,\n [base_mainnet_json_1.default.chainId]: base_mainnet_json_1.default,\n [fuse_testnet_json_1.default.chainId]: fuse_testnet_json_1.default,\n [artela_testnet_json_1.default.chainId]: artela_testnet_json_1.default,\n [taraxa_testnet_json_1.default.chainId]: taraxa_testnet_json_1.default,\n [zklink_testnet_json_1.default.chainId]: zklink_testnet_json_1.default,\n // [taraxa_mainnet.chainId]: taraxa_mainnet,\n // [goerli.chainId]: goerli,\n // [kovan.chainId]: kovan,\n // [kiln.chainId]: kiln,\n ...(dev !== null ? { [dev.chainId]: dev } : {})\n};\nconst branded = (t) => t;\nconst connectionFrom = (provider, signer, _contracts, _multicall, { deploymentDate, totalStabilityPoolLQTYReward, liquidityMiningLQTYRewardRate, ...deployment }, optionalParams) => {\n if (optionalParams &&\n optionalParams.useStore !== undefined &&\n !validStoreOptions.includes(optionalParams.useStore)) {\n throw new Error(`Invalid useStore value ${optionalParams.useStore}`);\n }\n return branded({\n provider,\n signer,\n _contracts,\n _multicall,\n deploymentDate: new Date(deploymentDate),\n totalStabilityPoolLQTYReward: lib_base_1.Decimal.from(totalStabilityPoolLQTYReward),\n liquidityMiningLQTYRewardRate: lib_base_1.Decimal.from(liquidityMiningLQTYRewardRate),\n ...deployment,\n ...optionalParams\n });\n};\n/** @internal */\nconst _getContracts = (connection) => connection._contracts;\nexports._getContracts = _getContracts;\nconst getMulticall = (connection) => connection._multicall;\nconst getTimestampFromBlock = ({ timestamp }) => timestamp;\n/** @internal */\nconst _getBlockTimestamp = (connection, blockTag = \"latest\") => { var _a, _b; return (_b = (_a = \n// Get the timestamp via a contract call whenever possible, to make it batchable with other calls\ngetMulticall(connection)) === null || _a === void 0 ? void 0 : _a.getCurrentBlockTimestamp({ blockTag }).then(_utils_1.numberify)) !== null && _b !== void 0 ? _b : exports._getProvider(connection).getBlock(blockTag).then(getTimestampFromBlock); };\nexports._getBlockTimestamp = _getBlockTimestamp;\n/** @internal */\nconst _requireSigner = (connection) => { var _a; return (_a = connection.signer) !== null && _a !== void 0 ? _a : _utils_1.panic(new Error(\"Must be connected through a Signer\")); };\nexports._requireSigner = _requireSigner;\n/** @internal */\nconst _getProvider = (connection) => connection.provider;\nexports._getProvider = _getProvider;\n// TODO parameterize error message?\n/** @internal */\nconst _requireAddress = (connection, overrides) => { var _a, _b; return (_b = (_a = overrides === null || overrides === void 0 ? void 0 : overrides.from) !== null && _a !== void 0 ? _a : connection.userAddress) !== null && _b !== void 0 ? _b : _utils_1.panic(new Error(\"A user address is required\")); };\nexports._requireAddress = _requireAddress;\n/** @internal */\nconst _requireFrontendAddress = (connection) => { var _a; return (_a = connection.frontendTag) !== null && _a !== void 0 ? _a : _utils_1.panic(new Error(\"A frontend address is required\")); };\nexports._requireFrontendAddress = _requireFrontendAddress;\n/** @internal */\nconst _usingStore = (connection) => connection.useStore !== undefined;\nexports._usingStore = _usingStore;\n/**\n * Thrown when trying to connect to a network where Liquity is not deployed.\n *\n * @remarks\n * Thrown by {@link ReadableEthersLiquity.(connect:2)} and {@link EthersLiquity.(connect:2)}.\n *\n * @public\n */\nclass UnsupportedNetworkError extends Error {\n /** @internal */\n constructor(chainId) {\n super(`Unsupported network (chainId = ${chainId})`);\n this.name = \"UnsupportedNetworkError\";\n this.chainId = chainId;\n }\n}\nexports.UnsupportedNetworkError = UnsupportedNetworkError;\nconst getProviderAndSigner = (signerOrProvider) => {\n var _a;\n const provider = abstract_signer_1.Signer.isSigner(signerOrProvider)\n ? (_a = signerOrProvider.provider) !== null && _a !== void 0 ? _a : _utils_1.panic(new Error(\"Signer must have a Provider\")) : signerOrProvider;\n const signer = abstract_signer_1.Signer.isSigner(signerOrProvider) ? signerOrProvider : undefined;\n return [provider, signer];\n};\n/** @internal */\nconst _connectToDeployment = (deployment, signerOrProvider, optionalParams) => connectionFrom(...getProviderAndSigner(signerOrProvider), contracts_1._connectToContracts(signerOrProvider, deployment), undefined, deployment, optionalParams);\nexports._connectToDeployment = _connectToDeployment;\nconst validStoreOptions = [\"blockPolled\"];\n/** @internal */\nfunction _connectByChainId(provider, signer, chainId, optionalParams) {\n var _a;\n const deployment = (_a = deployments[chainId]) !== null && _a !== void 0 ? _a : _utils_1.panic(new UnsupportedNetworkError(chainId));\n return connectionFrom(provider, signer, contracts_1._connectToContracts(signer !== null && signer !== void 0 ? signer : provider, deployment), _Multicall_1._connectToMulticall(signer !== null && signer !== void 0 ? signer : provider, chainId), deployment, optionalParams);\n}\nexports._connectByChainId = _connectByChainId;\n/** @internal */\nconst _connect = async (signerOrProvider, optionalParams) => {\n const [provider, signer] = getProviderAndSigner(signerOrProvider);\n if (signer) {\n if ((optionalParams === null || optionalParams === void 0 ? void 0 : optionalParams.userAddress) !== undefined) {\n throw new Error(\"Can't override userAddress when connecting through Signer\");\n }\n optionalParams = {\n ...optionalParams,\n userAddress: await signer.getAddress()\n };\n }\n return _connectByChainId(provider, signer, (await provider.getNetwork()).chainId, optionalParams);\n};\nexports._connect = _connect;\n//# sourceMappingURL=EthersLiquityConnection.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Percent = exports.Difference = exports.Decimal = void 0;\nconst assert_1 = __importDefault(require(\"assert\"));\nconst bignumber_1 = require(\"@ethersproject/bignumber\");\nconst getDigits = (numDigits) => TEN.pow(numDigits);\nconst MAX_UINT_256 = \"0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\";\nconst PRECISION = 18;\nconst ONE = bignumber_1.BigNumber.from(1);\nconst TEN = bignumber_1.BigNumber.from(10);\nconst DIGITS = getDigits(PRECISION);\nconst stringRepresentationFormat = /^[0-9]*(\\.[0-9]*)?(e[-+]?[0-9]+)?$/;\nconst trailingZeros = /0*$/;\nconst magnitudes = [\"\", \"K\", \"M\", \"B\", \"T\"];\nconst roundedMul = (x, y) => x.mul(y).add(Decimal.HALF.hex).div(DIGITS);\n/**\n * Fixed-point decimal bignumber with 18 digits of precision.\n *\n * @remarks\n * Used by Liquity libraries to precisely represent native currency (e.g. Ether), LUSD and LQTY\n * amounts, as well as derived metrics like collateral ratios.\n *\n * @public\n */\nclass Decimal {\n constructor(bigNumber) {\n if (bigNumber.isNegative()) {\n throw new Error(\"negatives not supported by Decimal\");\n }\n this._bigNumber = bigNumber;\n }\n /** @internal */\n get hex() {\n return this._bigNumber.toHexString();\n }\n /** @internal */\n get bigNumber() {\n return this._bigNumber.toString();\n }\n static fromBigNumberString(bigNumberString) {\n return new Decimal(bignumber_1.BigNumber.from(bigNumberString));\n }\n static _fromString(representation) {\n if (!representation || !representation.match(stringRepresentationFormat)) {\n throw new Error(`bad decimal format: \"${representation}\"`);\n }\n if (representation.includes(\"e\")) {\n // eslint-disable-next-line prefer-const\n let [coefficient, exponent] = representation.split(\"e\");\n if (exponent.startsWith(\"-\")) {\n return new Decimal(Decimal._fromString(coefficient)._bigNumber.div(TEN.pow(bignumber_1.BigNumber.from(exponent.substr(1)))));\n }\n if (exponent.startsWith(\"+\")) {\n exponent = exponent.substr(1);\n }\n return new Decimal(Decimal._fromString(coefficient)._bigNumber.mul(TEN.pow(bignumber_1.BigNumber.from(exponent))));\n }\n if (!representation.includes(\".\")) {\n return new Decimal(bignumber_1.BigNumber.from(representation).mul(DIGITS));\n }\n // eslint-disable-next-line prefer-const\n let [characteristic, mantissa] = representation.split(\".\");\n if (mantissa.length < PRECISION) {\n mantissa += \"0\".repeat(PRECISION - mantissa.length);\n }\n else {\n mantissa = mantissa.substr(0, PRECISION);\n }\n return new Decimal(bignumber_1.BigNumber.from(characteristic || 0)\n .mul(DIGITS)\n .add(mantissa));\n }\n static from(decimalish) {\n switch (typeof decimalish) {\n case \"object\":\n if (decimalish instanceof Decimal) {\n return decimalish;\n }\n else {\n throw new Error(\"invalid Decimalish value\");\n }\n case \"string\":\n return Decimal._fromString(decimalish);\n case \"number\":\n return Decimal._fromString(decimalish.toString());\n default:\n throw new Error(\"invalid Decimalish value\");\n }\n }\n _toStringWithAutomaticPrecision() {\n const characteristic = this._bigNumber.div(DIGITS);\n const mantissa = this._bigNumber.mod(DIGITS);\n if (mantissa.isZero()) {\n return characteristic.toString();\n }\n else {\n const paddedMantissa = mantissa.toString().padStart(PRECISION, \"0\");\n const trimmedMantissa = paddedMantissa.replace(trailingZeros, \"\");\n return characteristic.toString() + \".\" + trimmedMantissa;\n }\n }\n _roundUp(precision) {\n const halfDigit = getDigits(PRECISION - 1 - precision).mul(5);\n return this._bigNumber.add(halfDigit);\n }\n _toStringWithPrecision(precision) {\n if (precision < 0) {\n throw new Error(\"precision must not be negative\");\n }\n const value = precision < PRECISION ? this._roundUp(precision) : this._bigNumber;\n const characteristic = value.div(DIGITS);\n const mantissa = value.mod(DIGITS);\n if (precision === 0) {\n return characteristic.toString();\n }\n else {\n const paddedMantissa = mantissa.toString().padStart(PRECISION, \"0\");\n const trimmedMantissa = paddedMantissa.substr(0, precision);\n return characteristic.toString() + \".\" + trimmedMantissa;\n }\n }\n toString(precision) {\n if (this.infinite) {\n return \"∞\";\n }\n else if (precision !== undefined) {\n return this._toStringWithPrecision(precision);\n }\n else {\n return this._toStringWithAutomaticPrecision();\n }\n }\n prettify(precision = 2) {\n const [characteristic, mantissa] = this.toString(precision).split(\".\");\n const prettyCharacteristic = characteristic.replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, \"$1,\");\n return mantissa !== undefined ? prettyCharacteristic + \".\" + mantissa : prettyCharacteristic;\n }\n shorten() {\n const characteristicLength = this.toString(0).length;\n const magnitude = Math.min(Math.floor((characteristicLength - 1) / 3), magnitudes.length - 1);\n const precision = Math.max(3 * (magnitude + 1) - characteristicLength, 0);\n const normalized = this.div(new Decimal(getDigits(PRECISION + 3 * magnitude)));\n return normalized.prettify(precision) + magnitudes[magnitude];\n }\n shorten_4(decimalPlaces) {\n // ... (previous code remains unchanged)\n const characteristicLength = this.toString(0).length;\n const magnitude = Math.min(Math.floor((characteristicLength - 1) / 3), magnitudes.length - 1);\n // Increase the precision by setting the decimal places\n const normalized = this.div(new Decimal(getDigits(PRECISION + 3 * magnitude)));\n // Format the normalized number with the increased decimal places\n return normalized.prettify(decimalPlaces) + magnitudes[magnitude];\n }\n add(addend) {\n return new Decimal(this._bigNumber.add(Decimal.from(addend)._bigNumber));\n }\n sub(subtrahend) {\n return new Decimal(this._bigNumber.sub(Decimal.from(subtrahend)._bigNumber));\n }\n mul(multiplier) {\n return new Decimal(this._bigNumber.mul(Decimal.from(multiplier)._bigNumber).div(DIGITS));\n }\n div(divider) {\n divider = Decimal.from(divider);\n if (divider.isZero) {\n return Decimal.INFINITY;\n }\n return new Decimal(this._bigNumber.mul(DIGITS).div(divider._bigNumber));\n }\n /** @internal */\n _divCeil(divider) {\n divider = Decimal.from(divider);\n if (divider.isZero) {\n return Decimal.INFINITY;\n }\n return new Decimal(this._bigNumber.mul(DIGITS).add(divider._bigNumber.sub(ONE)).div(divider._bigNumber));\n }\n mulDiv(multiplier, divider) {\n multiplier = Decimal.from(multiplier);\n divider = Decimal.from(divider);\n if (divider.isZero) {\n return Decimal.INFINITY;\n }\n return new Decimal(this._bigNumber.mul(multiplier._bigNumber).div(divider._bigNumber));\n }\n pow(exponent) {\n assert_1.default(Number.isInteger(exponent));\n assert_1.default(0 <= exponent && exponent <= 0xffffffff); // Ensure we're safe to use bitwise ops\n if (exponent === 0) {\n return Decimal.ONE;\n }\n if (exponent === 1) {\n return this;\n }\n let x = this._bigNumber;\n let y = DIGITS;\n for (; exponent > 1; exponent >>>= 1) {\n if (exponent & 1) {\n y = roundedMul(x, y);\n }\n x = roundedMul(x, x);\n }\n return new Decimal(roundedMul(x, y));\n }\n get isZero() {\n return this._bigNumber.isZero();\n }\n get zero() {\n if (this.isZero) {\n return this;\n }\n }\n get nonZero() {\n if (!this.isZero) {\n return this;\n }\n }\n get infinite() {\n if (this.eq(Decimal.INFINITY)) {\n return this;\n }\n }\n get finite() {\n if (!this.eq(Decimal.INFINITY)) {\n return this;\n }\n }\n /** @internal */\n get absoluteValue() {\n return this;\n }\n lt(that) {\n return this._bigNumber.lt(Decimal.from(that)._bigNumber);\n }\n eq(that) {\n return this._bigNumber.eq(Decimal.from(that)._bigNumber);\n }\n gt(that) {\n return this._bigNumber.gt(Decimal.from(that)._bigNumber);\n }\n gte(that) {\n return this._bigNumber.gte(Decimal.from(that)._bigNumber);\n }\n lte(that) {\n return this._bigNumber.lte(Decimal.from(that)._bigNumber);\n }\n static min(a, b) {\n a = Decimal.from(a);\n b = Decimal.from(b);\n return a.lt(b) ? a : b;\n }\n static max(a, b) {\n a = Decimal.from(a);\n b = Decimal.from(b);\n return a.gt(b) ? a : b;\n }\n}\nexports.Decimal = Decimal;\nDecimal.INFINITY = Decimal.fromBigNumberString(MAX_UINT_256);\nDecimal.ZERO = Decimal.from(0);\nDecimal.HALF = Decimal.from(0.5);\nDecimal.ONE = Decimal.from(1);\n/** @alpha */\nclass Difference {\n constructor(number) {\n this._number = number;\n }\n static between(d1, d2) {\n if (d1 === undefined || d2 === undefined) {\n return new Difference(undefined);\n }\n d1 = Decimal.from(d1);\n d2 = Decimal.from(d2);\n if (d1.infinite && d2.infinite) {\n return new Difference(undefined);\n }\n else if (d1.infinite) {\n return new Difference({ sign: \"+\", absoluteValue: d1 });\n }\n else if (d2.infinite) {\n return new Difference({ sign: \"-\", absoluteValue: d2 });\n }\n else if (d1.gt(d2)) {\n return new Difference({ sign: \"+\", absoluteValue: Decimal.from(d1).sub(d2) });\n }\n else if (d2.gt(d1)) {\n return new Difference({ sign: \"-\", absoluteValue: Decimal.from(d2).sub(d1) });\n }\n else {\n return new Difference({ sign: \"\", absoluteValue: Decimal.ZERO });\n }\n }\n toString(precision) {\n if (!this._number) {\n return \"N/A\";\n }\n return this._number.sign + this._number.absoluteValue.toString(precision);\n }\n prettify(precision) {\n if (!this._number) {\n return this.toString();\n }\n return this._number.sign + this._number.absoluteValue.prettify(precision);\n }\n mul(multiplier) {\n return new Difference(this._number && {\n sign: this._number.sign,\n absoluteValue: this._number.absoluteValue.mul(multiplier)\n });\n }\n get nonZero() {\n var _a;\n return ((_a = this._number) === null || _a === void 0 ? void 0 : _a.absoluteValue.nonZero) && this;\n }\n get positive() {\n var _a;\n return ((_a = this._number) === null || _a === void 0 ? void 0 : _a.sign) === \"+\" ? this : undefined;\n }\n get negative() {\n var _a;\n return ((_a = this._number) === null || _a === void 0 ? void 0 : _a.sign) === \"-\" ? this : undefined;\n }\n get absoluteValue() {\n var _a;\n return (_a = this._number) === null || _a === void 0 ? void 0 : _a.absoluteValue;\n }\n get infinite() {\n var _a;\n return ((_a = this._number) === null || _a === void 0 ? void 0 : _a.absoluteValue.infinite) && this;\n }\n get finite() {\n var _a;\n return ((_a = this._number) === null || _a === void 0 ? void 0 : _a.absoluteValue.finite) && this;\n }\n}\nexports.Difference = Difference;\n/** @alpha */\nclass Percent {\n constructor(ratio) {\n this._percent = ratio.infinite || (ratio.mul && ratio.mul(100)) || ratio;\n }\n nonZeroish(precision) {\n var _a;\n const zeroish = `0.${\"0\".repeat(precision)}5`;\n if ((_a = this._percent.absoluteValue) === null || _a === void 0 ? void 0 : _a.gte(zeroish)) {\n return this;\n }\n }\n toString(precision) {\n return (this._percent.toString(precision) +\n (this._percent.absoluteValue && !this._percent.infinite ? \"%\" : \"\"));\n }\n prettify() {\n var _a, _b;\n if ((_a = this._percent.absoluteValue) === null || _a === void 0 ? void 0 : _a.gte(\"1000\")) {\n return this.toString(0);\n }\n else if ((_b = this._percent.absoluteValue) === null || _b === void 0 ? void 0 : _b.gte(\"10\")) {\n return this.toString(1);\n }\n else {\n return this.toString(2);\n }\n }\n}\nexports.Percent = Percent;\n//# sourceMappingURL=Decimal.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.promiseAllValues = exports.panic = exports.decimalify = exports.numberify = void 0;\nconst lib_base_1 = require(\"@liquity/lib-base\");\nconst numberify = (bigNumber) => bigNumber.toNumber();\nexports.numberify = numberify;\nconst decimalify = (bigNumber) => lib_base_1.Decimal.fromBigNumberString(bigNumber.toHexString());\nexports.decimalify = decimalify;\nconst panic = (e) => {\n throw e;\n};\nexports.panic = panic;\nconst promiseAllValues = (object) => {\n const keys = Object.keys(object);\n return Promise.all(Object.values(object)).then(values => Object.fromEntries(values.map((value, i) => [keys[i], value])));\n};\nexports.promiseAllValues = promiseAllValues;\n//# sourceMappingURL=_utils.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MINIMUM_REDEMPTION_RATE = exports.MAXIMUM_BORROWING_RATE = exports.MINIMUM_BORROWING_RATE = exports.LUSD_MINIMUM_DEBT = exports.LUSD_MINIMUM_NET_DEBT = exports.LUSD_LIQUIDATION_RESERVE = exports.MINIMUM_COLLATERAL_RATIO = exports.CRITICAL_COLLATERAL_RATIO = void 0;\nconst Decimal_1 = require(\"./Decimal\");\n/**\n * Total collateral ratio below which recovery mode is triggered.\n *\n * @public\n */\nexports.CRITICAL_COLLATERAL_RATIO = Decimal_1.Decimal.from(1.5);\n/**\n * Collateral ratio below which a Trove can be liquidated in normal mode.\n *\n * @public\n */\nexports.MINIMUM_COLLATERAL_RATIO = Decimal_1.Decimal.from(1.1);\n/**\n * Amount of LUSD that's reserved for compensating the liquidator of a Trove.\n *\n * @public\n */\nexports.LUSD_LIQUIDATION_RESERVE = Decimal_1.Decimal.from(20);\n/**\n * A Trove must always have at least this much debt on top of the\n * {@link LUSD_LIQUIDATION_RESERVE | liquidation reserve}.\n *\n * @remarks\n * Any transaction that would result in a Trove with less net debt than this will be reverted.\n *\n * @public\n */\nexports.LUSD_MINIMUM_NET_DEBT = Decimal_1.Decimal.from(180);\n/**\n * A Trove must always have at least this much debt.\n *\n * @remarks\n * Any transaction that would result in a Trove with less debt than this will be reverted.\n *\n * @public\n */\nexports.LUSD_MINIMUM_DEBT = exports.LUSD_LIQUIDATION_RESERVE.add(exports.LUSD_MINIMUM_NET_DEBT);\n/**\n * Value that the {@link Fees.borrowingRate | borrowing rate} will never decay below.\n *\n * @remarks\n * Note that the borrowing rate can still be lower than this during recovery mode, when it's\n * overridden by zero.\n *\n * @public\n */\nexports.MINIMUM_BORROWING_RATE = Decimal_1.Decimal.from(0.005);\n/**\n * Value that the {@link Fees.borrowingRate | borrowing rate} will never exceed.\n *\n * @public\n */\nexports.MAXIMUM_BORROWING_RATE = Decimal_1.Decimal.from(0.05);\n/**\n * Value that the {@link Fees.redemptionRate | redemption rate} will never decay below.\n *\n * @public\n */\nexports.MINIMUM_REDEMPTION_RATE = Decimal_1.Decimal.from(0.005);\n//# sourceMappingURL=constants.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useLiquityStore = void 0;\nconst react_1 = require(\"react\");\nconst LiquityStoreProvider_1 = require(\"../components/LiquityStoreProvider\");\nconst useLiquityStore = () => {\n const store = react_1.useContext(LiquityStoreProvider_1.LiquityStoreContext);\n if (!store) {\n throw new Error(\"You must provide a LiquityStore via LiquityStoreProvider\");\n }\n return store;\n};\nexports.useLiquityStore = useLiquityStore;\n//# sourceMappingURL=useLiquityStore.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WebSocketAugmentedWeb3Provider = exports.WebSocketAugmented = exports.isWebSocketAugmentedProvider = void 0;\nconst providers_1 = require(\"@ethersproject/providers\");\nconst bytes_1 = require(\"@ethersproject/bytes\");\nconst WebSocketProvider_1 = require(\"./WebSocketProvider\");\nconst webSocketAugmentedProviders = [];\nconst isWebSocketAugmentedProvider = (provider) => webSocketAugmentedProviders.some(webSocketAugmentedProvider => provider instanceof webSocketAugmentedProvider);\nexports.isWebSocketAugmentedProvider = isWebSocketAugmentedProvider;\nconst isHeaderNotFoundError = (error) => typeof error === \"object\" &&\n typeof error.message === \"string\" &&\n (error.message.includes(\n // geth\n \"header not found\") ||\n error.message.includes(\n // openethereum\n \"request is not supported because your node is running with state pruning\"));\nconst isTransactionHash = (eventName) => typeof eventName === \"string\" && bytes_1.hexDataLength(eventName) === 32;\nconst loadBalancingGlitchRetryIntervalMs = 200;\nconst delay = (ms) => new Promise(resolve => setTimeout(resolve, ms));\nconst waitFor = (f) => (g) => (t, { isActive }) => {\n f(t).then(u => {\n if (u !== null && isActive()) {\n g(u);\n }\n });\n};\nconst pass = (f) => (t, _) => {\n f(t);\n};\nconst passOnce = (f) => (t, { removeMe }) => {\n f(t);\n removeMe();\n};\nconst sequence = (f, g) => (h) => (t, context) => {\n f(u => g(h)(u, context))(t, context);\n};\nconst defer = (f) => (t) => {\n setTimeout(() => {\n f(t);\n }, 0);\n};\nconst WebSocketAugmented = (Base) => {\n let webSocketAugmentedProvider = class extends Base {\n constructor() {\n super(...arguments);\n this._seenBlock = 0;\n this._blockListenerScheduled = false;\n this._blockListeners = new Map();\n this._blockListener = this._onBlock.bind(this);\n }\n openWebSocket(url, network) {\n this._wsProvider = new WebSocketProvider_1.WebSocketProvider(url, network);\n this._wsProvider.onClose = this._onWebSocketClose.bind(this);\n this._wsParams = [url, network];\n this._switchover();\n }\n _onWebSocketClose() {\n this.closeWebSocket();\n console.warn(\"WebSocketProvider disconnected. Retrying in 10 seconds.\");\n this._reconnectTimerId = setTimeout(() => this.openWebSocket(...this._wsParams), 10000);\n }\n closeWebSocket() {\n if (this._wsProvider) {\n this._wsProvider.onClose = null;\n this._wsProvider.close(1000); // normal closure\n this._wsProvider = undefined;\n this._switchover();\n if (this._reconnectTimerId !== undefined) {\n clearTimeout(this._reconnectTimerId);\n this._reconnectTimerId = undefined;\n }\n }\n }\n _switchover() {\n if (this._blockListeners.size > 0) {\n if (this._wsProvider) {\n super.off(\"block\", this._blockListener);\n }\n this._startBlockEvents();\n }\n }\n _onBlock(blockNumber) {\n this._seenBlock = blockNumber;\n if (!this._blockListenerScheduled) {\n this._blockListenerScheduled = true;\n setTimeout(() => {\n this._blockListenerScheduled = false;\n [...this._blockListeners].forEach(([, listener]) => listener(this._seenBlock));\n }, 50);\n }\n }\n async _retrySeenBlock(perform, startingBlock) {\n for (let retries = 0;; ++retries) {\n try {\n const ret = await perform();\n if (retries) {\n // console.log(`Glitch resolved after ${retries} ${retries === 1 ? \"retry\" : \"retries\"}.`);\n }\n return ret;\n }\n catch (error) {\n if (this._seenBlock !== startingBlock || !isHeaderNotFoundError(error)) {\n throw error;\n }\n }\n // console.warn(\"Load balancing glitch. Retrying...\");\n await delay(loadBalancingGlitchRetryIntervalMs);\n }\n }\n async call(transaction, blockTag) {\n const resolvedBlockTag = await blockTag;\n const perform = () => {\n var _a;\n return ((_a = this._wsProvider) === null || _a === void 0 ? void 0 : _a.isReady) ? this._wsProvider.call(transaction, resolvedBlockTag)\n : super.call(transaction, resolvedBlockTag);\n };\n return resolvedBlockTag === this._seenBlock\n ? this._retrySeenBlock(perform, this._seenBlock)\n : perform();\n }\n async getBalance(addressOrName, blockTag) {\n const resolvedBlockTag = await blockTag;\n const perform = () => {\n var _a;\n return ((_a = this._wsProvider) === null || _a === void 0 ? void 0 : _a.isReady) ? this._wsProvider.getBalance(addressOrName, resolvedBlockTag)\n : super.getBalance(addressOrName, resolvedBlockTag);\n };\n return resolvedBlockTag === this._seenBlock\n ? this._retrySeenBlock(perform, this._seenBlock)\n : perform();\n }\n _startBlockEvents() {\n if (this._wsProvider) {\n console.log(\"Listening for new blocks on WebSocketProvider\");\n this._wsProvider.on(\"block\", this._blockListener);\n }\n else {\n console.log(\"Listening for new blocks on basic Provider\");\n super.on(\"block\", this._blockListener);\n }\n }\n _stopBlockEvents() {\n if (this._wsProvider) {\n this._wsProvider.off(\"block\", this._blockListener);\n }\n else {\n super.off(\"block\", this._blockListener);\n }\n }\n _wrap(f, g) {\n return [\n f,\n (u) => g(defer(f))(u, {\n isActive: () => this._blockListeners.has(f),\n removeMe: () => this._blockListeners.delete(f)\n })\n ];\n }\n on(eventName, listener) {\n if (isTransactionHash(eventName)) {\n const fetchReceipt = this._getTransactionReceiptFromLatest.bind(this, eventName);\n const [, passReceipt] = this._wrap(listener, waitFor(fetchReceipt));\n passReceipt(undefined);\n return this._addBlockListener(listener, passReceipt);\n }\n else if (eventName === \"block\") {\n return this._addBlockListener(...this._wrap(listener, pass));\n }\n else {\n return super.on(eventName, listener);\n }\n }\n _addBlockListener(key, blockListener) {\n if (!this._blockListeners.has(key)) {\n this._blockListeners.set(key, blockListener);\n if (this._blockListeners.size === 1) {\n this._startBlockEvents();\n }\n }\n return this;\n }\n once(eventName, listener) {\n if (isTransactionHash(eventName)) {\n const fetchReceipt = this._getTransactionReceiptFromLatest.bind(this, eventName);\n const [, passReceiptOnce] = this._wrap(listener, sequence(waitFor(fetchReceipt), passOnce));\n passReceiptOnce(undefined);\n return this._addBlockListener(listener, passReceiptOnce);\n }\n else if (eventName === \"block\") {\n return this._addBlockListener(...this._wrap(listener, passOnce));\n }\n else {\n return super.once(eventName, listener);\n }\n }\n off(eventName, listener) {\n if (isTransactionHash(eventName) || eventName === \"block\") {\n return this._removeBlockListener(listener);\n }\n else {\n return super.off(eventName, listener);\n }\n }\n _removeBlockListener(key) {\n if (this._blockListeners.has(key)) {\n this._blockListeners.delete(key);\n if (this._blockListeners.size === 0) {\n this._stopBlockEvents();\n }\n }\n return this;\n }\n async getTransaction(transactionHash) {\n var _a, _b;\n const txPromises = [\n super.getTransaction(transactionHash),\n ...(((_a = this._wsProvider) === null || _a === void 0 ? void 0 : _a.isReady) ? [this._wsProvider.getTransaction(transactionHash)] : [])\n ];\n const first = await Promise.race(txPromises);\n const tx = (_b = first !== null && first !== void 0 ? first : (await Promise.all(txPromises)).find(tx => tx !== null)) !== null && _b !== void 0 ? _b : null;\n return tx;\n }\n getTransactionReceipt(transactionHash) {\n var _a;\n return ((_a = this._wsProvider) === null || _a === void 0 ? void 0 : _a.isReady) ? this._wsProvider.getTransactionReceipt(transactionHash)\n : super.getTransactionReceipt(transactionHash);\n }\n getTransactionCount(addressOrName, blockTag) {\n var _a;\n return ((_a = this._wsProvider) === null || _a === void 0 ? void 0 : _a.isReady) ? this._wsProvider.getTransactionCount(addressOrName, blockTag)\n : super.getTransactionCount(addressOrName, blockTag);\n }\n getBlock(blockHashOrBlockTag) {\n var _a;\n return ((_a = this._wsProvider) === null || _a === void 0 ? void 0 : _a.isReady) ? this._wsProvider.getBlock(blockHashOrBlockTag)\n : super.getBlock(blockHashOrBlockTag);\n }\n getBlockWithTransactions(blockHashOrBlockTag) {\n var _a;\n return ((_a = this._wsProvider) === null || _a === void 0 ? void 0 : _a.isReady) ? this._wsProvider.getBlockWithTransactions(blockHashOrBlockTag)\n : super.getBlockWithTransactions(blockHashOrBlockTag);\n }\n async _blockContainsTx(blockNumber, txHash) {\n let block;\n for (block = null; !block; block = await this.getBlock(blockNumber)) {\n await delay(loadBalancingGlitchRetryIntervalMs);\n }\n return block.transactions.some(txHashInBlock => txHashInBlock === txHash);\n }\n async _getTransactionReceiptFromLatest(txHash, latestBlock) {\n txHash = await txHash;\n for (let retries = 0;; ++retries) {\n const receipt = (await this.getTransactionReceipt(txHash));\n if (latestBlock === undefined ||\n (receipt === null && !(await this._blockContainsTx(latestBlock, txHash))) ||\n (receipt !== null && receipt.blockNumber + receipt.confirmations - 1 >= latestBlock)) {\n if (retries) {\n // console.log(`Glitch resolved after ${retries} ${retries === 1 ? \"retry\" : \"retries\"}.`);\n }\n return receipt;\n }\n // console.warn(\"Load balancing glitch. Retrying...\");\n await delay(loadBalancingGlitchRetryIntervalMs);\n }\n }\n async waitForTransaction(txHash, confirmations, timeout) {\n if (timeout !== undefined) {\n // We don't use timeout, don't implement it\n return super.waitForTransaction(txHash, confirmations, timeout);\n }\n let latestBlock = undefined;\n for (;;) {\n const receipt = await this._getTransactionReceiptFromLatest(txHash, latestBlock);\n if (receipt !== null &&\n (confirmations === undefined || receipt.confirmations >= confirmations)) {\n return receipt;\n }\n latestBlock = await new Promise(resolve => this.once(\"block\", resolve));\n }\n }\n };\n webSocketAugmentedProviders.push(webSocketAugmentedProvider);\n return webSocketAugmentedProvider;\n};\nexports.WebSocketAugmented = WebSocketAugmented;\nexports.WebSocketAugmentedWeb3Provider = exports.WebSocketAugmented(providers_1.Web3Provider);\n//# sourceMappingURL=WebSocketAugmentedProvider.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WebSocketProvider = void 0;\nconst providers_1 = require(\"@ethersproject/providers\");\nclass WebSocketProvider extends providers_1.WebSocketProvider {\n get isReady() {\n return this._websocket.readyState === WebSocket.OPEN;\n }\n set onClose(closeListener) {\n this._websocket.onclose = closeListener;\n }\n close(code) {\n this._websocket.close(code);\n }\n async detectNetwork() {\n return this.network;\n }\n}\nexports.WebSocketProvider = WebSocketProvider;\n//# sourceMappingURL=WebSocketProvider.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._connectToContracts = exports._uniTokenIsMock = exports._priceFeedIsTestnet = exports._LiquityContract = void 0;\nconst contracts_1 = require(\"@ethersproject/contracts\");\nconst ActivePool_json_1 = __importDefault(require(\"../abi/ActivePool.json\"));\nconst BorrowerOperations_json_1 = __importDefault(require(\"../abi/BorrowerOperations.json\"));\nconst TroveManager_json_1 = __importDefault(require(\"../abi/TroveManager.json\"));\nconst LUSDToken_json_1 = __importDefault(require(\"../abi/LUSDToken.json\"));\nconst CollSurplusPool_json_1 = __importDefault(require(\"../abi/CollSurplusPool.json\"));\nconst CommunityIssuance_json_1 = __importDefault(require(\"../abi/CommunityIssuance.json\"));\nconst DefaultPool_json_1 = __importDefault(require(\"../abi/DefaultPool.json\"));\nconst LQTYToken_json_1 = __importDefault(require(\"../abi/LQTYToken.json\"));\nconst HintHelpers_json_1 = __importDefault(require(\"../abi/HintHelpers.json\"));\nconst LockupContractFactory_json_1 = __importDefault(require(\"../abi/LockupContractFactory.json\"));\nconst LQTYStaking_json_1 = __importDefault(require(\"../abi/LQTYStaking.json\"));\nconst MultiTroveGetter_json_1 = __importDefault(require(\"../abi/MultiTroveGetter.json\"));\nconst PriceFeed_json_1 = __importDefault(require(\"../abi/PriceFeed.json\"));\nconst PriceFeedTestnet_json_1 = __importDefault(require(\"../abi/PriceFeedTestnet.json\"));\nconst SortedTroves_json_1 = __importDefault(require(\"../abi/SortedTroves.json\"));\nconst StabilityPool_json_1 = __importDefault(require(\"../abi/StabilityPool.json\"));\nconst GasPool_json_1 = __importDefault(require(\"../abi/GasPool.json\"));\nconst Unipool_json_1 = __importDefault(require(\"../abi/Unipool.json\"));\nconst IERC20_json_1 = __importDefault(require(\"../abi/IERC20.json\"));\nconst ERC20Mock_json_1 = __importDefault(require(\"../abi/ERC20Mock.json\"));\nconst buildEstimatedFunctions = (estimateFunctions, functions) => Object.fromEntries(Object.keys(estimateFunctions).map(functionName => [\n functionName,\n async (overrides, adjustEstimate, ...args) => {\n if (overrides.gasLimit === undefined) {\n const estimatedGas = await estimateFunctions[functionName](...args, overrides);\n // Increase gas limit by 20%\n const increasedGasLimit = estimatedGas.mul(120).div(100);\n overrides = {\n ...overrides,\n gasLimit: adjustEstimate(increasedGasLimit)\n };\n }\n return functions[functionName](...args, overrides);\n }\n]));\nclass _LiquityContract extends contracts_1.Contract {\n constructor(addressOrName, contractInterface, signerOrProvider) {\n super(addressOrName, contractInterface, signerOrProvider);\n // this.estimateAndCall = buildEstimatedFunctions(this.estimateGas, this);\n this.estimateAndPopulate = buildEstimatedFunctions(this.estimateGas, this.populateTransaction);\n }\n extractEvents(logs, name) {\n return logs\n .filter(log => log.address === this.address)\n .map(log => this.interface.parseLog(log))\n .filter(e => e.name === name);\n }\n}\nexports._LiquityContract = _LiquityContract;\n/** @internal */\nconst _priceFeedIsTestnet = (priceFeed) => \"setPrice\" in priceFeed;\nexports._priceFeedIsTestnet = _priceFeedIsTestnet;\n/** @internal */\nconst _uniTokenIsMock = (uniToken) => \"mint\" in uniToken;\nexports._uniTokenIsMock = _uniTokenIsMock;\nconst getAbi = (priceFeedIsTestnet, uniTokenIsMock) => ({\n activePool: ActivePool_json_1.default,\n borrowerOperations: BorrowerOperations_json_1.default,\n troveManager: TroveManager_json_1.default,\n lusdToken: LUSDToken_json_1.default,\n communityIssuance: CommunityIssuance_json_1.default,\n defaultPool: DefaultPool_json_1.default,\n lqtyToken: LQTYToken_json_1.default,\n hintHelpers: HintHelpers_json_1.default,\n lockupContractFactory: LockupContractFactory_json_1.default,\n lqtyStaking: LQTYStaking_json_1.default,\n multiTroveGetter: MultiTroveGetter_json_1.default,\n priceFeed: priceFeedIsTestnet ? PriceFeedTestnet_json_1.default : PriceFeed_json_1.default,\n sortedTroves: SortedTroves_json_1.default,\n stabilityPool: StabilityPool_json_1.default,\n gasPool: GasPool_json_1.default,\n collSurplusPool: CollSurplusPool_json_1.default,\n unipool: Unipool_json_1.default,\n uniToken: uniTokenIsMock ? ERC20Mock_json_1.default : IERC20_json_1.default\n});\nconst mapLiquityContracts = (contracts, f) => Object.fromEntries(Object.entries(contracts).map(([key, t]) => [key, f(t, key)]));\n/** @internal */\nconst _connectToContracts = (signerOrProvider, { addresses, _priceFeedIsTestnet, _uniTokenIsMock }) => {\n const abi = getAbi(_priceFeedIsTestnet, _uniTokenIsMock);\n return mapLiquityContracts(addresses, (address, key) => new _LiquityContract(address, abi[key], signerOrProvider));\n};\nexports._connectToContracts = _connectToContracts;\n//# sourceMappingURL=contracts.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ReadableEthersLiquity = void 0;\nconst lib_base_1 = require(\"@liquity/lib-base\");\nconst _utils_1 = require(\"./_utils\");\nconst EthersLiquityConnection_1 = require(\"./EthersLiquityConnection\");\nconst BlockPolledLiquityStore_1 = require(\"./BlockPolledLiquityStore\");\n// TODO: these are constant in the contracts, so it doesn't make sense to make a call for them,\n// but to avoid having to update them here when we change them in the contracts, we could read\n// them once after deployment and save them to LiquityDeployment.\nconst MINUTE_DECAY_FACTOR = lib_base_1.Decimal.from(\"0.999037758833783000\");\nconst BETA = lib_base_1.Decimal.from(2);\nvar BackendTroveStatus;\n(function (BackendTroveStatus) {\n BackendTroveStatus[BackendTroveStatus[\"nonExistent\"] = 0] = \"nonExistent\";\n BackendTroveStatus[BackendTroveStatus[\"active\"] = 1] = \"active\";\n BackendTroveStatus[BackendTroveStatus[\"closedByOwner\"] = 2] = \"closedByOwner\";\n BackendTroveStatus[BackendTroveStatus[\"closedByLiquidation\"] = 3] = \"closedByLiquidation\";\n BackendTroveStatus[BackendTroveStatus[\"closedByRedemption\"] = 4] = \"closedByRedemption\";\n})(BackendTroveStatus || (BackendTroveStatus = {}));\nconst userTroveStatusFrom = (backendStatus) => backendStatus === BackendTroveStatus.nonExistent\n ? \"nonExistent\"\n : backendStatus === BackendTroveStatus.active\n ? \"open\"\n : backendStatus === BackendTroveStatus.closedByOwner\n ? \"closedByOwner\"\n : backendStatus === BackendTroveStatus.closedByLiquidation\n ? \"closedByLiquidation\"\n : backendStatus === BackendTroveStatus.closedByRedemption\n ? \"closedByRedemption\"\n : _utils_1.panic(new Error(`invalid backendStatus ${backendStatus}`));\nconst convertToDate = (timestamp) => new Date(timestamp * 1000);\nconst validSortingOptions = [\"ascendingCollateralRatio\", \"descendingCollateralRatio\"];\nconst expectPositiveInt = (obj, key) => {\n if (obj[key] !== undefined) {\n if (!Number.isInteger(obj[key])) {\n throw new Error(`${key} must be an integer`);\n }\n if (obj[key] < 0) {\n throw new Error(`${key} must not be negative`);\n }\n }\n};\n/**\n * Ethers-based implementation of {@link @liquity/lib-base#ReadableLiquity}.\n *\n * @public\n */\nclass ReadableEthersLiquity {\n /** @internal */\n constructor(connection) {\n this.connection = connection;\n }\n /** @internal */\n static _from(connection) {\n const readable = new ReadableEthersLiquity(connection);\n return connection.useStore === \"blockPolled\"\n ? new _BlockPolledReadableEthersLiquity(readable)\n : readable;\n }\n /**\n * Connect to the Liquity protocol and create a `ReadableEthersLiquity` object.\n *\n * @param signerOrProvider - Ethers `Signer` or `Provider` to use for connecting to the Ethereum\n * network.\n * @param optionalParams - Optional parameters that can be used to customize the connection.\n */\n static async connect(signerOrProvider, optionalParams) {\n return ReadableEthersLiquity._from(await EthersLiquityConnection_1._connect(signerOrProvider, optionalParams));\n }\n hasStore() {\n return false;\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getTotalRedistributed} */\n async getTotalRedistributed(overrides) {\n const { troveManager } = EthersLiquityConnection_1._getContracts(this.connection);\n const [collateral, debt] = await Promise.all([\n troveManager.L_ETH({ ...overrides }).then(_utils_1.decimalify),\n troveManager.L_LUSDDebt({ ...overrides }).then(_utils_1.decimalify)\n ]);\n return new lib_base_1.Trove(collateral, debt);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getTroveBeforeRedistribution} */\n async getTroveBeforeRedistribution(address, overrides) {\n address !== null && address !== void 0 ? address : (address = EthersLiquityConnection_1._requireAddress(this.connection));\n const { troveManager } = EthersLiquityConnection_1._getContracts(this.connection);\n const [trove, snapshot] = await Promise.all([\n troveManager.Troves(address, { ...overrides }),\n troveManager.rewardSnapshots(address, { ...overrides })\n ]);\n if (trove.status === BackendTroveStatus.active) {\n return new lib_base_1.TroveWithPendingRedistribution(address, userTroveStatusFrom(trove.status), _utils_1.decimalify(trove.coll), _utils_1.decimalify(trove.debt), _utils_1.decimalify(trove.stake), new lib_base_1.Trove(_utils_1.decimalify(snapshot.ETH), _utils_1.decimalify(snapshot.LUSDDebt)));\n }\n else {\n return new lib_base_1.TroveWithPendingRedistribution(address, userTroveStatusFrom(trove.status));\n }\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getTrove} */\n async getTrove(address, overrides) {\n const [trove, totalRedistributed] = await Promise.all([\n this.getTroveBeforeRedistribution(address, overrides),\n this.getTotalRedistributed(overrides)\n ]);\n return trove.applyRedistribution(totalRedistributed);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getNumberOfTroves} */\n async getNumberOfTroves(overrides) {\n const { troveManager } = EthersLiquityConnection_1._getContracts(this.connection);\n return (await troveManager.getTroveOwnersCount({ ...overrides })).toNumber();\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getPrice} */\n getPrice(overrides) {\n const { priceFeed } = EthersLiquityConnection_1._getContracts(this.connection);\n return priceFeed.callStatic.fetchPrice({ ...overrides }).then(_utils_1.decimalify);\n }\n /** @internal */\n async _getActivePool(overrides) {\n const { activePool } = EthersLiquityConnection_1._getContracts(this.connection);\n const [activeCollateral, activeDebt] = await Promise.all([\n activePool.getETH({ ...overrides }),\n activePool.getLUSDDebt({ ...overrides })\n ].map(getBigNumber => getBigNumber.then(_utils_1.decimalify)));\n return new lib_base_1.Trove(activeCollateral, activeDebt);\n }\n /** @internal */\n async _getDefaultPool(overrides) {\n const { defaultPool } = EthersLiquityConnection_1._getContracts(this.connection);\n const [liquidatedCollateral, closedDebt] = await Promise.all([\n defaultPool.getETH({ ...overrides }),\n defaultPool.getLUSDDebt({ ...overrides })\n ].map(getBigNumber => getBigNumber.then(_utils_1.decimalify)));\n return new lib_base_1.Trove(liquidatedCollateral, closedDebt);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getTotal} */\n async getTotal(overrides) {\n const [activePool, defaultPool] = await Promise.all([\n this._getActivePool(overrides),\n this._getDefaultPool(overrides)\n ]);\n return activePool.add(defaultPool);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getStabilityDeposit} */\n async getStabilityDeposit(address, overrides) {\n address !== null && address !== void 0 ? address : (address = EthersLiquityConnection_1._requireAddress(this.connection));\n const { stabilityPool } = EthersLiquityConnection_1._getContracts(this.connection);\n const [{ frontEndTag, initialValue }, currentLUSD, collateralGain, lqtyReward] = await Promise.all([\n stabilityPool.deposits(address, { ...overrides }),\n stabilityPool.getCompoundedLUSDDeposit(address, { ...overrides }),\n stabilityPool.getDepositorETHGain(address, { ...overrides }),\n stabilityPool.getDepositorLQTYGain(address, { ...overrides })\n ]);\n return new lib_base_1.StabilityDeposit(_utils_1.decimalify(initialValue), _utils_1.decimalify(currentLUSD), _utils_1.decimalify(collateralGain), _utils_1.decimalify(lqtyReward), frontEndTag);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getRemainingStabilityPoolLQTYReward} */\n async getRemainingStabilityPoolLQTYReward(overrides) {\n const { communityIssuance } = EthersLiquityConnection_1._getContracts(this.connection);\n const issuanceCap = this.connection.totalStabilityPoolLQTYReward;\n const totalLQTYIssued = _utils_1.decimalify(await communityIssuance.totalLQTYIssued({ ...overrides }));\n // totalLQTYIssued approaches but never reaches issuanceCap\n return issuanceCap.sub(totalLQTYIssued);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getLUSDInStabilityPool} */\n getLUSDInStabilityPool(overrides) {\n const { stabilityPool } = EthersLiquityConnection_1._getContracts(this.connection);\n return stabilityPool.getTotalLUSDDeposits({ ...overrides }).then(_utils_1.decimalify);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getLUSDBalance} */\n getLUSDBalance(address, overrides) {\n address !== null && address !== void 0 ? address : (address = EthersLiquityConnection_1._requireAddress(this.connection));\n const { lusdToken } = EthersLiquityConnection_1._getContracts(this.connection);\n return lusdToken.balanceOf(address, { ...overrides }).then(_utils_1.decimalify);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getLQTYBalance} */\n getLQTYBalance(address, overrides) {\n address !== null && address !== void 0 ? address : (address = EthersLiquityConnection_1._requireAddress(this.connection));\n const { lqtyToken } = EthersLiquityConnection_1._getContracts(this.connection);\n return lqtyToken.balanceOf(address, { ...overrides }).then(_utils_1.decimalify);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getUniTokenBalance} */\n getUniTokenBalance(address, overrides) {\n address !== null && address !== void 0 ? address : (address = EthersLiquityConnection_1._requireAddress(this.connection));\n const { uniToken } = EthersLiquityConnection_1._getContracts(this.connection);\n return uniToken.balanceOf(address, { ...overrides }).then(_utils_1.decimalify);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getUniTokenAllowance} */\n getUniTokenAllowance(address, overrides) {\n address !== null && address !== void 0 ? address : (address = EthersLiquityConnection_1._requireAddress(this.connection));\n const { uniToken, lqtyStaking } = EthersLiquityConnection_1._getContracts(this.connection);\n return uniToken.allowance(address, lqtyStaking.address, { ...overrides }).then(_utils_1.decimalify);\n }\n /** @internal */\n async _getRemainingLiquidityMiningLQTYRewardCalculator(overrides) {\n const { unipool } = EthersLiquityConnection_1._getContracts(this.connection);\n const [totalSupply, rewardRate, periodFinish, lastUpdateTime] = await Promise.all([\n unipool.totalSupply({ ...overrides }),\n unipool.rewardRate({ ...overrides }).then(_utils_1.decimalify),\n unipool.periodFinish({ ...overrides }).then(_utils_1.numberify),\n unipool.lastUpdateTime({ ...overrides }).then(_utils_1.numberify)\n ]);\n return (blockTimestamp) => rewardRate.mul(Math.max(0, periodFinish - (totalSupply.isZero() ? lastUpdateTime : blockTimestamp)));\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getRemainingLiquidityMiningLQTYReward} */\n async getRemainingLiquidityMiningLQTYReward(overrides) {\n const [calculateRemainingLQTY, blockTimestamp] = await Promise.all([\n this._getRemainingLiquidityMiningLQTYRewardCalculator(overrides),\n this._getBlockTimestamp(overrides === null || overrides === void 0 ? void 0 : overrides.blockTag)\n ]);\n return calculateRemainingLQTY(blockTimestamp);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getLiquidityMiningStake} */\n getLiquidityMiningStake(address, overrides) {\n address !== null && address !== void 0 ? address : (address = EthersLiquityConnection_1._requireAddress(this.connection));\n const { unipool } = EthersLiquityConnection_1._getContracts(this.connection);\n return unipool.balanceOf(address, { ...overrides }).then(_utils_1.decimalify);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getTotalStakedUniTokens} */\n getTotalStakedUniTokens(overrides) {\n const { unipool } = EthersLiquityConnection_1._getContracts(this.connection);\n return unipool.totalSupply({ ...overrides }).then(_utils_1.decimalify);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getLiquidityMiningLQTYReward} */\n getLiquidityMiningLQTYReward(address, overrides) {\n address !== null && address !== void 0 ? address : (address = EthersLiquityConnection_1._requireAddress(this.connection));\n const { unipool } = EthersLiquityConnection_1._getContracts(this.connection);\n return unipool.earned(address, { ...overrides }).then(_utils_1.decimalify);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getCollateralSurplusBalance} */\n getCollateralSurplusBalance(address, overrides) {\n address !== null && address !== void 0 ? address : (address = EthersLiquityConnection_1._requireAddress(this.connection));\n const { collSurplusPool } = EthersLiquityConnection_1._getContracts(this.connection);\n return collSurplusPool.getCollateral(address, { ...overrides }).then(_utils_1.decimalify);\n }\n async getTroves(params, overrides) {\n var _a, _b;\n const { multiTroveGetter } = EthersLiquityConnection_1._getContracts(this.connection);\n expectPositiveInt(params, \"first\");\n expectPositiveInt(params, \"startingAt\");\n if (!validSortingOptions.includes(params.sortedBy)) {\n throw new Error(`sortedBy must be one of: ${validSortingOptions.map(x => `\"${x}\"`).join(\", \")}`);\n }\n const [totalRedistributed, backendTroves] = await Promise.all([\n params.beforeRedistribution ? undefined : this.getTotalRedistributed({ ...overrides }),\n multiTroveGetter.getMultipleSortedTroves(params.sortedBy === \"descendingCollateralRatio\"\n ? (_a = params.startingAt) !== null && _a !== void 0 ? _a : 0 : -(((_b = params.startingAt) !== null && _b !== void 0 ? _b : 0) + 1), params.first, { ...overrides })\n ]);\n const troves = mapBackendTroves(backendTroves);\n if (totalRedistributed) {\n return troves.map(trove => trove.applyRedistribution(totalRedistributed));\n }\n else {\n return troves;\n }\n }\n /** @internal */\n _getBlockTimestamp(blockTag) {\n return EthersLiquityConnection_1._getBlockTimestamp(this.connection, blockTag);\n }\n /** @internal */\n async _getFeesFactory(overrides) {\n const { troveManager } = EthersLiquityConnection_1._getContracts(this.connection);\n const [lastFeeOperationTime, baseRateWithoutDecay] = await Promise.all([\n troveManager.lastFeeOperationTime({ ...overrides }),\n troveManager.baseRate({ ...overrides }).then(_utils_1.decimalify)\n ]);\n return (blockTimestamp, recoveryMode) => new lib_base_1.Fees(baseRateWithoutDecay, MINUTE_DECAY_FACTOR, BETA, convertToDate(lastFeeOperationTime.toNumber()), convertToDate(blockTimestamp), recoveryMode);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getFees} */\n async getFees(overrides) {\n const [createFees, total, price, blockTimestamp] = await Promise.all([\n this._getFeesFactory(overrides),\n this.getTotal(overrides),\n this.getPrice(overrides),\n this._getBlockTimestamp(overrides === null || overrides === void 0 ? void 0 : overrides.blockTag)\n ]);\n return createFees(blockTimestamp, total.collateralRatioIsBelowCritical(price));\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getLQTYStake} */\n async getLQTYStake(address, overrides) {\n address !== null && address !== void 0 ? address : (address = EthersLiquityConnection_1._requireAddress(this.connection));\n const { lqtyStaking } = EthersLiquityConnection_1._getContracts(this.connection);\n const [stakedLQTY, collateralGain, lusdGain] = await Promise.all([\n lqtyStaking.stakes(address, { ...overrides }),\n lqtyStaking.getPendingETHGain(address, { ...overrides }),\n lqtyStaking.getPendingLUSDGain(address, { ...overrides })\n ].map(getBigNumber => getBigNumber.then(_utils_1.decimalify)));\n return new lib_base_1.LQTYStake(stakedLQTY, collateralGain, lusdGain);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getTotalStakedLQTY} */\n async getTotalStakedLQTY(overrides) {\n const { lqtyStaking } = EthersLiquityConnection_1._getContracts(this.connection);\n return lqtyStaking.totalLQTYStaked({ ...overrides }).then(_utils_1.decimalify);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getFrontendStatus} */\n async getFrontendStatus(address, overrides) {\n address !== null && address !== void 0 ? address : (address = EthersLiquityConnection_1._requireFrontendAddress(this.connection));\n const { stabilityPool } = EthersLiquityConnection_1._getContracts(this.connection);\n const { registered, kickbackRate } = await stabilityPool.frontEnds(address, { ...overrides });\n return registered\n ? { status: \"registered\", kickbackRate: _utils_1.decimalify(kickbackRate) }\n : { status: \"unregistered\" };\n }\n}\nexports.ReadableEthersLiquity = ReadableEthersLiquity;\nconst mapBackendTroves = (troves) => troves.map(trove => new lib_base_1.TroveWithPendingRedistribution(trove.owner, \"open\", // These Troves are coming from the SortedTroves list, so they must be open\n_utils_1.decimalify(trove.coll), _utils_1.decimalify(trove.debt), _utils_1.decimalify(trove.stake), new lib_base_1.Trove(_utils_1.decimalify(trove.snapshotETH), _utils_1.decimalify(trove.snapshotLUSDDebt))));\nclass _BlockPolledReadableEthersLiquity {\n constructor(readable) {\n const store = new BlockPolledLiquityStore_1.BlockPolledLiquityStore(readable);\n this.store = store;\n this.connection = readable.connection;\n this._readable = readable;\n }\n _blockHit(overrides) {\n return (!overrides ||\n overrides.blockTag === undefined ||\n overrides.blockTag === this.store.state.blockTag);\n }\n _userHit(address, overrides) {\n return (this._blockHit(overrides) &&\n (address === undefined || address === this.store.connection.userAddress));\n }\n _frontendHit(address, overrides) {\n return (this._blockHit(overrides) &&\n (address === undefined || address === this.store.connection.frontendTag));\n }\n hasStore(store) {\n return store === undefined || store === \"blockPolled\";\n }\n async getTotalRedistributed(overrides) {\n return this._blockHit(overrides)\n ? this.store.state.totalRedistributed\n : this._readable.getTotalRedistributed(overrides);\n }\n async getTroveBeforeRedistribution(address, overrides) {\n return this._userHit(address, overrides)\n ? this.store.state.troveBeforeRedistribution\n : this._readable.getTroveBeforeRedistribution(address, overrides);\n }\n async getTrove(address, overrides) {\n return this._userHit(address, overrides)\n ? this.store.state.trove\n : this._readable.getTrove(address, overrides);\n }\n async getNumberOfTroves(overrides) {\n return this._blockHit(overrides)\n ? this.store.state.numberOfTroves\n : this._readable.getNumberOfTroves(overrides);\n }\n async getPrice(overrides) {\n return this._blockHit(overrides) ? this.store.state.price : this._readable.getPrice(overrides);\n }\n async getTotal(overrides) {\n return this._blockHit(overrides) ? this.store.state.total : this._readable.getTotal(overrides);\n }\n async getStabilityDeposit(address, overrides) {\n return this._userHit(address, overrides)\n ? this.store.state.stabilityDeposit\n : this._readable.getStabilityDeposit(address, overrides);\n }\n async getRemainingStabilityPoolLQTYReward(overrides) {\n return this._blockHit(overrides)\n ? this.store.state.remainingStabilityPoolLQTYReward\n : this._readable.getRemainingStabilityPoolLQTYReward(overrides);\n }\n async getLUSDInStabilityPool(overrides) {\n return this._blockHit(overrides)\n ? this.store.state.lusdInStabilityPool\n : this._readable.getLUSDInStabilityPool(overrides);\n }\n async getLUSDBalance(address, overrides) {\n return this._userHit(address, overrides)\n ? this.store.state.lusdBalance\n : this._readable.getLUSDBalance(address, overrides);\n }\n async getLQTYBalance(address, overrides) {\n return this._userHit(address, overrides)\n ? this.store.state.lqtyBalance\n : this._readable.getLQTYBalance(address, overrides);\n }\n async getUniTokenBalance(address, overrides) {\n return this._userHit(address, overrides)\n ? this.store.state.uniTokenBalance\n : this._readable.getUniTokenBalance(address, overrides);\n }\n async getUniTokenAllowance(address, overrides) {\n return this._userHit(address, overrides)\n ? this.store.state.uniTokenAllowance\n : this._readable.getUniTokenAllowance(address, overrides);\n }\n async getRemainingLiquidityMiningLQTYReward(overrides) {\n return this._blockHit(overrides)\n ? this.store.state.remainingLiquidityMiningLQTYReward\n : this._readable.getRemainingLiquidityMiningLQTYReward(overrides);\n }\n async getLiquidityMiningStake(address, overrides) {\n return this._userHit(address, overrides)\n ? this.store.state.liquidityMiningStake\n : this._readable.getLiquidityMiningStake(address, overrides);\n }\n async getTotalStakedUniTokens(overrides) {\n return this._blockHit(overrides)\n ? this.store.state.totalStakedUniTokens\n : this._readable.getTotalStakedUniTokens(overrides);\n }\n async getLiquidityMiningLQTYReward(address, overrides) {\n return this._userHit(address, overrides)\n ? this.store.state.liquidityMiningLQTYReward\n : this._readable.getLiquidityMiningLQTYReward(address, overrides);\n }\n async getCollateralSurplusBalance(address, overrides) {\n return this._userHit(address, overrides)\n ? this.store.state.collateralSurplusBalance\n : this._readable.getCollateralSurplusBalance(address, overrides);\n }\n async _getBlockTimestamp(blockTag) {\n return this._blockHit({ blockTag })\n ? this.store.state.blockTimestamp\n : this._readable._getBlockTimestamp(blockTag);\n }\n async _getFeesFactory(overrides) {\n return this._blockHit(overrides)\n ? this.store.state._feesFactory\n : this._readable._getFeesFactory(overrides);\n }\n async getFees(overrides) {\n return this._blockHit(overrides) ? this.store.state.fees : this._readable.getFees(overrides);\n }\n async getLQTYStake(address, overrides) {\n return this._userHit(address, overrides)\n ? this.store.state.lqtyStake\n : this._readable.getLQTYStake(address, overrides);\n }\n async getTotalStakedLQTY(overrides) {\n return this._blockHit(overrides)\n ? this.store.state.totalStakedLQTY\n : this._readable.getTotalStakedLQTY(overrides);\n }\n async getFrontendStatus(address, overrides) {\n return this._frontendHit(address, overrides)\n ? this.store.state.frontend\n : this._readable.getFrontendStatus(address, overrides);\n }\n getTroves(params, overrides) {\n return this._readable.getTroves(params, overrides);\n }\n _getActivePool() {\n throw new Error(\"Method not implemented.\");\n }\n _getDefaultPool() {\n throw new Error(\"Method not implemented.\");\n }\n _getRemainingLiquidityMiningLQTYRewardCalculator() {\n throw new Error(\"Method not implemented.\");\n }\n}\n//# sourceMappingURL=ReadableEthersLiquity.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BlockPolledLiquityStore = void 0;\nconst constants_1 = require(\"@ethersproject/constants\");\nconst lib_base_1 = require(\"@liquity/lib-base\");\nconst _utils_1 = require(\"./_utils\");\nconst EthersLiquityConnection_1 = require(\"./EthersLiquityConnection\");\n/**\n * Ethers-based {@link @liquity/lib-base#LiquityStore} that updates state whenever there's a new\n * block.\n *\n * @public\n */\nclass BlockPolledLiquityStore extends lib_base_1.LiquityStore {\n constructor(readable) {\n super();\n this.connection = readable.connection;\n this._readable = readable;\n this._provider = EthersLiquityConnection_1._getProvider(readable.connection);\n console.log(\"BlockPolledLiquityStore initialized\");\n }\n async _getRiskiestTroveBeforeRedistribution(overrides) {\n console.log(\"Fetching riskiest trove before redistribution...\");\n const riskiestTroves = await this._readable.getTroves({ first: 1, sortedBy: \"ascendingCollateralRatio\", beforeRedistribution: true }, overrides);\n if (riskiestTroves.length === 0) {\n console.log(\"No riskiest trove found. Returning default.\");\n return new lib_base_1.TroveWithPendingRedistribution(constants_1.AddressZero, \"nonExistent\");\n }\n console.log(\"Riskiest trove found:\", riskiestTroves[0]);\n return riskiestTroves[0];\n }\n async _get(blockTag) {\n console.log(`Fetching state at block ${blockTag !== null && blockTag !== void 0 ? blockTag : \"latest\"}...`);\n const { userAddress, frontendTag } = this.connection;\n const { blockTimestamp, _feesFactory, calculateRemainingLQTY, ...baseState } = await _utils_1.promiseAllValues({\n blockTimestamp: this._readable._getBlockTimestamp(blockTag),\n _feesFactory: this._readable._getFeesFactory({ blockTag }),\n calculateRemainingLQTY: this._readable._getRemainingLiquidityMiningLQTYRewardCalculator({ blockTag }),\n price: this._readable.getPrice({ blockTag }),\n numberOfTroves: this._readable.getNumberOfTroves({ blockTag }),\n totalRedistributed: this._readable.getTotalRedistributed({ blockTag }),\n total: this._readable.getTotal({ blockTag }),\n lusdInStabilityPool: this._readable.getLUSDInStabilityPool({ blockTag }),\n totalStakedLQTY: this._readable.getTotalStakedLQTY({ blockTag }),\n _riskiestTroveBeforeRedistribution: this._getRiskiestTroveBeforeRedistribution({ blockTag }),\n totalStakedUniTokens: this._readable.getTotalStakedUniTokens({ blockTag }),\n remainingStabilityPoolLQTYReward: this._readable.getRemainingStabilityPoolLQTYReward({\n blockTag\n }),\n frontend: frontendTag\n ? this._readable.getFrontendStatus(frontendTag, { blockTag })\n : { status: \"unregistered\" },\n ...(userAddress\n ? {\n accountBalance: this._provider.getBalance(userAddress, blockTag).then(_utils_1.decimalify),\n lusdBalance: this._readable.getLUSDBalance(userAddress, { blockTag }),\n lqtyBalance: this._readable.getLQTYBalance(userAddress, { blockTag }),\n uniTokenBalance: this._readable.getUniTokenBalance(userAddress, { blockTag }),\n uniTokenAllowance: this._readable.getUniTokenAllowance(userAddress, { blockTag }),\n liquidityMiningStake: this._readable.getLiquidityMiningStake(userAddress, { blockTag }),\n liquidityMiningLQTYReward: this._readable.getLiquidityMiningLQTYReward(userAddress, {\n blockTag\n }),\n collateralSurplusBalance: this._readable.getCollateralSurplusBalance(userAddress, {\n blockTag\n }),\n troveBeforeRedistribution: this._readable.getTroveBeforeRedistribution(userAddress, {\n blockTag\n }),\n stabilityDeposit: this._readable.getStabilityDeposit(userAddress, { blockTag }),\n lqtyStake: this._readable.getLQTYStake(userAddress, { blockTag }),\n ownFrontend: this._readable.getFrontendStatus(userAddress, { blockTag })\n }\n : {\n accountBalance: lib_base_1.Decimal.ZERO,\n lusdBalance: lib_base_1.Decimal.ZERO,\n lqtyBalance: lib_base_1.Decimal.ZERO,\n uniTokenBalance: lib_base_1.Decimal.ZERO,\n uniTokenAllowance: lib_base_1.Decimal.ZERO,\n liquidityMiningStake: lib_base_1.Decimal.ZERO,\n liquidityMiningLQTYReward: lib_base_1.Decimal.ZERO,\n collateralSurplusBalance: lib_base_1.Decimal.ZERO,\n troveBeforeRedistribution: new lib_base_1.TroveWithPendingRedistribution(constants_1.AddressZero, \"nonExistent\"),\n stabilityDeposit: new lib_base_1.StabilityDeposit(lib_base_1.Decimal.ZERO, lib_base_1.Decimal.ZERO, lib_base_1.Decimal.ZERO, lib_base_1.Decimal.ZERO, constants_1.AddressZero),\n lqtyStake: new lib_base_1.LQTYStake(),\n ownFrontend: { status: \"unregistered\" }\n })\n });\n console.log(\"Fetched state:\", baseState);\n return [\n {\n ...baseState,\n _feesInNormalMode: _feesFactory(blockTimestamp, false),\n remainingLiquidityMiningLQTYReward: calculateRemainingLQTY(blockTimestamp)\n },\n {\n blockTag,\n blockTimestamp,\n _feesFactory\n }\n ];\n }\n /** @internal @override */\n _doStart() {\n console.log(\"Starting BlockPolledLiquityStore...\");\n this._get().then(state => {\n if (!this._loaded) {\n console.log(\"Loading initial state...\");\n this._load(...state);\n }\n });\n const blockListener = async (blockTag) => {\n console.log(`New block detected: ${blockTag}`);\n const state = await this._get(blockTag);\n if (this._loaded) {\n console.log(\"Updating state...\");\n this._update(...state);\n }\n else {\n console.log(\"Loading state...\");\n this._load(...state);\n }\n };\n this._provider.on(\"block\", blockListener);\n return () => {\n console.log(\"Stopping BlockPolledLiquityStore...\");\n this._provider.off(\"block\", blockListener);\n };\n }\n /** @internal @override */\n _reduceExtra(oldState, stateUpdate) {\n var _a, _b, _c;\n return {\n blockTag: (_a = stateUpdate.blockTag) !== null && _a !== void 0 ? _a : oldState.blockTag,\n blockTimestamp: (_b = stateUpdate.blockTimestamp) !== null && _b !== void 0 ? _b : oldState.blockTimestamp,\n _feesFactory: (_c = stateUpdate._feesFactory) !== null && _c !== void 0 ? _c : oldState._feesFactory\n };\n }\n}\nexports.BlockPolledLiquityStore = BlockPolledLiquityStore;\n//# sourceMappingURL=BlockPolledLiquityStore.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.PopulatableEthersLiquity = exports.PopulatedEthersRedemption = exports.PopulatedEthersLiquityTransaction = exports.SentEthersLiquityTransaction = exports.EthersTransactionCancelledError = exports._RawErrorReason = exports._redeemMaxIterations = void 0;\nconst assert_1 = __importDefault(require(\"assert\"));\nconst constants_1 = require(\"@ethersproject/constants\");\nconst logger_1 = require(\"@ethersproject/logger\");\nconst lib_base_1 = require(\"@liquity/lib-base\");\nconst EthersLiquityConnection_1 = require(\"./EthersLiquityConnection\");\nconst _utils_1 = require(\"./_utils\");\nconst contracts_1 = require(\"./contracts\");\nconst parseLogs_1 = require(\"./parseLogs\");\nconst bigNumberMax = (a, b) => ((b === null || b === void 0 ? void 0 : b.gt(a)) ? b : a);\n// With 70 iterations redemption costs about ~10M gas, and each iteration accounts for ~138k more\n/** @internal */\nexports._redeemMaxIterations = 70;\nconst defaultBorrowingRateSlippageTolerance = lib_base_1.Decimal.from(0.005); // 0.5%\nconst defaultRedemptionRateSlippageTolerance = lib_base_1.Decimal.from(0.001); // 0.1%\nconst defaultBorrowingFeeDecayToleranceMinutes = 10;\nconst noDetails = () => undefined;\nconst compose = (f, g) => (_) => f(g(_));\nconst id = (t) => t;\n// Takes ~6-7K (use 10K to be safe) to update lastFeeOperationTime, but the cost of calculating the\n// decayed baseRate increases logarithmically with time elapsed since the last update.\nconst addGasForBaseRateUpdate = (maxMinutesSinceLastUpdate = 10) => (gas) => gas.add(10000 + 1414 * Math.ceil(Math.log2(maxMinutesSinceLastUpdate + 1)));\n// First traversal in ascending direction takes ~50K, then ~13.5K per extra step.\n// 80K should be enough for 3 steps, plus some extra to be safe.\nconst addGasForPotentialListTraversal = (gas) => gas.add(80000);\nconst addGasForLQTYIssuance = (gas) => gas.add(50000);\nconst addGasForUnipoolRewardUpdate = (gas) => gas.add(20000);\n// To get the best entropy available, we'd do something like:\n//\n// const bigRandomNumber = () =>\n// BigNumber.from(\n// `0x${Array.from(crypto.getRandomValues(new Uint32Array(8)))\n// .map(u32 => u32.toString(16).padStart(8, \"0\"))\n// .join(\"\")}`\n// );\n//\n// However, Window.crypto is browser-specific. Since we only use this for randomly picking Troves\n// during the search for hints, Math.random() will do fine, too.\n//\n// This returns a random integer between 0 and Number.MAX_SAFE_INTEGER\nconst randomInteger = () => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER);\n// Maximum number of trials to perform in a single getApproxHint() call. If the number of trials\n// required to get a statistically \"good\" hint is larger than this, the search for the hint will\n// be broken up into multiple getApproxHint() calls.\n//\n// This should be low enough to work with popular public Ethereum providers like Infura without\n// triggering any fair use limits.\nconst maxNumberOfTrialsAtOnce = 2500;\nfunction* generateTrials(totalNumberOfTrials) {\n assert_1.default(Number.isInteger(totalNumberOfTrials) && totalNumberOfTrials > 0);\n while (totalNumberOfTrials) {\n const numberOfTrials = Math.min(totalNumberOfTrials, maxNumberOfTrialsAtOnce);\n yield numberOfTrials;\n totalNumberOfTrials -= numberOfTrials;\n }\n}\n/** @internal */\nvar _RawErrorReason;\n(function (_RawErrorReason) {\n _RawErrorReason[\"TRANSACTION_FAILED\"] = \"transaction failed\";\n _RawErrorReason[\"TRANSACTION_CANCELLED\"] = \"cancelled\";\n _RawErrorReason[\"TRANSACTION_REPLACED\"] = \"replaced\";\n _RawErrorReason[\"TRANSACTION_REPRICED\"] = \"repriced\";\n})(_RawErrorReason = exports._RawErrorReason || (exports._RawErrorReason = {}));\nconst transactionReplacementReasons = [\n _RawErrorReason.TRANSACTION_CANCELLED,\n _RawErrorReason.TRANSACTION_REPLACED,\n _RawErrorReason.TRANSACTION_REPRICED\n];\nconst hasProp = (o, p) => p in o;\nconst isTransactionFailedError = (error) => hasProp(error, \"code\") &&\n error.code === logger_1.ErrorCode.CALL_EXCEPTION &&\n hasProp(error, \"reason\") &&\n error.reason === _RawErrorReason.TRANSACTION_FAILED;\nconst isTransactionReplacedError = (error) => hasProp(error, \"code\") &&\n error.code === logger_1.ErrorCode.TRANSACTION_REPLACED &&\n hasProp(error, \"reason\") &&\n transactionReplacementReasons.includes(error.reason);\n/**\n * Thrown when a transaction is cancelled or replaced by a different transaction.\n *\n * @public\n */\nclass EthersTransactionCancelledError extends Error {\n /** @internal */\n constructor(rawError) {\n assert_1.default(rawError.reason !== _RawErrorReason.TRANSACTION_REPRICED);\n super(`Transaction ${rawError.reason}`);\n this.name = \"TransactionCancelledError\";\n this.rawReplacementReceipt = rawError.receipt;\n this.rawError = rawError;\n }\n}\nexports.EthersTransactionCancelledError = EthersTransactionCancelledError;\n/**\n * A transaction that has already been sent.\n *\n * @remarks\n * Returned by {@link SendableEthersLiquity} functions.\n *\n * @public\n */\nclass SentEthersLiquityTransaction {\n /** @internal */\n constructor(rawSentTransaction, connection, parse) {\n this.rawSentTransaction = rawSentTransaction;\n this._connection = connection;\n this._parse = parse;\n }\n _receiptFrom(rawReceipt) {\n return rawReceipt\n ? rawReceipt.status\n ? lib_base_1._successfulReceipt(rawReceipt, this._parse(rawReceipt), () => parseLogs_1.logsToString(rawReceipt, EthersLiquityConnection_1._getContracts(this._connection)))\n : lib_base_1._failedReceipt(rawReceipt)\n : lib_base_1._pendingReceipt;\n }\n async _waitForRawReceipt(confirmations) {\n try {\n return await this.rawSentTransaction.wait(confirmations);\n }\n catch (error) {\n if (error instanceof Error) {\n if (isTransactionFailedError(error)) {\n return error.receipt;\n }\n if (isTransactionReplacedError(error)) {\n if (error.cancelled) {\n throw new EthersTransactionCancelledError(error);\n }\n else {\n return error.receipt;\n }\n }\n }\n throw error;\n }\n }\n /** {@inheritDoc @liquity/lib-base#SentLiquityTransaction.getReceipt} */\n async getReceipt() {\n return this._receiptFrom(await this._waitForRawReceipt(0));\n }\n /**\n * {@inheritDoc @liquity/lib-base#SentLiquityTransaction.waitForReceipt}\n *\n * @throws\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n async waitForReceipt() {\n const receipt = this._receiptFrom(await this._waitForRawReceipt());\n assert_1.default(receipt.status !== \"pending\");\n return receipt;\n }\n}\nexports.SentEthersLiquityTransaction = SentEthersLiquityTransaction;\nconst normalizeBorrowingOperationOptionalParams = (maxBorrowingRateOrOptionalParams, currentBorrowingRate) => {\n var _a, _b;\n if (maxBorrowingRateOrOptionalParams === undefined) {\n return {\n maxBorrowingRate: (_a = currentBorrowingRate === null || currentBorrowingRate === void 0 ? void 0 : currentBorrowingRate.add(defaultBorrowingRateSlippageTolerance)) !== null && _a !== void 0 ? _a : lib_base_1.Decimal.ZERO,\n borrowingFeeDecayToleranceMinutes: defaultBorrowingFeeDecayToleranceMinutes\n };\n }\n else if (typeof maxBorrowingRateOrOptionalParams === \"number\" ||\n typeof maxBorrowingRateOrOptionalParams === \"string\" ||\n maxBorrowingRateOrOptionalParams instanceof lib_base_1.Decimal) {\n return {\n maxBorrowingRate: lib_base_1.Decimal.from(maxBorrowingRateOrOptionalParams),\n borrowingFeeDecayToleranceMinutes: defaultBorrowingFeeDecayToleranceMinutes\n };\n }\n else {\n const { maxBorrowingRate, borrowingFeeDecayToleranceMinutes } = maxBorrowingRateOrOptionalParams;\n return {\n maxBorrowingRate: maxBorrowingRate !== undefined\n ? lib_base_1.Decimal.from(maxBorrowingRate)\n : (_b = currentBorrowingRate === null || currentBorrowingRate === void 0 ? void 0 : currentBorrowingRate.add(defaultBorrowingRateSlippageTolerance)) !== null && _b !== void 0 ? _b : lib_base_1.Decimal.ZERO,\n borrowingFeeDecayToleranceMinutes: borrowingFeeDecayToleranceMinutes !== null && borrowingFeeDecayToleranceMinutes !== void 0 ? borrowingFeeDecayToleranceMinutes : defaultBorrowingFeeDecayToleranceMinutes\n };\n }\n};\n/**\n * A transaction that has been prepared for sending.\n *\n * @remarks\n * Returned by {@link PopulatableEthersLiquity} functions.\n *\n * @public\n */\nclass PopulatedEthersLiquityTransaction {\n /** @internal */\n constructor(rawPopulatedTransaction, connection, parse, gasHeadroom) {\n this.rawPopulatedTransaction = rawPopulatedTransaction;\n this._connection = connection;\n this._parse = parse;\n if (gasHeadroom !== undefined) {\n this.gasHeadroom = gasHeadroom;\n }\n }\n /** {@inheritDoc @liquity/lib-base#PopulatedLiquityTransaction.send} */\n async send() {\n return new SentEthersLiquityTransaction(await EthersLiquityConnection_1._requireSigner(this._connection).sendTransaction(this.rawPopulatedTransaction), this._connection, this._parse);\n }\n}\nexports.PopulatedEthersLiquityTransaction = PopulatedEthersLiquityTransaction;\n/**\n * {@inheritDoc @liquity/lib-base#PopulatedRedemption}\n *\n * @public\n */\nclass PopulatedEthersRedemption extends PopulatedEthersLiquityTransaction {\n /** @internal */\n constructor(rawPopulatedTransaction, connection, attemptedLUSDAmount, redeemableLUSDAmount, increaseAmountByMinimumNetDebt) {\n const { troveManager } = EthersLiquityConnection_1._getContracts(connection);\n super(rawPopulatedTransaction, connection, ({ logs }) => troveManager\n .extractEvents(logs, \"Redemption\")\n .map(({ args: { _ETHSent, _ETHFee, _actualLUSDAmount, _attemptedLUSDAmount } }) => ({\n attemptedLUSDAmount: _utils_1.decimalify(_attemptedLUSDAmount),\n actualLUSDAmount: _utils_1.decimalify(_actualLUSDAmount),\n collateralTaken: _utils_1.decimalify(_ETHSent),\n fee: _utils_1.decimalify(_ETHFee)\n }))[0]);\n this.attemptedLUSDAmount = attemptedLUSDAmount;\n this.redeemableLUSDAmount = redeemableLUSDAmount;\n this.isTruncated = redeemableLUSDAmount.lt(attemptedLUSDAmount);\n this._increaseAmountByMinimumNetDebt = increaseAmountByMinimumNetDebt;\n }\n /** {@inheritDoc @liquity/lib-base#PopulatedRedemption.increaseAmountByMinimumNetDebt} */\n increaseAmountByMinimumNetDebt(maxRedemptionRate) {\n if (!this._increaseAmountByMinimumNetDebt) {\n throw new Error(\"PopulatedEthersRedemption: increaseAmountByMinimumNetDebt() can \" +\n \"only be called when amount is truncated\");\n }\n return this._increaseAmountByMinimumNetDebt(maxRedemptionRate);\n }\n}\nexports.PopulatedEthersRedemption = PopulatedEthersRedemption;\n/**\n * Ethers-based implementation of {@link @liquity/lib-base#PopulatableLiquity}.\n *\n * @public\n */\nclass PopulatableEthersLiquity {\n constructor(readable) {\n this._readable = readable;\n }\n _wrapSimpleTransaction(rawPopulatedTransaction) {\n return new PopulatedEthersLiquityTransaction(rawPopulatedTransaction, this._readable.connection, noDetails);\n }\n _wrapTroveChangeWithFees(params, rawPopulatedTransaction, gasHeadroom) {\n const { borrowerOperations } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n return new PopulatedEthersLiquityTransaction(rawPopulatedTransaction, this._readable.connection, ({ logs }) => {\n const [newTrove] = borrowerOperations\n .extractEvents(logs, \"TroveUpdated\")\n .map(({ args: { _coll, _debt } }) => new lib_base_1.Trove(_utils_1.decimalify(_coll), _utils_1.decimalify(_debt)));\n const [fee] = borrowerOperations\n .extractEvents(logs, \"LUSDBorrowingFeePaid\")\n .map(({ args: { _LUSDFee } }) => _utils_1.decimalify(_LUSDFee));\n return {\n params,\n newTrove,\n fee\n };\n }, gasHeadroom);\n }\n async _wrapTroveClosure(rawPopulatedTransaction) {\n const { activePool, lusdToken } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n return new PopulatedEthersLiquityTransaction(rawPopulatedTransaction, this._readable.connection, ({ logs, from: userAddress }) => {\n const [repayLUSD] = lusdToken\n .extractEvents(logs, \"Transfer\")\n .filter(({ args: { from, to } }) => from === userAddress && to === constants_1.AddressZero)\n .map(({ args: { value } }) => _utils_1.decimalify(value));\n const [withdrawCollateral] = activePool\n .extractEvents(logs, \"EtherSent\")\n .filter(({ args: { _to } }) => _to === userAddress)\n .map(({ args: { _amount } }) => _utils_1.decimalify(_amount));\n return {\n params: repayLUSD.nonZero ? { withdrawCollateral, repayLUSD } : { withdrawCollateral }\n };\n });\n }\n _wrapLiquidation(rawPopulatedTransaction) {\n const { troveManager } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n return new PopulatedEthersLiquityTransaction(rawPopulatedTransaction, this._readable.connection, ({ logs }) => {\n const liquidatedAddresses = troveManager\n .extractEvents(logs, \"TroveLiquidated\")\n .map(({ args: { _borrower } }) => _borrower);\n const [totals] = troveManager\n .extractEvents(logs, \"Liquidation\")\n .map(({ args: { _LUSDGasCompensation, _collGasCompensation, _liquidatedColl, _liquidatedDebt } }) => ({\n collateralGasCompensation: _utils_1.decimalify(_collGasCompensation),\n lusdGasCompensation: _utils_1.decimalify(_LUSDGasCompensation),\n totalLiquidated: new lib_base_1.Trove(_utils_1.decimalify(_liquidatedColl), _utils_1.decimalify(_liquidatedDebt))\n }));\n return {\n liquidatedAddresses,\n ...totals\n };\n });\n }\n _extractStabilityPoolGainsWithdrawalDetails(logs) {\n const { stabilityPool } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n const [newLUSDDeposit] = stabilityPool\n .extractEvents(logs, \"UserDepositChanged\")\n .map(({ args: { _newDeposit } }) => _utils_1.decimalify(_newDeposit));\n const [[collateralGain, lusdLoss]] = stabilityPool\n .extractEvents(logs, \"ETHGainWithdrawn\")\n .map(({ args: { _ETH, _LUSDLoss } }) => [_utils_1.decimalify(_ETH), _utils_1.decimalify(_LUSDLoss)]);\n const [lqtyReward] = stabilityPool\n .extractEvents(logs, \"LQTYPaidToDepositor\")\n .map(({ args: { _LQTY } }) => _utils_1.decimalify(_LQTY));\n return {\n lusdLoss,\n newLUSDDeposit,\n collateralGain,\n lqtyReward\n };\n }\n _wrapStabilityPoolGainsWithdrawal(rawPopulatedTransaction) {\n return new PopulatedEthersLiquityTransaction(rawPopulatedTransaction, this._readable.connection, ({ logs }) => this._extractStabilityPoolGainsWithdrawalDetails(logs));\n }\n _wrapStabilityDepositTopup(change, rawPopulatedTransaction) {\n return new PopulatedEthersLiquityTransaction(rawPopulatedTransaction, this._readable.connection, ({ logs }) => ({\n ...this._extractStabilityPoolGainsWithdrawalDetails(logs),\n change\n }));\n }\n async _wrapStabilityDepositWithdrawal(rawPopulatedTransaction) {\n const { stabilityPool, lusdToken } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n return new PopulatedEthersLiquityTransaction(rawPopulatedTransaction, this._readable.connection, ({ logs, from: userAddress }) => {\n const gainsWithdrawalDetails = this._extractStabilityPoolGainsWithdrawalDetails(logs);\n const [withdrawLUSD] = lusdToken\n .extractEvents(logs, \"Transfer\")\n .filter(({ args: { from, to } }) => from === stabilityPool.address && to === userAddress)\n .map(({ args: { value } }) => _utils_1.decimalify(value));\n return {\n ...gainsWithdrawalDetails,\n change: { withdrawLUSD, withdrawAllLUSD: gainsWithdrawalDetails.newLUSDDeposit.isZero }\n };\n });\n }\n _wrapCollateralGainTransfer(rawPopulatedTransaction) {\n const { borrowerOperations } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n return new PopulatedEthersLiquityTransaction(rawPopulatedTransaction, this._readable.connection, ({ logs }) => {\n const [newTrove] = borrowerOperations\n .extractEvents(logs, \"TroveUpdated\")\n .map(({ args: { _coll, _debt } }) => new lib_base_1.Trove(_utils_1.decimalify(_coll), _utils_1.decimalify(_debt)));\n return {\n ...this._extractStabilityPoolGainsWithdrawalDetails(logs),\n newTrove\n };\n });\n }\n async _findHintsForNominalCollateralRatio(nominalCollateralRatio, ownAddress) {\n const { sortedTroves, hintHelpers } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n const numberOfTroves = await this._readable.getNumberOfTroves();\n if (!numberOfTroves) {\n return [constants_1.AddressZero, constants_1.AddressZero];\n }\n if (nominalCollateralRatio.infinite) {\n return [constants_1.AddressZero, await sortedTroves.getFirst()];\n }\n const totalNumberOfTrials = Math.ceil(10 * Math.sqrt(numberOfTroves));\n const [firstTrials, ...restOfTrials] = generateTrials(totalNumberOfTrials);\n const collectApproxHint = ({ latestRandomSeed, results }, numberOfTrials) => {\n const limitedTrials = numberOfTrials > 50 ? 50 : numberOfTrials;\n console.log('collectApproxHint called with:', { latestRandomSeed, results, numberOfTrials, limitedTrials });\n return hintHelpers\n .getApproxHint(nominalCollateralRatio.hex, limitedTrials, latestRandomSeed)\n .then(({ latestRandomSeed, ...result }) => {\n console.log('hintHelpers.getApproxHint result:', { latestRandomSeed, result });\n return {\n latestRandomSeed,\n results: [...results, result]\n };\n });\n };\n console.log('Starting the reduce process');\n const initial = {\n latestRandomSeed: randomInteger(),\n results: []\n };\n const { results } = await restOfTrials.reduce((p, numberOfTrials) => p.then(state => {\n console.log('Reducing with state:', state, 'and numberOfTrials:', numberOfTrials);\n return collectApproxHint(state, numberOfTrials);\n }), collectApproxHint(initial, firstTrials));\n console.log('Final results:', results);\n const { hintAddress } = results.reduce((a, b) => (a.diff.lt(b.diff) ? a : b));\n let [prev, next] = await sortedTroves.findInsertPosition(nominalCollateralRatio.hex, hintAddress, hintAddress);\n if (ownAddress) {\n // In the case of reinsertion, the address of the Trove being reinserted is not a usable hint,\n // because it is deleted from the list before the reinsertion.\n // \"Jump over\" the Trove to get the proper hint.\n if (prev === ownAddress) {\n prev = await sortedTroves.getPrev(prev);\n }\n else if (next === ownAddress) {\n next = await sortedTroves.getNext(next);\n }\n }\n // Don't use `address(0)` as hint as it can result in huge gas cost.\n // (See https://github.com/liquity/dev/issues/600).\n if (prev === constants_1.AddressZero) {\n prev = next;\n }\n else if (next === constants_1.AddressZero) {\n next = prev;\n }\n return [prev, next];\n }\n async _findHints(trove, ownAddress) {\n if (trove instanceof lib_base_1.TroveWithPendingRedistribution) {\n throw new Error(\"Rewards must be applied to this Trove\");\n }\n return this._findHintsForNominalCollateralRatio(trove._nominalCollateralRatio, ownAddress);\n }\n async _findRedemptionHints(amount) {\n const { hintHelpers } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n const price = await this._readable.getPrice();\n const { firstRedemptionHint, partialRedemptionHintNICR, truncatedLUSDamount } = await hintHelpers.getRedemptionHints(amount.hex, price.hex, exports._redeemMaxIterations);\n const [partialRedemptionUpperHint, partialRedemptionLowerHint] = partialRedemptionHintNICR.isZero()\n ? [constants_1.AddressZero, constants_1.AddressZero]\n : await this._findHintsForNominalCollateralRatio(_utils_1.decimalify(partialRedemptionHintNICR)\n // XXX: if we knew the partially redeemed Trove's address, we'd pass it here\n );\n return [\n _utils_1.decimalify(truncatedLUSDamount),\n firstRedemptionHint,\n partialRedemptionUpperHint,\n partialRedemptionLowerHint,\n partialRedemptionHintNICR\n ];\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.openTrove} */\n async openTrove(params, maxBorrowingRateOrOptionalParams, overrides) {\n const { borrowerOperations } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n const normalizedParams = lib_base_1._normalizeTroveCreation(params);\n const { depositCollateral, borrowLUSD } = normalizedParams;\n const [fees, blockTimestamp, total, price] = await Promise.all([\n this._readable._getFeesFactory(),\n this._readable._getBlockTimestamp(),\n this._readable.getTotal(),\n this._readable.getPrice()\n ]);\n const recoveryMode = total.collateralRatioIsBelowCritical(price);\n const decayBorrowingRate = (seconds) => fees(blockTimestamp + seconds, recoveryMode).borrowingRate();\n const currentBorrowingRate = decayBorrowingRate(0);\n const newTrove = lib_base_1.Trove.create(normalizedParams, currentBorrowingRate);\n const hints = await this._findHints(newTrove);\n const { maxBorrowingRate, borrowingFeeDecayToleranceMinutes } = normalizeBorrowingOperationOptionalParams(maxBorrowingRateOrOptionalParams, currentBorrowingRate);\n const txParams = (borrowLUSD) => [\n maxBorrowingRate.hex,\n borrowLUSD.hex,\n ...hints,\n { value: depositCollateral.hex, ...overrides }\n ];\n let gasHeadroom;\n if ((overrides === null || overrides === void 0 ? void 0 : overrides.gasLimit) === undefined) {\n const decayedBorrowingRate = decayBorrowingRate(60 * borrowingFeeDecayToleranceMinutes);\n const decayedTrove = lib_base_1.Trove.create(normalizedParams, decayedBorrowingRate);\n const { borrowLUSD: borrowLUSDSimulatingDecay } = lib_base_1.Trove.recreate(decayedTrove, currentBorrowingRate);\n if (decayedTrove.debt.lt(lib_base_1.LUSD_MINIMUM_DEBT)) {\n throw new Error(`Trove's debt might fall below ${lib_base_1.LUSD_MINIMUM_DEBT} ` +\n `within ${borrowingFeeDecayToleranceMinutes} minutes`);\n }\n const [gasNow, gasLater] = await Promise.all([\n borrowerOperations.estimateGas.openTrove(...txParams(borrowLUSD)),\n borrowerOperations.estimateGas.openTrove(...txParams(borrowLUSDSimulatingDecay))\n ]);\n const gasLimit = addGasForBaseRateUpdate(borrowingFeeDecayToleranceMinutes)(bigNumberMax(addGasForPotentialListTraversal(gasNow), gasLater));\n gasHeadroom = gasLimit.sub(gasNow).toNumber();\n overrides = { ...overrides, gasLimit };\n }\n return this._wrapTroveChangeWithFees(normalizedParams, await borrowerOperations.populateTransaction.openTrove(...txParams(borrowLUSD)), gasHeadroom);\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.closeTrove} */\n async closeTrove(overrides) {\n const { borrowerOperations } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n return this._wrapTroveClosure(await borrowerOperations.estimateAndPopulate.closeTrove({ ...overrides }, id));\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.depositCollateral} */\n depositCollateral(amount, overrides) {\n return this.adjustTrove({ depositCollateral: amount }, undefined, overrides);\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.withdrawCollateral} */\n withdrawCollateral(amount, overrides) {\n return this.adjustTrove({ withdrawCollateral: amount }, undefined, overrides);\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.borrowLUSD} */\n borrowLUSD(amount, maxBorrowingRate, overrides) {\n return this.adjustTrove({ borrowLUSD: amount }, maxBorrowingRate, overrides);\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.repayLUSD} */\n repayLUSD(amount, overrides) {\n return this.adjustTrove({ repayLUSD: amount }, undefined, overrides);\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.adjustTrove} */\n async adjustTrove(params, maxBorrowingRateOrOptionalParams, overrides) {\n const address = EthersLiquityConnection_1._requireAddress(this._readable.connection, overrides);\n const { borrowerOperations } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n const normalizedParams = lib_base_1._normalizeTroveAdjustment(params);\n const { depositCollateral, withdrawCollateral, borrowLUSD, repayLUSD } = normalizedParams;\n const [trove, feeVars] = await Promise.all([\n this._readable.getTrove(address),\n borrowLUSD &&\n _utils_1.promiseAllValues({\n fees: this._readable._getFeesFactory(),\n blockTimestamp: this._readable._getBlockTimestamp(),\n total: this._readable.getTotal(),\n price: this._readable.getPrice()\n })\n ]);\n const decayBorrowingRate = (seconds) => feeVars === null || feeVars === void 0 ? void 0 : feeVars.fees(feeVars.blockTimestamp + seconds, feeVars.total.collateralRatioIsBelowCritical(feeVars.price)).borrowingRate();\n const currentBorrowingRate = decayBorrowingRate(0);\n const adjustedTrove = trove.adjust(normalizedParams, currentBorrowingRate);\n const hints = await this._findHints(adjustedTrove, address);\n const { maxBorrowingRate, borrowingFeeDecayToleranceMinutes } = normalizeBorrowingOperationOptionalParams(maxBorrowingRateOrOptionalParams, currentBorrowingRate);\n const txParams = (borrowLUSD) => {\n var _a;\n return [\n maxBorrowingRate.hex,\n (withdrawCollateral !== null && withdrawCollateral !== void 0 ? withdrawCollateral : lib_base_1.Decimal.ZERO).hex,\n ((_a = borrowLUSD !== null && borrowLUSD !== void 0 ? borrowLUSD : repayLUSD) !== null && _a !== void 0 ? _a : lib_base_1.Decimal.ZERO).hex,\n !!borrowLUSD,\n ...hints,\n { value: depositCollateral === null || depositCollateral === void 0 ? void 0 : depositCollateral.hex, ...overrides }\n ];\n };\n let gasHeadroom;\n if ((overrides === null || overrides === void 0 ? void 0 : overrides.gasLimit) === undefined) {\n const decayedBorrowingRate = decayBorrowingRate(60 * borrowingFeeDecayToleranceMinutes);\n const decayedTrove = trove.adjust(normalizedParams, decayedBorrowingRate);\n const { borrowLUSD: borrowLUSDSimulatingDecay } = trove.adjustTo(decayedTrove, currentBorrowingRate);\n if (decayedTrove.debt.lt(lib_base_1.LUSD_MINIMUM_DEBT)) {\n throw new Error(`Trove's debt might fall below ${lib_base_1.LUSD_MINIMUM_DEBT} ` +\n `within ${borrowingFeeDecayToleranceMinutes} minutes`);\n }\n const [gasNow, gasLater] = await Promise.all([\n borrowerOperations.estimateGas.adjustTrove(...txParams(borrowLUSD)),\n borrowLUSD &&\n borrowerOperations.estimateGas.adjustTrove(...txParams(borrowLUSDSimulatingDecay))\n ]);\n let gasLimit = bigNumberMax(addGasForPotentialListTraversal(gasNow), gasLater);\n if (borrowLUSD) {\n gasLimit = addGasForBaseRateUpdate(borrowingFeeDecayToleranceMinutes)(gasLimit);\n }\n gasHeadroom = gasLimit.sub(gasNow).toNumber();\n overrides = { ...overrides, gasLimit };\n }\n return this._wrapTroveChangeWithFees(normalizedParams, await borrowerOperations.populateTransaction.adjustTrove(...txParams(borrowLUSD)), gasHeadroom);\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.claimCollateralSurplus} */\n async claimCollateralSurplus(overrides) {\n const { borrowerOperations } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n return this._wrapSimpleTransaction(await borrowerOperations.estimateAndPopulate.claimCollateral({ ...overrides }, id));\n }\n /** @internal */\n async setPrice(price, overrides) {\n const { priceFeed } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n if (!contracts_1._priceFeedIsTestnet(priceFeed)) {\n throw new Error(\"setPrice() unavailable on this deployment of Liquity\");\n }\n return this._wrapSimpleTransaction(await priceFeed.estimateAndPopulate.setPrice({ ...overrides }, id, lib_base_1.Decimal.from(price).hex));\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.liquidate} */\n async liquidate(address, overrides) {\n const { troveManager } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n if (Array.isArray(address)) {\n return this._wrapLiquidation(await troveManager.estimateAndPopulate.batchLiquidateTroves({ ...overrides }, addGasForLQTYIssuance, address));\n }\n else {\n return this._wrapLiquidation(await troveManager.estimateAndPopulate.liquidate({ ...overrides }, addGasForLQTYIssuance, address));\n }\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.liquidateUpTo} */\n async liquidateUpTo(maximumNumberOfTrovesToLiquidate, overrides) {\n const { troveManager } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n return this._wrapLiquidation(await troveManager.estimateAndPopulate.liquidateTroves({ ...overrides }, addGasForLQTYIssuance, maximumNumberOfTrovesToLiquidate));\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.depositLUSDInStabilityPool} */\n async depositLUSDInStabilityPool(amount, frontendTag, overrides) {\n var _a;\n const { stabilityPool } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n const depositLUSD = lib_base_1.Decimal.from(amount);\n return this._wrapStabilityDepositTopup({ depositLUSD }, await stabilityPool.estimateAndPopulate.provideToSP({ ...overrides }, addGasForLQTYIssuance, depositLUSD.hex, (_a = frontendTag !== null && frontendTag !== void 0 ? frontendTag : this._readable.connection.frontendTag) !== null && _a !== void 0 ? _a : constants_1.AddressZero));\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.withdrawLUSDFromStabilityPool} */\n async withdrawLUSDFromStabilityPool(amount, overrides) {\n const { stabilityPool } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n return this._wrapStabilityDepositWithdrawal(await stabilityPool.estimateAndPopulate.withdrawFromSP({ ...overrides }, addGasForLQTYIssuance, lib_base_1.Decimal.from(amount).hex));\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.withdrawGainsFromStabilityPool} */\n async withdrawGainsFromStabilityPool(overrides) {\n const { stabilityPool } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n return this._wrapStabilityPoolGainsWithdrawal(await stabilityPool.estimateAndPopulate.withdrawFromSP({ ...overrides }, addGasForLQTYIssuance, lib_base_1.Decimal.ZERO.hex));\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.transferCollateralGainToTrove} */\n async transferCollateralGainToTrove(overrides) {\n const address = EthersLiquityConnection_1._requireAddress(this._readable.connection, overrides);\n const { stabilityPool } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n const [initialTrove, stabilityDeposit] = await Promise.all([\n this._readable.getTrove(address),\n this._readable.getStabilityDeposit(address)\n ]);\n const finalTrove = initialTrove.addCollateral(stabilityDeposit.collateralGain);\n return this._wrapCollateralGainTransfer(await stabilityPool.estimateAndPopulate.withdrawETHGainToTrove({ ...overrides }, compose(addGasForPotentialListTraversal, addGasForLQTYIssuance), ...(await this._findHints(finalTrove, address))));\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.sendLUSD} */\n async sendLUSD(toAddress, amount, overrides) {\n const { lusdToken } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n return this._wrapSimpleTransaction(await lusdToken.estimateAndPopulate.transfer({ ...overrides }, id, toAddress, lib_base_1.Decimal.from(amount).hex));\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.sendLQTY} */\n async sendLQTY(toAddress, amount, overrides) {\n const { lqtyToken } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n return this._wrapSimpleTransaction(await lqtyToken.estimateAndPopulate.transfer({ ...overrides }, id, toAddress, lib_base_1.Decimal.from(amount).hex));\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.redeemLUSD} */\n async redeemLUSD(amount, maxRedemptionRate, overrides) {\n const { troveManager } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n const attemptedLUSDAmount = lib_base_1.Decimal.from(amount);\n const [fees, total, [truncatedAmount, firstRedemptionHint, ...partialHints]] = await Promise.all([\n this._readable.getFees(),\n this._readable.getTotal(),\n this._findRedemptionHints(attemptedLUSDAmount)\n ]);\n if (truncatedAmount.isZero) {\n throw new Error(`redeemLUSD: amount too low to redeem (try at least ${lib_base_1.LUSD_MINIMUM_NET_DEBT})`);\n }\n const defaultMaxRedemptionRate = (amount) => lib_base_1.Decimal.min(fees.redemptionRate(amount.div(total.debt)).add(defaultRedemptionRateSlippageTolerance), lib_base_1.Decimal.ONE);\n const populateRedemption = async (attemptedLUSDAmount, maxRedemptionRate, truncatedAmount = attemptedLUSDAmount, partialHints = [constants_1.AddressZero, constants_1.AddressZero, 0]) => {\n const maxRedemptionRateOrDefault = maxRedemptionRate !== undefined\n ? lib_base_1.Decimal.from(maxRedemptionRate)\n : defaultMaxRedemptionRate(truncatedAmount);\n return new PopulatedEthersRedemption(await troveManager.estimateAndPopulate.redeemCollateral({ ...overrides }, addGasForBaseRateUpdate(), truncatedAmount.hex, firstRedemptionHint, ...partialHints, exports._redeemMaxIterations, maxRedemptionRateOrDefault.hex), this._readable.connection, attemptedLUSDAmount, truncatedAmount, truncatedAmount.lt(attemptedLUSDAmount)\n ? newMaxRedemptionRate => populateRedemption(truncatedAmount.add(lib_base_1.LUSD_MINIMUM_NET_DEBT), newMaxRedemptionRate !== null && newMaxRedemptionRate !== void 0 ? newMaxRedemptionRate : maxRedemptionRate)\n : undefined);\n };\n return populateRedemption(attemptedLUSDAmount, maxRedemptionRate, truncatedAmount, partialHints);\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.stakeLQTY} */\n async stakeLQTY(amount, overrides) {\n const { lqtyStaking } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n return this._wrapSimpleTransaction(await lqtyStaking.estimateAndPopulate.stake({ ...overrides }, id, lib_base_1.Decimal.from(amount).hex));\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.unstakeLQTY} */\n async unstakeLQTY(amount, overrides) {\n const { lqtyStaking } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n return this._wrapSimpleTransaction(await lqtyStaking.estimateAndPopulate.unstake({ ...overrides }, id, lib_base_1.Decimal.from(amount).hex));\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.withdrawGainsFromStaking} */\n withdrawGainsFromStaking(overrides) {\n return this.unstakeLQTY(lib_base_1.Decimal.ZERO, overrides);\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.registerFrontend} */\n async registerFrontend(kickbackRate, overrides) {\n const { stabilityPool } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n return this._wrapSimpleTransaction(await stabilityPool.estimateAndPopulate.registerFrontEnd({ ...overrides }, id, lib_base_1.Decimal.from(kickbackRate).hex));\n }\n /** @internal */\n async _mintUniToken(amount, address, overrides) {\n address !== null && address !== void 0 ? address : (address = EthersLiquityConnection_1._requireAddress(this._readable.connection, overrides));\n const { uniToken } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n if (!contracts_1._uniTokenIsMock(uniToken)) {\n throw new Error(\"_mintUniToken() unavailable on this deployment of Liquity\");\n }\n return this._wrapSimpleTransaction(await uniToken.estimateAndPopulate.mint({ ...overrides }, id, address, lib_base_1.Decimal.from(amount).hex));\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.approveUniTokens} */\n async approveUniTokens(allowance, overrides) {\n const { uniToken, lqtyStaking } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n return this._wrapSimpleTransaction(await uniToken.estimateAndPopulate.approve({ ...overrides }, id, lqtyStaking.address, lib_base_1.Decimal.from(allowance !== null && allowance !== void 0 ? allowance : lib_base_1.Decimal.INFINITY).hex));\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.stakeUniTokens} */\n async stakeUniTokens(amount, overrides) {\n const { unipool } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n return this._wrapSimpleTransaction(await unipool.estimateAndPopulate.stake({ ...overrides }, addGasForUnipoolRewardUpdate, lib_base_1.Decimal.from(amount).hex));\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.unstakeUniTokens} */\n async unstakeUniTokens(amount, overrides) {\n const { unipool } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n return this._wrapSimpleTransaction(await unipool.estimateAndPopulate.withdraw({ ...overrides }, addGasForUnipoolRewardUpdate, lib_base_1.Decimal.from(amount).hex));\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.withdrawLQTYRewardFromLiquidityMining} */\n async withdrawLQTYRewardFromLiquidityMining(overrides) {\n const { unipool } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n return this._wrapSimpleTransaction(await unipool.estimateAndPopulate.claimReward({ ...overrides }, addGasForUnipoolRewardUpdate));\n }\n /** {@inheritDoc @liquity/lib-base#PopulatableLiquity.exitLiquidityMining} */\n async exitLiquidityMining(overrides) {\n const { unipool } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n return this._wrapSimpleTransaction(await unipool.estimateAndPopulate.withdrawAndClaim({ ...overrides }, addGasForUnipoolRewardUpdate));\n }\n}\nexports.PopulatableEthersLiquity = PopulatableEthersLiquity;\n//# sourceMappingURL=PopulatableEthersLiquity.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SendableEthersLiquity = void 0;\nconst sendTransaction = (tx) => tx.send();\n/**\n * Ethers-based implementation of {@link @liquity/lib-base#SendableLiquity}.\n *\n * @public\n */\nclass SendableEthersLiquity {\n constructor(populatable) {\n this._populate = populatable;\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.openTrove} */\n async openTrove(params, maxBorrowingRateOrOptionalParams, overrides) {\n return this._populate\n .openTrove(params, maxBorrowingRateOrOptionalParams, overrides)\n .then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.closeTrove} */\n closeTrove(overrides) {\n return this._populate.closeTrove(overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.adjustTrove} */\n adjustTrove(params, maxBorrowingRateOrOptionalParams, overrides) {\n return this._populate\n .adjustTrove(params, maxBorrowingRateOrOptionalParams, overrides)\n .then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.depositCollateral} */\n depositCollateral(amount, overrides) {\n return this._populate.depositCollateral(amount, overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.withdrawCollateral} */\n withdrawCollateral(amount, overrides) {\n return this._populate.withdrawCollateral(amount, overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.borrowLUSD} */\n borrowLUSD(amount, maxBorrowingRate, overrides) {\n return this._populate.borrowLUSD(amount, maxBorrowingRate, overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.repayLUSD} */\n repayLUSD(amount, overrides) {\n return this._populate.repayLUSD(amount, overrides).then(sendTransaction);\n }\n /** @internal */\n setPrice(price, overrides) {\n return this._populate.setPrice(price, overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.liquidate} */\n liquidate(address, overrides) {\n return this._populate.liquidate(address, overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.liquidateUpTo} */\n liquidateUpTo(maximumNumberOfTrovesToLiquidate, overrides) {\n return this._populate\n .liquidateUpTo(maximumNumberOfTrovesToLiquidate, overrides)\n .then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.depositLUSDInStabilityPool} */\n depositLUSDInStabilityPool(amount, frontendTag, overrides) {\n return this._populate\n .depositLUSDInStabilityPool(amount, frontendTag, overrides)\n .then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.withdrawLUSDFromStabilityPool} */\n withdrawLUSDFromStabilityPool(amount, overrides) {\n return this._populate.withdrawLUSDFromStabilityPool(amount, overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.withdrawGainsFromStabilityPool} */\n withdrawGainsFromStabilityPool(overrides) {\n return this._populate.withdrawGainsFromStabilityPool(overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.transferCollateralGainToTrove} */\n transferCollateralGainToTrove(overrides) {\n return this._populate.transferCollateralGainToTrove(overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.sendLUSD} */\n sendLUSD(toAddress, amount, overrides) {\n return this._populate.sendLUSD(toAddress, amount, overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.sendLQTY} */\n sendLQTY(toAddress, amount, overrides) {\n return this._populate.sendLQTY(toAddress, amount, overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.redeemLUSD} */\n redeemLUSD(amount, maxRedemptionRate, overrides) {\n return this._populate.redeemLUSD(amount, maxRedemptionRate, overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.claimCollateralSurplus} */\n claimCollateralSurplus(overrides) {\n return this._populate.claimCollateralSurplus(overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.stakeLQTY} */\n stakeLQTY(amount, overrides) {\n return this._populate.stakeLQTY(amount, overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.unstakeLQTY} */\n unstakeLQTY(amount, overrides) {\n return this._populate.unstakeLQTY(amount, overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.withdrawGainsFromStaking} */\n withdrawGainsFromStaking(overrides) {\n return this._populate.withdrawGainsFromStaking(overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.registerFrontend} */\n registerFrontend(kickbackRate, overrides) {\n return this._populate.registerFrontend(kickbackRate, overrides).then(sendTransaction);\n }\n /** @internal */\n _mintUniToken(amount, address, overrides) {\n return this._populate._mintUniToken(amount, address, overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.approveUniTokens} */\n approveUniTokens(allowance, overrides) {\n return this._populate.approveUniTokens(allowance, overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.stakeUniTokens} */\n stakeUniTokens(amount, overrides) {\n return this._populate.stakeUniTokens(amount, overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.unstakeUniTokens} */\n unstakeUniTokens(amount, overrides) {\n return this._populate.unstakeUniTokens(amount, overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.withdrawLQTYRewardFromLiquidityMining} */\n withdrawLQTYRewardFromLiquidityMining(overrides) {\n return this._populate.withdrawLQTYRewardFromLiquidityMining(overrides).then(sendTransaction);\n }\n /** {@inheritDoc @liquity/lib-base#SendableLiquity.exitLiquidityMining} */\n exitLiquidityMining(overrides) {\n return this._populate.exitLiquidityMining(overrides).then(sendTransaction);\n }\n}\nexports.SendableEthersLiquity = SendableEthersLiquity;\n//# sourceMappingURL=SendableEthersLiquity.js.map","\"use strict\";\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LiquityStoreProvider = exports.LiquityStoreContext = void 0;\nconst react_1 = __importStar(require(\"react\"));\nexports.LiquityStoreContext = react_1.createContext(undefined);\nconst LiquityStoreProvider = ({ store, loader, children }) => {\n const [loadedStore, setLoadedStore] = react_1.useState();\n react_1.useEffect(() => {\n store.onLoaded = () => setLoadedStore(store);\n const stop = store.start();\n return () => {\n store.onLoaded = undefined;\n setLoadedStore(undefined);\n stop();\n };\n }, [store]);\n if (!loadedStore) {\n return react_1.default.createElement(react_1.default.Fragment, null, loader);\n }\n return react_1.default.createElement(exports.LiquityStoreContext.Provider, { value: loadedStore }, children);\n};\nexports.LiquityStoreProvider = LiquityStoreProvider;\n//# sourceMappingURL=LiquityStoreProvider.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.equals = void 0;\nconst hasOwnProperty = (o, key) => Object.prototype.hasOwnProperty.call(o, key);\nconst shallowEquals = (a, b) => {\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n return (keysA.length === keysB.length &&\n keysA.every(key => hasOwnProperty(b, key) && Object.is(a[key], b[key])));\n};\nconst isObject = (a) => a !== null && typeof a === \"object\";\nconst equals = (a, b) => isObject(a) && isObject(b) ? shallowEquals(a, b) : Object.is(a, b);\nexports.equals = equals;\n//# sourceMappingURL=equals.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BatchedWebSocketAugmentedWeb3Provider = exports.Batched = exports.isBatchedProvider = void 0;\nconst address_1 = require(\"@ethersproject/address\");\nconst contracts_1 = require(\"@ethersproject/contracts\");\nconst properties_1 = require(\"@ethersproject/properties\");\nconst WebSocketAugmentedProvider_1 = require(\"./WebSocketAugmentedProvider\");\nconst multicallAddress = {\n 1: \"0xeefBa1e63905eF1D7ACbA5a8513c70307C1cE441\",\n 3: \"0x53C43764255c17BD724F74c4eF150724AC50a3ed\",\n 4: \"0x42Ad527de7d4e9d9d011aC45B31D8551f8Fe9821\",\n 5: \"0x77dCa2C955b15e9dE4dbBCf1246B4B85b651e50e\",\n 42: \"0x2cc8688C5f75E365aaEEb4ea8D6a480405A48D2A\"\n};\nconst hasMulticall = (chainId) => chainId in multicallAddress;\nconst multicallAbi = [\n {\n type: \"function\",\n name: \"aggregate\",\n stateMutability: \"nonpayable\",\n constant: false,\n payable: false,\n inputs: [\n {\n components: [\n {\n name: \"target\",\n type: \"address\"\n },\n {\n name: \"callData\",\n type: \"bytes\"\n }\n ],\n name: \"calls\",\n type: \"tuple[]\"\n }\n ],\n outputs: [\n {\n name: \"blockNumber\",\n type: \"uint256\"\n },\n {\n name: \"returnData\",\n type: \"bytes[]\"\n }\n ]\n },\n {\n type: \"function\",\n name: \"getEthBalance\",\n stateMutability: \"view\",\n constant: true,\n payable: false,\n inputs: [\n {\n name: \"addr\",\n type: \"address\"\n }\n ],\n outputs: [\n {\n name: \"balance\",\n type: \"uint256\"\n }\n ]\n }\n];\nconst emptyBatch = () => ({ calls: [], callbacks: [] });\n// TODO\n//\n// Technically, requests that have a `from` address shouldn't be batched, because `msg.sender` will\n// be replaced with the Multicall contract's address when the batched calls are being executed.\n//\n// Currently, `@liquity/lib-ethers` makes many of its read calls through Signers, which populates\n// `from`. Instead these calls should be made through a Provider, and `from` should be omitted\n// (since none of the read calls in Liquity care about `msg.sender`).\n//\n// Then we'll be able to properly exclude calls that have `from` addresses from batching.\nconst batchableCall = (request) => request.gasLimit === undefined && request.gasPrice === undefined && request.value === undefined;\nconst batchedCall = (request, multicallAddress) => request.to === multicallAddress &&\n typeof request.data === \"string\" &&\n request.data.startsWith(\"0x252dba42\"); // signature of `aggregate((address,bytes)[])`\nconst batchedProviders = [];\nconst isBatchedProvider = (provider) => batchedProviders.some(batchedProvider => provider instanceof batchedProvider);\nexports.isBatchedProvider = isBatchedProvider;\nconst Batched = (Base) => {\n const batchedProvider = class extends Base {\n constructor() {\n super(...arguments);\n this.batchingDelayMs = 10;\n this._chainId = 0;\n this._batched = emptyBatch();\n this._numberOfBatchedCalls = 0;\n this._numberOfActualCalls = 0;\n }\n get chainId() {\n return this._chainId;\n }\n set chainId(chainId) {\n if (this._multicall) {\n throw new Error(\"can only set chainId once\");\n }\n if (hasMulticall(chainId)) {\n this._multicall = new contracts_1.Contract(multicallAddress[chainId], multicallAbi, this);\n }\n this._chainId = chainId;\n }\n async _dispatchCalls() {\n const { calls, callbacks, blockTag } = this._batched;\n this._batched = emptyBatch();\n try {\n const results = calls.length > 1\n ? await this._multicall.callStatic.aggregate(calls, { blockTag }).then(x => x.returnData)\n : [await super.call({ to: calls[0].target, data: calls[0].callData }, blockTag)];\n callbacks.forEach(([resolve], i) => resolve(results[i]));\n }\n catch (error) {\n callbacks.forEach(([, reject]) => reject(error));\n }\n }\n _enqueueCall(call) {\n if (this._timeoutId !== undefined) {\n clearTimeout(this._timeoutId);\n }\n this._batched.calls.push(call);\n this._timeoutId = setTimeout(() => this._dispatchCalls(), this.batchingDelayMs);\n return new Promise((resolve, reject) => this._batched.callbacks.push([resolve, reject]));\n }\n _alreadyBatchedCallsConflictWith(blockTag) {\n var _a;\n return (this._batched.calls.length !== 0 &&\n (blockTag !== null && blockTag !== void 0 ? blockTag : \"latest\") !== ((_a = this._batched.blockTag) !== null && _a !== void 0 ? _a : \"latest\"));\n }\n async call(request, blockTag) {\n if (!this._multicall) {\n return super.call(request, blockTag);\n }\n else {\n const now = new Date().getTime();\n if (this._timeOfLastRatioCheck === undefined) {\n this._timeOfLastRatioCheck = now;\n }\n else {\n const timeSinceLastRatioCheck = now - this._timeOfLastRatioCheck;\n if (timeSinceLastRatioCheck >= 10000 && this._numberOfActualCalls) {\n // console.log(\n // `Call batching ratio: ${\n // Math.round((10 * this._numberOfBatchedCalls) / this._numberOfActualCalls) / 10\n // }X`\n // );\n this._numberOfBatchedCalls = 0;\n this._numberOfActualCalls = 0;\n this._timeOfLastRatioCheck = now;\n }\n }\n }\n const [resolvedRequest, resolvedBlockTag] = await Promise.all([\n properties_1.resolveProperties(request),\n blockTag\n ]);\n if (batchedCall(resolvedRequest, this._multicall.address) ||\n !batchableCall(resolvedRequest) ||\n this._alreadyBatchedCallsConflictWith(resolvedBlockTag)) {\n this._numberOfActualCalls++;\n return super.call(resolvedRequest, resolvedBlockTag);\n }\n else {\n this._numberOfBatchedCalls++;\n if (this._batched.calls.length === 0) {\n this._batched.blockTag = resolvedBlockTag;\n }\n return this._enqueueCall({ target: resolvedRequest.to, callData: resolvedRequest.data });\n }\n }\n async getBalance(addressOrName, blockTag) {\n const [resolvedAddressOrName, resolvedBlockTag] = await Promise.all([addressOrName, blockTag]);\n if (!address_1.isAddress(resolvedAddressOrName) || !this._multicall) {\n return super.getBalance(resolvedAddressOrName, blockTag);\n }\n const [balance] = await this._multicall.functions.getEthBalance(resolvedAddressOrName, {\n blockTag: resolvedBlockTag\n });\n return balance;\n }\n };\n batchedProviders.push(batchedProvider);\n return batchedProvider;\n};\nexports.Batched = Batched;\nexports.BatchedWebSocketAugmentedWeb3Provider = exports.Batched(WebSocketAugmentedProvider_1.WebSocketAugmentedWeb3Provider);\n//# sourceMappingURL=BatchedProvider.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TroveWithPendingRedistribution = exports.UserTrove = exports._emptyTrove = exports.Trove = exports._normalizeTroveAdjustment = exports._normalizeTroveCreation = void 0;\nconst assert_1 = __importDefault(require(\"assert\"));\nconst Decimal_1 = require(\"./Decimal\");\nconst constants_1 = require(\"./constants\");\nconst invalidTroveCreation = (invalidTrove, error) => ({\n type: \"invalidCreation\",\n invalidTrove,\n error\n});\nconst troveCreation = (params) => ({\n type: \"creation\",\n params\n});\nconst troveClosure = (params) => ({\n type: \"closure\",\n params\n});\nconst troveAdjustment = (params, setToZero) => ({\n type: \"adjustment\",\n params,\n setToZero\n});\nconst valueIsDefined = (entry) => entry[1] !== undefined;\nconst allowedTroveCreationKeys = [\n \"depositCollateral\",\n \"borrowLUSD\"\n];\nfunction checkAllowedTroveCreationKeys(entries) {\n const badKeys = entries\n .filter(([k]) => !allowedTroveCreationKeys.includes(k))\n .map(([k]) => `'${k}'`);\n if (badKeys.length > 0) {\n throw new Error(`TroveCreationParams: property ${badKeys.join(\", \")} not allowed`);\n }\n}\nconst troveCreationParamsFromEntries = (entries) => {\n const params = Object.fromEntries(entries);\n const missingKeys = allowedTroveCreationKeys.filter(k => !(k in params)).map(k => `'${k}'`);\n if (missingKeys.length > 0) {\n throw new Error(`TroveCreationParams: property ${missingKeys.join(\", \")} missing`);\n }\n return params;\n};\nconst decimalize = ([k, v]) => [k, Decimal_1.Decimal.from(v)];\nconst nonZero = ([, v]) => !v.isZero;\n/** @internal */\nconst _normalizeTroveCreation = (params) => {\n const definedEntries = Object.entries(params).filter(valueIsDefined);\n checkAllowedTroveCreationKeys(definedEntries);\n const nonZeroEntries = definedEntries.map(decimalize);\n return troveCreationParamsFromEntries(nonZeroEntries);\n};\nexports._normalizeTroveCreation = _normalizeTroveCreation;\nconst allowedTroveAdjustmentKeys = [\n \"depositCollateral\",\n \"withdrawCollateral\",\n \"borrowLUSD\",\n \"repayLUSD\"\n];\nfunction checkAllowedTroveAdjustmentKeys(entries) {\n const badKeys = entries\n .filter(([k]) => !allowedTroveAdjustmentKeys.includes(k))\n .map(([k]) => `'${k}'`);\n if (badKeys.length > 0) {\n throw new Error(`TroveAdjustmentParams: property ${badKeys.join(\", \")} not allowed`);\n }\n}\nconst collateralChangeFrom = ({ depositCollateral, withdrawCollateral }) => {\n if (depositCollateral !== undefined && withdrawCollateral !== undefined) {\n throw new Error(\"TroveAdjustmentParams: 'depositCollateral' and 'withdrawCollateral' \" +\n \"can't be present at the same time\");\n }\n if (depositCollateral !== undefined) {\n return { depositCollateral };\n }\n if (withdrawCollateral !== undefined) {\n return { withdrawCollateral };\n }\n};\nconst debtChangeFrom = ({ borrowLUSD, repayLUSD }) => {\n if (borrowLUSD !== undefined && repayLUSD !== undefined) {\n throw new Error(\"TroveAdjustmentParams: 'borrowLUSD' and 'repayLUSD' can't be present at the same time\");\n }\n if (borrowLUSD !== undefined) {\n return { borrowLUSD };\n }\n if (repayLUSD !== undefined) {\n return { repayLUSD };\n }\n};\nconst troveAdjustmentParamsFromEntries = (entries) => {\n const params = Object.fromEntries(entries);\n const collateralChange = collateralChangeFrom(params);\n const debtChange = debtChangeFrom(params);\n if (collateralChange !== undefined && debtChange !== undefined) {\n return { ...collateralChange, ...debtChange };\n }\n if (collateralChange !== undefined) {\n return collateralChange;\n }\n if (debtChange !== undefined) {\n return debtChange;\n }\n throw new Error(\"TroveAdjustmentParams: must include at least one non-zero parameter\");\n};\n/** @internal */\nconst _normalizeTroveAdjustment = (params) => {\n const definedEntries = Object.entries(params).filter(valueIsDefined);\n checkAllowedTroveAdjustmentKeys(definedEntries);\n const nonZeroEntries = definedEntries.map(decimalize).filter(nonZero);\n return troveAdjustmentParamsFromEntries(nonZeroEntries);\n};\nexports._normalizeTroveAdjustment = _normalizeTroveAdjustment;\nconst applyFee = (borrowingRate, debtIncrease) => debtIncrease.mul(Decimal_1.Decimal.ONE.add(borrowingRate));\nconst unapplyFee = (borrowingRate, debtIncrease) => debtIncrease._divCeil(Decimal_1.Decimal.ONE.add(borrowingRate));\nconst NOMINAL_COLLATERAL_RATIO_PRECISION = Decimal_1.Decimal.from(100);\n/**\n * A combination of collateral and debt.\n *\n * @public\n */\nclass Trove {\n /** @internal */\n constructor(collateral = Decimal_1.Decimal.ZERO, debt = Decimal_1.Decimal.ZERO) {\n this.collateral = collateral;\n this.debt = debt;\n }\n get isEmpty() {\n return this.collateral.isZero && this.debt.isZero;\n }\n /**\n * Amount of LUSD that must be repaid to close this Trove.\n *\n * @remarks\n * This doesn't include the liquidation reserve, which is refunded in case of normal closure.\n */\n get netDebt() {\n if (this.debt.lt(constants_1.LUSD_LIQUIDATION_RESERVE)) {\n throw new Error(`netDebt should not be used when debt < ${constants_1.LUSD_LIQUIDATION_RESERVE}`);\n }\n return this.debt.sub(constants_1.LUSD_LIQUIDATION_RESERVE);\n }\n /** @internal */\n get _nominalCollateralRatio() {\n return this.collateral.mulDiv(NOMINAL_COLLATERAL_RATIO_PRECISION, this.debt);\n }\n /** Calculate the Trove's collateralization ratio at a given price. */\n collateralRatio(price) {\n return this.collateral.mulDiv(price, this.debt);\n }\n /**\n * Whether the Trove is undercollateralized at a given price.\n *\n * @returns\n * `true` if the Trove's collateralization ratio is less than the\n * {@link MINIMUM_COLLATERAL_RATIO}.\n */\n collateralRatioIsBelowMinimum(price) {\n return this.collateralRatio(price).lt(constants_1.MINIMUM_COLLATERAL_RATIO);\n }\n /**\n * Whether the collateralization ratio is less than the {@link CRITICAL_COLLATERAL_RATIO} at a\n * given price.\n *\n * @example\n * Can be used to check whether the Liquity protocol is in recovery mode by using it on the return\n * value of {@link ReadableLiquity.getTotal | getTotal()}. For example:\n *\n * ```typescript\n * const total = await liquity.getTotal();\n * const price = await liquity.getPrice();\n *\n * if (total.collateralRatioIsBelowCritical(price)) {\n * // Recovery mode is active\n * }\n * ```\n */\n collateralRatioIsBelowCritical(price) {\n return this.collateralRatio(price).lt(constants_1.CRITICAL_COLLATERAL_RATIO);\n }\n /** Whether the Trove is sufficiently collateralized to be opened during recovery mode. */\n isOpenableInRecoveryMode(price) {\n return this.collateralRatio(price).gte(constants_1.CRITICAL_COLLATERAL_RATIO);\n }\n /** @internal */\n toString() {\n return `{ collateral: ${this.collateral}, debt: ${this.debt} }`;\n }\n equals(that) {\n return this.collateral.eq(that.collateral) && this.debt.eq(that.debt);\n }\n add(that) {\n return new Trove(this.collateral.add(that.collateral), this.debt.add(that.debt));\n }\n addCollateral(collateral) {\n return new Trove(this.collateral.add(collateral), this.debt);\n }\n addDebt(debt) {\n return new Trove(this.collateral, this.debt.add(debt));\n }\n subtract(that) {\n const { collateral, debt } = that;\n return new Trove(this.collateral.gt(collateral) ? this.collateral.sub(collateral) : Decimal_1.Decimal.ZERO, this.debt.gt(debt) ? this.debt.sub(debt) : Decimal_1.Decimal.ZERO);\n }\n subtractCollateral(collateral) {\n return new Trove(this.collateral.gt(collateral) ? this.collateral.sub(collateral) : Decimal_1.Decimal.ZERO, this.debt);\n }\n subtractDebt(debt) {\n return new Trove(this.collateral, this.debt.gt(debt) ? this.debt.sub(debt) : Decimal_1.Decimal.ZERO);\n }\n multiply(multiplier) {\n return new Trove(this.collateral.mul(multiplier), this.debt.mul(multiplier));\n }\n setCollateral(collateral) {\n return new Trove(Decimal_1.Decimal.from(collateral), this.debt);\n }\n setDebt(debt) {\n return new Trove(this.collateral, Decimal_1.Decimal.from(debt));\n }\n _debtChange({ debt }, borrowingRate) {\n return debt.gt(this.debt)\n ? { borrowLUSD: unapplyFee(borrowingRate, debt.sub(this.debt)) }\n : { repayLUSD: this.debt.sub(debt) };\n }\n _collateralChange({ collateral }) {\n return collateral.gt(this.collateral)\n ? { depositCollateral: collateral.sub(this.collateral) }\n : { withdrawCollateral: this.collateral.sub(collateral) };\n }\n /**\n * Calculate the difference between this Trove and another.\n *\n * @param that - The other Trove.\n * @param borrowingRate - Borrowing rate to use when calculating a borrowed amount.\n *\n * @returns\n * An object representing the change, or `undefined` if the Troves are equal.\n */\n whatChanged(that, borrowingRate = constants_1.MINIMUM_BORROWING_RATE) {\n var _a;\n if (this.collateral.eq(that.collateral) && this.debt.eq(that.debt)) {\n return undefined;\n }\n if (this.isEmpty) {\n if (that.debt.lt(constants_1.LUSD_LIQUIDATION_RESERVE)) {\n return invalidTroveCreation(that, \"missingLiquidationReserve\");\n }\n return troveCreation({\n depositCollateral: that.collateral,\n borrowLUSD: unapplyFee(borrowingRate, that.netDebt)\n });\n }\n if (that.isEmpty) {\n return troveClosure(this.netDebt.nonZero\n ? { withdrawCollateral: this.collateral, repayLUSD: this.netDebt }\n : { withdrawCollateral: this.collateral });\n }\n return this.collateral.eq(that.collateral)\n ? troveAdjustment(this._debtChange(that, borrowingRate), that.debt.zero && \"debt\")\n : this.debt.eq(that.debt)\n ? troveAdjustment(this._collateralChange(that), that.collateral.zero && \"collateral\")\n : troveAdjustment({\n ...this._debtChange(that, borrowingRate),\n ...this._collateralChange(that)\n }, (_a = (that.debt.zero && \"debt\")) !== null && _a !== void 0 ? _a : (that.collateral.zero && \"collateral\"));\n }\n /**\n * Make a new Trove by applying a {@link TroveChange} to this Trove.\n *\n * @param change - The change to apply.\n * @param borrowingRate - Borrowing rate to use when adding a borrowed amount to the Trove's debt.\n */\n apply(change, borrowingRate = constants_1.MINIMUM_BORROWING_RATE) {\n if (!change) {\n return this;\n }\n switch (change.type) {\n case \"invalidCreation\":\n if (!this.isEmpty) {\n throw new Error(\"Can't create onto existing Trove\");\n }\n return change.invalidTrove;\n case \"creation\": {\n if (!this.isEmpty) {\n throw new Error(\"Can't create onto existing Trove\");\n }\n const { depositCollateral, borrowLUSD } = change.params;\n return new Trove(depositCollateral, constants_1.LUSD_LIQUIDATION_RESERVE.add(applyFee(borrowingRate, borrowLUSD)));\n }\n case \"closure\":\n if (this.isEmpty) {\n throw new Error(\"Can't close empty Trove\");\n }\n return exports._emptyTrove;\n case \"adjustment\": {\n const { setToZero, params: { depositCollateral, withdrawCollateral, borrowLUSD, repayLUSD } } = change;\n const collateralDecrease = withdrawCollateral !== null && withdrawCollateral !== void 0 ? withdrawCollateral : Decimal_1.Decimal.ZERO;\n const collateralIncrease = depositCollateral !== null && depositCollateral !== void 0 ? depositCollateral : Decimal_1.Decimal.ZERO;\n const debtDecrease = repayLUSD !== null && repayLUSD !== void 0 ? repayLUSD : Decimal_1.Decimal.ZERO;\n const debtIncrease = borrowLUSD ? applyFee(borrowingRate, borrowLUSD) : Decimal_1.Decimal.ZERO;\n return setToZero === \"collateral\"\n ? this.setCollateral(Decimal_1.Decimal.ZERO).addDebt(debtIncrease).subtractDebt(debtDecrease)\n : setToZero === \"debt\"\n ? this.setDebt(Decimal_1.Decimal.ZERO)\n .addCollateral(collateralIncrease)\n .subtractCollateral(collateralDecrease)\n : this.add(new Trove(collateralIncrease, debtIncrease)).subtract(new Trove(collateralDecrease, debtDecrease));\n }\n }\n }\n /**\n * Calculate the result of an {@link TransactableLiquity.openTrove | openTrove()} transaction.\n *\n * @param params - Parameters of the transaction.\n * @param borrowingRate - Borrowing rate to use when calculating the Trove's debt.\n */\n static create(params, borrowingRate) {\n return exports._emptyTrove.apply(troveCreation(exports._normalizeTroveCreation(params)), borrowingRate);\n }\n /**\n * Calculate the parameters of an {@link TransactableLiquity.openTrove | openTrove()} transaction\n * that will result in the given Trove.\n *\n * @param that - The Trove to recreate.\n * @param borrowingRate - Current borrowing rate.\n */\n static recreate(that, borrowingRate) {\n const change = exports._emptyTrove.whatChanged(that, borrowingRate);\n assert_1.default((change === null || change === void 0 ? void 0 : change.type) === \"creation\");\n return change.params;\n }\n /**\n * Calculate the result of an {@link TransactableLiquity.adjustTrove | adjustTrove()} transaction\n * on this Trove.\n *\n * @param params - Parameters of the transaction.\n * @param borrowingRate - Borrowing rate to use when adding to the Trove's debt.\n */\n adjust(params, borrowingRate) {\n return this.apply(troveAdjustment(exports._normalizeTroveAdjustment(params)), borrowingRate);\n }\n /**\n * Calculate the parameters of an {@link TransactableLiquity.adjustTrove | adjustTrove()}\n * transaction that will change this Trove into the given Trove.\n *\n * @param that - The desired result of the transaction.\n * @param borrowingRate - Current borrowing rate.\n */\n adjustTo(that, borrowingRate) {\n const change = this.whatChanged(that, borrowingRate);\n assert_1.default((change === null || change === void 0 ? void 0 : change.type) === \"adjustment\");\n return change.params;\n }\n}\nexports.Trove = Trove;\n/** @internal */\nexports._emptyTrove = new Trove();\n/**\n * A Trove that is associated with a single owner.\n *\n * @remarks\n * The SDK uses the base {@link Trove} class as a generic container of collateral and debt, for\n * example to represent the {@link ReadableLiquity.getTotal | total collateral and debt} locked up\n * in the protocol.\n *\n * The `UserTrove` class extends `Trove` with extra information that's only available for Troves\n * that are associated with a single owner (such as the owner's address, or the Trove's status).\n *\n * @public\n */\nclass UserTrove extends Trove {\n /** @internal */\n constructor(ownerAddress, status, collateral, debt) {\n super(collateral, debt);\n this.ownerAddress = ownerAddress;\n this.status = status;\n }\n equals(that) {\n return (super.equals(that) && this.ownerAddress === that.ownerAddress && this.status === that.status);\n }\n /** @internal */\n toString() {\n return (`{ ownerAddress: \"${this.ownerAddress}\"` +\n `, collateral: ${this.collateral}` +\n `, debt: ${this.debt}` +\n `, status: \"${this.status}\" }`);\n }\n}\nexports.UserTrove = UserTrove;\n/**\n * A Trove in its state after the last direct modification.\n *\n * @remarks\n * The Trove may have received collateral and debt shares from liquidations since then.\n * Use {@link TroveWithPendingRedistribution.applyRedistribution | applyRedistribution()} to\n * calculate the Trove's most up-to-date state.\n *\n * @public\n */\nclass TroveWithPendingRedistribution extends UserTrove {\n /** @internal */\n constructor(ownerAddress, status, collateral, debt, stake = Decimal_1.Decimal.ZERO, snapshotOfTotalRedistributed = exports._emptyTrove) {\n super(ownerAddress, status, collateral, debt);\n this.stake = stake;\n this.snapshotOfTotalRedistributed = snapshotOfTotalRedistributed;\n }\n applyRedistribution(totalRedistributed) {\n const afterRedistribution = this.add(totalRedistributed.subtract(this.snapshotOfTotalRedistributed).multiply(this.stake));\n return new UserTrove(this.ownerAddress, this.status, afterRedistribution.collateral, afterRedistribution.debt);\n }\n equals(that) {\n return (super.equals(that) &&\n this.stake.eq(that.stake) &&\n this.snapshotOfTotalRedistributed.equals(that.snapshotOfTotalRedistributed));\n }\n}\nexports.TroveWithPendingRedistribution = TroveWithPendingRedistribution;\n//# sourceMappingURL=Trove.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.StabilityDeposit = void 0;\nconst Decimal_1 = require(\"./Decimal\");\n/**\n * A Stability Deposit and its accrued gains.\n *\n * @public\n */\nclass StabilityDeposit {\n /** @internal */\n constructor(initialLUSD, currentLUSD, collateralGain, lqtyReward, frontendTag) {\n this.initialLUSD = initialLUSD;\n this.currentLUSD = currentLUSD;\n this.collateralGain = collateralGain;\n this.lqtyReward = lqtyReward;\n this.frontendTag = frontendTag;\n if (this.currentLUSD.gt(this.initialLUSD)) {\n throw new Error(\"currentLUSD can't be greater than initialLUSD\");\n }\n }\n get isEmpty() {\n return (this.initialLUSD.isZero &&\n this.currentLUSD.isZero &&\n this.collateralGain.isZero &&\n this.lqtyReward.isZero);\n }\n /** @internal */\n toString() {\n return (`{ initialLUSD: ${this.initialLUSD}` +\n `, currentLUSD: ${this.currentLUSD}` +\n `, collateralGain: ${this.collateralGain}` +\n `, lqtyReward: ${this.lqtyReward}` +\n `, frontendTag: \"${this.frontendTag}\" }`);\n }\n /**\n * Compare to another instance of `StabilityDeposit`.\n */\n equals(that) {\n return (this.initialLUSD.eq(that.initialLUSD) &&\n this.currentLUSD.eq(that.currentLUSD) &&\n this.collateralGain.eq(that.collateralGain) &&\n this.lqtyReward.eq(that.lqtyReward) &&\n this.frontendTag === that.frontendTag);\n }\n /**\n * Calculate the difference between the `currentLUSD` in this Stability Deposit and `thatLUSD`.\n *\n * @returns An object representing the change, or `undefined` if the deposited amounts are equal.\n */\n whatChanged(thatLUSD) {\n thatLUSD = Decimal_1.Decimal.from(thatLUSD);\n if (thatLUSD.lt(this.currentLUSD)) {\n return { withdrawLUSD: this.currentLUSD.sub(thatLUSD), withdrawAllLUSD: thatLUSD.isZero };\n }\n if (thatLUSD.gt(this.currentLUSD)) {\n return { depositLUSD: thatLUSD.sub(this.currentLUSD) };\n }\n }\n /**\n * Apply a {@link StabilityDepositChange} to this Stability Deposit.\n *\n * @returns The new deposited LUSD amount.\n */\n apply(change) {\n if (!change) {\n return this.currentLUSD;\n }\n if (change.withdrawLUSD !== undefined) {\n return change.withdrawAllLUSD || this.currentLUSD.lte(change.withdrawLUSD)\n ? Decimal_1.Decimal.ZERO\n : this.currentLUSD.sub(change.withdrawLUSD);\n }\n else {\n return this.currentLUSD.add(change.depositLUSD);\n }\n }\n}\nexports.StabilityDeposit = StabilityDeposit;\n//# sourceMappingURL=StabilityDeposit.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LQTYStake = void 0;\nconst Decimal_1 = require(\"./Decimal\");\n/**\n * Represents a user's LQTY stake and accrued gains.\n *\n * @remarks\n * Returned by the {@link ReadableLiquity.getLQTYStake | getLQTYStake()} function.\n\n * @public\n */\nclass LQTYStake {\n /** @internal */\n constructor(stakedLQTY = Decimal_1.Decimal.ZERO, collateralGain = Decimal_1.Decimal.ZERO, lusdGain = Decimal_1.Decimal.ZERO) {\n this.stakedLQTY = stakedLQTY;\n this.collateralGain = collateralGain;\n this.lusdGain = lusdGain;\n }\n get isEmpty() {\n return this.stakedLQTY.isZero && this.collateralGain.isZero && this.lusdGain.isZero;\n }\n /** @internal */\n toString() {\n return (`{ stakedLQTY: ${this.stakedLQTY}` +\n `, collateralGain: ${this.collateralGain}` +\n `, lusdGain: ${this.lusdGain} }`);\n }\n /**\n * Compare to another instance of `LQTYStake`.\n */\n equals(that) {\n return (this.stakedLQTY.eq(that.stakedLQTY) &&\n this.collateralGain.eq(that.collateralGain) &&\n this.lusdGain.eq(that.lusdGain));\n }\n /**\n * Calculate the difference between this `LQTYStake` and `thatStakedLQTY`.\n *\n * @returns An object representing the change, or `undefined` if the staked amounts are equal.\n */\n whatChanged(thatStakedLQTY) {\n thatStakedLQTY = Decimal_1.Decimal.from(thatStakedLQTY);\n if (thatStakedLQTY.lt(this.stakedLQTY)) {\n return {\n unstakeLQTY: this.stakedLQTY.sub(thatStakedLQTY),\n unstakeAllLQTY: thatStakedLQTY.isZero\n };\n }\n if (thatStakedLQTY.gt(this.stakedLQTY)) {\n return { stakeLQTY: thatStakedLQTY.sub(this.stakedLQTY) };\n }\n }\n /**\n * Apply a {@link LQTYStakeChange} to this `LQTYStake`.\n *\n * @returns The new staked LQTY amount.\n */\n apply(change) {\n if (!change) {\n return this.stakedLQTY;\n }\n if (change.unstakeLQTY !== undefined) {\n return change.unstakeAllLQTY || this.stakedLQTY.lte(change.unstakeLQTY)\n ? Decimal_1.Decimal.ZERO\n : this.stakedLQTY.sub(change.unstakeLQTY);\n }\n else {\n return this.stakedLQTY.add(change.stakeLQTY);\n }\n }\n}\nexports.LQTYStake = LQTYStake;\n//# sourceMappingURL=LQTYStake.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Fees = void 0;\nconst assert_1 = __importDefault(require(\"assert\"));\nconst Decimal_1 = require(\"./Decimal\");\nconst constants_1 = require(\"./constants\");\n/**\n * Calculator for fees.\n *\n * @remarks\n * Returned by the {@link ReadableLiquity.getFees | getFees()} function.\n *\n * @public\n */\nclass Fees {\n /** @internal */\n constructor(baseRateWithoutDecay, minuteDecayFactor, beta, lastFeeOperation, timeOfLatestBlock, recoveryMode) {\n this._baseRateWithoutDecay = Decimal_1.Decimal.from(baseRateWithoutDecay);\n this._minuteDecayFactor = Decimal_1.Decimal.from(minuteDecayFactor);\n this._beta = Decimal_1.Decimal.from(beta);\n this._lastFeeOperation = lastFeeOperation;\n this._timeOfLatestBlock = timeOfLatestBlock;\n this._recoveryMode = recoveryMode;\n assert_1.default(this._minuteDecayFactor.lt(1));\n }\n /** @internal */\n _setRecoveryMode(recoveryMode) {\n return new Fees(this._baseRateWithoutDecay, this._minuteDecayFactor, this._beta, this._lastFeeOperation, this._timeOfLatestBlock, recoveryMode);\n }\n /**\n * Compare to another instance of `Fees`.\n */\n equals(that) {\n return (this._baseRateWithoutDecay.eq(that._baseRateWithoutDecay) &&\n this._minuteDecayFactor.eq(that._minuteDecayFactor) &&\n this._beta.eq(that._beta) &&\n this._lastFeeOperation.getTime() === that._lastFeeOperation.getTime() &&\n this._timeOfLatestBlock.getTime() === that._timeOfLatestBlock.getTime() &&\n this._recoveryMode === that._recoveryMode);\n }\n /** @internal */\n toString() {\n return (`{ baseRateWithoutDecay: ${this._baseRateWithoutDecay}` +\n `, lastFeeOperation: \"${this._lastFeeOperation.toLocaleString()}\"` +\n `, recoveryMode: ${this._recoveryMode} } `);\n }\n /** @internal */\n baseRate(when = this._timeOfLatestBlock) {\n const millisecondsSinceLastFeeOperation = Math.max(when.getTime() - this._lastFeeOperation.getTime(), 0 // Clamp negative elapsed time to 0, in case the client's time is in the past.\n // We will calculate slightly higher than actual fees, which is fine.\n );\n const minutesSinceLastFeeOperation = Math.floor(millisecondsSinceLastFeeOperation / 60000);\n return this._minuteDecayFactor.pow(minutesSinceLastFeeOperation).mul(this._baseRateWithoutDecay);\n }\n /**\n * Calculate the current borrowing rate.\n *\n * @param when - Optional timestamp that can be used to calculate what the borrowing rate would\n * decay to at a point of time in the future.\n *\n * @remarks\n * By default, the fee is calculated at the time of the latest block. This can be overridden using\n * the `when` parameter.\n *\n * To calculate the borrowing fee in LUSD, multiply the borrowed LUSD amount by the borrowing rate.\n *\n * @example\n * ```typescript\n * const fees = await liquity.getFees();\n *\n * const borrowedLUSDAmount = 100;\n * const borrowingRate = fees.borrowingRate();\n * const borrowingFeeLUSD = borrowingRate.mul(borrowedLUSDAmount);\n * ```\n */\n borrowingRate(when) {\n return this._recoveryMode\n ? Decimal_1.Decimal.ZERO\n : Decimal_1.Decimal.min(constants_1.MINIMUM_BORROWING_RATE.add(this.baseRate(when)), constants_1.MAXIMUM_BORROWING_RATE);\n }\n /**\n * Calculate the current redemption rate.\n *\n * @param redeemedFractionOfSupply - The amount of LUSD being redeemed divided by the total supply.\n * @param when - Optional timestamp that can be used to calculate what the redemption rate would\n * decay to at a point of time in the future.\n *\n * @remarks\n * By default, the fee is calculated at the time of the latest block. This can be overridden using\n * the `when` parameter.\n \n * Unlike the borrowing rate, the redemption rate depends on the amount being redeemed. To be more\n * precise, it depends on the fraction of the redeemed amount compared to the total LUSD supply,\n * which must be passed as a parameter.\n *\n * To calculate the redemption fee in LUSD, multiply the redeemed LUSD amount with the redemption\n * rate.\n *\n * @example\n * ```typescript\n * const fees = await liquity.getFees();\n * const total = await liquity.getTotal();\n *\n * const redeemedLUSDAmount = Decimal.from(100);\n * const redeemedFractionOfSupply = redeemedLUSDAmount.div(total.debt);\n * const redemptionRate = fees.redemptionRate(redeemedFractionOfSupply);\n * const redemptionFeeLUSD = redemptionRate.mul(redeemedLUSDAmount);\n * ```\n */\n redemptionRate(redeemedFractionOfSupply = Decimal_1.Decimal.ZERO, when) {\n redeemedFractionOfSupply = Decimal_1.Decimal.from(redeemedFractionOfSupply);\n let baseRate = this.baseRate(when);\n if (redeemedFractionOfSupply.nonZero) {\n baseRate = redeemedFractionOfSupply.div(this._beta).add(baseRate);\n }\n return Decimal_1.Decimal.min(constants_1.MINIMUM_REDEMPTION_RATE.add(baseRate), Decimal_1.Decimal.ONE);\n }\n}\nexports.Fees = Fees;\n//# sourceMappingURL=Fees.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TransactionFailedError = void 0;\n/**\n * Thrown by {@link TransactableLiquity} functions in case of transaction failure.\n *\n * @public\n */\nclass TransactionFailedError extends Error {\n /** @internal */\n constructor(name, message, failedReceipt) {\n super(message);\n this.name = name;\n this.failedReceipt = failedReceipt;\n }\n}\nexports.TransactionFailedError = TransactionFailedError;\n//# sourceMappingURL=TransactableLiquity.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._successfulReceipt = exports._failedReceipt = exports._pendingReceipt = void 0;\n/** @internal */\nexports._pendingReceipt = { status: \"pending\" };\n/** @internal */\nconst _failedReceipt = (rawReceipt) => ({\n status: \"failed\",\n rawReceipt\n});\nexports._failedReceipt = _failedReceipt;\n/** @internal */\nconst _successfulReceipt = (rawReceipt, details, toString) => ({\n status: \"succeeded\",\n rawReceipt,\n details,\n ...(toString ? { toString } : {})\n});\nexports._successfulReceipt = _successfulReceipt;\n//# sourceMappingURL=SendableLiquity.js.map","\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.LiquityStore = void 0;\nconst assert_1 = __importDefault(require(\"assert\"));\nconst strictEquals = (a, b) => a === b;\nconst eq = (a, b) => a.eq(b);\nconst equals = (a, b) => a.equals(b);\nconst frontendStatusEquals = (a, b) => a.status === \"unregistered\"\n ? b.status === \"unregistered\"\n : b.status === \"registered\" && a.kickbackRate.eq(b.kickbackRate);\nconst showFrontendStatus = (x) => x.status === \"unregistered\"\n ? '{ status: \"unregistered\" }'\n : `{ status: \"registered\", kickbackRate: ${x.kickbackRate} }`;\nconst wrap = (f) => (...args) => f(...args);\nconst difference = (a, b) => Object.fromEntries(Object.entries(a).filter(([key, value]) => value !== b[key]));\n/**\n * Abstract base class of Liquity data store implementations.\n *\n * @remarks\n * The type parameter `T` may be used to type extra state added to {@link LiquityStoreState} by the\n * subclass.\n *\n * Implemented by {@link @liquity/lib-ethers#BlockPolledLiquityStore}.\n *\n * @public\n */\nclass LiquityStore {\n constructor() {\n /** Turn console logging on/off. */\n this.logging = false;\n /** @internal */\n this._loaded = false;\n this._listeners = new Set();\n }\n /**\n * The current store state.\n *\n * @remarks\n * Should not be accessed before the store is loaded. Assign a function to\n * {@link LiquityStore.onLoaded | onLoaded} to get a callback when this happens.\n *\n * See {@link LiquityStoreState} for the list of properties returned.\n */\n get state() {\n return Object.assign({}, this._baseState, this._derivedState, this._extraState);\n }\n /**\n * Start monitoring the blockchain for Liquity state changes.\n *\n * @remarks\n * The {@link LiquityStore.onLoaded | onLoaded} callback will be called after the state is fetched\n * for the first time.\n *\n * Use the {@link LiquityStore.subscribe | subscribe()} function to register listeners.\n *\n * @returns Function to stop the monitoring.\n */\n start() {\n const doStop = this._doStart();\n return () => {\n doStop();\n this._cancelUpdateIfScheduled();\n };\n }\n _cancelUpdateIfScheduled() {\n if (this._updateTimeoutId !== undefined) {\n clearTimeout(this._updateTimeoutId);\n }\n }\n _scheduleUpdate() {\n this._cancelUpdateIfScheduled();\n this._updateTimeoutId = setTimeout(() => {\n this._updateTimeoutId = undefined;\n this._update();\n }, 30000);\n }\n _logUpdate(name, next, show) {\n if (this.logging) {\n console.log(`${name} updated to ${show ? show(next) : next}`);\n }\n return next;\n }\n _updateIfChanged(equals, name, prev, next, show) {\n return next !== undefined && !equals(prev, next) ? this._logUpdate(name, next, show) : prev;\n }\n _silentlyUpdateIfChanged(equals, prev, next) {\n return next !== undefined && !equals(prev, next) ? next : prev;\n }\n _updateFees(name, prev, next) {\n if (next && !next.equals(prev)) {\n // Filter out fee update spam that happens on every new block by only logging when string\n // representation changes.\n if (`${next}` !== `${prev}`) {\n this._logUpdate(name, next);\n }\n return next;\n }\n else {\n return prev;\n }\n }\n _reduce(baseState, baseStateUpdate) {\n return {\n frontend: this._updateIfChanged(frontendStatusEquals, \"frontend\", baseState.frontend, baseStateUpdate.frontend, showFrontendStatus),\n ownFrontend: this._updateIfChanged(frontendStatusEquals, \"ownFrontend\", baseState.ownFrontend, baseStateUpdate.ownFrontend, showFrontendStatus),\n numberOfTroves: this._updateIfChanged(strictEquals, \"numberOfTroves\", baseState.numberOfTroves, baseStateUpdate.numberOfTroves),\n accountBalance: this._updateIfChanged(eq, \"accountBalance\", baseState.accountBalance, baseStateUpdate.accountBalance),\n lusdBalance: this._updateIfChanged(eq, \"lusdBalance\", baseState.lusdBalance, baseStateUpdate.lusdBalance),\n lqtyBalance: this._updateIfChanged(eq, \"lqtyBalance\", baseState.lqtyBalance, baseStateUpdate.lqtyBalance),\n uniTokenBalance: this._updateIfChanged(eq, \"uniTokenBalance\", baseState.uniTokenBalance, baseStateUpdate.uniTokenBalance),\n uniTokenAllowance: this._updateIfChanged(eq, \"uniTokenAllowance\", baseState.uniTokenAllowance, baseStateUpdate.uniTokenAllowance),\n remainingLiquidityMiningLQTYReward: this._silentlyUpdateIfChanged(eq, baseState.remainingLiquidityMiningLQTYReward, baseStateUpdate.remainingLiquidityMiningLQTYReward),\n liquidityMiningStake: this._updateIfChanged(eq, \"liquidityMiningStake\", baseState.liquidityMiningStake, baseStateUpdate.liquidityMiningStake),\n totalStakedUniTokens: this._updateIfChanged(eq, \"totalStakedUniTokens\", baseState.totalStakedUniTokens, baseStateUpdate.totalStakedUniTokens),\n liquidityMiningLQTYReward: this._silentlyUpdateIfChanged(eq, baseState.liquidityMiningLQTYReward, baseStateUpdate.liquidityMiningLQTYReward),\n collateralSurplusBalance: this._updateIfChanged(eq, \"collateralSurplusBalance\", baseState.collateralSurplusBalance, baseStateUpdate.collateralSurplusBalance),\n price: this._updateIfChanged(eq, \"price\", baseState.price, baseStateUpdate.price),\n lusdInStabilityPool: this._updateIfChanged(eq, \"lusdInStabilityPool\", baseState.lusdInStabilityPool, baseStateUpdate.lusdInStabilityPool),\n total: this._updateIfChanged(equals, \"total\", baseState.total, baseStateUpdate.total),\n totalRedistributed: this._updateIfChanged(equals, \"totalRedistributed\", baseState.totalRedistributed, baseStateUpdate.totalRedistributed),\n troveBeforeRedistribution: this._updateIfChanged(equals, \"troveBeforeRedistribution\", baseState.troveBeforeRedistribution, baseStateUpdate.troveBeforeRedistribution),\n stabilityDeposit: this._updateIfChanged(equals, \"stabilityDeposit\", baseState.stabilityDeposit, baseStateUpdate.stabilityDeposit),\n remainingStabilityPoolLQTYReward: this._silentlyUpdateIfChanged(eq, baseState.remainingStabilityPoolLQTYReward, baseStateUpdate.remainingStabilityPoolLQTYReward),\n _feesInNormalMode: this._silentlyUpdateIfChanged(equals, baseState._feesInNormalMode, baseStateUpdate._feesInNormalMode),\n lqtyStake: this._updateIfChanged(equals, \"lqtyStake\", baseState.lqtyStake, baseStateUpdate.lqtyStake),\n totalStakedLQTY: this._updateIfChanged(eq, \"totalStakedLQTY\", baseState.totalStakedLQTY, baseStateUpdate.totalStakedLQTY),\n _riskiestTroveBeforeRedistribution: this._silentlyUpdateIfChanged(equals, baseState._riskiestTroveBeforeRedistribution, baseStateUpdate._riskiestTroveBeforeRedistribution)\n };\n }\n _derive({ troveBeforeRedistribution, totalRedistributed, _feesInNormalMode, total, price, _riskiestTroveBeforeRedistribution }) {\n const fees = _feesInNormalMode._setRecoveryMode(total.collateralRatioIsBelowCritical(price));\n return {\n trove: troveBeforeRedistribution.applyRedistribution(totalRedistributed),\n fees,\n borrowingRate: fees.borrowingRate(),\n redemptionRate: fees.redemptionRate(),\n haveUndercollateralizedTroves: _riskiestTroveBeforeRedistribution\n .applyRedistribution(totalRedistributed)\n .collateralRatioIsBelowMinimum(price)\n };\n }\n _reduceDerived(derivedState, derivedStateUpdate) {\n return {\n fees: this._updateFees(\"fees\", derivedState.fees, derivedStateUpdate.fees),\n trove: this._updateIfChanged(equals, \"trove\", derivedState.trove, derivedStateUpdate.trove),\n borrowingRate: this._silentlyUpdateIfChanged(eq, derivedState.borrowingRate, derivedStateUpdate.borrowingRate),\n redemptionRate: this._silentlyUpdateIfChanged(eq, derivedState.redemptionRate, derivedStateUpdate.redemptionRate),\n haveUndercollateralizedTroves: this._updateIfChanged(strictEquals, \"haveUndercollateralizedTroves\", derivedState.haveUndercollateralizedTroves, derivedStateUpdate.haveUndercollateralizedTroves)\n };\n }\n _notify(params) {\n // Iterate on a copy of `_listeners`, to avoid notifying any new listeners subscribed by\n // existing listeners, as that could result in infinite loops.\n //\n // Before calling a listener from our copy of `_listeners`, check if it has been removed from\n // the original set. This way we avoid calling listeners that have already been unsubscribed\n // by an earlier listener callback.\n [...this._listeners].forEach(listener => {\n if (this._listeners.has(listener)) {\n listener(params);\n }\n });\n }\n /**\n * Register a state change listener.\n *\n * @param listener - Function that will be called whenever state changes.\n * @returns Function to unregister this listener.\n */\n subscribe(listener) {\n const uniqueListener = wrap(listener);\n this._listeners.add(uniqueListener);\n return () => {\n this._listeners.delete(uniqueListener);\n };\n }\n /** @internal */\n _load(baseState, extraState) {\n assert_1.default(!this._loaded);\n this._baseState = baseState;\n this._derivedState = this._derive(baseState);\n this._extraState = extraState;\n this._loaded = true;\n this._scheduleUpdate();\n if (this.onLoaded) {\n this.onLoaded();\n }\n }\n /** @internal */\n _update(baseStateUpdate, extraStateUpdate) {\n assert_1.default(this._baseState && this._derivedState);\n const oldState = this.state;\n if (baseStateUpdate) {\n this._baseState = this._reduce(this._baseState, baseStateUpdate);\n }\n // Always running this lets us derive state based on passage of time, like baseRate decay\n this._derivedState = this._reduceDerived(this._derivedState, this._derive(this._baseState));\n if (extraStateUpdate) {\n assert_1.default(this._extraState);\n this._extraState = this._reduceExtra(this._extraState, extraStateUpdate);\n }\n this._scheduleUpdate();\n this._notify({\n newState: this.state,\n oldState,\n stateChange: difference(this.state, oldState)\n });\n }\n}\nexports.LiquityStore = LiquityStore;\n//# sourceMappingURL=LiquityStore.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._CachedReadableLiquity = void 0;\n/** @internal */\nclass _CachedReadableLiquity {\n constructor(readable, cache) {\n this._readable = readable;\n this._cache = cache;\n }\n async getTotalRedistributed(...extraParams) {\n var _a;\n return ((_a = this._cache.getTotalRedistributed(...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getTotalRedistributed(...extraParams));\n }\n async getTroveBeforeRedistribution(address, ...extraParams) {\n var _a;\n return ((_a = this._cache.getTroveBeforeRedistribution(address, ...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getTroveBeforeRedistribution(address, ...extraParams));\n }\n async getTrove(address, ...extraParams) {\n const [troveBeforeRedistribution, totalRedistributed] = await Promise.all([\n this.getTroveBeforeRedistribution(address, ...extraParams),\n this.getTotalRedistributed(...extraParams)\n ]);\n return troveBeforeRedistribution.applyRedistribution(totalRedistributed);\n }\n async getNumberOfTroves(...extraParams) {\n var _a;\n return ((_a = this._cache.getNumberOfTroves(...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getNumberOfTroves(...extraParams));\n }\n async getPrice(...extraParams) {\n var _a;\n return (_a = this._cache.getPrice(...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getPrice(...extraParams);\n }\n async getTotal(...extraParams) {\n var _a;\n return (_a = this._cache.getTotal(...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getTotal(...extraParams);\n }\n async getStabilityDeposit(address, ...extraParams) {\n var _a;\n return ((_a = this._cache.getStabilityDeposit(address, ...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getStabilityDeposit(address, ...extraParams));\n }\n async getRemainingStabilityPoolLQTYReward(...extraParams) {\n var _a;\n return ((_a = this._cache.getRemainingStabilityPoolLQTYReward(...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getRemainingStabilityPoolLQTYReward(...extraParams));\n }\n async getLUSDInStabilityPool(...extraParams) {\n var _a;\n return ((_a = this._cache.getLUSDInStabilityPool(...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getLUSDInStabilityPool(...extraParams));\n }\n async getLUSDBalance(address, ...extraParams) {\n var _a;\n return ((_a = this._cache.getLUSDBalance(address, ...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getLUSDBalance(address, ...extraParams));\n }\n async getLQTYBalance(address, ...extraParams) {\n var _a;\n return ((_a = this._cache.getLQTYBalance(address, ...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getLQTYBalance(address, ...extraParams));\n }\n async getUniTokenBalance(address, ...extraParams) {\n var _a;\n return ((_a = this._cache.getUniTokenBalance(address, ...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getUniTokenBalance(address, ...extraParams));\n }\n async getUniTokenAllowance(address, ...extraParams) {\n var _a;\n return ((_a = this._cache.getUniTokenAllowance(address, ...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getUniTokenAllowance(address, ...extraParams));\n }\n async getRemainingLiquidityMiningLQTYReward(...extraParams) {\n var _a;\n return ((_a = this._cache.getRemainingLiquidityMiningLQTYReward(...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getRemainingLiquidityMiningLQTYReward(...extraParams));\n }\n async getLiquidityMiningStake(address, ...extraParams) {\n var _a;\n return ((_a = this._cache.getLiquidityMiningStake(address, ...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getLiquidityMiningStake(address, ...extraParams));\n }\n async getTotalStakedUniTokens(...extraParams) {\n var _a;\n return ((_a = this._cache.getTotalStakedUniTokens(...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getTotalStakedUniTokens(...extraParams));\n }\n async getLiquidityMiningLQTYReward(address, ...extraParams) {\n var _a;\n return ((_a = this._cache.getLiquidityMiningLQTYReward(address, ...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getLiquidityMiningLQTYReward(address, ...extraParams));\n }\n async getCollateralSurplusBalance(address, ...extraParams) {\n var _a;\n return ((_a = this._cache.getCollateralSurplusBalance(address, ...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getCollateralSurplusBalance(address, ...extraParams));\n }\n async getTroves(params, ...extraParams) {\n var _a;\n const { beforeRedistribution, ...restOfParams } = params;\n const [totalRedistributed, troves] = await Promise.all([\n beforeRedistribution ? undefined : this.getTotalRedistributed(...extraParams),\n (_a = this._cache.getTroves({ beforeRedistribution: true, ...restOfParams }, ...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getTroves({ beforeRedistribution: true, ...restOfParams }, ...extraParams)\n ]);\n if (totalRedistributed) {\n return troves.map(trove => trove.applyRedistribution(totalRedistributed));\n }\n else {\n return troves;\n }\n }\n async getFees(...extraParams) {\n var _a;\n return (_a = this._cache.getFees(...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getFees(...extraParams);\n }\n async getLQTYStake(address, ...extraParams) {\n var _a;\n return ((_a = this._cache.getLQTYStake(address, ...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getLQTYStake(address, ...extraParams));\n }\n async getTotalStakedLQTY(...extraParams) {\n var _a;\n return ((_a = this._cache.getTotalStakedLQTY(...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getTotalStakedLQTY(...extraParams));\n }\n async getFrontendStatus(address, ...extraParams) {\n var _a;\n return ((_a = this._cache.getFrontendStatus(address, ...extraParams)) !== null && _a !== void 0 ? _a : this._readable.getFrontendStatus(address, ...extraParams));\n }\n}\nexports._CachedReadableLiquity = _CachedReadableLiquity;\n//# sourceMappingURL=_CachedReadableLiquity.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports._connectToMulticall = void 0;\nconst contracts_1 = require(\"@ethersproject/contracts\");\nconst multicallAbi = [\n {\n constant: true,\n inputs: [],\n name: \"getCurrentBlockTimestamp\",\n outputs: [\n {\n name: \"timestamp\",\n type: \"uint256\"\n }\n ],\n payable: false,\n stateMutability: \"view\",\n type: \"function\"\n }\n];\nconst multicallAddress = {\n 1: \"0xeefba1e63905ef1d7acba5a8513c70307c1ce441\",\n 3: \"0x53c43764255c17bd724f74c4ef150724ac50a3ed\",\n 4: \"0x42ad527de7d4e9d9d011ac45b31d8551f8fe9821\",\n 5: \"0x77dca2c955b15e9de4dbbcf1246b4b85b651e50e\",\n 42: \"0x2cc8688c5f75e365aaeeb4ea8d6a480405a48d2a\"\n};\nconst hasMulticall = (chainId) => chainId in multicallAddress;\nconst _connectToMulticall = (signerOrProvider, chainId) => hasMulticall(chainId)\n ? new contracts_1.Contract(multicallAddress[chainId], multicallAbi, signerOrProvider)\n : undefined;\nexports._connectToMulticall = _connectToMulticall;\n//# sourceMappingURL=_Multicall.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ObservableEthersLiquity = void 0;\nconst EthersLiquityConnection_1 = require(\"./EthersLiquityConnection\");\nconst debouncingDelayMs = 50;\nconst debounce = (listener) => {\n let timeoutId = undefined;\n let latestBlock = 0;\n return (...args) => {\n const event = args[args.length - 1];\n if (event.blockNumber !== undefined && event.blockNumber > latestBlock) {\n latestBlock = event.blockNumber;\n }\n if (timeoutId !== undefined) {\n clearTimeout(timeoutId);\n }\n timeoutId = setTimeout(() => {\n listener(latestBlock);\n timeoutId = undefined;\n }, debouncingDelayMs);\n };\n};\n/** @alpha */\nclass ObservableEthersLiquity {\n constructor(readable) {\n this._readable = readable;\n }\n watchTotalRedistributed(onTotalRedistributedChanged) {\n const { activePool, defaultPool } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n const etherSent = activePool.filters.EtherSent();\n const redistributionListener = debounce((blockTag) => {\n this._readable.getTotalRedistributed({ blockTag }).then(onTotalRedistributedChanged);\n });\n const etherSentListener = (toAddress, _amount, event) => {\n if (toAddress === defaultPool.address) {\n redistributionListener(event);\n }\n };\n activePool.on(etherSent, etherSentListener);\n return () => {\n activePool.removeListener(etherSent, etherSentListener);\n };\n }\n watchTroveWithoutRewards(onTroveChanged, address) {\n address !== null && address !== void 0 ? address : (address = EthersLiquityConnection_1._requireAddress(this._readable.connection));\n const { troveManager, borrowerOperations } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n const troveUpdatedByTroveManager = troveManager.filters.TroveUpdated(address);\n const troveUpdatedByBorrowerOperations = borrowerOperations.filters.TroveUpdated(address);\n const troveListener = debounce((blockTag) => {\n this._readable.getTroveBeforeRedistribution(address, { blockTag }).then(onTroveChanged);\n });\n troveManager.on(troveUpdatedByTroveManager, troveListener);\n borrowerOperations.on(troveUpdatedByBorrowerOperations, troveListener);\n return () => {\n troveManager.removeListener(troveUpdatedByTroveManager, troveListener);\n borrowerOperations.removeListener(troveUpdatedByBorrowerOperations, troveListener);\n };\n }\n watchNumberOfTroves(onNumberOfTrovesChanged) {\n const { troveManager } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n const { TroveUpdated } = troveManager.filters;\n const troveUpdated = TroveUpdated();\n const troveUpdatedListener = debounce((blockTag) => {\n this._readable.getNumberOfTroves({ blockTag }).then(onNumberOfTrovesChanged);\n });\n troveManager.on(troveUpdated, troveUpdatedListener);\n return () => {\n troveManager.removeListener(troveUpdated, troveUpdatedListener);\n };\n }\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n watchPrice(onPriceChanged) {\n // TODO revisit\n // We no longer have our own PriceUpdated events. If we want to implement this in an event-based\n // manner, we'll need to listen to aggregator events directly. Or we could do polling.\n throw new Error(\"Method not implemented.\");\n }\n watchTotal(onTotalChanged) {\n const { troveManager } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n const { TroveUpdated } = troveManager.filters;\n const troveUpdated = TroveUpdated();\n const totalListener = debounce((blockTag) => {\n this._readable.getTotal({ blockTag }).then(onTotalChanged);\n });\n troveManager.on(troveUpdated, totalListener);\n return () => {\n troveManager.removeListener(troveUpdated, totalListener);\n };\n }\n watchStabilityDeposit(onStabilityDepositChanged, address) {\n address !== null && address !== void 0 ? address : (address = EthersLiquityConnection_1._requireAddress(this._readable.connection));\n const { activePool, stabilityPool } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n const { UserDepositChanged } = stabilityPool.filters;\n const { EtherSent } = activePool.filters;\n const userDepositChanged = UserDepositChanged(address);\n const etherSent = EtherSent();\n const depositListener = debounce((blockTag) => {\n this._readable.getStabilityDeposit(address, { blockTag }).then(onStabilityDepositChanged);\n });\n const etherSentListener = (toAddress, _amount, event) => {\n if (toAddress === stabilityPool.address) {\n // Liquidation while Stability Pool has some deposits\n // There may be new gains\n depositListener(event);\n }\n };\n stabilityPool.on(userDepositChanged, depositListener);\n activePool.on(etherSent, etherSentListener);\n return () => {\n stabilityPool.removeListener(userDepositChanged, depositListener);\n activePool.removeListener(etherSent, etherSentListener);\n };\n }\n watchLUSDInStabilityPool(onLUSDInStabilityPoolChanged) {\n const { lusdToken, stabilityPool } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n const { Transfer } = lusdToken.filters;\n const transferLUSDFromStabilityPool = Transfer(stabilityPool.address);\n const transferLUSDToStabilityPool = Transfer(null, stabilityPool.address);\n const stabilityPoolLUSDFilters = [transferLUSDFromStabilityPool, transferLUSDToStabilityPool];\n const stabilityPoolLUSDListener = debounce((blockTag) => {\n this._readable.getLUSDInStabilityPool({ blockTag }).then(onLUSDInStabilityPoolChanged);\n });\n stabilityPoolLUSDFilters.forEach(filter => lusdToken.on(filter, stabilityPoolLUSDListener));\n return () => stabilityPoolLUSDFilters.forEach(filter => lusdToken.removeListener(filter, stabilityPoolLUSDListener));\n }\n watchLUSDBalance(onLUSDBalanceChanged, address) {\n address !== null && address !== void 0 ? address : (address = EthersLiquityConnection_1._requireAddress(this._readable.connection));\n const { lusdToken } = EthersLiquityConnection_1._getContracts(this._readable.connection);\n const { Transfer } = lusdToken.filters;\n const transferLUSDFromUser = Transfer(address);\n const transferLUSDToUser = Transfer(null, address);\n const lusdTransferFilters = [transferLUSDFromUser, transferLUSDToUser];\n const lusdTransferListener = debounce((blockTag) => {\n this._readable.getLUSDBalance(address, { blockTag }).then(onLUSDBalanceChanged);\n });\n lusdTransferFilters.forEach(filter => lusdToken.on(filter, lusdTransferListener));\n return () => lusdTransferFilters.forEach(filter => lusdToken.removeListener(filter, lusdTransferListener));\n }\n}\nexports.ObservableEthersLiquity = ObservableEthersLiquity;\n//# sourceMappingURL=ObservableEthersLiquity.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.logsToString = void 0;\nconst bignumber_1 = require(\"@ethersproject/bignumber\");\nconst constants_1 = require(\"@ethersproject/constants\");\nconst lib_base_1 = require(\"@liquity/lib-base\");\nconst interfaceLookupFrom = (contractLookup) => {\n return Object.fromEntries(Object.entries(contractLookup).map(([, contract]) => [contract.address, contract.interface]));\n};\nconst nameLookupFrom = (contractLookup) => {\n return Object.fromEntries(Object.entries(contractLookup).map(([name, contract]) => [contract.address, name]));\n};\nconst tryToParseLog = (log, interfaceLookup) => {\n const { address } = log;\n if (address in interfaceLookup) {\n try {\n return { address, logDescription: interfaceLookup[address].parseLog(log) };\n }\n catch (err) {\n console.warn(\"Failed to parse log:\");\n console.warn(log);\n console.warn(\"Caught:\");\n console.warn(err);\n }\n }\n};\nconst parseLogs = (logs, interfaceLookup) => {\n const parsedLogs = [];\n const unparsedLogs = [];\n logs.forEach(log => {\n const parsedLog = tryToParseLog(log, interfaceLookup);\n if (parsedLog) {\n parsedLogs.push(parsedLog);\n }\n else {\n unparsedLogs.push(log);\n }\n });\n return [parsedLogs, unparsedLogs];\n};\nconst VERY_BIG = bignumber_1.BigNumber.from(10).pow(9);\nconst prettify = (arg, nameLookup) => {\n if (bignumber_1.BigNumber.isBigNumber(arg)) {\n if (arg.gte(VERY_BIG)) {\n return `${lib_base_1.Decimal.fromBigNumberString(arg.toHexString())}e18`;\n }\n else {\n return arg.toString();\n }\n }\n else if (typeof arg === \"string\") {\n return arg === constants_1.AddressZero\n ? \"address(0)\"\n : nameLookup && arg in nameLookup\n ? nameLookup[arg]\n : arg;\n }\n else {\n return String(arg);\n }\n};\nconst logDescriptionToString = (logDescription, nameLookup) => {\n const prettyEntries = Object.entries(logDescription.args)\n .filter(([key]) => !key.match(/^[0-9]/))\n .map(([key, value]) => `${key}: ${prettify(value, nameLookup)}`);\n return `${logDescription.name}({ ${prettyEntries.join(\", \")} })`;\n};\nconst logsToString = (receipt, contracts) => {\n const contractLookup = contracts;\n const interfaceLookup = interfaceLookupFrom(contractLookup);\n const contractNameLookup = nameLookupFrom(contractLookup);\n const nameLookup = {\n [receipt.from]: \"user\",\n ...contractNameLookup\n };\n const [parsedLogs, unparsedLogs] = parseLogs(receipt.logs, interfaceLookup);\n if (unparsedLogs.length > 0) {\n console.warn(\"Warning: not all logs were parsed. Unparsed logs:\");\n console.warn(unparsedLogs);\n }\n if (parsedLogs.length > 0) {\n return (`Logs of tx ${receipt.transactionHash}:\\n` +\n parsedLogs\n .map(({ address, logDescription }) => ` ${contractNameLookup[address]}.${logDescriptionToString(logDescription, nameLookup)}`)\n .join(\"\\n\"));\n }\n else {\n return `No logs were parsed in tx ${receipt.transactionHash}`;\n }\n};\nexports.logsToString = logsToString;\n//# sourceMappingURL=parseLogs.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EthersLiquity = exports.EthersTransactionFailedError = void 0;\nconst lib_base_1 = require(\"@liquity/lib-base\");\nconst EthersLiquityConnection_1 = require(\"./EthersLiquityConnection\");\nconst PopulatableEthersLiquity_1 = require(\"./PopulatableEthersLiquity\");\nconst ReadableEthersLiquity_1 = require(\"./ReadableEthersLiquity\");\nconst SendableEthersLiquity_1 = require(\"./SendableEthersLiquity\");\n/**\n * Thrown by {@link EthersLiquity} in case of transaction failure.\n *\n * @public\n */\nclass EthersTransactionFailedError extends lib_base_1.TransactionFailedError {\n constructor(message, failedReceipt) {\n super(\"EthersTransactionFailedError\", message, failedReceipt);\n }\n}\nexports.EthersTransactionFailedError = EthersTransactionFailedError;\nconst waitForSuccess = async (tx) => {\n const receipt = await tx.waitForReceipt();\n if (receipt.status !== \"succeeded\") {\n throw new EthersTransactionFailedError(\"Transaction failed\", receipt);\n }\n return receipt.details;\n};\n/**\n * Convenience class that combines multiple interfaces of the library in one object.\n *\n * @public\n */\nclass EthersLiquity {\n /** @internal */\n constructor(readable) {\n this._readable = readable;\n this.connection = readable.connection;\n this.populate = new PopulatableEthersLiquity_1.PopulatableEthersLiquity(readable);\n this.send = new SendableEthersLiquity_1.SendableEthersLiquity(this.populate);\n }\n /** @internal */\n static _from(connection) {\n if (EthersLiquityConnection_1._usingStore(connection)) {\n return new _EthersLiquityWithStore(ReadableEthersLiquity_1.ReadableEthersLiquity._from(connection));\n }\n else {\n return new EthersLiquity(ReadableEthersLiquity_1.ReadableEthersLiquity._from(connection));\n }\n }\n static async connect(signerOrProvider, optionalParams) {\n return EthersLiquity._from(await EthersLiquityConnection_1._connect(signerOrProvider, optionalParams));\n }\n hasStore() {\n return false;\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getTotalRedistributed} */\n getTotalRedistributed(overrides) {\n return this._readable.getTotalRedistributed(overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getTroveBeforeRedistribution} */\n getTroveBeforeRedistribution(address, overrides) {\n return this._readable.getTroveBeforeRedistribution(address, overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getTrove} */\n getTrove(address, overrides) {\n return this._readable.getTrove(address, overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getNumberOfTroves} */\n getNumberOfTroves(overrides) {\n return this._readable.getNumberOfTroves(overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getPrice} */\n getPrice(overrides) {\n return this._readable.getPrice(overrides);\n }\n /** @internal */\n _getActivePool(overrides) {\n return this._readable._getActivePool(overrides);\n }\n /** @internal */\n _getDefaultPool(overrides) {\n return this._readable._getDefaultPool(overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getTotal} */\n getTotal(overrides) {\n return this._readable.getTotal(overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getStabilityDeposit} */\n getStabilityDeposit(address, overrides) {\n return this._readable.getStabilityDeposit(address, overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getRemainingStabilityPoolLQTYReward} */\n getRemainingStabilityPoolLQTYReward(overrides) {\n return this._readable.getRemainingStabilityPoolLQTYReward(overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getLUSDInStabilityPool} */\n getLUSDInStabilityPool(overrides) {\n return this._readable.getLUSDInStabilityPool(overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getLUSDBalance} */\n getLUSDBalance(address, overrides) {\n return this._readable.getLUSDBalance(address, overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getLQTYBalance} */\n getLQTYBalance(address, overrides) {\n return this._readable.getLQTYBalance(address, overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getUniTokenBalance} */\n getUniTokenBalance(address, overrides) {\n return this._readable.getUniTokenBalance(address, overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getUniTokenAllowance} */\n getUniTokenAllowance(address, overrides) {\n return this._readable.getUniTokenAllowance(address, overrides);\n }\n /** @internal */\n _getRemainingLiquidityMiningLQTYRewardCalculator(overrides) {\n return this._readable._getRemainingLiquidityMiningLQTYRewardCalculator(overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getRemainingLiquidityMiningLQTYReward} */\n getRemainingLiquidityMiningLQTYReward(overrides) {\n return this._readable.getRemainingLiquidityMiningLQTYReward(overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getLiquidityMiningStake} */\n getLiquidityMiningStake(address, overrides) {\n return this._readable.getLiquidityMiningStake(address, overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getTotalStakedUniTokens} */\n getTotalStakedUniTokens(overrides) {\n return this._readable.getTotalStakedUniTokens(overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getLiquidityMiningLQTYReward} */\n getLiquidityMiningLQTYReward(address, overrides) {\n return this._readable.getLiquidityMiningLQTYReward(address, overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getCollateralSurplusBalance} */\n getCollateralSurplusBalance(address, overrides) {\n return this._readable.getCollateralSurplusBalance(address, overrides);\n }\n getTroves(params, overrides) {\n return this._readable.getTroves(params, overrides);\n }\n /** @internal */\n _getBlockTimestamp(blockTag) {\n return this._readable._getBlockTimestamp(blockTag);\n }\n /** @internal */\n _getFeesFactory(overrides) {\n return this._readable._getFeesFactory(overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getFees} */\n getFees(overrides) {\n return this._readable.getFees(overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getLQTYStake} */\n getLQTYStake(address, overrides) {\n return this._readable.getLQTYStake(address, overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getTotalStakedLQTY} */\n getTotalStakedLQTY(overrides) {\n return this._readable.getTotalStakedLQTY(overrides);\n }\n /** {@inheritDoc @liquity/lib-base#ReadableLiquity.getFrontendStatus} */\n getFrontendStatus(address, overrides) {\n return this._readable.getFrontendStatus(address, overrides);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.openTrove}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n openTrove(params, maxBorrowingRateOrOptionalParams, overrides) {\n return this.send\n .openTrove(params, maxBorrowingRateOrOptionalParams, overrides)\n .then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.closeTrove}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n closeTrove(overrides) {\n return this.send.closeTrove(overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.adjustTrove}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n adjustTrove(params, maxBorrowingRateOrOptionalParams, overrides) {\n return this.send\n .adjustTrove(params, maxBorrowingRateOrOptionalParams, overrides)\n .then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.depositCollateral}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n depositCollateral(amount, overrides) {\n return this.send.depositCollateral(amount, overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.withdrawCollateral}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n withdrawCollateral(amount, overrides) {\n return this.send.withdrawCollateral(amount, overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.borrowLUSD}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n borrowLUSD(amount, maxBorrowingRate, overrides) {\n return this.send.borrowLUSD(amount, maxBorrowingRate, overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.repayLUSD}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n repayLUSD(amount, overrides) {\n return this.send.repayLUSD(amount, overrides).then(waitForSuccess);\n }\n /** @internal */\n setPrice(price, overrides) {\n return this.send.setPrice(price, overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.liquidate}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n liquidate(address, overrides) {\n return this.send.liquidate(address, overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.liquidateUpTo}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n liquidateUpTo(maximumNumberOfTrovesToLiquidate, overrides) {\n return this.send.liquidateUpTo(maximumNumberOfTrovesToLiquidate, overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.depositLUSDInStabilityPool}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n depositLUSDInStabilityPool(amount, frontendTag, overrides) {\n return this.send.depositLUSDInStabilityPool(amount, frontendTag, overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.withdrawLUSDFromStabilityPool}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n withdrawLUSDFromStabilityPool(amount, overrides) {\n return this.send.withdrawLUSDFromStabilityPool(amount, overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.withdrawGainsFromStabilityPool}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n withdrawGainsFromStabilityPool(overrides) {\n return this.send.withdrawGainsFromStabilityPool(overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.transferCollateralGainToTrove}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n transferCollateralGainToTrove(overrides) {\n return this.send.transferCollateralGainToTrove(overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.sendLUSD}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n sendLUSD(toAddress, amount, overrides) {\n return this.send.sendLUSD(toAddress, amount, overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.sendLQTY}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n sendLQTY(toAddress, amount, overrides) {\n return this.send.sendLQTY(toAddress, amount, overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.redeemLUSD}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n redeemLUSD(amount, maxRedemptionRate, overrides) {\n return this.send.redeemLUSD(amount, maxRedemptionRate, overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.claimCollateralSurplus}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n claimCollateralSurplus(overrides) {\n return this.send.claimCollateralSurplus(overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.stakeLQTY}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n stakeLQTY(amount, overrides) {\n return this.send.stakeLQTY(amount, overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.unstakeLQTY}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n unstakeLQTY(amount, overrides) {\n return this.send.unstakeLQTY(amount, overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.withdrawGainsFromStaking}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n withdrawGainsFromStaking(overrides) {\n return this.send.withdrawGainsFromStaking(overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.registerFrontend}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n registerFrontend(kickbackRate, overrides) {\n return this.send.registerFrontend(kickbackRate, overrides).then(waitForSuccess);\n }\n /** @internal */\n _mintUniToken(amount, address, overrides) {\n return this.send._mintUniToken(amount, address, overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.approveUniTokens}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n approveUniTokens(allowance, overrides) {\n return this.send.approveUniTokens(allowance, overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.stakeUniTokens}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n stakeUniTokens(amount, overrides) {\n return this.send.stakeUniTokens(amount, overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.unstakeUniTokens}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n unstakeUniTokens(amount, overrides) {\n return this.send.unstakeUniTokens(amount, overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.withdrawLQTYRewardFromLiquidityMining}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n withdrawLQTYRewardFromLiquidityMining(overrides) {\n return this.send.withdrawLQTYRewardFromLiquidityMining(overrides).then(waitForSuccess);\n }\n /**\n * {@inheritDoc @liquity/lib-base#TransactableLiquity.exitLiquidityMining}\n *\n * @throws\n * Throws {@link EthersTransactionFailedError} in case of transaction failure.\n * Throws {@link EthersTransactionCancelledError} if the transaction is cancelled or replaced.\n */\n exitLiquidityMining(overrides) {\n return this.send.exitLiquidityMining(overrides).then(waitForSuccess);\n }\n}\nexports.EthersLiquity = EthersLiquity;\nclass _EthersLiquityWithStore extends EthersLiquity {\n constructor(readable) {\n super(readable);\n this.store = readable.store;\n }\n hasStore(store) {\n return store === undefined || store === this.connection.useStore;\n }\n}\n//# sourceMappingURL=EthersLiquity.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useLiquityReducer = void 0;\nconst react_1 = require(\"react\");\nconst equals_1 = require(\"../utils/equals\");\nconst useLiquityStore_1 = require(\"./useLiquityStore\");\nconst useLiquityReducer = (reduce, init) => {\n const store = useLiquityStore_1.useLiquityStore();\n const oldStore = react_1.useRef(store);\n const state = react_1.useRef(init(store.state));\n const [, rerender] = react_1.useReducer(() => ({}), {});\n const dispatch = react_1.useCallback((action) => {\n const newState = reduce(state.current, action);\n if (!equals_1.equals(newState, state.current)) {\n state.current = newState;\n rerender();\n }\n }, [reduce]);\n react_1.useEffect(() => store.subscribe(params => dispatch({ type: \"updateStore\", ...params })), [\n store,\n dispatch\n ]);\n if (oldStore.current !== store) {\n state.current = init(store.state);\n oldStore.current = store;\n }\n return [state.current, dispatch];\n};\nexports.useLiquityReducer = useLiquityReducer;\n//# sourceMappingURL=useLiquityReducer.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.useLiquitySelector = void 0;\nconst react_1 = require(\"react\");\nconst equals_1 = require(\"../utils/equals\");\nconst useLiquityStore_1 = require(\"./useLiquityStore\");\nconst useLiquitySelector = (select) => {\n const store = useLiquityStore_1.useLiquityStore();\n const [, rerender] = react_1.useReducer(() => ({}), {});\n react_1.useEffect(() => store.subscribe(({ newState, oldState }) => {\n if (!equals_1.equals(select(newState), select(oldState))) {\n rerender();\n }\n }), [store, select]);\n return select(store.state);\n};\nexports.useLiquitySelector = useLiquitySelector;\n//# sourceMappingURL=useLiquitySelector.js.map","import { AddressZero } from \"@ethersproject/constants\";\nimport { isAddress, getAddress } from \"@ethersproject/address\";\n\nexport type LiquityFrontendConfig = {\n frontendTag: string;\n infuraApiKey?: string;\n testnetOnly?: boolean;\n};\n\nconst defaultConfig: LiquityFrontendConfig = {\n frontendTag: AddressZero\n};\n\nfunction hasKey(o: object, k: K): o is Record {\n return k in o;\n}\n\nconst parseConfig = (json: unknown): LiquityFrontendConfig => {\n const config = { ...defaultConfig };\n\n if (typeof json === \"object\" && json !== null) {\n if (hasKey(json, \"frontendTag\") && json.frontendTag !== \"\") {\n const { frontendTag } = json;\n\n if (typeof frontendTag === \"string\" && isAddress(frontendTag)) {\n config.frontendTag = getAddress(frontendTag);\n } else {\n console.error(\"Malformed frontendTag:\");\n console.log(frontendTag);\n }\n }\n\n if (hasKey(json, \"infuraApiKey\") && json.infuraApiKey !== \"\") {\n const { infuraApiKey } = json;\n\n if (typeof infuraApiKey === \"string\") {\n config.infuraApiKey = infuraApiKey;\n } else {\n console.error(\"Malformed infuraApiKey:\");\n console.log(infuraApiKey);\n }\n }\n\n if (hasKey(json, \"testnetOnly\")) {\n const { testnetOnly } = json;\n\n if (typeof testnetOnly === \"boolean\") {\n config.testnetOnly = testnetOnly;\n } else {\n console.error(\"Malformed testnetOnly:\");\n console.log(testnetOnly);\n }\n }\n } else {\n console.error(\"Malformed config:\");\n console.log(json);\n }\n\n return config;\n};\n\nlet configPromise: Promise | undefined = undefined;\n\nconst fetchConfig = async () => {\n try {\n const response = await fetch(\"config.json\");\n\n if (!response.ok) {\n throw new Error(`Failed to fetch config.json (status ${response.status})`);\n }\n\n return parseConfig(await response.json());\n } catch (err) {\n console.error(err);\n return { ...defaultConfig };\n }\n};\n\nexport const getConfig = (): Promise => {\n if (!configPromise) {\n configPromise = fetchConfig();\n }\n\n return configPromise;\n};\n","import React, { createContext, useContext, useEffect, useMemo, useState } from \"react\";\nimport { Provider } from \"@ethersproject/abstract-provider\";\nimport { getNetwork } from \"@ethersproject/networks\";\nimport { Web3Provider } from \"@ethersproject/providers\";\nimport { useWeb3React } from \"@web3-react/core\";\n\nimport { isBatchedProvider, isWebSocketAugmentedProvider } from \"@liquity/providers\";\nimport {\n BlockPolledLiquityStore,\n EthersLiquity,\n EthersLiquityWithStore,\n _connectByChainId\n} from \"@liquity/lib-ethers\";\n\nimport { LiquityFrontendConfig, getConfig } from \"../config\";\n\ntype LiquityContextValue = {\n config: LiquityFrontendConfig;\n account: string;\n provider: Provider;\n liquity: EthersLiquityWithStore;\n collateral?: string; // Add \"word\" property with an optional string type\n chainId: number; // JJ\n\n};\n\nconst LiquityContext = createContext(undefined);\n\ntype LiquityProviderProps = {\n loader?: React.ReactNode;\n unsupportedNetworkFallback?: (chainId: number) => React.ReactNode;\n unsupportedMainnetFallback?: React.ReactNode;\n};\n\nconst wsParams = (network: string, infuraApiKey: string): [string, string] => [\n `wss://${network === \"homestead\" ? \"mainnet\" : network}.infura.io/ws/v3/${infuraApiKey}`,\n network\n];\n\nconst webSocketSupportedNetworks = [\"homestead\", \"kovan\", \"rinkeby\", \"ropsten\"];\n\nexport const LiquityProvider: React.FC = ({\n children,\n loader,\n unsupportedNetworkFallback,\n unsupportedMainnetFallback\n}) => {\n const { library: provider, account, chainId } = useWeb3React();\n const [config, setConfig] = useState();\n const [collateral, setCollateral] = useState(); // Define the \"word\" state\n\n const connection = useMemo(() => {\n if (config && provider && account && chainId) {\n try {\n // Define the conditions to set \"word\" based on \"chainId\"\n if (chainId === 40) {\n setCollateral(\"TLOS\");\n } else if (chainId === 8453) {\n setCollateral(\"ETH\");\n } else if (chainId === 122) {\n setCollateral(\"FUSE\");\n } else if (chainId === 11820) {\n setCollateral(\"ART\");\n } else if (chainId === 841) {\n setCollateral(\"TARA\");\n } else if (chainId === 810181) {\n setCollateral(\"ETH\");\n }\n return _connectByChainId(provider, provider.getSigner(account), chainId, {\n userAddress: account,\n frontendTag: config.frontendTag,\n useStore: \"blockPolled\"\n });\n } catch { }\n }\n }, [config, provider, account, chainId]);\n\n useEffect(() => {\n getConfig().then(setConfig);\n }, []);\n\n useEffect(() => {\n if (config && connection) {\n const { provider, chainId } = connection;\n\n // Rest of your existing code...\n }\n }, [config, connection]);\n\n if (!config || !provider || !account || !chainId) {\n return <>{loader};\n }\n\n if (config.testnetOnly && chainId === 1) {\n return <>{unsupportedMainnetFallback};\n }\n\n if (!connection) {\n return unsupportedNetworkFallback ? <>{unsupportedNetworkFallback(chainId)} : null;\n }\n\n const liquity = EthersLiquity._from(connection);\n liquity.store.logging = true;\n\n return (\n {/* Add \"word\" to the context value */}\n {children}\n \n );\n};\n\nexport const useLiquity = () => {\n const liquityContext = useContext(LiquityContext);\n\n if (!liquityContext) {\n throw new Error(\"You must provide a LiquityContext via LiquityProvider\");\n }\n\n return liquityContext;\n};\n","import { InjectedConnector } from \"@web3-react/injected-connector\";\n\nexport const injectedConnector = new InjectedConnector({});\n","import React from \"react\";\nimport { library, IconName, IconProp } from \"@fortawesome/fontawesome-svg-core\";\nimport {\n faCircleNotch,\n faCheckCircle,\n faExclamationTriangle,\n faInfoCircle,\n faTimes,\n faTrash,\n faChartLine,\n faRedo,\n faHistory,\n faChevronLeft,\n faChevronRight,\n faUserCircle,\n faWallet,\n faExternalLinkAlt,\n faClipboardCheck,\n faCog,\n faCheck,\n faPlug,\n faExclamationCircle,\n faAngleUp,\n faAngleDoubleUp,\n faAngleDown,\n faAngleDoubleDown,\n faPen,\n faHandPaper,\n faHeartbeat,\n faBars\n} from \"@fortawesome/free-solid-svg-icons\";\nimport { faClipboard, faQuestionCircle } from \"@fortawesome/free-regular-svg-icons\";\nimport { FontAwesomeIcon, FontAwesomeIconProps } from \"@fortawesome/react-fontawesome\";\n\nlibrary.add(\n faCircleNotch,\n faCheck,\n faCheckCircle,\n faExclamationTriangle,\n faInfoCircle,\n faTimes,\n faTrash,\n faChartLine,\n faRedo,\n faHistory,\n faChevronLeft,\n faChevronRight,\n faClipboard,\n faClipboardCheck,\n faUserCircle,\n faWallet,\n faExternalLinkAlt,\n faCog,\n faPlug,\n faExclamationCircle,\n faAngleUp,\n faAngleDoubleUp,\n faAngleDown,\n faAngleDoubleDown,\n faPen,\n faHandPaper,\n faHeartbeat,\n faBars,\n faQuestionCircle\n);\n\nconst getIcon = (name: IconName): IconProp => {\n switch (name) {\n case \"clipboard\":\n return [\"far\", \"clipboard\"];\n case \"question-circle\":\n return [\"far\", \"question-circle\"];\n default:\n return name;\n }\n};\n\nexport type IconProps = Pick & {\n name: IconName;\n};\n\nexport const Icon: React.FC = ({ name, style, ...rest }) => (\n \n);\n","import React from \"react\";\nimport { Heading, Flex, Card, Button, Box } from \"theme-ui\";\n\nimport { Icon } from \"./Icon\";\n\ntype DialogIntent = \"success\" | \"warning\" | \"danger\" | \"info\";\n\ntype DialogProps = {\n intent?: DialogIntent;\n title: string;\n icon?: React.ReactNode;\n cancelLabel?: string;\n onCancel: () => void;\n};\n\nconst iconFromIntent = (intent: DialogIntent | undefined) => {\n switch (intent) {\n case \"success\":\n return ;\n case \"warning\":\n return ;\n case \"danger\":\n return ;\n case \"info\":\n return ;\n }\n return null;\n};\n\nexport const Dialog: React.FC = ({\n intent,\n title,\n icon,\n cancelLabel,\n onCancel,\n children\n}) => (\n \n {intent ? : null}\n \n {icon || iconFromIntent(intent)}\n \n {title}\n \n \n \n {children}\n \n);\n","import React from \"react\";\nimport { Box, Button, Flex } from \"theme-ui\";\n\nimport { Dialog } from \"./Dialog\";\n\ntype RetryDialogProps = {\n title: string;\n cancelLabel?: string;\n retryLabel?: string;\n onCancel: () => void;\n onRetry: () => void;\n};\n\nexport const RetryDialog: React.FC = ({\n title,\n cancelLabel,\n onCancel,\n retryLabel,\n onRetry,\n children\n}) => (\n \n {children}\n \n \n {cancelLabel || \"Cancel\"}\n \n \n \n \n);\n","import React from \"react\";\nimport { Box, Flex, Spinner } from \"theme-ui\";\n\nimport { Dialog } from \"./Dialog\";\n\ntype WaitingDialogProps = {\n title: string;\n icon?: React.ReactNode;\n waitReason: React.ReactNode;\n cancelLabel?: string;\n onCancel: () => void;\n};\n\nexport const WaitingDialog: React.FC = ({\n title,\n icon,\n waitReason,\n cancelLabel,\n onCancel,\n children\n}) => (\n \n {children}\n \n \n \n \n {waitReason}\n \n \n \n \n);\n","import React from \"react\";\nimport { Text, Box } from \"theme-ui\";\nimport { WaitingDialog } from \"./WaitingDialog\";\n\ntype ConnectionConfirmationDialogProps = {\n title: string;\n icon?: React.ReactNode;\n onCancel: () => void;\n};\n\nexport const ConnectionConfirmationDialog: React.FC = ({\n title,\n icon,\n onCancel,\n children\n}) => (\n \n Waiting for connection confirmation...\n \n }\n cancelLabel=\"Cancel connection\"\n onCancel={onCancel}\n >\n {children}\n \n);\n","import React from \"react\";\n\nexport const MetaMaskIcon: React.FC = () => (\n \n MetaMask extension icon\n \n \n \n \n \n);\n","import React from \"react\";\nimport { Container } from \"theme-ui\";\n\nexport const Modal: React.FC = ({ children }) => (\n \n {children}\n \n);\n","\n\nimport React, { useEffect, useReducer } from \"react\";\nimport { useWeb3React } from \"@web3-react/core\";\nimport { AbstractConnector } from \"@web3-react/abstract-connector\";\nimport { Button, Text, Flex, Link, Box } from \"theme-ui\";\n\nimport { injectedConnector } from \"../connectors/injectedConnector\";\nimport { useAuthorizedConnection } from \"../hooks/useAuthorizedConnection\";\n\nimport { RetryDialog } from \"./RetryDialog\";\nimport { ConnectionConfirmationDialog } from \"./ConnectionConfirmationDialog\";\nimport { MetaMaskIcon } from \"./MetaMaskIcon\";\nimport { Icon } from \"./Icon\";\nimport { Modal } from \"./Modal\";\n\n\nconst dappUrl = \"https://testnet.meridianfinance.net/\";\nconst encodedDappUrl = encodeURIComponent(dappUrl);\nconst deepLink = \"okx://wallet/dapp/url?dappUrl=\" + encodedDappUrl;\nconst encodedUrl = \"https://www.okx.com/download?deeplink=\" + encodeURIComponent(deepLink);\n\n\ninterface MaybeHasMetaMask {\n ethereum?: {\n isMetaMask?: boolean;\n };\n}\n\ntype ConnectionState =\n | { type: \"inactive\" }\n | {\n type: \"activating\" | \"active\" | \"rejectedByUser\" | \"alreadyPending\" | \"failed\";\n connector: AbstractConnector;\n }\n | { type: \"waitingForAgreement\"; connector: AbstractConnector };\n\ntype ConnectionAction =\n | { type: \"startActivating\" | \"agreeToTerms\"; connector: AbstractConnector }\n | { type: \"fail\"; error: Error }\n | { type: \"finishActivating\" | \"retry\" | \"cancel\" | \"deactivate\" };\n\nconst connectionReducer: React.Reducer = (state, action) => {\n switch (action.type) {\n case \"startActivating\":\n if (state.type === \"waitingForAgreement\") {\n return {\n type: \"activating\",\n connector: action.connector\n };\n }\n return {\n type: \"waitingForAgreement\",\n connector: action.connector\n };\n\n case \"agreeToTerms\":\n if (state.type === \"waitingForAgreement\") {\n return {\n type: \"activating\",\n connector: state.connector\n };\n }\n break;\n case \"finishActivating\":\n return {\n type: \"active\",\n connector: state.type === \"inactive\" ? injectedConnector : state.connector\n };\n case \"fail\":\n if (state.type !== \"inactive\") {\n return {\n type: action.error.message.match(/user rejected/i)\n ? \"rejectedByUser\"\n : action.error.message.match(/already pending/i)\n ? \"alreadyPending\"\n : \"failed\",\n connector: state.connector\n };\n }\n break;\n case \"retry\":\n if (state.type !== \"inactive\") {\n return {\n type: \"activating\",\n connector: state.connector\n };\n }\n break;\n case \"cancel\":\n return {\n type: \"inactive\"\n };\n case \"deactivate\":\n return {\n type: \"inactive\"\n };\n }\n\n console.warn(\"Ignoring connectionReducer action:\");\n console.log(action);\n console.log(\" in state:\");\n console.log(state);\n\n return state;\n};\n\nconst detectMetaMask = () => (window as MaybeHasMetaMask).ethereum?.isMetaMask ?? false;\n\ntype WalletConnectorProps = {\n loader?: React.ReactNode;\n};\n\nexport const WalletConnector: React.FC = ({ children, loader }) => {\n const { activate, deactivate, active, error } = useWeb3React();\n const triedAuthorizedConnection = useAuthorizedConnection();\n const [connectionState, dispatch] = useReducer(connectionReducer, { type: \"inactive\" });\n const isMetaMask = detectMetaMask();\n\n useEffect(() => {\n if (error) {\n dispatch({ type: \"fail\", error });\n deactivate();\n }\n }, [error, deactivate]);\n\n useEffect(() => {\n if (active) {\n dispatch({ type: \"finishActivating\" });\n } else {\n dispatch({ type: \"deactivate\" });\n }\n }, [active]);\n\n if (!triedAuthorizedConnection) {\n return <>{loader};\n }\n\n if (connectionState.type === \"active\") {\n return <>{children};\n }\n\n const handleOKXConnect = () => {\n window.location.href = encodedUrl;\n };\n\n return (\n <>\n \n {\n dispatch({ type: \"startActivating\", connector: injectedConnector });\n activate(injectedConnector);\n }}\n >\n {isMetaMask ? (\n <>\n \n Connect Wallet\n \n ) : (\n <>\n \n Connect wallet\n \n )}\n \n \n \n\n {connectionState.type === \"failed\" && (\n \n dispatch({ type: \"cancel\" })}\n onRetry={() => {\n dispatch({ type: \"retry\" });\n activate(connectionState.connector);\n }}\n >\n \n You might need to install MetaMask or use a different browser.\n \n \n Learn more \n \n \n \n )}\n\n {connectionState.type === \"activating\" && (\n \n : }\n onCancel={() => dispatch({ type: \"cancel\" })}\n >\n \n Confirm the request that's just appeared.\n {isMetaMask ? (\n <> If you can't see a request, open your MetaMask extension via your browser.\n ) : (\n <> If you can't see a request, you might have to open your wallet.\n )}\n \n \n \n )}\n\n {connectionState.type === \"rejectedByUser\" && (\n \n dispatch({ type: \"cancel\" })}\n onRetry={() => {\n dispatch({ type: \"retry\" });\n activate(connectionState.connector);\n }}\n >\n To use Meridian, you need to connect your Metamask account.\n \n \n )}\n\n {connectionState.type === \"alreadyPending\" && (\n \n dispatch({ type: \"cancel\" })}\n onRetry={() => {\n dispatch({ type: \"retry\" });\n activate(connectionState.connector);\n }}\n >\n Please check your wallet and accept the connection request before retrying.\n \n \n )}\n \n );\n};\n","import { useState, useEffect } from \"react\";\nimport { useWeb3React } from \"@web3-react/core\";\n\nimport { injectedConnector } from \"../connectors/injectedConnector\";\n\n/**\n * React hook that tries to activate the InjectedConnector if the app's already authorized in the\n * browser's wallet (in the case of dApp-enabled browsers) or its wallet extension (e.g. MetaMask).\n *\n * Example: user has a browser with the MetaMask extension. MetaMask injects an Ethereum provider\n * into the window object. We check via InjectedConnector if our app is already authorized to use\n * the wallet through this provider, and in that case we try to activate the connector.\n *\n * @returns true when finished trying to activate the InjectedConnector, false otherwise\n */\n\nexport function useAuthorizedConnection(): boolean {\n const { activate, active } = useWeb3React();\n const [tried, setTried] = useState(false);\n\n useEffect(() => {\n const tryToActivateIfAuthorized = async () => {\n try {\n if (await injectedConnector.isAuthorized()) {\n await activate(injectedConnector, undefined, true);\n } else {\n throw new Error(\"Unauthorized\");\n }\n } catch {\n setTried(true);\n }\n };\n tryToActivateIfAuthorized();\n }, [activate]);\n\n useEffect(() => {\n if (active) {\n setTried(true);\n }\n }, [active]);\n\n return tried;\n}\n","import React, { useState, useRef } from \"react\";\nimport { VirtualElement } from \"@popperjs/core\";\nimport { usePopper } from \"react-popper\";\nimport { Card } from \"theme-ui\";\n\nexport type Hoverable = {\n onMouseOver: () => void;\n onMouseOut: () => void;\n ref: (instance: Element | VirtualElement | null) => void;\n};\n\nexport type TooltipProps = {\n children: C;\n message: string;\n placement?: \"top\" | \"bottom\" | \"left\" | \"right\";\n};\n\nexport function Tooltip>({\n children,\n message,\n placement = \"top\"\n}: TooltipProps) {\n const event = useRef<\"over\" | \"out\">();\n const [show, setShow] = useState(false);\n const [referenceElement, setReferenceElement] = useState();\n const [popperElement, setPopperElement] = useState();\n\n const { styles, attributes } = usePopper(referenceElement, popperElement, { placement });\n\n return (\n <>\n {React.cloneElement(React.Children.only(children), {\n // Use a debounced onMouseOver/onMouseOut instead of onMouseEnter/onMouseLeave to\n // work around https://github.com/facebook/react/issues/10109\n\n onMouseOver: () => {\n event.current = \"over\";\n\n if (!show) {\n setShow(true);\n }\n },\n\n onMouseOut: () => {\n event.current = \"out\";\n\n setTimeout(() => {\n if (event.current === \"out\") {\n setShow(false);\n }\n }, 0);\n },\n\n ref: setReferenceElement\n })}\n\n {show && (\n \n {message}\n \n )}\n \n );\n}\n","import React, { useState, useContext, useEffect, useCallback } from \"react\";\nimport { Flex, Text, Box } from \"theme-ui\";\nimport { Provider, TransactionResponse, TransactionReceipt } from \"@ethersproject/abstract-provider\";\nimport { hexDataSlice, hexDataLength } from \"@ethersproject/bytes\";\nimport { defaultAbiCoder } from \"@ethersproject/abi\";\n\nimport { buildStyles, CircularProgressbarWithChildren } from \"react-circular-progressbar\";\nimport \"react-circular-progressbar/dist/styles.css\";\n\nimport { EthersTransactionOverrides, EthersTransactionCancelledError } from \"@liquity/lib-ethers\";\nimport { SentLiquityTransaction, LiquityReceipt } from \"@liquity/lib-base\";\n\nimport { useLiquity } from \"../hooks/LiquityContext\";\n\nimport { Icon } from \"./Icon\";\nimport { Tooltip, TooltipProps, Hoverable } from \"./Tooltip\";\n\nconst strokeWidth = 10;\n\nconst circularProgressbarStyle = {\n strokeLinecap: \"butt\",\n pathColor: \"white\",\n trailColor: \"rgba(255, 255, 255, 0.33)\"\n};\n\nconst slowProgress = {\n strokeWidth,\n styles: buildStyles({\n ...circularProgressbarStyle,\n pathTransitionDuration: 30\n })\n};\n\nconst fastProgress = {\n strokeWidth,\n styles: buildStyles({\n ...circularProgressbarStyle,\n pathTransitionDuration: 0.75\n })\n};\n\ntype TransactionIdle = {\n type: \"idle\";\n};\n\ntype TransactionFailed = {\n type: \"failed\";\n id: string;\n error: Error;\n};\n\ntype TransactionWaitingForApproval = {\n type: \"waitingForApproval\";\n id: string;\n};\n\ntype TransactionCancelled = {\n type: \"cancelled\";\n id: string;\n};\n\ntype TransactionWaitingForConfirmations = {\n type: \"waitingForConfirmation\";\n id: string;\n tx: SentTransaction;\n};\n\ntype TransactionConfirmed = {\n type: \"confirmed\";\n id: string;\n};\n\ntype TransactionConfirmedOneShot = {\n type: \"confirmedOneShot\";\n id: string;\n};\n\ntype TransactionState =\n | TransactionIdle\n | TransactionFailed\n | TransactionWaitingForApproval\n | TransactionCancelled\n | TransactionWaitingForConfirmations\n | TransactionConfirmed\n | TransactionConfirmedOneShot;\n\nconst TransactionContext = React.createContext<\n [TransactionState, (state: TransactionState) => void] | undefined\n>(undefined);\n\nexport const TransactionProvider: React.FC = ({ children }) => {\n const transactionState = useState({ type: \"idle\" });\n return (\n {children}\n );\n};\n\nconst useTransactionState = () => {\n const transactionState = useContext(TransactionContext);\n\n if (!transactionState) {\n throw new Error(\"You must provide a TransactionContext via TransactionProvider\");\n }\n\n return transactionState;\n};\n\nexport const useMyTransactionState = (myId: string | RegExp): TransactionState => {\n const [transactionState] = useTransactionState();\n\n return transactionState.type !== \"idle\" &&\n (typeof myId === \"string\" ? transactionState.id === myId : transactionState.id.match(myId))\n ? transactionState\n : { type: \"idle\" };\n};\n\nconst hasMessage = (error: unknown): error is { message: string } =>\n typeof error === \"object\" &&\n error !== null &&\n \"message\" in error &&\n typeof (error as { message: unknown }).message === \"string\";\n\ntype ButtonlikeProps = {\n disabled?: boolean;\n variant?: string;\n onClick?: () => void;\n};\n\ntype SentTransaction = SentLiquityTransaction<\n TransactionResponse,\n LiquityReceipt\n>;\n\nexport type TransactionFunction = (\n overrides?: EthersTransactionOverrides\n) => Promise;\n\ntype TransactionProps = {\n id: string;\n tooltip?: string;\n tooltipPlacement?: TooltipProps[\"placement\"];\n showFailure?: \"asTooltip\" | \"asChildText\";\n requires?: readonly (readonly [boolean, string])[];\n send: TransactionFunction;\n children: C;\n};\n\nexport const useTransactionFunction = (\n id: string,\n send: TransactionFunction\n): [sendTransaction: () => Promise, transactionState: TransactionState] => {\n const [transactionState, setTransactionState] = useTransactionState();\n\n const sendTransaction = useCallback(async () => {\n setTransactionState({ type: \"waitingForApproval\", id });\n\n try {\n const tx = await send();\n\n setTransactionState({\n type: \"waitingForConfirmation\",\n id,\n tx\n });\n } catch (error) {\n if (hasMessage(error) && error.message.includes(\"User denied transaction signature\")) {\n setTransactionState({ type: \"cancelled\", id });\n } else {\n console.error(error);\n\n setTransactionState({\n type: \"failed\",\n id,\n error: new Error(\"Failed to send transaction (try again)\")\n });\n }\n }\n }, [send, id, setTransactionState]);\n\n return [sendTransaction, transactionState];\n};\n\nexport function Transaction>({\n id,\n tooltip,\n tooltipPlacement,\n showFailure,\n requires,\n send,\n children\n}: TransactionProps) {\n const [sendTransaction, transactionState] = useTransactionFunction(id, send);\n const trigger = React.Children.only(children);\n\n const failureReasons = (requires || [])\n .filter(([requirement]) => !requirement)\n .map(([, reason]) => reason);\n\n if (\n transactionState.type === \"waitingForApproval\" ||\n transactionState.type === \"waitingForConfirmation\"\n ) {\n failureReasons.push(\"You must wait for confirmation\");\n }\n\n showFailure =\n failureReasons.length > 0 ? showFailure ?? (tooltip ? \"asTooltip\" : \"asChildText\") : undefined;\n\n const clonedTrigger =\n showFailure === \"asChildText\"\n ? React.cloneElement(\n trigger,\n {\n disabled: true,\n variant: \"danger\"\n },\n failureReasons[0]\n )\n : showFailure === \"asTooltip\"\n ? React.cloneElement(trigger, { disabled: true })\n : React.cloneElement(trigger, { onClick: sendTransaction });\n\n if (showFailure === \"asTooltip\") {\n tooltip = failureReasons[0];\n }\n\n return tooltip ? (\n <>\n \n {clonedTrigger}\n \n \n ) : (\n clonedTrigger\n );\n}\n\n// Doesn't work on Kovan:\n// https://github.com/MetaMask/metamask-extension/issues/5579\nconst tryToGetRevertReason = async (provider: Provider, tx: TransactionReceipt) => {\n try {\n const result = await provider.call(tx, tx.blockNumber);\n\n if (hexDataLength(result) % 32 === 4 && hexDataSlice(result, 0, 4) === \"0x08c379a0\") {\n return (defaultAbiCoder.decode([\"string\"], hexDataSlice(result, 4)) as [string])[0];\n }\n } catch {\n return undefined;\n }\n};\n\nconst Donut = React.memo(\n CircularProgressbarWithChildren,\n ({ value: prev }, { value: next }) => prev === next\n);\n\ntype TransactionProgressDonutProps = {\n state: TransactionState[\"type\"];\n};\n\nconst TransactionProgressDonut: React.FC = ({ state }) => {\n const [value, setValue] = useState(0);\n const maxValue = 1;\n\n useEffect(() => {\n if (state === \"confirmed\") {\n setTimeout(() => setValue(maxValue), 40);\n } else {\n setTimeout(() => setValue(maxValue * 0.67), 20);\n }\n }, [state]);\n\n return state === \"confirmed\" ? (\n \n \n \n ) : state === \"failed\" || state === \"cancelled\" ? (\n \n \n \n ) : (\n \n \n \n );\n};\n\nexport const TransactionMonitor: React.FC = () => {\n const { provider } = useLiquity();\n const [transactionState, setTransactionState] = useTransactionState();\n\n const id = transactionState.type !== \"idle\" ? transactionState.id : undefined;\n const tx = transactionState.type === \"waitingForConfirmation\" ? transactionState.tx : undefined;\n\n useEffect(() => {\n if (id && tx) {\n let cancelled = false;\n let finished = false;\n\n const txHash = tx.rawSentTransaction.hash;\n\n const waitForConfirmation = async () => {\n try {\n const receipt = await tx.waitForReceipt();\n\n if (cancelled) {\n return;\n }\n\n const { confirmations } = receipt.rawReceipt;\n const blockNumber = receipt.rawReceipt.blockNumber + confirmations - 1;\n console.log(`Block #${blockNumber} ${confirmations}-confirms tx ${txHash}`);\n console.log(`Finish monitoring tx ${txHash}`);\n finished = true;\n\n if (receipt.status === \"succeeded\") {\n console.log(`${receipt}`);\n\n setTransactionState({\n type: \"confirmedOneShot\",\n id\n });\n } else {\n const reason = await tryToGetRevertReason(provider, receipt.rawReceipt);\n\n if (cancelled) {\n return;\n }\n\n console.error(`Tx ${txHash} failed`);\n if (reason) {\n console.error(`Revert reason: ${reason}`);\n }\n\n setTransactionState({\n type: \"failed\",\n id,\n error: new Error(reason ? `Reverted: ${reason}` : \"Failed\")\n });\n }\n } catch (rawError) {\n if (cancelled) {\n return;\n }\n\n finished = true;\n\n if (rawError instanceof EthersTransactionCancelledError) {\n console.log(`Cancelled tx ${txHash}`);\n setTransactionState({ type: \"cancelled\", id });\n } else {\n console.error(`Failed to get receipt for tx ${txHash}`);\n console.error(rawError);\n\n setTransactionState({\n type: \"failed\",\n id,\n error: new Error(\"Failed\")\n });\n }\n }\n };\n\n console.log(`Start monitoring tx ${txHash}`);\n waitForConfirmation();\n\n return () => {\n if (!finished) {\n setTransactionState({ type: \"idle\" });\n console.log(`Cancel monitoring tx ${txHash}`);\n cancelled = true;\n }\n };\n }\n }, [provider, id, tx, setTransactionState]);\n\n useEffect(() => {\n if (transactionState.type === \"confirmedOneShot\" && id) {\n // hack: the txn confirmed state lasts 5 seconds which blocks other states, review with Dani\n setTransactionState({ type: \"confirmed\", id });\n } else if (\n transactionState.type === \"confirmed\" ||\n transactionState.type === \"failed\" ||\n transactionState.type === \"cancelled\"\n ) {\n let cancelled = false;\n\n setTimeout(() => {\n if (!cancelled) {\n setTransactionState({ type: \"idle\" });\n }\n }, 5000);\n\n return () => {\n cancelled = true;\n };\n }\n }, [transactionState.type, setTransactionState, id]);\n\n if (transactionState.type === \"idle\" || transactionState.type === \"waitingForApproval\") {\n return null;\n }\n\n return (\n \n \n \n \n\n \n {transactionState.type === \"waitingForConfirmation\"\n ? \"Waiting for confirmation\"\n : transactionState.type === \"cancelled\"\n ? \"Cancelled\"\n : transactionState.type === \"failed\"\n ? transactionState.error.message\n : \"Confirmed\"}\n \n \n );\n};\n","import { Theme, ThemeUIStyleObject } from \"theme-ui\";\n\nconst baseColors = {\n blue: \"#2a375e\",\n purple: \"#364575\",\n cyan: \"#2eb6ea\",\n green: \"#28c081\",\n yellow: \"#fd9d28\",\n red: \"#dc2c10\",\n lightRed: \"#ff755f\"\n};\n\nconst colors = {\n primary: baseColors.blue,\n secondary: baseColors.purple,\n accent: baseColors.cyan,\n\n success: baseColors.green,\n warning: baseColors.yellow,\n danger: baseColors.red,\n dangerHover: baseColors.lightRed,\n info: baseColors.blue,\n invalid: \"pink\",\n\n text: \"#353535\",\n background: \"#FAFAFA\",\n muted: \"#eaebed\"\n};\n\nconst buttonBase: ThemeUIStyleObject = {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n\n \":enabled\": { cursor: \"pointer\" }\n};\n\nconst button: ThemeUIStyleObject = {\n ...buttonBase,\n\n px: \"32px\",\n py: \"12px\",\n\n color: \"white\",\n border: 1,\n\n fontWeight: \"bold\",\n\n \":disabled\": {\n opacity: 0.5\n }\n};\n\nconst buttonOutline = (color: string, hoverColor: string): ThemeUIStyleObject => ({\n color,\n borderColor: color,\n background: \"none\",\n\n \":enabled:hover\": {\n color: \"background\",\n bg: hoverColor,\n borderColor: hoverColor\n }\n});\n\nconst iconButton: ThemeUIStyleObject = {\n ...buttonBase,\n\n padding: 0,\n width: \"40px\",\n height: \"40px\",\n\n background: \"none\",\n\n \":disabled\": {\n color: \"text\",\n opacity: 0.25\n }\n};\n\nconst cardHeadingFontSize = 18.7167;\n\nconst cardGapX = [0, 3, 4];\nconst cardGapY = [3, 3, 4];\n\nconst card: ThemeUIStyleObject = {\n position: \"relative\",\n mt: cardGapY,\n border: 1,\n boxShadow: [1, null, 2]\n};\n\nconst infoCard: ThemeUIStyleObject = {\n ...card,\n\n padding: 3,\n\n borderColor: \"#ffffff\",\n background: \"linear-gradient(200deg, #ffffff, #ebebeb)\",\n\n h2: {\n mb: 2,\n fontSize: cardHeadingFontSize\n }\n};\n\nconst formBase: ThemeUIStyleObject = {\n display: \"block\",\n width: \"auto\",\n flexShrink: 0,\n padding: 2,\n fontSize: 3\n};\n\nconst formCell: ThemeUIStyleObject = {\n ...formBase,\n\n bg: \"background\",\n border: 1,\n borderColor: \"muted\",\n borderRadius: 0,\n boxShadow: [1, 2]\n};\n\nconst overlay: ThemeUIStyleObject = {\n position: \"absolute\",\n\n left: 0,\n top: 0,\n width: \"100%\",\n height: \"100%\"\n};\n\nconst modalOverlay: ThemeUIStyleObject = {\n position: \"fixed\",\n\n left: 0,\n top: 0,\n width: \"100vw\",\n height: \"100vh\"\n};\n\nconst headerGradient: ThemeUIStyleObject = {\n background: `linear-gradient(90deg, ${colors.background}, ${colors.muted})`\n};\n\nconst theme: Theme = {\n breakpoints: [\"48em\", \"52em\", \"64em\"],\n\n space: [0, 4, 8, 16, 32, 64, 128, 256, 512],\n\n fonts: {\n body: [\n \"system-ui\",\n \"-apple-system\",\n \"BlinkMacSystemFont\",\n '\"Segoe UI\"',\n \"Roboto\",\n '\"Helvetica Neue\"',\n \"sans-serif\"\n ].join(\", \"),\n heading: \"inherit\",\n monospace: \"Menlo, monospace\"\n },\n\n fontSizes: [12, 14, 16, 20, 24, 32, 48, 64, 96],\n\n fontWeights: {\n body: 400,\n heading: 600,\n\n light: 200,\n medium: 500,\n bold: 600\n },\n\n lineHeights: {\n body: 1.5,\n heading: 1.25\n },\n\n colors,\n\n borders: [0, \"1px solid\", \"2px solid\"],\n\n shadows: [\"0\", \"0px 4px 8px rgba(41, 49, 71, 0.1)\", \"0px 8px 16px rgba(41, 49, 71, 0.1)\"],\n\n text: {\n address: {\n fontFamily: \"monospace\",\n fontSize: 1\n }\n },\n\n buttons: {\n primary: {\n ...button,\n\n bg: \"primary\",\n borderColor: \"primary\",\n\n \":enabled:hover\": {\n bg: \"secondary\",\n borderColor: \"secondary\"\n }\n },\n\n outline: {\n ...button,\n ...buttonOutline(\"primary\", \"secondary\")\n },\n\n cancel: {\n ...button,\n ...buttonOutline(\"text\", \"text\"),\n\n opacity: 0.8\n },\n\n danger: {\n ...button,\n\n bg: \"danger\",\n borderColor: \"danger\",\n\n \":enabled:hover\": {\n bg: \"dangerHover\",\n borderColor: \"dangerHover\"\n }\n },\n\n icon: {\n ...iconButton,\n color: \"primary\",\n \":enabled:hover\": { color: \"accent\" }\n },\n\n dangerIcon: {\n ...iconButton,\n color: \"danger\",\n \":enabled:hover\": { color: \"dangerHover\" }\n },\n\n titleIcon: {\n ...iconButton,\n color: \"text\",\n \":enabled:hover\": { color: \"success\" }\n }\n },\n\n cards: {\n primary: {\n ...card,\n\n padding: 0,\n\n borderColor: \"muted\",\n bg: \"#ffffff\",\n\n \"> h2\": {\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n\n height: \"56px\",\n\n pl: 3,\n py: 2,\n pr: 2,\n\n bg: \"muted\",\n\n fontSize: cardHeadingFontSize\n }\n },\n\n info: {\n ...infoCard,\n\n display: [\"none\", \"block\"]\n },\n\n infoPopup: {\n ...infoCard,\n\n position: \"fixed\",\n top: 0,\n right: 3,\n left: 3,\n mt: \"72px\",\n height: \"80%\",\n overflowY: \"scroll\"\n },\n\n tooltip: {\n padding: 2,\n\n border: 1,\n borderColor: \"muted\",\n borderRadius: \"4px\",\n bg: \"background\",\n boxShadow: 2,\n\n fontSize: 1,\n color: \"text\",\n fontWeight: \"body\",\n zIndex: 1\n }\n },\n\n forms: {\n label: {\n ...formBase\n },\n\n unit: {\n ...formCell,\n\n textAlign: \"center\",\n bg: \"muted\"\n },\n\n input: {\n ...formCell,\n\n flex: 1\n },\n\n editor: {}\n },\n\n layout: {\n header: {\n display: \"flex\",\n justifyContent: \"space-between\",\n alignItems: \"stretch\",\n\n position: [\"fixed\", \"relative\"],\n width: \"100vw\",\n top: 0,\n zIndex: 1,\n\n px: [1, 1, 1, 1],\n py: [2, 2,2],\n\n ...headerGradient,\n boxShadow: [1, \"none\"]\n },\n\n footer: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n\n mt: cardGapY,\n px: 3,\n minHeight: \"72px\",\n\n bg: \"muted\"\n },\n\n main: {\n width: \"100%\",\n maxWidth: \"912px\",\n mx: \"auto\",\n mt: [\"40px\", \"40px\"],\n mb: [\"40px\", \"40px\"],\n px: cardGapX\n },\n\n columns: {\n display: \"flex\",\n flexWrap: \"wrap\",\n justifyItems: \"center\"\n },\n\n left: {\n pr: cardGapX,\n width: [\"100%\", \"58%\"]\n },\n\n right: {\n width: [\"100%\", \"42%\"]\n },\n\n actions: {\n justifyContent: \"flex-end\",\n mt: 2,\n\n button: {\n ml: 2\n }\n },\n\n disabledOverlay: {\n ...overlay,\n\n bg: \"rgba(255, 255, 255, 0.5)\"\n },\n\n modalOverlay: {\n ...modalOverlay,\n\n bg: \"rgba(0, 0, 0, 0.8)\",\n\n display: \"flex\",\n justifyContent: \"center\",\n alignItems: \"center\"\n },\n\n modal: {\n padding: 3,\n width: [\"100%\", \"40em\"]\n },\n\n infoOverlay: {\n ...modalOverlay,\n\n display: [\"block\", \"none\"],\n\n bg: \"rgba(255, 255, 255, 0.8)\"\n },\n\n infoMessage: {\n display: \"flex\",\n justifyContent: \"center\",\n m: 3,\n alignItems: \"center\",\n minWidth: \"128px\"\n },\n\n sidenav: {\n display: [\"flex\", \"none\"],\n flexDirection: \"column\",\n p: 0,\n m: 0,\n borderColor: \"muted\",\n mr: \"25vw\",\n height: \"100%\",\n ...headerGradient\n },\n\n badge: {\n border: 0,\n borderRadius: 3,\n p: 1,\n px: 2,\n backgroundColor: \"muted\",\n color: \"slate\",\n fontSize: 1,\n fontWeight: \"body\"\n }\n },\n\n styles: {\n root: {\n fontFamily: \"body\",\n lineHeight: \"body\",\n fontWeight: \"body\",\n\n height: \"100%\",\n\n \"#root\": {\n height: \"100%\"\n }\n },\n\n a: {\n color: \"primary\",\n \":hover\": { color: \"accent\" },\n textDecoration: \"none\",\n fontWeight: \"bold\"\n }\n },\n\n links: {\n nav: {\n px: 2,\n py: 1,\n fontWeight: \"medium\",\n fontSize: 2,\n textTransform: \"uppercase\",\n letterSpacing: \"2px\",\n width: [\"100%\", \"auto\"],\n mt: [3, \"auto\"]\n }\n }\n};\n\nexport default theme;","import { hexlify } from \"@ethersproject/bytes\";\nimport { Wallet } from \"@ethersproject/wallet\";\n\nimport { Decimal, Decimalish } from \"@liquity/lib-base\";\n\nexport class DisposableWalletProvider {\n private readonly url: string;\n private id: number = 0;\n\n private readonly wallet: Wallet;\n private readonly funderWallet: Wallet;\n\n private readonly ethAmount: Decimal;\n private haveFunded = false;\n\n constructor(url: string, funderPrivateKey: string, ethAmount: Decimalish = 100) {\n this.url = url;\n this.wallet = Wallet.createRandom();\n this.funderWallet = new Wallet(funderPrivateKey);\n this.ethAmount = Decimal.from(ethAmount);\n }\n\n private findWallet(address: string) {\n const wallet = [this.wallet, this.funderWallet].find(\n wallet => wallet.address.toLowerCase() === address.toLowerCase()\n );\n\n if (!wallet) {\n throw new Error(`Unknow account ${address}`);\n }\n\n return wallet;\n }\n\n private async fund() {\n return this.send(\"eth_sendTransaction\", [\n {\n from: this.funderWallet.address,\n to: this.wallet.address,\n value: this.ethAmount.hex,\n gas: hexlify(21000)\n }\n ]);\n\n // TODO maybe wait for tx to be mined (not a problem on devchains though)\n }\n\n async send(method: string, params: any[]): Promise {\n if (!this.haveFunded) {\n this.haveFunded = true;\n await this.fund();\n }\n\n switch (method) {\n case \"eth_accounts\":\n case \"eth_requestAccounts\":\n return [this.wallet.address];\n\n case \"eth_sendTransaction\":\n return this.send(\n \"eth_sendRawTransaction\",\n await Promise.all(\n params.map(async ({ from, nonce, gas, ...rest }) => {\n if (nonce === undefined) {\n nonce = await this.send(\"eth_getTransactionCount\", [from]);\n }\n\n return this.findWallet(from).signTransaction({\n from,\n nonce,\n ...(gas !== undefined ? { gasLimit: gas } : {}),\n ...rest\n });\n })\n )\n );\n }\n\n //console.log({ method, params });\n\n const response = await fetch(this.url, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n method: method,\n params: params,\n id: this.id++,\n jsonrpc: \"2.0\"\n })\n });\n\n const json = await response.json();\n\n //console.log(json);\n\n if (json.error) {\n const { message, ...rest } = json.error;\n const error = new Error(`${message} ${JSON.stringify(rest)}`);\n throw Object.assign(error, rest);\n }\n\n return json.result;\n }\n\n request({ method, params }: { method: string; params: any[] }) {\n return this.send(method, params);\n }\n}\n","export const COIN = \"USDM\";\nexport const GT = \"MST\";\nexport const LP = \"LEET LP\";\n// export const LP = \"ETH/LUSD LP\";\n","export const shortenAddress = (address: string) => address.substr(0, 6) + \"...\" + address.substr(-4);\n","import React from \"react\";\nimport { Text, Flex, Box, Heading } from \"theme-ui\";\n\nimport { LiquityStoreState } from \"@liquity/lib-base\";\nimport { useLiquitySelector } from \"@liquity/lib-react\";\n\nimport { COIN, GT } from \"../strings\";\nimport { useLiquity } from \"../hooks/LiquityContext\";\nimport { shortenAddress } from \"../utils/shortenAddress\";\n\nimport { Icon } from \"./Icon\";\n\nconst select = ({ accountBalance, lusdBalance, lqtyBalance }: LiquityStoreState) => ({\n accountBalance,\n lusdBalance,\n lqtyBalance\n});\n\nexport const UserAccount: React.FC = () => {\n const { account, collateral } = useLiquity();\n const { accountBalance, lusdBalance, lqtyBalance } = useLiquitySelector(select);\n\n return (\n \n \n \n \n Connected as\n \n {shortenAddress(account)}\n \n \n \n\n \n \n\n {([\n [collateral, accountBalance],\n [COIN, lusdBalance],\n [GT, lqtyBalance]\n ] as const).map(([currency, balance], i) => (\n \n {currency}\n {balance.prettify()}\n \n ))}\n \n \n );\n};\n","import { Decimal } from \"@liquity/lib-base\";\n\ntype CoinGeckoSimplePriceResponse = {\n [P in T]: {\n [Q in U]: number;\n };\n};\n\nconst hasProp = (o: T, p: P): o is T & { [_ in P]: unknown } => p in o;\n\nconst validateCoinGeckoSimplePriceResponse = (\n expectedCoinIds: readonly T[],\n expectedCurrencies: readonly U[],\n body: unknown\n): CoinGeckoSimplePriceResponse => {\n if (typeof body !== \"object\" || body === null) {\n throw new Error(`unexpected response from CoinGecko`);\n }\n\n for (const coinId of expectedCoinIds) {\n if (!hasProp(body, coinId)) {\n throw new Error(`coin \"${coinId}\" missing from CoinGecko response`);\n }\n\n const coinPrices = body[coinId];\n\n for (const currency of expectedCurrencies) {\n if (!hasProp(coinPrices, currency)) {\n throw new Error(`currency \"${currency}\" missing from CoinGecko response`);\n }\n\n if (typeof coinPrices[currency] !== \"number\") {\n throw new Error(`price of coin \"${coinId}\" in currency \"${currency}\" is not a number`);\n }\n }\n }\n\n return body as CoinGeckoSimplePriceResponse;\n};\n\nconst fetchCoinGeckoSimplePrice = async (\n coinIds: readonly T[],\n vsCurrencies: readonly U[]\n): Promise> => {\n const simplePriceUrl =\n \"https://api.coingecko.com/api/v3/simple/price?\" +\n new URLSearchParams({\n ids: coinIds.join(\",\"),\n vs_currencies: vsCurrencies.join(\",\")\n });\n\n const response = await window.fetch(simplePriceUrl, {\n headers: {\n accept: \"application/json\"\n }\n });\n\n if (!response.ok) {\n throw new Error(`couldn't fetch price from CoinGecko: got status ${response.status}`);\n }\n\n return validateCoinGeckoSimplePriceResponse(coinIds, vsCurrencies, await response.json());\n};\n\nexport interface LqtyPriceResponse {\n lqtyPriceUSD: Decimal;\n}\n\nexport const fetchLqtyPrice = async (): Promise => {\n const response = await fetchCoinGeckoSimplePrice([\"liquity\"] as const, [\"usd\"] as const);\n\n console.log(Decimal.from(response.liquity.usd), \"LIQUITY PRICE\")\n return {\n lqtyPriceUSD: Decimal.from(response.liquity.usd)\n };\n};\n\n\nexport interface MstPriceResponse {\n lqtyPriceUSD: Decimal;\n}\n\nexport const fetchMSTPrice = async (): Promise => {\n try {\n const url =\n \"https://api.coingecko.com/api/v3/simple/price?ids=meridian-mst&vs_currencies=usd\";\n const response = await fetch(url);\n const data = await response.json();\n\n // Access the MST price from CoinGecko using bracket notation\n const mstPrice = data[\"meridian-mst\"]?.usd || 0;\n\n return {\n lqtyPriceUSD: Decimal.from(mstPrice),\n };\n } catch (error) {\n console.error(\"Error fetching MST price:\", error);\n return {\n lqtyPriceUSD: Decimal.from(0),\n };\n }\n};\n\n\n\nexport interface TLOSYieldResponse {\n TLOSYield: Decimal;\n}\n\nexport const fetchTLOSYield = async (): Promise => {\n const url = \"https://omnidex.bmaa3ajd1gjri.eu-west-2.cs.amazonlightsail.com/stability_pool\";\n const response = await fetch(url);\n const data = await response.json();\n\n return {\n TLOSYield: Decimal.from(data.telos)\n };\n};\n\nexport interface FUSEYieldResponse {\n FUSEYield: Decimal;\n}\n\nexport const fetchFUSEYield = async (): Promise => {\n const url = \"https://omnidex.bmaa3ajd1gjri.eu-west-2.cs.amazonlightsail.com/stability_pool\";\n const response = await fetch(url);\n const data = await response.json();\n return {\n FUSEYield: Decimal.from(data.fuse)\n };\n};\n\n\nexport interface MSTMcapResponse {\n MstMcapUSD: Decimal;\n}\n\nexport interface TVLUSDResponse {\n TVLUSD: Decimal;\n}\n\n\nexport const fetchMSTMcap = async (): Promise => {\n // Get the MST price from the first function\n const { lqtyPriceUSD } = await fetchMSTPrice();\n\n // Multiply the MST price by 10,000,000\n const mcap = lqtyPriceUSD.mul(10000000);\n\n return {\n MstMcapUSD: mcap,\n };\n};\n\n\n\nexport const fetchMeridianTVL = async (): Promise => {\n const url = \"https://omnidex.bmaa3ajd1gjri.eu-west-2.cs.amazonlightsail.com/total_tvl\";\n const response = await fetch(url);\n const data = await response.json();\n\n return {\n TVLUSD: Decimal.from(data)\n };\n};\n\n\n","import React from \"react\";\nimport Tippy, { TippyProps } from \"@tippyjs/react\";\nimport { Icon } from \"./Icon\";\nimport { FontAwesomeIconProps } from \"@fortawesome/react-fontawesome\";\n\nexport type InfoIconProps = Pick &\n Pick & {\n tooltip: React.ReactNode;\n };\n\nexport const InfoIcon: React.FC = ({ placement = \"right\", tooltip, size = \"1x\" }) => {\n return (\n \n \n  \n \n \n \n );\n};\n","import React from \"react\";\nimport { Flex, Card } from \"theme-ui\";\nimport { InfoIcon } from \"./InfoIcon\";\n\ntype StatisticProps = {\n name: React.ReactNode;\n tooltip?: React.ReactNode;\n};\n\nexport const Statistic: React.FC = ({ name, tooltip, children }) => {\n return (\n \n \n {name}\n {tooltip && {tooltip}} />}\n \n {children}\n \n );\n};\n","import React, { useState, useEffect } from \"react\";\nimport { Card, Heading, Link, Box, Text } from \"theme-ui\";\nimport { AddressZero } from \"@ethersproject/constants\";\nimport { Decimal, Percent, LiquityStoreState } from \"@liquity/lib-base\";\nimport { useLiquitySelector } from \"@liquity/lib-react\";\nimport { fetchMSTPrice, fetchMSTMcap, fetchMeridianTVL } from \"./Stability/context/fetchLqtyPrice\";\n\nimport { useLiquity } from \"../hooks/LiquityContext\";\nimport { COIN, GT } from \"../strings\";\nimport { Statistic } from \"./Statistic\";\n\nconst selectBalances = ({ accountBalance, lusdBalance, lqtyBalance }: LiquityStoreState) => ({\n accountBalance,\n lusdBalance,\n lqtyBalance\n});\n\n\nconst GitHubCommit: React.FC<{ children?: string }> = ({ children }) =>\n children?.match(/[0-9a-f]{40}/) ? (\n {children.substr(0, 7)}\n ) : (\n <>unknown\n );\n\ntype SystemStatsProps = {\n variant?: string;\n showBalances?: boolean;\n};\n\nconst select = ({\n numberOfTroves,\n price,\n total,\n lusdInStabilityPool,\n borrowingRate,\n redemptionRate,\n totalStakedLQTY,\n frontend\n}: LiquityStoreState) => ({\n numberOfTroves,\n price,\n total,\n lusdInStabilityPool,\n borrowingRate,\n redemptionRate,\n totalStakedLQTY,\n kickbackRate: frontend.status === \"registered\" ? frontend.kickbackRate : null\n});\n\n\n\nexport const SystemStats: React.FC = ({ variant = \"info\", showBalances }) => {\n const {\n liquity: {\n connection: { version: contractsVersion, deploymentDate, frontendTag }\n },\n collateral\n } = useLiquity();\n\n const [lqtyPrice, setLqtyPrice] = useState(undefined);\n const [mstMcap, setMSTMcap] = useState(undefined);\n const [TVLUSD, setTVLUSD] = useState(undefined);\n\n const Balances: React.FC = () => {\n const { accountBalance, lusdBalance, lqtyBalance } = useLiquitySelector(selectBalances);\n\n return (\n \n My Account Balances\n {accountBalance.prettify(4)}\n {lusdBalance.prettify()}\n {lqtyBalance.prettify()}\n \n );\n };\n\n useEffect(() => {\n (async () => {\n try {\n // const { lqtyPriceUSD } = await fetchLqtyPrice();\n const { lqtyPriceUSD } = await fetchMSTPrice();\n const { MstMcapUSD } = await fetchMSTMcap();\n const { TVLUSD } = await fetchMeridianTVL();\n\n setLqtyPrice(lqtyPriceUSD);\n setMSTMcap(MstMcapUSD);\n setTVLUSD(TVLUSD);\n\n } catch (error) {\n console.error(error);\n }\n })();\n }, []);\n\n // if (lqtyPrice === undefined) return null;\n\n const {\n numberOfTroves,\n price,\n lusdInStabilityPool,\n total,\n borrowingRate,\n totalStakedLQTY,\n kickbackRate\n } = useLiquitySelector(select);\n\n const lusdInStabilityPoolPct =\n total.debt.nonZero && new Percent(lusdInStabilityPool.div(total.debt));\n const totalCollateralRatioPct = new Percent(total.collateralRatio(price));\n const borrowingFeePct = new Percent(borrowingRate);\n const kickbackRatePct = frontendTag === AddressZero ? \"100\" : kickbackRate?.mul(100).prettify();\n\n let decimals: number;\n\n if (collateral === \"TARA\") {\n decimals = 5;\n } else if (collateral === \"TLOS\" || collateral === \"FUSE\" || collateral === \"ART\" ) {\n decimals = 4;\n } else {\n decimals = 2;\n }\n\n\n return (\n \n {showBalances && }\n\n Meridian statistics\n\n \n Protocol\n \n\n \n {borrowingFeePct.toString(2)}\n \n\n \n {total.collateral.shorten()}  {collateral}\n \n  (${Decimal.from(total.collateral.mul(price)).shorten()})\n \n \n \n {Decimal.from(numberOfTroves).prettify(0)}\n \n \n {total.debt.shorten()}\n \n {lusdInStabilityPoolPct && (\n \n {lusdInStabilityPool.shorten()}\n  ({lusdInStabilityPoolPct.toString(1)})\n \n )}\n\n {collateral != \"FUSE\" || \"TARA\" && (\n \n {totalStakedLQTY.shorten()}\n \n )}\n \n {totalCollateralRatioPct.prettify()}\n \n \n  ${Decimal.from(price).shorten_4(decimals)}\n \n \n Average price of MST across all supported exchanges\n \n }\n >\n  ${Decimal.from(lqtyPrice || 0).shorten_4(4)}\n \n \n  ${Decimal.from(mstMcap || 0).shorten()}\n \n\n \n  ${Decimal.from(TVLUSD || 0).shorten()}\n \n \n {total.collateralRatioIsBelowCritical(price) ? Yes : \"No\"}\n \n\n { }\n {/*\n \n Frontend\n \n \n {kickbackRatePct && (\n \n {kickbackRatePct}%\n \n )}\n */}\n {/*}\n \n \n Contracts version: {contractsVersion}\n \n Deployed: {deploymentDate.toLocaleString()}\n \n Frontend version:{\" \"}\n {process.env.NODE_ENV === \"development\" ? (\n \"development\"\n ) : (\n {process.env.REACT_APP_VERSION}\n )}\n \n \n */}\n \n );\n};\n","import React, { useState, useRef } from \"react\";\nimport { Container, Flex, Button } from \"theme-ui\";\n\nimport { LiquityStoreState } from \"@liquity/lib-base\";\nimport { useLiquitySelector } from \"@liquity/lib-react\";\n\nimport { Icon } from \"./Icon\";\nimport { SystemStats } from \"./SystemStats\";\n\nconst select = ({ total, price }: LiquityStoreState) => ({ total, price });\n\nexport const SystemStatsPopup: React.FC = () => {\n const { price, total } = useLiquitySelector(select);\n\n const [systemStatsOpen, setSystemStatsOpen] = useState(false);\n const systemStatsOverlayRef = useRef(null);\n\n return (\n <>\n setSystemStatsOpen(!systemStatsOpen)}\n variant=\"icon\"\n sx={{\n position: \"relative\",\n display: [\"block\", \"none\"]\n }}\n >\n \n\n {total.collateralRatioIsBelowCritical(price) && (\n \n \n \n )}\n \n\n {systemStatsOpen && (\n {\n if (e.target === systemStatsOverlayRef.current) {\n setSystemStatsOpen(false);\n }\n }}\n >\n \n \n )}\n \n );\n};\n","import React from \"react\";\nimport { Box, Image } from \"theme-ui\";\n\ntype LiquityLogoProps = React.ComponentProps & {\n height?: number | string;\n};\n\nexport const LiquityLogo: React.FC = ({ height, ...boxProps }) => (\n \n \n \n \n \n);\n","export default __webpack_public_path__ + \"static/media/base.f87e6eb5.svg\";","export default __webpack_public_path__ + \"static/media/fuse.684849d7.svg\";","export default __webpack_public_path__ + \"static/media/telos.ef4bd342.svg\";","export default __webpack_public_path__ + \"static/media/taraxa.84573e52.png\";","export default __webpack_public_path__ + \"static/media/artela.1b2afdaa.png\";","// @ts-nocheck\n\nimport { useState, useEffect } from 'react';\nimport { ethers } from 'ethers';\nimport Select, { components } from 'react-select';\nimport { useLiquity } from \"../hooks/LiquityContext\";\n\n// Import network logos\nimport baseLogo from \"../images/networks/base.svg\";\nimport fuseLogo from \"../images/networks/fuse.svg\";\nimport telosLogo from \"../images/networks/telos.svg\";\nimport taraxaLogo from \"../images/networks/taraxa.png\";\nimport artelaLogo from \"../images/networks/artela.png\";\n\n\n\n// Import other logos as needed\n\nexport async function SwitchNetwork(newNetwork) {\n try {\n if (window.ethereum) {\n await window.ethereum.request({\n method: 'wallet_switchEthereumChain',\n params: [{ chainId: newNetwork }],\n });\n const updatedProvider = new ethers.providers.Web3Provider(window.ethereum);\n\n const currentNetworkId = await updatedProvider.send('eth_chainId');\n console.log(`Current network ID: ${currentNetworkId}`);\n }\n } catch (error) {\n console.error(error);\n }\n}\n\nfunction NetworkSwitcher() {\n const { collateral } = useLiquity();\n\n const networks = [\n { value: '0x2105', label: 'Base', logo: baseLogo, chainId: 8453, collateral: 'ETH' },\n { value: '0x28', label: 'Telos', logo: telosLogo, chainId: 40, collateral: 'TLOS' },\n { value: '0x7A', label: 'Fuse', logo: fuseLogo, chainId: 122, collateral: 'FUSE' },\n { value: '0x349', label: 'Taraxa', logo: taraxaLogo, chainId: 841, collateral: 'TARA' },\n { value: '0x2E2C', label: 'Artela', logo: artelaLogo, chainId: 841, collateral: 'ART' },\n\n\n // Add more networks as needed\n ];\n\n const [availableNetworks] = useState(networks);\n const [selectedNetwork, setSelectedNetwork] = useState();\n\n // Set the selected network based on the collateral\n useEffect(() => {\n const currentNetwork = networks.find((net) => net.collateral === collateral);\n if (currentNetwork) {\n setSelectedNetwork(currentNetwork);\n }\n }, [collateral]);\n\n useEffect(() => {\n if (selectedNetwork) {\n SwitchNetwork(selectedNetwork.value);\n }\n }, [selectedNetwork]);\n\n const handleNetworkChange = (selectedOption) => {\n setSelectedNetwork(selectedOption);\n };\n\n // Custom Option component\n const Option = (props) => (\n \n
\n \n {props.data.label}\n
\n
\n );\n\n // Custom SingleValue component\n const SingleValue = (props) => (\n \n
\n \n {props.data.label}\n
\n
\n );\n\n return (\n
\n ({\n ...provided,\n width: 150,\n }),\n }}\n />\n
\n );\n}\n\nexport default NetworkSwitcher;\n","import { Flex, Box, Badge, Text } from \"theme-ui\";\nimport { Link } from \"./Link\";\nimport NetworkSwitcher from './NetworkSwitcher';\nimport { useLiquity } from \"../hooks/LiquityContext\";\n\nconst TemporaryNewBadge = () => {\n const isBeforeNovember2022 = new Date() < new Date(\"2022-11-01\");\n if (!isBeforeNovember2022) return null;\n return (\n \n New\n \n );\n};\n\nexport const Nav: React.FC = () => {\n const { collateral } = useLiquity();\n\n return (\n \n\n \n
\n \n {/* Other components */}\n
\n
\n
\n );\n};\n","export default __webpack_public_path__ + \"static/media/meter-white.646d8a12.svg\";","export default __webpack_public_path__ + \"static/media/taiko.d4107c38.svg\";","import { IconType } from \"react-icons\";\nimport {\n FaRegChartBar,\n FaCoins,\n FaHandshake,\n FaChartLine,\n FaArchway,\n FaSeedling,\n FaDollarSign,\n FaArrowAltCircleUp,\n FaExchangeAlt,\n FaEllipsisH,\n} from \"react-icons/fa\";\n\n// **Import network logo images**\nimport baseLogo from \"../../images/networks/base.svg\";\nimport fuseLogo from \"../../images/networks/fuse.svg\";\nimport meterLogo from \"../../images/networks/meter-white.svg\";\nimport telosLogo from \"../../images/networks/telos.svg\";\nimport taikoLogo from \"../../images/networks/taiko.svg\";\nimport taraxaLogo from \"../../images/networks/taraxa.png\";\nimport artelaLogo from \"../../images/networks/artela.png\";\n\n// Import other logos as needed\n\nconst BASE_MAINNET = 8453;\nconst FUSE_MAINNET = 122;\nconst METER_MAINNET = 82;\nconst TELOS_MAINNET = 40;\nconst TAIKO_MAINNET = 167000;\nconst TARAXA_MAINNET = 841;\nconst ARTELA_MAINNET = 11820;\n\n\n// Define interfaces\nexport interface InAppPath {\n name: string;\n path: string;\n}\n\nexport interface SubMenuItemConfig {\n networkId: number;\n name: string;\n path: string;\n logo?: string; // **Added logo property**\n subSubMenu?: InAppPath[];\n}\n\nexport interface MenuItemConfig {\n icon: IconType;\n title: string;\n path: string;\n subMenu?: SubMenuItemConfig[];\n}\n\n// Update menuConfig with logos\nconst menuConfig: MenuItemConfig[] = [\n {\n icon: FaCoins,\n title: \"Mint USDM\",\n path: \"https://mint.meridianfinance.net/\",\n subMenu: [\n {\n networkId: BASE_MAINNET,\n name: \"Base\",\n path: \"https://mint.meridianfinance.net/\",\n logo: baseLogo, // **Added logo here**\n subSubMenu: [\n { name: \"Trove\", path: \"/\" },\n { name: \"Stability Pool\", path: \"/pool\" },\n { name: \"Staking\", path: \"/staking\" },\n { name: \"Risky Troves\", path: \"/risky-troves\" },\n { name: \"Redemptions\", path: \"/redemption\" },\n ],\n },\n {\n networkId: FUSE_MAINNET,\n name: \"Fuse\",\n path: \"https://mint.meridianfinance.net/\",\n logo: fuseLogo, // **Added logo here**\n subSubMenu: [\n { name: \"Trove\", path: \"/\" },\n { name: \"Stability Pool\", path: \"/pool\" },\n { name: \"Staking\", path: \"/staking\" },\n { name: \"Risky Troves\", path: \"/risky-troves\" },\n { name: \"Redemptions\", path: \"/redemption\" },\n ],\n },\n {\n networkId: TELOS_MAINNET,\n name: \"Telos\",\n path: \"https://mint.meridianfinance.net/\",\n logo: telosLogo, // **Added logo here**\n subSubMenu: [\n { name: \"Trove\", path: \"/\" },\n { name: \"Stability Pool\", path: \"/pool\" },\n { name: \"Staking\", path: \"/staking\" },\n { name: \"Risky Troves\", path: \"/risky-troves\" },\n { name: \"Redemptions\", path: \"/redemption\" },\n ],\n },\n {\n networkId: TARAXA_MAINNET,\n name: \"Taraxa\",\n path: \"https://mint.meridianfinance.net/\",\n logo: taraxaLogo, // **Added logo here**\n subSubMenu: [\n { name: \"Trove\", path: \"/\" },\n { name: \"Stability Pool\", path: \"/pool\" },\n { name: \"Staking\", path: \"/staking\" },\n { name: \"Risky Troves\", path: \"/risky-troves\" },\n { name: \"Redemptions\", path: \"/redemption\" },\n ],\n },\n {\n networkId: ARTELA_MAINNET,\n name: \"Artela\",\n path: \"https://mint.meridianfinance.net/\",\n logo: artelaLogo, // **Added logo here**\n subSubMenu: [\n { name: \"Trove\", path: \"/\" },\n { name: \"Stability Pool\", path: \"/pool\" },\n { name: \"Staking\", path: \"/staking\" },\n { name: \"Risky Troves\", path: \"/risky-troves\" },\n { name: \"Redemptions\", path: \"/redemption\" },\n ],\n },\n ],\n },\n {\n icon: FaHandshake,\n title: \"Lend/Borrow\",\n path: \"https://lend.meridianfinance.net/\",\n subMenu: [\n {\n networkId: FUSE_MAINNET,\n name: \"Fuse\",\n path: \"https://lend.meridianfinance.net/\",\n logo: fuseLogo, // **Added logo here**\n },\n {\n networkId: METER_MAINNET,\n name: \"Meter\",\n path: \"https://lend.meridianfinance.net/\",\n logo: meterLogo, // **Added logo here**\n },\n {\n networkId: TELOS_MAINNET,\n name: \"Telos\",\n path: \"https://lend.meridianfinance.net/\",\n logo: telosLogo, // **Added logo here**\n },\n {\n networkId: TAIKO_MAINNET,\n name: \"Taiko\",\n path: \"https://lend.meridianfinance.net/\",\n logo: taikoLogo, // **Added logo here**\n },\n {\n networkId: TARAXA_MAINNET,\n name: \"Taraxa\",\n path: \"https://lend.meridianfinance.net/\",\n logo: taraxaLogo, // **Added logo here**\n },\n {\n networkId: ARTELA_MAINNET,\n name: \"Artela\",\n path: \"https://lend.meridianfinance.net/\",\n logo: artelaLogo, // **Added logo here**\n },\n ],\n },\n {\n icon: FaChartLine,\n title: \"Trade\",\n path: \"https://trade.meridianfinance.net/#/trade\",\n subMenu: [\n {\n networkId: BASE_MAINNET,\n name: \"Base\",\n path: \"https://trade.meridianfinance.net/#/trade\",\n logo: baseLogo, // **Added logo here**\n },\n {\n networkId: METER_MAINNET,\n name: \"Meter\",\n path: \"https://trade.meridianfinance.net/#/trade\",\n logo: meterLogo, // **Added logo here**\n },\n ],\n },\n {\n icon: FaExchangeAlt,\n title: \"Swap\",\n path: \"https://swaps.meridianfinance.net\",\n subMenu: [\n {\n networkId: TELOS_MAINNET,\n name: \"Telos\",\n path: \"https://swaps.meridianfinance.net\",\n logo: telosLogo, // **Added logo here**\n },\n ],\n },\n {\n icon: FaSeedling,\n title: \"Stake MST\",\n path: \"https://stake.meridianfinance.net/#/stakemst\",\n subMenu: [\n {\n networkId: BASE_MAINNET,\n name: \"Base\",\n path: \"https://stake.meridianfinance.net/#/stakemst\",\n logo: baseLogo, // **Added logo here**\n },\n {\n networkId: FUSE_MAINNET,\n name: \"Fuse\",\n path: \"https://stake.meridianfinance.net/#/stakemst\",\n logo: fuseLogo, // **Added logo here**\n },\n {\n networkId: METER_MAINNET,\n name: \"Meter\",\n path: \"https://stake.meridianfinance.net/#/stakemst\",\n logo: meterLogo, // **Added logo here**\n },\n {\n networkId: TELOS_MAINNET,\n name: \"Telos\",\n path: \"https://stake.meridianfinance.net/#/stakemst\",\n logo: telosLogo, // **Added logo here**\n },\n {\n networkId: TAIKO_MAINNET,\n name: \"Taiko\",\n path: \"https://stake.meridianfinance.net/#/stakemst\",\n logo: taikoLogo, // **Added logo here**\n },\n ],\n },\n {\n icon: FaArchway,\n title: \"Bridge MST\",\n path: \"https://bridge.meridianfinance.net/#/\",\n },\n {\n icon: FaArrowAltCircleUp,\n title: \"Buy MST\",\n path: \"https://stake.meridianfinance.net/#/tokens/\",\n },\n {\n icon: FaDollarSign,\n title: \"Buy USDM\",\n path: \"https://stake.meridianfinance.net/#/tokens/\",\n },\n {\n icon: FaRegChartBar,\n title: \"Analytics\",\n path: \"\",\n subMenu: [\n {\n networkId: 0,\n name: \"Swaps\",\n path: \"https://analytics.swaps.meridianfinance.net\",\n // Optionally add a logo if applicable\n },\n {\n networkId: 0,\n name: \"Yields\",\n path: \"https://stake.meridianfinance.net/#/yields\",\n // Optionally add a logo if applicable\n },\n ],\n },\n {\n icon: FaEllipsisH,\n title: \"More\",\n path: \"\",\n subMenu: [\n {\n networkId: 0,\n name: \"Tokens\",\n path: \"https://stake.meridianfinance.net/#/tokens/\",\n // Optionally add a logo if applicable\n },\n {\n networkId: 0,\n name: \"Ecosystem\",\n path: \"https://stake.meridianfinance.net/#/ecosystem/\",\n // Optionally add a logo if applicable\n },\n {\n networkId: 0,\n name: \"Docs\",\n path: \"https://docs.meridianfinance.net/\",\n // Optionally add a logo if applicable\n },\n {\n networkId: 0,\n name: \"Github\",\n path: \"https://github.com/MeridianDollar\",\n // Optionally add a logo if applicable\n },\n {\n networkId: 0,\n name: \"Governance\",\n path: \"https://snapshot.org/#/meridian-foundation.eth\",\n // Optionally add a logo if applicable\n },\n {\n networkId: 0,\n name: \"Network Bridges\",\n path: \"\",\n subSubMenu: [\n { name: \"Gas Top-up\", path: \"https://www.gas.zip/\" },\n { name: \"Base\", path: \"https://bridge.base.org/\" },\n { name: \"Fuse\", path: \"https://console.fuse.io/bridge\" },\n { name: \"Meter\", path: \"https://passport.meter.io/\" },\n { name: \"Telos\", path: \"https://bridge.telos.net/bridge\" },\n { name: \"Taiko\", path: \"https://bridge.taiko.xyz\" },\n { name: \"Taraxa\", path: \"https://bridge.taraxa.io\" },\n { name: \"Artela\", path: \"https://artbridge.artela.network\" },\n ],\n },\n {\n networkId: 0,\n name: \"Network Explorers\",\n path: \"\",\n subSubMenu: [\n { name: \"Gas Top-up\", path: \"https://www.gas.zip/\" },\n { name: \"Base\", path: \"https://basescan.org/\" },\n { name: \"Fuse\", path: \"https://explorer.fuse.io/\" },\n { name: \"Meter\", path: \"https://scan.meter.io/\" },\n { name: \"Telos\", path: \"https://www.teloscan.io/\" },\n { name: \"Taiko\", path: \"https://taikoscan.io\" },\n { name: \"Taraxa\", path: \"https://tara.to\" },\n { name: \"Artela\", path: \"https://artscan.artela.network\" },\n ],\n },\n ],\n },\n];\n\nexport default menuConfig;\n","interface InvalidPath {\n network: number;\n path: string;\n }\n \n const invalidPaths: InvalidPath[] = [\n { network: 8453, path: \"https://lend.meridianfinance.net/\" },\n ];\n \n export function isInvalidPath(network: number, path: string): boolean {\n const isInvalid = invalidPaths.some((invalidPath) => {\n return invalidPath.network === network && invalidPath.path === path;\n });\n \n if (isInvalid) {\n window.alert(\"Please switch network.\\nLending is currently only available on Telos, Fuse & Meter and networks.\");\n }\n \n return isInvalid;\n }","import React, { useState, useEffect } from 'react';\nimport { useHistory } from \"react-router-dom\";\nimport './Sidebar.css'; // Import CSS for styling\nimport menuConfig, { MenuItemConfig, SubMenuItemConfig } from \"./SidebarConfig\";\nimport { SwitchNetwork } from '../NetworkSwitcher';\nimport { isInvalidPath } from \"./invalidPaths\";\n\n// **Import network logo images**\nimport baseLogo from \"../images/networks/base.svg\";\nimport fuseLogo from \"../images/networks/fuse.svg\";\nimport meterLogo from \"../images/networks/meter.svg\";\nimport telosLogo from \"../images/networks/telos.svg\";\nimport taikoLogo from \"../images/networks/taiko.svg\";\n// Import other logos as needed\n\ninterface SidebarProps {\n chainId: number;\n}\n\nconst Sidebar: React.FC = (props) => {\n const { chainId } = props;\n const [isExpanded, setIsExpanded] = useState(false);\n const [activeSubMenu, setActiveSubMenu] = useState(null);\n const [activeSubSubMenu, setActiveSubSubMenu] = useState(null);\n const history = useHistory();\n\n const toggleExpandOpen = () => {\n setIsExpanded(true);\n };\n const toggleExpandClose = () => {\n setIsExpanded(false);\n };\n\n useEffect(() => {\n // Function to determine initial expand state based on screen size\n const handleResize = () => {\n const isSmallScreen = window.innerWidth < 768; // Define \"small screen\" as less than 768px\n setIsExpanded(isSmallScreen);\n };\n handleResize();\n }, []);\n\n const handleItemClick = async (\n chainId: number,\n targetChainId: number,\n path: string,\n isSubSubMenu: boolean\n ) => {\n if (!isInvalidPath(targetChainId, path)) {\n if (chainId !== targetChainId && targetChainId !== 0) {\n // change networks if required\n let newPath = path;\n if (isSubSubMenu) {\n const hashPath = window.location.hash;\n const basePath = hashPath.split('/')[0];\n newPath = `#${basePath.replace(/^#/, '')}${path.slice(1)}`;\n }\n try {\n const newChainName = await SwitchNetwork(\"0x\" + targetChainId.toString(16));\n // if (newChainName === \"Telos\") { // getChainName(targetChainId)) {\n window.location.href = newPath;\n // }\n } catch (error) {\n console.error('Error switching network:', error);\n }\n } else {\n if (targetChainId === 0) {\n window.open(path, '_blank');\n } else {\n if (isSubSubMenu) {\n history.push(path);\n } else {\n window.location.href = path;\n }\n }\n }\n }\n };\n\n const handleMenuItemClick = async (\n isExpanded: boolean,\n chainId: number,\n targetChainId: number,\n item: MenuItemConfig\n ) => {\n const mediaQuery = window.matchMedia('(max-width: 768px)');\n if (mediaQuery.matches && (item.subMenu || !isExpanded)) {\n // on small screen open submenus if available\n toggleExpandOpen();\n setActiveSubMenu(activeSubMenu === item.title ? null : item.title);\n } else {\n handleItemClick(chainId, targetChainId, item.path, false);\n }\n };\n\n const handleArrowClick = (item: MenuItemConfig) => {\n if (item.subMenu) {\n setActiveSubMenu(activeSubMenu === item.title ? null : item.title);\n }\n };\n\n const handleSubArrowClick = (subItem: SubMenuItemConfig) => {\n if (subItem.subSubMenu) {\n setActiveSubSubMenu(activeSubSubMenu === subItem.name ? null : subItem.name);\n }\n };\n\n return (\n \n
\n {menuConfig.map((item, index) => (\n
\n
\n
\n \n handleMenuItemClick(isExpanded, chainId, chainId, item)\n }\n />\n \n handleMenuItemClick(isExpanded, chainId, chainId, item)\n }\n >\n {item.title}\n \n {isExpanded && item.subMenu && (\n handleArrowClick(item)}>\n {activeSubMenu === item.title ? '▼' : '▶'}\n \n )}\n
\n
\n {isExpanded &&\n activeSubMenu === item.title &&\n item.subMenu && (\n
\n {item.subMenu.map((subItem, subIndex) => (\n
\n
\n {/* Display the logo image next to the network name */}\n {subItem.logo && (\n \n )}\n \n handleItemClick(\n chainId,\n subItem.networkId,\n subItem.path,\n false\n )\n }\n >\n {subItem.name}\n \n {subItem.subSubMenu && (\n handleSubArrowClick(subItem)}\n >\n {activeSubSubMenu === subItem.name ? '▼' : '▶'}\n \n )}\n
\n {activeSubSubMenu === subItem.name &&\n subItem.subSubMenu && (\n
\n {subItem.subSubMenu.map(\n (subSubItem, subSubIndex) => (\n \n handleItemClick(\n chainId,\n subItem.networkId,\n subSubItem.path,\n true\n )\n }\n >\n {subSubItem.name}\n \n )\n )}\n
\n )}\n
\n ))}\n
\n )}\n
\n ))}\n
\n \n );\n};\n\nexport default Sidebar;\n","import React, { useState, useRef, useEffect } from \"react\";\nimport { Box, Button, Container, Flex } from \"theme-ui\";\nimport { Icon } from \"./Icon\";\nimport { LiquityLogo } from \"./LiquityLogo\";\nimport { Link } from \"./Link\";\nimport Sidebar from \"./Sidebar/Sidebar\";\nimport { useLiquity } from \"../hooks/LiquityContext\";\n\nconst logoHeight = \"42px\";\n\nexport const SideNav: React.FC = () => {\n const [isVisible, setIsVisible] = useState(false);\n const overlay = useRef(null);\n const { chainId } = useLiquity();\n\n useEffect(() => {\n const handleOutsideClick = (event: MouseEvent) => {\n if (overlay.current && !overlay.current.contains(event.target as Node)) {\n setIsVisible(false);\n }\n };\n if (isVisible) {\n document.addEventListener('click', handleOutsideClick);\n }\n return () => {\n // Cleanup listener\n document.removeEventListener('click', handleOutsideClick);\n };\n }, [isVisible]); \n\n if (!isVisible) {\n return (\n <>\n \n \n \n \n \n );\n }\n return (\n <>\n \n \n \n \n \n \n );\n};","import React from \"react\";\nimport { LiquityStoreState } from \"@liquity/lib-base\";\nimport { useLiquitySelector } from \"@liquity/lib-react\";\nimport { Container, Flex, Box } from \"theme-ui\";\nimport { AddressZero } from \"@ethersproject/constants\";\nimport { useLiquity } from \"../hooks/LiquityContext\";\n\nimport { LiquityLogo } from \"./LiquityLogo\";\nimport { Nav } from \"./Nav\";\nimport { SideNav } from \"./SideNav\";\n\nconst logoHeight = \"35px\";\n\nconst select = ({ frontend }: LiquityStoreState) => ({\n frontend\n});\n\nexport const Header: React.FC = ({ children }) => {\n const {\n config: { frontendTag }\n } = useLiquity();\n const { frontend } = useLiquitySelector(select);\n const isFrontendRegistered = frontendTag === AddressZero || frontend.status === \"registered\";\n\n return (\n <>\n \n \n \n\n {isFrontendRegistered && (\n