@mento-protocol/mento-sdk 3.2.3 → 3.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cache/routes.d.ts +13 -0
- package/dist/cache/routes.js +14089 -0
- package/dist/cache/tokens.d.ts +68 -0
- package/dist/cache/tokens.js +460 -0
- package/dist/core/abis/activePool.d.ts +2 -0
- package/dist/core/abis/activePool.js +14 -0
- package/dist/core/abis/addressesRegistry.d.ts +2 -0
- package/dist/core/abis/addressesRegistry.js +26 -0
- package/dist/core/abis/bipoolmanager.d.ts +34 -0
- package/dist/core/abis/bipoolmanager.js +72 -0
- package/dist/core/abis/borrowerOperations.d.ts +9 -0
- package/dist/core/abis/borrowerOperations.js +89 -0
- package/dist/core/abis/breakerbox.d.ts +13 -0
- package/dist/core/abis/breakerbox.js +8 -0
- package/dist/core/abis/broker.d.ts +2 -0
- package/dist/core/abis/broker.js +9 -0
- package/dist/core/abis/erc20.d.ts +9 -0
- package/dist/core/abis/erc20.js +21 -0
- package/dist/core/abis/fpmm.d.ts +270 -0
- package/dist/core/abis/fpmm.js +49 -0
- package/dist/core/abis/fpmmFactory.d.ts +85 -0
- package/dist/core/abis/fpmmFactory.js +26 -0
- package/dist/core/abis/hintHelpers.d.ts +2 -0
- package/dist/core/abis/hintHelpers.js +14 -0
- package/dist/core/abis/index.d.ts +22 -0
- package/dist/core/abis/index.js +38 -0
- package/dist/core/abis/liquidityStrategy.d.ts +132 -0
- package/dist/core/abis/liquidityStrategy.js +10 -0
- package/dist/core/abis/multiTroveGetter.d.ts +8 -0
- package/dist/core/abis/multiTroveGetter.js +15 -0
- package/dist/core/abis/priceFeed.d.ts +7 -0
- package/dist/core/abis/priceFeed.js +16 -0
- package/dist/core/abis/pricingmodule.d.ts +2 -0
- package/dist/core/abis/pricingmodule.js +6 -0
- package/dist/core/abis/reserve.d.ts +3 -0
- package/dist/core/abis/reserve.js +18 -0
- package/dist/core/abis/router.d.ts +521 -0
- package/dist/core/abis/router.js +45 -0
- package/dist/core/abis/sortedTroves.d.ts +2 -0
- package/dist/core/abis/sortedTroves.js +15 -0
- package/dist/core/abis/systemParams.d.ts +2 -0
- package/dist/core/abis/systemParams.js +14 -0
- package/dist/core/abis/troveManager.d.ts +2 -0
- package/dist/core/abis/troveManager.js +27 -0
- package/dist/core/abis/troveNFT.d.ts +2 -0
- package/dist/core/abis/troveNFT.js +9 -0
- package/dist/core/abis/virtualPool.d.ts +50 -0
- package/dist/core/abis/virtualPool.js +11 -0
- package/dist/core/abis/virtualPoolFactory.d.ts +59 -0
- package/dist/core/abis/virtualPoolFactory.js +17 -0
- package/dist/core/constants/addresses.d.ts +18 -0
- package/dist/core/constants/addresses.js +113 -0
- package/dist/core/constants/borrowConstants.d.ts +10 -0
- package/dist/core/constants/borrowConstants.js +16 -0
- package/dist/core/constants/borrowRegistries.d.ts +7 -0
- package/dist/core/constants/borrowRegistries.js +30 -0
- package/dist/core/constants/chainId.d.ts +7 -0
- package/dist/{cjs/enums → core/constants}/chainId.js +4 -1
- package/dist/core/constants/contractNames.d.ts +21 -0
- package/dist/core/constants/contractNames.js +24 -0
- package/dist/core/constants/index.d.ts +6 -0
- package/dist/core/constants/index.js +22 -0
- package/dist/core/errors/base.d.ts +8 -0
- package/dist/core/errors/base.js +17 -0
- package/dist/core/errors/index.d.ts +4 -0
- package/dist/{cjs/constants → core/errors}/index.js +4 -4
- package/dist/core/errors/oracle.d.ts +9 -0
- package/dist/core/errors/oracle.js +15 -0
- package/dist/core/errors/router.d.ts +14 -0
- package/dist/core/errors/router.js +24 -0
- package/dist/core/types/borrow.d.ts +87 -0
- package/dist/{cjs/interfaces/tradingLimitsConfig.js → core/types/borrow.js} +1 -0
- package/dist/core/types/contractAddresses.d.ts +42 -0
- package/dist/{cjs → core}/types/contractAddresses.js +1 -0
- package/dist/core/types/index.d.ts +10 -0
- package/dist/core/types/index.js +26 -0
- package/dist/core/types/liquidity.d.ts +194 -0
- package/dist/core/types/liquidity.js +3 -0
- package/dist/core/types/pool.d.ts +208 -0
- package/dist/core/types/pool.js +14 -0
- package/dist/core/types/provider.d.ts +45 -0
- package/dist/{cjs/interfaces/tradingLimitsState.js → core/types/provider.js} +1 -0
- package/dist/core/types/route.d.ts +62 -0
- package/dist/{cjs/interfaces/IChainClient.js → core/types/route.js} +1 -0
- package/dist/core/types/token.d.ts +21 -0
- package/dist/{cjs/interfaces/tradingLimit.js → core/types/token.js} +1 -0
- package/dist/core/types/tradingLimits.d.ts +91 -0
- package/dist/core/types/tradingLimits.js +3 -0
- package/dist/core/types/tradingMode.d.ts +24 -0
- package/dist/core/types/tradingMode.js +31 -0
- package/dist/core/types/transaction.d.ts +45 -0
- package/dist/core/types/transaction.js +3 -0
- package/dist/esm/cache/routes.js +14084 -0
- package/dist/esm/cache/tokens.js +452 -0
- package/dist/esm/core/abis/activePool.js +10 -0
- package/dist/esm/core/abis/addressesRegistry.js +22 -0
- package/dist/esm/core/abis/bipoolmanager.js +68 -0
- package/dist/esm/core/abis/borrowerOperations.js +85 -0
- package/dist/esm/core/abis/breakerbox.js +4 -0
- package/dist/esm/core/abis/broker.js +5 -0
- package/dist/esm/core/abis/erc20.js +17 -0
- package/dist/esm/core/abis/fpmm.js +45 -0
- package/dist/esm/core/abis/fpmmFactory.js +22 -0
- package/dist/esm/core/abis/hintHelpers.js +10 -0
- package/dist/esm/core/abis/index.js +21 -0
- package/dist/esm/core/abis/liquidityStrategy.js +6 -0
- package/dist/esm/core/abis/multiTroveGetter.js +11 -0
- package/dist/esm/core/abis/priceFeed.js +12 -0
- package/dist/esm/core/abis/pricingmodule.js +2 -0
- package/dist/esm/core/abis/reserve.js +14 -0
- package/dist/esm/core/abis/router.js +41 -0
- package/dist/esm/core/abis/sortedTroves.js +11 -0
- package/dist/esm/core/abis/systemParams.js +10 -0
- package/dist/esm/core/abis/troveManager.js +23 -0
- package/dist/esm/core/abis/troveNFT.js +5 -0
- package/dist/esm/core/abis/virtualPool.js +7 -0
- package/dist/esm/core/abis/virtualPoolFactory.js +13 -0
- package/dist/esm/core/constants/addresses.js +107 -0
- package/dist/esm/core/constants/borrowConstants.js +12 -0
- package/dist/esm/core/constants/borrowRegistries.js +25 -0
- package/dist/esm/{enums → core/constants}/chainId.js +2 -0
- package/dist/esm/core/constants/contractNames.js +20 -0
- package/dist/esm/core/constants/index.js +5 -0
- package/dist/esm/core/errors/base.js +12 -0
- package/dist/esm/core/errors/index.js +3 -0
- package/dist/esm/core/errors/oracle.js +10 -0
- package/dist/esm/core/errors/router.js +18 -0
- package/dist/esm/core/types/index.js +9 -0
- package/dist/esm/core/types/pool.js +10 -0
- package/dist/esm/core/types/tradingLimits.js +1 -0
- package/dist/esm/core/types/tradingMode.js +26 -0
- package/dist/esm/core/types/transaction.js +1 -0
- package/dist/esm/index.js +138 -6
- package/dist/esm/package.json +1 -0
- package/dist/esm/services/borrow/BorrowService.js +455 -0
- package/dist/esm/services/borrow/borrowHelpers.js +3 -0
- package/dist/esm/services/borrow/borrowMath.js +127 -0
- package/dist/esm/services/borrow/index.js +3 -0
- package/dist/esm/services/borrow/internal/borrowApprovalService.js +48 -0
- package/dist/esm/services/borrow/internal/borrowContextStore.js +35 -0
- package/dist/esm/services/borrow/internal/borrowErc20.js +38 -0
- package/dist/esm/services/borrow/internal/borrowHints.js +27 -0
- package/dist/esm/services/borrow/internal/borrowPositionParser.js +82 -0
- package/dist/esm/services/borrow/internal/borrowReadService.js +271 -0
- package/dist/esm/services/borrow/internal/borrowRegistryReader.js +108 -0
- package/dist/esm/services/borrow/internal/borrowTransactionService.js +271 -0
- package/dist/esm/services/borrow/internal/borrowTypes.js +1 -0
- package/dist/esm/services/borrow/internal/borrowValidation.js +89 -0
- package/dist/esm/services/index.js +8 -0
- package/dist/esm/services/liquidity/LiquidityService.js +163 -0
- package/dist/esm/services/liquidity/basicLiquidity.js +162 -0
- package/dist/esm/services/liquidity/index.js +1 -0
- package/dist/esm/services/liquidity/liquidityHelpers.js +95 -0
- package/dist/esm/services/liquidity/rebalance.js +59 -0
- package/dist/esm/services/liquidity/zapHelpers.js +120 -0
- package/dist/esm/services/liquidity/zapIn.js +112 -0
- package/dist/esm/services/liquidity/zapOut.js +248 -0
- package/dist/esm/services/pools/PoolService.js +204 -0
- package/dist/esm/services/pools/index.js +1 -0
- package/dist/esm/services/pools/poolDetails.js +209 -0
- package/dist/esm/services/pools/poolDiscovery.js +112 -0
- package/dist/esm/services/pools/rebalancePreview.js +181 -0
- package/dist/esm/services/quotes/QuoteService.js +85 -0
- package/dist/esm/services/quotes/index.js +1 -0
- package/dist/esm/services/routes/RouteService.js +268 -0
- package/dist/esm/services/routes/index.js +1 -0
- package/dist/esm/services/swap/SwapService.js +247 -0
- package/dist/esm/services/swap/index.js +1 -0
- package/dist/esm/services/tokens/index.js +1 -0
- package/dist/esm/services/tokens/tokenService.js +285 -0
- package/dist/esm/services/trading/TradingLimitsService.js +154 -0
- package/dist/esm/services/trading/TradingService.js +222 -0
- package/dist/esm/services/trading/index.js +2 -0
- package/dist/esm/utils/chainConfig.js +118 -0
- package/dist/esm/utils/costUtils.js +56 -0
- package/dist/esm/utils/deadline.js +22 -0
- package/dist/esm/utils/index.js +9 -0
- package/dist/esm/utils/multicall.js +47 -0
- package/dist/esm/utils/pathEncoder.js +69 -0
- package/dist/esm/utils/rateFeed.js +23 -0
- package/dist/esm/utils/retry.js +24 -0
- package/dist/esm/{routeUtils.js → utils/routeUtils.js} +115 -116
- package/dist/esm/utils/routes.js +2 -0
- package/dist/esm/utils/sortUtils.js +33 -0
- package/dist/esm/utils/tokens.js +2 -0
- package/dist/esm/utils/tradingLimits.js +163 -0
- package/dist/esm/utils/validation.js +30 -0
- package/dist/index.d.ts +101 -0
- package/dist/index.js +158 -0
- package/dist/services/borrow/BorrowService.d.ts +381 -0
- package/dist/services/borrow/BorrowService.js +460 -0
- package/dist/services/borrow/borrowHelpers.d.ts +4 -0
- package/dist/services/borrow/borrowHelpers.js +13 -0
- package/dist/services/borrow/borrowMath.d.ts +21 -0
- package/dist/services/borrow/borrowMath.js +137 -0
- package/dist/services/borrow/index.d.ts +4 -0
- package/dist/{cjs/interfaces → services/borrow}/index.js +4 -4
- package/dist/services/borrow/internal/borrowApprovalService.d.ts +14 -0
- package/dist/services/borrow/internal/borrowApprovalService.js +53 -0
- package/dist/services/borrow/internal/borrowContextStore.d.ts +11 -0
- package/dist/services/borrow/internal/borrowContextStore.js +40 -0
- package/dist/services/borrow/internal/borrowErc20.d.ts +5 -0
- package/dist/services/borrow/internal/borrowErc20.js +43 -0
- package/dist/services/borrow/internal/borrowHints.d.ts +7 -0
- package/dist/services/borrow/internal/borrowHints.js +31 -0
- package/dist/services/borrow/internal/borrowPositionParser.d.ts +4 -0
- package/dist/services/borrow/internal/borrowPositionParser.js +87 -0
- package/dist/services/borrow/internal/borrowReadService.d.ts +31 -0
- package/dist/services/borrow/internal/borrowReadService.js +276 -0
- package/dist/services/borrow/internal/borrowRegistryReader.d.ts +5 -0
- package/dist/services/borrow/internal/borrowRegistryReader.js +113 -0
- package/dist/services/borrow/internal/borrowTransactionService.d.ts +23 -0
- package/dist/services/borrow/internal/borrowTransactionService.js +276 -0
- package/dist/services/borrow/internal/borrowTypes.d.ts +15 -0
- package/dist/services/borrow/internal/borrowTypes.js +3 -0
- package/dist/services/borrow/internal/borrowValidation.d.ts +14 -0
- package/dist/services/borrow/internal/borrowValidation.js +104 -0
- package/dist/services/index.d.ts +9 -0
- package/dist/{cjs → services}/index.js +9 -7
- package/dist/services/liquidity/LiquidityService.d.ts +139 -0
- package/dist/services/liquidity/LiquidityService.js +168 -0
- package/dist/services/liquidity/basicLiquidity.d.ts +11 -0
- package/dist/services/liquidity/basicLiquidity.js +172 -0
- package/dist/services/liquidity/index.d.ts +2 -0
- package/dist/{cjs/types → services/liquidity}/index.js +2 -2
- package/dist/services/liquidity/liquidityHelpers.d.ts +19 -0
- package/dist/services/liquidity/liquidityHelpers.js +104 -0
- package/dist/services/liquidity/rebalance.d.ts +6 -0
- package/dist/services/liquidity/rebalance.js +64 -0
- package/dist/services/liquidity/zapHelpers.d.ts +66 -0
- package/dist/services/liquidity/zapHelpers.js +129 -0
- package/dist/services/liquidity/zapIn.d.ts +18 -0
- package/dist/services/liquidity/zapIn.js +119 -0
- package/dist/services/liquidity/zapOut.d.ts +9 -0
- package/dist/services/liquidity/zapOut.js +255 -0
- package/dist/services/pools/PoolService.d.ts +69 -0
- package/dist/services/pools/PoolService.js +209 -0
- package/dist/services/pools/index.d.ts +2 -0
- package/dist/{cjs/enums → services/pools}/index.js +2 -3
- package/dist/services/pools/poolDetails.d.ts +13 -0
- package/dist/services/pools/poolDetails.js +216 -0
- package/dist/services/pools/poolDiscovery.d.ts +12 -0
- package/dist/services/pools/poolDiscovery.js +117 -0
- package/dist/services/pools/rebalancePreview.d.ts +5 -0
- package/dist/services/pools/rebalancePreview.js +186 -0
- package/dist/services/quotes/QuoteService.d.ts +51 -0
- package/dist/services/quotes/QuoteService.js +91 -0
- package/dist/services/quotes/index.d.ts +2 -0
- package/dist/services/quotes/index.js +18 -0
- package/dist/services/routes/RouteService.d.ts +117 -0
- package/dist/services/routes/RouteService.js +306 -0
- package/dist/services/routes/index.d.ts +2 -0
- package/dist/services/routes/index.js +18 -0
- package/dist/services/swap/SwapService.d.ts +198 -0
- package/dist/services/swap/SwapService.js +252 -0
- package/dist/services/swap/index.d.ts +2 -0
- package/dist/services/swap/index.js +18 -0
- package/dist/services/tokens/index.d.ts +2 -0
- package/dist/services/tokens/index.js +18 -0
- package/dist/services/tokens/tokenService.d.ts +55 -0
- package/dist/services/tokens/tokenService.js +290 -0
- package/dist/services/trading/TradingLimitsService.d.ts +38 -0
- package/dist/services/trading/TradingLimitsService.js +159 -0
- package/dist/services/trading/TradingService.d.ts +115 -0
- package/dist/services/trading/TradingService.js +227 -0
- package/dist/services/trading/index.d.ts +3 -0
- package/dist/services/trading/index.js +19 -0
- package/dist/utils/chainConfig.d.ts +16 -0
- package/dist/utils/chainConfig.js +123 -0
- package/dist/utils/costUtils.d.ts +12 -0
- package/dist/utils/costUtils.js +60 -0
- package/dist/utils/deadline.d.ts +21 -0
- package/dist/utils/deadline.js +26 -0
- package/dist/utils/index.d.ts +10 -0
- package/dist/utils/index.js +26 -0
- package/dist/utils/multicall.d.ts +30 -0
- package/dist/utils/multicall.js +52 -0
- package/dist/utils/pathEncoder.d.ts +34 -0
- package/dist/utils/pathEncoder.js +73 -0
- package/dist/utils/rateFeed.d.ts +18 -0
- package/dist/utils/rateFeed.js +27 -0
- package/dist/utils/retry.d.ts +12 -0
- package/dist/utils/retry.js +28 -0
- package/dist/{esm → utils}/routeUtils.d.ts +84 -93
- package/dist/{cjs → utils}/routeUtils.js +123 -124
- package/dist/utils/routes.d.ts +3 -0
- package/dist/utils/routes.js +8 -0
- package/dist/utils/sortUtils.d.ts +24 -0
- package/dist/utils/sortUtils.js +39 -0
- package/dist/utils/tokens.d.ts +2 -0
- package/dist/utils/tokens.js +13 -0
- package/dist/utils/tradingLimits.d.ts +41 -0
- package/dist/utils/tradingLimits.js +171 -0
- package/dist/utils/validation.d.ts +19 -0
- package/dist/utils/validation.js +34 -0
- package/package.json +1 -1
- package/dist/cjs/ChainClient.d.ts +0 -9
- package/dist/cjs/ChainClient.js +0 -58
- package/dist/cjs/TestChainClient.d.ts +0 -7
- package/dist/cjs/TestChainClient.js +0 -41
- package/dist/cjs/constants/addresses.d.ts +0 -4
- package/dist/cjs/constants/addresses.js +0 -59
- package/dist/cjs/constants/currencies.d.ts +0 -5
- package/dist/cjs/constants/currencies.js +0 -29
- package/dist/cjs/constants/index.d.ts +0 -4
- package/dist/cjs/constants/tokens.11142220.d.ts +0 -2
- package/dist/cjs/constants/tokens.11142220.js +0 -128
- package/dist/cjs/constants/tokens.42220.d.ts +0 -2
- package/dist/cjs/constants/tokens.42220.js +0 -128
- package/dist/cjs/constants/tokens.d.ts +0 -65
- package/dist/cjs/constants/tokens.js +0 -170
- package/dist/cjs/constants/tradablePairs.11142220.d.ts +0 -2
- package/dist/cjs/constants/tradablePairs.11142220.js +0 -7391
- package/dist/cjs/constants/tradablePairs.42220.d.ts +0 -2
- package/dist/cjs/constants/tradablePairs.42220.js +0 -7391
- package/dist/cjs/constants/tradablePairs.d.ts +0 -16
- package/dist/cjs/constants/tradablePairs.js +0 -53
- package/dist/cjs/enums/chainId.d.ts +0 -4
- package/dist/cjs/enums/index.d.ts +0 -3
- package/dist/cjs/enums/proposalState.d.ts +0 -10
- package/dist/cjs/enums/proposalState.js +0 -14
- package/dist/cjs/enums/tradingMode.d.ts +0 -17
- package/dist/cjs/enums/tradingMode.js +0 -21
- package/dist/cjs/governance.d.ts +0 -62
- package/dist/cjs/governance.js +0 -151
- package/dist/cjs/index.d.ts +0 -7
- package/dist/cjs/interfaces/IChainClient.d.ts +0 -6
- package/dist/cjs/interfaces/index.d.ts +0 -4
- package/dist/cjs/interfaces/tradingLimit.d.ts +0 -7
- package/dist/cjs/interfaces/tradingLimitsConfig.d.ts +0 -10
- package/dist/cjs/interfaces/tradingLimitsState.d.ts +0 -9
- package/dist/cjs/limits.d.ts +0 -33
- package/dist/cjs/limits.js +0 -130
- package/dist/cjs/mento.d.ts +0 -287
- package/dist/cjs/mento.js +0 -699
- package/dist/cjs/routeUtils.d.ts +0 -304
- package/dist/cjs/types/contractAddressMap.d.ts +0 -4
- package/dist/cjs/types/contractAddressMap.js +0 -2
- package/dist/cjs/types/contractAddresses.d.ts +0 -23
- package/dist/cjs/types/index.d.ts +0 -2
- package/dist/cjs/utils.d.ts +0 -80
- package/dist/cjs/utils.js +0 -177
- package/dist/esm/ChainClient.d.ts +0 -9
- package/dist/esm/ChainClient.js +0 -54
- package/dist/esm/TestChainClient.d.ts +0 -7
- package/dist/esm/TestChainClient.js +0 -37
- package/dist/esm/constants/addresses.d.ts +0 -4
- package/dist/esm/constants/addresses.js +0 -55
- package/dist/esm/constants/currencies.d.ts +0 -5
- package/dist/esm/constants/currencies.js +0 -26
- package/dist/esm/constants/index.d.ts +0 -4
- package/dist/esm/constants/index.js +0 -4
- package/dist/esm/constants/tokens.11142220.d.ts +0 -2
- package/dist/esm/constants/tokens.11142220.js +0 -125
- package/dist/esm/constants/tokens.42220.d.ts +0 -2
- package/dist/esm/constants/tokens.42220.js +0 -125
- package/dist/esm/constants/tokens.d.ts +0 -65
- package/dist/esm/constants/tokens.js +0 -142
- package/dist/esm/constants/tradablePairs.11142220.d.ts +0 -2
- package/dist/esm/constants/tradablePairs.11142220.js +0 -7388
- package/dist/esm/constants/tradablePairs.42220.d.ts +0 -2
- package/dist/esm/constants/tradablePairs.42220.js +0 -7388
- package/dist/esm/constants/tradablePairs.d.ts +0 -16
- package/dist/esm/constants/tradablePairs.js +0 -26
- package/dist/esm/enums/chainId.d.ts +0 -4
- package/dist/esm/enums/index.d.ts +0 -3
- package/dist/esm/enums/index.js +0 -3
- package/dist/esm/enums/proposalState.d.ts +0 -10
- package/dist/esm/enums/proposalState.js +0 -11
- package/dist/esm/enums/tradingMode.d.ts +0 -17
- package/dist/esm/enums/tradingMode.js +0 -18
- package/dist/esm/governance.d.ts +0 -62
- package/dist/esm/governance.js +0 -147
- package/dist/esm/index.d.ts +0 -7
- package/dist/esm/interfaces/IChainClient.d.ts +0 -6
- package/dist/esm/interfaces/index.d.ts +0 -4
- package/dist/esm/interfaces/index.js +0 -4
- package/dist/esm/interfaces/tradingLimit.d.ts +0 -7
- package/dist/esm/interfaces/tradingLimitsConfig.d.ts +0 -10
- package/dist/esm/interfaces/tradingLimitsState.d.ts +0 -9
- package/dist/esm/limits.d.ts +0 -33
- package/dist/esm/limits.js +0 -123
- package/dist/esm/mento.d.ts +0 -287
- package/dist/esm/mento.js +0 -671
- package/dist/esm/types/contractAddressMap.d.ts +0 -4
- package/dist/esm/types/contractAddresses.d.ts +0 -23
- package/dist/esm/types/index.d.ts +0 -2
- package/dist/esm/types/index.js +0 -2
- package/dist/esm/utils.d.ts +0 -80
- package/dist/esm/utils.js +0 -162
- /package/dist/esm/{interfaces/IChainClient.js → core/types/borrow.js} +0 -0
- /package/dist/esm/{types → core/types}/contractAddresses.js +0 -0
- /package/dist/esm/{interfaces/tradingLimit.js → core/types/liquidity.js} +0 -0
- /package/dist/esm/{interfaces/tradingLimitsConfig.js → core/types/provider.js} +0 -0
- /package/dist/esm/{interfaces/tradingLimitsState.js → core/types/route.js} +0 -0
- /package/dist/esm/{types/contractAddressMap.js → core/types/token.js} +0 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.computeLimitId = computeLimitId;
|
|
4
|
+
exports.calculateTradingLimitsV1 = calculateTradingLimitsV1;
|
|
5
|
+
exports.calculateTradingLimitsV2 = calculateTradingLimitsV2;
|
|
6
|
+
exports.hasConfiguredLimitsV1 = hasConfiguredLimitsV1;
|
|
7
|
+
exports.hasConfiguredLimitsV2 = hasConfiguredLimitsV2;
|
|
8
|
+
const viem_1 = require("viem");
|
|
9
|
+
/** V2 trading limits use 15 decimals internally */
|
|
10
|
+
const V2_INTERNAL_DECIMALS = 15;
|
|
11
|
+
/** V2 L0 window is fixed at 5 minutes */
|
|
12
|
+
const V2_L0_TIMESTEP = 5 * 60; // 300 seconds
|
|
13
|
+
/** V2 L1 window is fixed at 1 day */
|
|
14
|
+
const V2_L1_TIMESTEP = 24 * 60 * 60; // 86400 seconds
|
|
15
|
+
/** Far future timestamp for global limits (year 2030) */
|
|
16
|
+
const TIMESTAMP_FAR_FUTURE = 1893456000;
|
|
17
|
+
/**
|
|
18
|
+
* Compute limit ID for Broker (V1) trading limits.
|
|
19
|
+
* limitId = exchangeId XOR bytes32(uint256(uint160(token)))
|
|
20
|
+
*
|
|
21
|
+
* @param exchangeId - The exchange ID (bytes32)
|
|
22
|
+
* @param token - The token address
|
|
23
|
+
* @returns The limit ID as hex string
|
|
24
|
+
*/
|
|
25
|
+
function computeLimitId(exchangeId, token) {
|
|
26
|
+
// Pad token address to 32 bytes (left-padded with zeros)
|
|
27
|
+
const tokenBytes32 = (0, viem_1.pad)(token, { size: 32 });
|
|
28
|
+
// Convert both to BigInt for XOR operation
|
|
29
|
+
const exchangeIdBigInt = (0, viem_1.hexToBigInt)(exchangeId);
|
|
30
|
+
const tokenBigInt = (0, viem_1.hexToBigInt)(tokenBytes32);
|
|
31
|
+
// XOR operation
|
|
32
|
+
const limitIdBigInt = exchangeIdBigInt ^ tokenBigInt;
|
|
33
|
+
// Convert back to hex with proper padding
|
|
34
|
+
return (0, viem_1.pad)((0, viem_1.numberToHex)(limitIdBigInt), { size: 32 });
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Calculate trading limits from V1 config and state (Broker/Virtual pools).
|
|
38
|
+
* Returns human-friendly TradingLimit objects with maxIn/maxOut/until.
|
|
39
|
+
*
|
|
40
|
+
* @param config - V1 trading limits configuration
|
|
41
|
+
* @param state - V1 trading limits state
|
|
42
|
+
* @param asset - Token address
|
|
43
|
+
* @param tokenDecimals - Token decimals for consumer reference
|
|
44
|
+
* @returns Array of TradingLimit objects
|
|
45
|
+
*/
|
|
46
|
+
function calculateTradingLimitsV1(config, state, asset, tokenDecimals) {
|
|
47
|
+
const nowEpoch = Math.floor(Date.now() / 1000);
|
|
48
|
+
const limits = [];
|
|
49
|
+
// Check if L0 is enabled (bit 0 of flags)
|
|
50
|
+
const isL0Enabled = (config.flags & 0x01) !== 0;
|
|
51
|
+
// Check if L1 is enabled (bit 1 of flags)
|
|
52
|
+
const isL1Enabled = (config.flags & 0x02) !== 0;
|
|
53
|
+
// Check if LG is enabled (bit 2 of flags)
|
|
54
|
+
const isLGEnabled = (config.flags & 0x04) !== 0;
|
|
55
|
+
// Reset netflows if time windows have passed
|
|
56
|
+
const isL0Outdated = isL0Enabled && nowEpoch > state.lastUpdated0 + config.timestep0;
|
|
57
|
+
const isL1Outdated = isL1Enabled && nowEpoch > state.lastUpdated1 + config.timestep1;
|
|
58
|
+
const effectiveNetflow0 = isL0Outdated ? 0n : state.netflow0;
|
|
59
|
+
const effectiveNetflow1 = isL1Outdated ? 0n : state.netflow1;
|
|
60
|
+
const effectiveLastUpdated0 = isL0Outdated ? nowEpoch : state.lastUpdated0;
|
|
61
|
+
const effectiveLastUpdated1 = isL1Outdated ? nowEpoch : state.lastUpdated1;
|
|
62
|
+
// Add L0 limit if configured
|
|
63
|
+
if (isL0Enabled && config.limit0 > 0n) {
|
|
64
|
+
limits.push({
|
|
65
|
+
asset,
|
|
66
|
+
maxIn: config.limit0 - effectiveNetflow0,
|
|
67
|
+
maxOut: config.limit0 + effectiveNetflow0,
|
|
68
|
+
until: effectiveLastUpdated0 + config.timestep0,
|
|
69
|
+
decimals: tokenDecimals,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
// Add L1 limit if configured
|
|
73
|
+
if (isL1Enabled && config.limit1 > 0n) {
|
|
74
|
+
limits.push({
|
|
75
|
+
asset,
|
|
76
|
+
maxIn: config.limit1 - effectiveNetflow1,
|
|
77
|
+
maxOut: config.limit1 + effectiveNetflow1,
|
|
78
|
+
until: effectiveLastUpdated1 + config.timestep1,
|
|
79
|
+
decimals: tokenDecimals,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
// Add LG (global) limit if configured
|
|
83
|
+
if (isLGEnabled && config.limitGlobal > 0n) {
|
|
84
|
+
limits.push({
|
|
85
|
+
asset,
|
|
86
|
+
maxIn: config.limitGlobal - state.netflowGlobal,
|
|
87
|
+
maxOut: config.limitGlobal + state.netflowGlobal,
|
|
88
|
+
until: TIMESTAMP_FAR_FUTURE,
|
|
89
|
+
decimals: tokenDecimals,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
// Apply cascading restrictions: limits with larger timeframes restrict smaller ones
|
|
93
|
+
// e.g., if maxIn is 0 in LG, it should also be 0 in L1 and L0
|
|
94
|
+
for (let i = limits.length - 1; i > 0; i--) {
|
|
95
|
+
if (limits[i - 1].maxIn > limits[i].maxIn) {
|
|
96
|
+
limits[i - 1] = { ...limits[i - 1], maxIn: limits[i].maxIn };
|
|
97
|
+
}
|
|
98
|
+
if (limits[i - 1].maxOut > limits[i].maxOut) {
|
|
99
|
+
limits[i - 1] = { ...limits[i - 1], maxOut: limits[i].maxOut };
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return limits;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Calculate trading limits from V2 config and state (FPMM pools).
|
|
106
|
+
* V2 uses fixed timeframes: 5 min for L0, 1 day for L1.
|
|
107
|
+
* Values are stored with 15 decimals precision.
|
|
108
|
+
*
|
|
109
|
+
* @param config - V2 trading limits configuration
|
|
110
|
+
* @param state - V2 trading limits state
|
|
111
|
+
* @param asset - Token address
|
|
112
|
+
* @returns Array of TradingLimit objects
|
|
113
|
+
*/
|
|
114
|
+
function calculateTradingLimitsV2(config, state, asset) {
|
|
115
|
+
const nowEpoch = Math.floor(Date.now() / 1000);
|
|
116
|
+
const limits = [];
|
|
117
|
+
// Check if L0 is configured (limit0 > 0)
|
|
118
|
+
const isL0Enabled = config.limit0 > 0n;
|
|
119
|
+
// Check if L1 is configured (limit1 > 0)
|
|
120
|
+
const isL1Enabled = config.limit1 > 0n;
|
|
121
|
+
// Reset netflows if time windows have passed
|
|
122
|
+
const isL0Outdated = isL0Enabled && nowEpoch > state.lastUpdated0 + V2_L0_TIMESTEP;
|
|
123
|
+
const isL1Outdated = isL1Enabled && nowEpoch > state.lastUpdated1 + V2_L1_TIMESTEP;
|
|
124
|
+
const effectiveNetflow0 = isL0Outdated ? 0n : state.netflow0;
|
|
125
|
+
const effectiveNetflow1 = isL1Outdated ? 0n : state.netflow1;
|
|
126
|
+
const effectiveLastUpdated0 = isL0Outdated ? nowEpoch : state.lastUpdated0;
|
|
127
|
+
const effectiveLastUpdated1 = isL1Outdated ? nowEpoch : state.lastUpdated1;
|
|
128
|
+
// Add L0 limit if configured
|
|
129
|
+
if (isL0Enabled) {
|
|
130
|
+
limits.push({
|
|
131
|
+
asset,
|
|
132
|
+
maxIn: config.limit0 - effectiveNetflow0,
|
|
133
|
+
maxOut: config.limit0 + effectiveNetflow0,
|
|
134
|
+
until: effectiveLastUpdated0 + V2_L0_TIMESTEP,
|
|
135
|
+
decimals: V2_INTERNAL_DECIMALS, // V2 returns 15 decimal values
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
// Add L1 limit if configured
|
|
139
|
+
if (isL1Enabled) {
|
|
140
|
+
limits.push({
|
|
141
|
+
asset,
|
|
142
|
+
maxIn: config.limit1 - effectiveNetflow1,
|
|
143
|
+
maxOut: config.limit1 + effectiveNetflow1,
|
|
144
|
+
until: effectiveLastUpdated1 + V2_L1_TIMESTEP,
|
|
145
|
+
decimals: V2_INTERNAL_DECIMALS, // V2 returns 15 decimal values
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
// Apply cascading restrictions
|
|
149
|
+
for (let i = limits.length - 1; i > 0; i--) {
|
|
150
|
+
if (limits[i - 1].maxIn > limits[i].maxIn) {
|
|
151
|
+
limits[i - 1] = { ...limits[i - 1], maxIn: limits[i].maxIn };
|
|
152
|
+
}
|
|
153
|
+
if (limits[i - 1].maxOut > limits[i].maxOut) {
|
|
154
|
+
limits[i - 1] = { ...limits[i - 1], maxOut: limits[i].maxOut };
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return limits;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Check if any trading limits are configured (flags > 0 for V1, or limit0/limit1 > 0 for V2)
|
|
161
|
+
*/
|
|
162
|
+
function hasConfiguredLimitsV1(config) {
|
|
163
|
+
return config.flags > 0;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Check if any trading limits are configured for V2
|
|
167
|
+
*/
|
|
168
|
+
function hasConfiguredLimitsV2(config) {
|
|
169
|
+
return config.limit0 > 0n || config.limit1 > 0n;
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=tradingLimits.js.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates an Ethereum address format using viem's isAddress utility
|
|
3
|
+
*
|
|
4
|
+
* @param address - The address string to validate
|
|
5
|
+
* @param paramName - Optional parameter name for better error messages
|
|
6
|
+
* @returns True if valid (type guard for `0x${string}`)
|
|
7
|
+
* @throws Error if address is invalid
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* validateAddress('0x765DE816845861e75A25fCA122bb6898B8B1282a')
|
|
12
|
+
* // Returns true
|
|
13
|
+
*
|
|
14
|
+
* validateAddress('invalid', 'tokenIn')
|
|
15
|
+
* // Throws: "Invalid address for tokenIn: invalid"
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function validateAddress(address: string, paramName?: string): address is `0x${string}`;
|
|
19
|
+
//# sourceMappingURL=validation.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateAddress = validateAddress;
|
|
4
|
+
const viem_1 = require("viem");
|
|
5
|
+
/**
|
|
6
|
+
* Validates an Ethereum address format using viem's isAddress utility
|
|
7
|
+
*
|
|
8
|
+
* @param address - The address string to validate
|
|
9
|
+
* @param paramName - Optional parameter name for better error messages
|
|
10
|
+
* @returns True if valid (type guard for `0x${string}`)
|
|
11
|
+
* @throws Error if address is invalid
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* validateAddress('0x765DE816845861e75A25fCA122bb6898B8B1282a')
|
|
16
|
+
* // Returns true
|
|
17
|
+
*
|
|
18
|
+
* validateAddress('invalid', 'tokenIn')
|
|
19
|
+
* // Throws: "Invalid address for tokenIn: invalid"
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
function validateAddress(address, paramName) {
|
|
23
|
+
if (typeof address !== 'string') {
|
|
24
|
+
const param = paramName ? ` for ${paramName}` : '';
|
|
25
|
+
throw new Error(`Address${param} must be a string, got ${typeof address}`);
|
|
26
|
+
}
|
|
27
|
+
// Use viem's isAddress with strict: false to allow both checksummed and non-checksummed addresses
|
|
28
|
+
if (!(0, viem_1.isAddress)(address, { strict: false })) {
|
|
29
|
+
const param = paramName ? ` for ${paramName}` : '';
|
|
30
|
+
throw new Error(`Invalid address${param}: ${address}. Expected 0x followed by 40 hex characters`);
|
|
31
|
+
}
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=validation.js.map
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { PopulatedTransaction, ethers, providers } from 'ethers';
|
|
2
|
-
import { IChainClient } from './interfaces';
|
|
3
|
-
export declare class ChainClient implements IChainClient {
|
|
4
|
-
private readonly signerOrProvider;
|
|
5
|
-
constructor(signerOrProvider: ethers.Signer | providers.Provider);
|
|
6
|
-
getSigner(): Promise<ethers.Signer | providers.Provider>;
|
|
7
|
-
getChainId(): Promise<number>;
|
|
8
|
-
populateTransaction(tx: PopulatedTransaction): Promise<providers.TransactionRequest>;
|
|
9
|
-
}
|
package/dist/cjs/ChainClient.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ChainClient = void 0;
|
|
13
|
-
const ethers_1 = require("ethers");
|
|
14
|
-
const utils_1 = require("./utils");
|
|
15
|
-
class ChainClient {
|
|
16
|
-
constructor(signerOrProvider) {
|
|
17
|
-
(0, utils_1.validateSignerOrProvider)(signerOrProvider);
|
|
18
|
-
this.signerOrProvider = signerOrProvider;
|
|
19
|
-
}
|
|
20
|
-
getSigner() {
|
|
21
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
return this.signerOrProvider;
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
getChainId() {
|
|
26
|
-
var _a;
|
|
27
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
let chainId = 0;
|
|
29
|
-
if (ethers_1.Signer.isSigner(this.signerOrProvider)) {
|
|
30
|
-
const network = yield ((_a = this.signerOrProvider.provider) === null || _a === void 0 ? void 0 : _a.getNetwork());
|
|
31
|
-
if (network) {
|
|
32
|
-
chainId = network.chainId;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
else if (ethers_1.providers.Provider.isProvider(this.signerOrProvider)) {
|
|
36
|
-
const network = yield this.signerOrProvider.getNetwork();
|
|
37
|
-
if (network) {
|
|
38
|
-
chainId = network.chainId;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
if (chainId === 0) {
|
|
42
|
-
throw new Error('Could not get chainId from signer or provider');
|
|
43
|
-
}
|
|
44
|
-
return chainId;
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
populateTransaction(tx) {
|
|
48
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
49
|
-
if (ethers_1.Signer.isSigner(this.signerOrProvider)) {
|
|
50
|
-
return this.signerOrProvider.populateTransaction(tx);
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
return tx;
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
exports.ChainClient = ChainClient;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PopulatedTransaction, ethers, providers } from 'ethers';
|
|
2
|
-
import { IChainClient } from './interfaces';
|
|
3
|
-
export declare class TestChainClient implements IChainClient {
|
|
4
|
-
getSigner(): Promise<ethers.Signer | providers.Provider>;
|
|
5
|
-
getChainId(): Promise<number>;
|
|
6
|
-
populateTransaction(tx: PopulatedTransaction): Promise<providers.TransactionRequest>;
|
|
7
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.TestChainClient = void 0;
|
|
13
|
-
class TestChainClient {
|
|
14
|
-
getSigner() {
|
|
15
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
const fakeProvider = {};
|
|
17
|
-
return fakeProvider;
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
getChainId() {
|
|
21
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
return 11142220;
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
populateTransaction(tx) {
|
|
26
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
27
|
-
const fakeTx = {
|
|
28
|
-
to: tx.to,
|
|
29
|
-
from: tx.from,
|
|
30
|
-
data: tx.data,
|
|
31
|
-
value: tx.value,
|
|
32
|
-
nonce: 0,
|
|
33
|
-
gasLimit: 0,
|
|
34
|
-
gasPrice: 0,
|
|
35
|
-
chainId: 1,
|
|
36
|
-
};
|
|
37
|
-
return fakeTx;
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.TestChainClient = TestChainClient;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAddress = exports.addresses = void 0;
|
|
4
|
-
const enums_1 = require("./../enums");
|
|
5
|
-
exports.addresses = {
|
|
6
|
-
[enums_1.ChainId.CELO]: {
|
|
7
|
-
// Oracles & Breakers
|
|
8
|
-
BreakerBox: '0x303ED1df62Fa067659B586EbEe8De0EcE824Ab39',
|
|
9
|
-
MedianDeltaBreaker: '0x49349F92D2B17d491e42C8fdB02D19f072F9B5D9',
|
|
10
|
-
SortedOracles: '0xefB84935239dAcdecF7c5bA76d8dE40b077B7b33',
|
|
11
|
-
ValueDeltaBreaker: '0x4DBC33B3abA78475A5AA4BC7A5B11445d387BF68',
|
|
12
|
-
// DEX
|
|
13
|
-
BiPoolManager: '0x22d9db95E6Ae61c104A7B6F6C78D7993B94ec901',
|
|
14
|
-
Broker: '0x777A8255cA72412f0d706dc03C9D1987306B4CaD',
|
|
15
|
-
ConstantProductPricingModule: '0x0c07126d0CB30E66eF7553Cc7C37143B4f06DddB',
|
|
16
|
-
ConstantSumPricingModule: '0xDebED1F6f6ce9F6e73AA25F95acBFFE2397550Fb',
|
|
17
|
-
MentoRouter: '0xbe729350f8cdfc19db6866e8579841188ee57f67',
|
|
18
|
-
Reserve: '0x9380fA34Fd9e4Fd14c06305fd7B6199089eD4eb9',
|
|
19
|
-
// Governance
|
|
20
|
-
Airgrab: '0x7D8E73deafDBAfc98fDBe7974168cFA6d8B9AE0C',
|
|
21
|
-
Emission: '0x5C789592E2611df1873b46D394c69f75faB99778',
|
|
22
|
-
Locking: '0x001Bb66636dCd149A1A2bA8C50E408BdDd80279C',
|
|
23
|
-
MentoGovernor: '0x47036d78bB3169b4F5560dD77BF93f4412A59852',
|
|
24
|
-
MentoToken: '0x7FF62f59e3e89EA34163EA1458EEBCc81177Cfb6',
|
|
25
|
-
TimelockController: '0x890DB8A597940165901372Dd7DB61C9f246e2147',
|
|
26
|
-
},
|
|
27
|
-
[enums_1.ChainId.CELO_SEPOLIA]: {
|
|
28
|
-
// Oracles & Breakers
|
|
29
|
-
BreakerBox: '0x578bD46003B9D3fd4c3C3f47c98B329562a6a1dE',
|
|
30
|
-
MedianDeltaBreaker: '0xd29B4e743F7B84D63fBF9149B6D983DF2eF5C952',
|
|
31
|
-
SortedOracles: '0xfaa7Ca2B056E60F6733aE75AA0709140a6eAfD20',
|
|
32
|
-
ValueDeltaBreaker: '0x03CDf2966185Eb0b980f2481Ad386B8aFdAB4534',
|
|
33
|
-
// DEX
|
|
34
|
-
BiPoolManager: '0xeCB3C656C131fCd9bB8D1d80898716bD684feb78',
|
|
35
|
-
Broker: '0xB9Ae2065142EB79b6c5EB1E8778F883fad6B07Ba',
|
|
36
|
-
ConstantProductPricingModule: '0x2584a5835e3aE7E901e6462E1de06920c2C68028',
|
|
37
|
-
ConstantSumPricingModule: '0x3b199d9EbEbe509bb711BfFb455c2d79102A9602',
|
|
38
|
-
MentoRouter: '0x8e4Fb12D86D5DF911086a9153e79CA27e0c96156',
|
|
39
|
-
Reserve: '0x2bC2D48735842924C508468C5A02580aD4F6d99A',
|
|
40
|
-
// Governance
|
|
41
|
-
Emission: '0x3C1BEA0F35b5dcAc1065CA9b3b6877657dEa4A69',
|
|
42
|
-
Locking: '0xB72320fC501cb30E55bAF0DA48c20b11fAc9f79D',
|
|
43
|
-
MentoGovernor: '0x23173Ac37b8E4e5a60d787aC543B3F51e8f398b4',
|
|
44
|
-
MentoToken: '0x07867fd40EB56b4380bE39c88D0a7EA59Aa99A20',
|
|
45
|
-
TimelockController: '0x74c44Be99937815173A3C56274331e0A05611e0D',
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
function getAddress(identifier, chainId) {
|
|
49
|
-
const addressesForChain = exports.addresses[chainId];
|
|
50
|
-
if (!addressesForChain) {
|
|
51
|
-
throw new Error(`No addresses found for chain ID ${chainId}`);
|
|
52
|
-
}
|
|
53
|
-
const address = addressesForChain[identifier];
|
|
54
|
-
if (!address) {
|
|
55
|
-
throw new Error(`Address not found for identifier ${identifier} on chain ID ${chainId}`);
|
|
56
|
-
}
|
|
57
|
-
return address;
|
|
58
|
-
}
|
|
59
|
-
exports.getAddress = getAddress;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* List of supported currencies for rate feed generation and validation
|
|
3
|
-
*/
|
|
4
|
-
export declare const CURRENCIES: readonly ["AUD", "USD", "PHP", "ZAR", "CAD", "EUR", "BRL", "XOF", "COP", "GHS", "CHF", "NGN", "JPY", "GBP", "KES", "CELO", "ETH", "EURC", "EUROC", "USDC", "USDT"];
|
|
5
|
-
export type Currency = typeof CURRENCIES[number];
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CURRENCIES = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* List of supported currencies for rate feed generation and validation
|
|
6
|
-
*/
|
|
7
|
-
exports.CURRENCIES = [
|
|
8
|
-
"AUD",
|
|
9
|
-
"USD",
|
|
10
|
-
"PHP",
|
|
11
|
-
"ZAR",
|
|
12
|
-
"CAD",
|
|
13
|
-
"EUR",
|
|
14
|
-
"BRL",
|
|
15
|
-
"XOF",
|
|
16
|
-
"COP",
|
|
17
|
-
"GHS",
|
|
18
|
-
"CHF",
|
|
19
|
-
"NGN",
|
|
20
|
-
"JPY",
|
|
21
|
-
"GBP",
|
|
22
|
-
"KES",
|
|
23
|
-
"CELO",
|
|
24
|
-
"ETH",
|
|
25
|
-
"EURC",
|
|
26
|
-
"EUROC",
|
|
27
|
-
"USDC",
|
|
28
|
-
"USDT"
|
|
29
|
-
];
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// This file is auto-generated. Do not edit manually.
|
|
3
|
-
// Generated on 2025-12-10T13:15:03.083Z
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.tokens11142220 = void 0;
|
|
6
|
-
const mento_1 = require("../mento");
|
|
7
|
-
exports.tokens11142220 = [
|
|
8
|
-
{
|
|
9
|
-
address: '0x5873Faeb42F3563dcD77F0fbbdA818E6d6DA3139',
|
|
10
|
-
symbol: mento_1.TokenSymbol.AUDm,
|
|
11
|
-
name: 'Mento Australian Dollar',
|
|
12
|
-
decimals: 18,
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
address: '0x9883d788d40F1C7595a780ed881Ea833C7743B4B',
|
|
16
|
-
symbol: mento_1.TokenSymbol.axlEUROC,
|
|
17
|
-
name: 'Mento Mock axlEUROC',
|
|
18
|
-
decimals: 18,
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
address: '0x6285De9DA7C1d329C0451628638908915002d9d1',
|
|
22
|
-
symbol: mento_1.TokenSymbol.axlUSDC,
|
|
23
|
-
name: 'Mento Mock axlUSDC',
|
|
24
|
-
decimals: 18,
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
address: '0x2294298942fdc79417DE9E0D740A4957E0e7783a',
|
|
28
|
-
symbol: mento_1.TokenSymbol.BRLm,
|
|
29
|
-
name: 'Mento Brazilian Real',
|
|
30
|
-
decimals: 18,
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
address: '0xF151c9a13b78C84f93f50B8b3bC689fedc134F60',
|
|
34
|
-
symbol: mento_1.TokenSymbol.CADm,
|
|
35
|
-
name: 'Mento Canadian Dollar',
|
|
36
|
-
decimals: 18,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
address: '0x471EcE3750Da237f93B8E339c536989b8978a438',
|
|
40
|
-
symbol: mento_1.TokenSymbol.CELO,
|
|
41
|
-
name: 'Celo native asset',
|
|
42
|
-
decimals: 18,
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
address: '0x284E9b7B623eAE866914b7FA0eB720C2Bb3C2980',
|
|
46
|
-
symbol: mento_1.TokenSymbol.CHFm,
|
|
47
|
-
name: 'Mento Swiss Franc',
|
|
48
|
-
decimals: 18,
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
address: '0x5F8d55c3627d2dc0a2B4afa798f877242F382F67',
|
|
52
|
-
symbol: mento_1.TokenSymbol.COPm,
|
|
53
|
-
name: 'Mento Colombian Peso',
|
|
54
|
-
decimals: 18,
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
address: '0xA99dC247d6b7B2E3ab48a1fEE101b83cD6aCd82a',
|
|
58
|
-
symbol: mento_1.TokenSymbol.EURm,
|
|
59
|
-
name: 'Mento Euro',
|
|
60
|
-
decimals: 18,
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
address: '0x85F5181Abdbf0e1814Fc4358582Ae07b8eBA3aF3',
|
|
64
|
-
symbol: mento_1.TokenSymbol.GBPm,
|
|
65
|
-
name: 'Mento British Pound',
|
|
66
|
-
decimals: 18,
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
address: '0x5e94B8C872bD47BC4255E60ECBF44D5E66e7401C',
|
|
70
|
-
symbol: mento_1.TokenSymbol.GHSm,
|
|
71
|
-
name: 'Mento Ghanaian Cedi',
|
|
72
|
-
decimals: 18,
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
address: '0x85Bee67D435A39f7467a8a9DE34a5B73D25Df426',
|
|
76
|
-
symbol: mento_1.TokenSymbol.JPYm,
|
|
77
|
-
name: 'Mento Japanese Yen',
|
|
78
|
-
decimals: 18,
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
address: '0xC7e4635651E3e3Af82b61d3E23c159438daE3BbF',
|
|
82
|
-
symbol: mento_1.TokenSymbol.KESm,
|
|
83
|
-
name: 'Mento Kenyan Shilling',
|
|
84
|
-
decimals: 18,
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
address: '0x3d5ae86F34E2a82771496D140daFAEf3789dF888',
|
|
88
|
-
symbol: mento_1.TokenSymbol.NGNm,
|
|
89
|
-
name: 'Mento Nigerian Naira',
|
|
90
|
-
decimals: 18,
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
address: '0x0352976d940a2C3FBa0C3623198947Ee1d17869E',
|
|
94
|
-
symbol: mento_1.TokenSymbol.PHPm,
|
|
95
|
-
name: 'Mento Philippine Peso',
|
|
96
|
-
decimals: 18,
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
address: '0xd077A400968890Eacc75cdc901F0356c943e4fDb',
|
|
100
|
-
symbol: mento_1.TokenSymbol.USD_,
|
|
101
|
-
name: 'Tether USD',
|
|
102
|
-
decimals: 6,
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
address: '0x01C5C0122039549AD1493B8220cABEdD739BC44E',
|
|
106
|
-
symbol: mento_1.TokenSymbol.USDC,
|
|
107
|
-
name: 'USDC',
|
|
108
|
-
decimals: 6,
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
address: '0xdE9e4C3ce781b4bA68120d6261cbad65ce0aB00b',
|
|
112
|
-
symbol: mento_1.TokenSymbol.USDm,
|
|
113
|
-
name: 'Mento Dollar',
|
|
114
|
-
decimals: 18,
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
address: '0x5505b70207aE3B826c1A7607F19F3Bf73444A082',
|
|
118
|
-
symbol: mento_1.TokenSymbol.XOFm,
|
|
119
|
-
name: 'Mento West African CFA franc',
|
|
120
|
-
decimals: 18,
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
address: '0x10CCfB235b0E1Ed394bACE4560C3ed016697687e',
|
|
124
|
-
symbol: mento_1.TokenSymbol.ZARm,
|
|
125
|
-
name: 'Mento South African Rand',
|
|
126
|
-
decimals: 18,
|
|
127
|
-
},
|
|
128
|
-
];
|