diff --git a/mm2src/mm2_main/src/lp_swap/max_maker_vol_rpc.rs b/mm2src/mm2_main/src/lp_swap/max_maker_vol_rpc.rs index cceb5cb3ed..e3f24987ec 100644 --- a/mm2src/mm2_main/src/lp_swap/max_maker_vol_rpc.rs +++ b/mm2src/mm2_main/src/lp_swap/max_maker_vol_rpc.rs @@ -52,8 +52,6 @@ pub enum MaxMakerVolRpcError { }, #[display(fmt = "No such coin {}", coin)] NoSuchCoin { coin: String }, - #[display(fmt = "Coin {} is wallet only", coin)] - CoinIsWalletOnly { coin: String }, #[display(fmt = "Transport error: {}", _0)] Transport(String), #[display(fmt = "Internal error: {}", _0)] @@ -111,11 +109,10 @@ impl From for MaxMakerVolRpcError { impl HttpStatusCode for MaxMakerVolRpcError { fn status_code(&self) -> StatusCode { match self { + MaxMakerVolRpcError::NoSuchCoin { .. } => StatusCode::NOT_FOUND, MaxMakerVolRpcError::NotSufficientBalance { .. } | MaxMakerVolRpcError::NotSufficientBaseCoinBalance { .. } - | MaxMakerVolRpcError::VolumeTooLow { .. } - | MaxMakerVolRpcError::NoSuchCoin { .. } - | MaxMakerVolRpcError::CoinIsWalletOnly { .. } => StatusCode::BAD_REQUEST, + | MaxMakerVolRpcError::VolumeTooLow { .. } => StatusCode::BAD_REQUEST, MaxMakerVolRpcError::Transport(_) | MaxMakerVolRpcError::InternalError(_) => { StatusCode::INTERNAL_SERVER_ERROR }, @@ -138,14 +135,12 @@ pub struct MaxMakerVolResponse { pub async fn max_maker_vol(ctx: MmArc, req: MaxMakerVolRequest) -> MmResult { let coin = lp_coinfind_or_err(&ctx, &req.coin).await?; - if coin.wallet_only(&ctx) { - return MmError::err(MaxMakerVolRpcError::CoinIsWalletOnly { coin: req.coin }); - } let CoinVolumeInfo { volume, balance, locked_by_swaps, } = get_max_maker_vol(&ctx, &coin).await?; + Ok(MaxMakerVolResponse { coin: req.coin, volume: MmNumberMultiRepr::from(volume),