cherry-shared2 0.1.30__tar.gz → 0.1.31__tar.gz
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.
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/PKG-INFO +1 -1
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared/InfoService.py +19 -1
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared2.egg-info/PKG-INFO +1 -1
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/setup.py +1 -1
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/README.md +0 -0
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared/__init__.py +0 -0
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared/blockchains.py +0 -0
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared/bot_strings.py +0 -0
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared/constants.py +0 -0
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared/emojis.py +0 -0
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared/functions.py +0 -0
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared/launchpads.py +0 -0
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared/types/__init__.py +0 -0
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared/types/blockchain.py +0 -0
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared/types/dexscreener.py +0 -0
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared/types/launchpad.py +0 -0
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared/types/leaderboardEntry.py +0 -0
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared/types/raid_info.py +0 -0
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared/types/user_wallet.py +0 -0
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared2.egg-info/SOURCES.txt +0 -0
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared2.egg-info/dependency_links.txt +0 -0
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared2.egg-info/requires.txt +0 -0
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared2.egg-info/top_level.txt +0 -0
- {cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/setup.cfg +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import logging
|
|
3
3
|
from typing import Any, Dict, Literal, Optional
|
|
4
|
+
from urllib.parse import urlparse
|
|
4
5
|
import aiohttp
|
|
5
6
|
from cherry_shared.launchpads import LaunchPad
|
|
6
7
|
from cherry_shared.types.dexscreener import Pair
|
|
@@ -9,9 +10,22 @@ from cherry_shared.types.launchpad import LaunchpadToken
|
|
|
9
10
|
|
|
10
11
|
class InfoService:
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
_public_buybot_paths = {
|
|
14
|
+
"/buybot/ping",
|
|
15
|
+
"/buybot/trendingslot/init",
|
|
16
|
+
"/buybot/trendingslot/verify",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
def __init__(
|
|
20
|
+
self,
|
|
21
|
+
info_url: str,
|
|
22
|
+
helper_url: str,
|
|
23
|
+
logger: logging.Logger = None,
|
|
24
|
+
api_key: Optional[str] = None,
|
|
25
|
+
):
|
|
13
26
|
self.info_url = info_url
|
|
14
27
|
self.helper_url = helper_url
|
|
28
|
+
self._api_key = api_key
|
|
15
29
|
if logger is None:
|
|
16
30
|
self._logger = logging.getLogger(__name__)
|
|
17
31
|
else:
|
|
@@ -28,6 +42,10 @@ class InfoService:
|
|
|
28
42
|
):
|
|
29
43
|
if headers is None:
|
|
30
44
|
headers = {"Content-Type": "application/json"}
|
|
45
|
+
if self._api_key:
|
|
46
|
+
path = urlparse(url).path
|
|
47
|
+
if path.startswith("/buybot") and path not in self._public_buybot_paths:
|
|
48
|
+
headers = {**headers, "x-api-key": self._api_key}
|
|
31
49
|
# Define a custom timeout
|
|
32
50
|
custom_timeout = aiohttp.ClientTimeout(total=timeout)
|
|
33
51
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{cherry_shared2-0.1.30 → cherry_shared2-0.1.31}/cherry_shared2.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|