Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
run: uv sync --group dev

- name: Lint with ruff
run: uv run ruff check scripts/rugguard.py solana_rug/ tests/
run: uv run ruff check rugguard/ tests/

- name: Type check with mypy
run: uv run mypy scripts/rugguard.py solana_rug/ || true
run: uv run mypy rugguard/ || true

- name: Run unit tests
run: uv run pytest tests/test_checks.py -v -k "not slow" --tb=short
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Repository = "https://github.com/rugpullnet/solana-rug"
"Bug Tracker" = "https://github.com/rugpullnet/solana-rug/issues"

[project.scripts]
solana-rug = "scripts.rugguard:main"
solana-rug = "rugguard.cli:main"

[dependency-groups]
dev = [
Expand Down Expand Up @@ -58,4 +58,4 @@ requires = ["setuptools>=68.0"]
build-backend = "setuptools.build_meta"

[tool.setuptools.packages.find]
include = ["solana_rug*", "scripts*"]
include = ["rugguard*", "scripts*"]
64 changes: 64 additions & 0 deletions rugguard/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
"""rugguard -- On-chain rug-pull detection for Solana tokens.

The core engine: RPC access, on-chain fetchers, risk scoring, and reporting.

Usage:
from rugguard import rug_check_token, RugReport
report = rug_check_token("DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263")
print(report.safety_score)
"""

from importlib.metadata import version as _version

from .analysis import RugReport, rug_check_token, rug_check_wallet
from .formatting import format_csv, format_json, format_jsonl, format_markdown
from .onchain import (
HolderInfo,
HoneypotResult,
LiquidityInfo,
MintHistory,
TokenMeta,
fetch_token_holders,
fetch_token_meta,
)
from .scoring import RugFlags, RugScore
from .watch import (
cli_watch,
describe_watch_change,
ensure_history_db,
load_last_history,
prune_history,
record_history,
send_webhook,
)

try:
__version__ = _version("solana-rug")
except Exception:
__version__ = "0.1.0"

__all__ = [
"rug_check_token",
"rug_check_wallet",
"format_markdown",
"format_json",
"format_csv",
"format_jsonl",
"RugReport",
"RugScore",
"RugFlags",
"TokenMeta",
"LiquidityInfo",
"HolderInfo",
"HoneypotResult",
"MintHistory",
"fetch_token_meta",
"fetch_token_holders",
"cli_watch",
"ensure_history_db",
"load_last_history",
"record_history",
"prune_history",
"describe_watch_change",
"send_webhook",
]
Loading
Loading