cherry-shared2 0.1.29__py3-none-any.whl → 0.1.31__py3-none-any.whl

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.
@@ -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
- def __init__(self, info_url: str, helper_url: str, logger: logging.Logger = None):
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
 
@@ -33,8 +33,8 @@ class Blockchains:
33
33
  "https://solscan.io/token",
34
34
  False,
35
35
  {
36
- 3: {3: 0, 6: 0, 12: 6, 24: 9},
37
- 10: {3: 1.6 , 6: 2.5, 12: 4, 24: 7},
36
+ 3: {3: 0, 6: 0, 12: 8.1, 24: 12.5},
37
+ 10: {3: 2.3, 6: 3.4, 12: 5.4, 24: 9.2},
38
38
  },
39
39
  ["SOL", "USDC"],
40
40
  {
@@ -60,7 +60,7 @@ class Blockchains:
60
60
  25000: 55,
61
61
  100_000: 220,
62
62
  },
63
- "boost_price": {1000: 0.4, 2000: 0.7, 4000: 1.3, 8000: 2.5},
63
+ "boost_price": {1000: 1.5, 2000: 2.9, 4000: 5.4, 8000: 9},
64
64
  },
65
65
  )
66
66
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cherry_shared2
3
- Version: 0.1.29
3
+ Version: 0.1.31
4
4
  Summary: Cherry Bot shared utilities
5
5
  Author: headria
6
6
  Classifier: Development Status :: 4 - Beta
@@ -1,6 +1,6 @@
1
- cherry_shared/InfoService.py,sha256=CikZgVsDgxmonaQrJZuS8vJATL9t7OBIwRYoab3n-5g,13438
1
+ cherry_shared/InfoService.py,sha256=toobrZli-abiP_1JmMtIU1i9h0w0zJyq1IIaSDZdM_k,13933
2
2
  cherry_shared/__init__.py,sha256=4DXpYSpmUPva4PvPewonY2gJFqtSUIMdsnf4QcDcrlc,230
3
- cherry_shared/blockchains.py,sha256=2q_U9Uos9h1K3ybRBWIOtzPIdsfERg7CSCLRTvcDIb4,7269
3
+ cherry_shared/blockchains.py,sha256=8zN7wcNiAi90KfQMdn_I10M0-LruA5_KEvKij2zeUXY,7275
4
4
  cherry_shared/bot_strings.py,sha256=DCNgc8pFFMq6aBzXAKxhrd6Fg1o81BtTU0ZnJ1HfJSA,23373
5
5
  cherry_shared/constants.py,sha256=xcb0daGqq3hqJfbIJMQcQBM-4GPKR4JBGSjtjhwqDeI,1411
6
6
  cherry_shared/emojis.py,sha256=ObKHhNYIHYh3eCSiqSExppa2lQ8TBc1ij0c91vEq5A0,2720
@@ -13,7 +13,7 @@ cherry_shared/types/launchpad.py,sha256=I-oHS96ggyXkSgcpIsVt2U8wbh_myEWssAq3Hnt9
13
13
  cherry_shared/types/leaderboardEntry.py,sha256=BvHACWHQzM5wd3qbc592MOYgNepVBH_ZrGsI8a9qn9A,1979
14
14
  cherry_shared/types/raid_info.py,sha256=qvS3CRCb9sst91iQNvWq0y3m1LMLNNOsXK1xzyiayFg,2916
15
15
  cherry_shared/types/user_wallet.py,sha256=Wq-_eBYLqelsjli890ZyBQCZir_85pC3aBPx1r6v_dA,333
16
- cherry_shared2-0.1.29.dist-info/METADATA,sha256=_f9YtnUqyRb7sTMa9arEf3jxgGQFo_6EOTSB2HRpU8A,2107
17
- cherry_shared2-0.1.29.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
18
- cherry_shared2-0.1.29.dist-info/top_level.txt,sha256=26KLLqVpxIRwDrmJLVqK-fRjZ3ONZSMIK5xvRSMvQPA,14
19
- cherry_shared2-0.1.29.dist-info/RECORD,,
16
+ cherry_shared2-0.1.31.dist-info/METADATA,sha256=Uyu_VW3u-HlTc3llAPug6QtEDIeS6PD3UA1YNEXce9Y,2107
17
+ cherry_shared2-0.1.31.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
18
+ cherry_shared2-0.1.31.dist-info/top_level.txt,sha256=26KLLqVpxIRwDrmJLVqK-fRjZ3ONZSMIK5xvRSMvQPA,14
19
+ cherry_shared2-0.1.31.dist-info/RECORD,,