Skip to content

Commit

Permalink
Fix: Rugcheck options passing (#338)
Browse files Browse the repository at this point in the history
* Fix: options passing to RugCheck service

* Version bump
  • Loading branch information
karimodm authored Feb 13, 2025
1 parent 97b25f7 commit b2c12fe
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
9 changes: 5 additions & 4 deletions python/src/plugins/rugcheck/goat_plugins/rugcheck/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@
@dataclass
class RugCheckPluginOptions:
jwt_token: str = ""
base_url: str = "https://api.rugcheck.xyz/v1"


class RugCheckPlugin(PluginBase):
def __init__(self):
super().__init__("rugcheck", [RugCheckService()])
def __init__(self, options: RugCheckPluginOptions):
super().__init__("rugcheck", [RugCheckService(options.jwt_token, options.base_url)])

def supports_chain(self, chain) -> bool:
return True


def rugcheck() -> RugCheckPlugin:
return RugCheckPlugin()
def rugcheck(options: RugCheckPluginOptions) -> RugCheckPlugin:
return RugCheckPlugin(options)
4 changes: 2 additions & 2 deletions python/src/plugins/rugcheck/goat_plugins/rugcheck/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@


class RugCheckService:
def __init__(self, jwt_token: str = ""):
def __init__(self, jwt_token: str = "", base_url: str = "https://api.rugcheck.xyz/v1"):
self.jwt_token = jwt_token
self.base_url = "https://api.rugcheck.xyz/v1"
self.base_url = base_url

async def _make_request(self, endpoint: str):
headers = {
Expand Down
2 changes: 1 addition & 1 deletion python/src/plugins/rugcheck/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "goat-sdk-plugin-rugcheck"
version = "0.1.1"
version = "0.1.2"
description = "A Python rugcheck plugin for the GOAT SDK"
authors = ["GOAT SDK Team"]
packages = [
Expand Down

0 comments on commit b2c12fe

Please sign in to comment.