Skip to main content
Glama
monostate

100ms Raydium Sniper MCP

by monostate
useDraggablePane.ts1.45 kB
import { useCallback, useEffect, useRef, useState } from "react"; export function useDraggablePane(initialHeight: number) { const [height, setHeight] = useState(initialHeight); const [isDragging, setIsDragging] = useState(false); const dragStartY = useRef<number>(0); const dragStartHeight = useRef<number>(0); const handleDragStart = useCallback( (e: React.MouseEvent) => { setIsDragging(true); dragStartY.current = e.clientY; dragStartHeight.current = height; document.body.style.userSelect = "none"; }, [height], ); const handleDragMove = useCallback( (e: MouseEvent) => { if (!isDragging) return; const deltaY = dragStartY.current - e.clientY; const newHeight = Math.max( 100, Math.min(800, dragStartHeight.current + deltaY), ); setHeight(newHeight); }, [isDragging], ); const handleDragEnd = useCallback(() => { setIsDragging(false); document.body.style.userSelect = ""; }, []); useEffect(() => { if (isDragging) { window.addEventListener("mousemove", handleDragMove); window.addEventListener("mouseup", handleDragEnd); return () => { window.removeEventListener("mousemove", handleDragMove); window.removeEventListener("mouseup", handleDragEnd); }; } }, [isDragging, handleDragMove, handleDragEnd]); return { height, isDragging, handleDragStart, }; }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/monostate/100ms-SPL-Token-Sniper-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server