strideutils 0.7.0__tar.gz → 0.7.2__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.
- {strideutils-0.7.0 → strideutils-0.7.2}/.bumpversion.cfg +1 -1
- strideutils-0.7.2/.github/workflows/test.yml +36 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/PKG-INFO +1 -1
- {strideutils-0.7.0 → strideutils-0.7.2}/pyproject.toml +1 -1
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils/redis_connector.py +6 -4
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils/run_safely.py +5 -1
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils/sheets_connector.py +2 -2
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils/stride_config.py +1 -1
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils.egg-info/PKG-INFO +1 -1
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils.egg-info/SOURCES.txt +1 -14
- strideutils-0.7.2/strideutils.egg-info/top_level.txt +1 -0
- strideutils-0.7.0/strideutils-stubs/__init__.pyi +0 -0
- strideutils-0.7.0/strideutils-stubs/coingecko.pyi +0 -7
- strideutils-0.7.0/strideutils-stubs/cryptography.pyi +0 -2
- strideutils-0.7.0/strideutils-stubs/exec_tx.pyi +0 -15
- strideutils-0.7.0/strideutils-stubs/invariant_helpers.pyi +0 -5
- strideutils-0.7.0/strideutils-stubs/redis_connector.pyi +0 -37
- strideutils-0.7.0/strideutils-stubs/run_safely.pyi +0 -5
- strideutils-0.7.0/strideutils-stubs/sheets_connector.pyi +0 -41
- strideutils-0.7.0/strideutils-stubs/slack_connector.pyi +0 -13
- strideutils-0.7.0/strideutils-stubs/stride_alerts.pyi +0 -19
- strideutils-0.7.0/strideutils-stubs/stride_config.pyi +0 -109
- strideutils-0.7.0/strideutils-stubs/stride_requests.pyi +0 -66
- strideutils-0.7.0/strideutils-stubs/stride_upstash.pyi +0 -10
- strideutils-0.7.0/strideutils-stubs/twilio_connector.pyi +0 -21
- strideutils-0.7.0/strideutils.egg-info/top_level.txt +0 -2
- {strideutils-0.7.0 → strideutils-0.7.2}/.github/workflows/lint.yml +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/.github/workflows/publish.yml +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/.github/workflows/version.yaml +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/.gitignore +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/LICENSE +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/Makefile +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/README.md +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/setup.cfg +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils/Makefile +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils/__init__.py +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils/coingecko.py +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils/config_examples/env.local.example +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils/config_examples/strideutils_config.yaml.example +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils/cryptography.py +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils/exec_tx.py +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils/invariant_helpers.py +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils/slack_connector.py +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils/stride_alerts.py +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils/stride_requests.py +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils/stride_upstash.py +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils/twilio_connector.py +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils/types.py +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils.egg-info/dependency_links.txt +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/strideutils.egg-info/requires.txt +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/tests/test_config.py +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/tests/test_encryption.py +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/tests/test_redis_connector.py +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/tests/test_sheets_connector.py +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/tests/test_slack_connector.py +0 -0
- {strideutils-0.7.0 → strideutils-0.7.2}/tests/test_twilio_connector.py +0 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: Strideutils Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
workflow_dispatch:
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
test:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v3
|
|
17
|
+
|
|
18
|
+
- name: Set up Python
|
|
19
|
+
uses: actions/setup-python@v4
|
|
20
|
+
with:
|
|
21
|
+
python-version: "3.11"
|
|
22
|
+
|
|
23
|
+
- name: Install dependencies
|
|
24
|
+
run: |
|
|
25
|
+
python -m pip install --upgrade pip
|
|
26
|
+
pip install -e .[dev]
|
|
27
|
+
|
|
28
|
+
- name: Run tests
|
|
29
|
+
run: pytest tests -v
|
|
30
|
+
|
|
31
|
+
- name: Upload test results
|
|
32
|
+
uses: actions/upload-artifact@v3
|
|
33
|
+
if: failure()
|
|
34
|
+
with:
|
|
35
|
+
name: test-results
|
|
36
|
+
path: test-results/
|
|
@@ -32,26 +32,28 @@ class RedisClient:
|
|
|
32
32
|
_instance = None
|
|
33
33
|
_dbs: Dict[str, redis.Redis] = {}
|
|
34
34
|
|
|
35
|
-
def __new__(cls, db_names: Optional[List[str]] = None):
|
|
35
|
+
def __new__(cls, db_names: Optional[List[str] | str] = None):
|
|
36
36
|
if cls._instance is None:
|
|
37
37
|
cls._instance = super(RedisClient, cls).__new__(cls)
|
|
38
38
|
cls._instance.__init__(db_names)
|
|
39
39
|
return cls._instance
|
|
40
40
|
|
|
41
|
-
def __init__(self, db_names: Optional[List[str]] = None):
|
|
41
|
+
def __init__(self, db_names: Optional[List[str] | str] = None):
|
|
42
42
|
if len(self._dbs) == 0:
|
|
43
43
|
self._init_dbs(db_names)
|
|
44
44
|
|
|
45
|
-
def _init_dbs(self,
|
|
45
|
+
def _init_dbs(self, db_name_or_names: Optional[List[str] | str] = None):
|
|
46
46
|
"""
|
|
47
47
|
Initializes Redis database connections.
|
|
48
48
|
|
|
49
49
|
Args:
|
|
50
|
-
db_names: Optional list of database names to initialize.
|
|
50
|
+
db_names: Optional database name or list of database names to initialize.
|
|
51
|
+
If None, initializes all databases.
|
|
51
52
|
|
|
52
53
|
Raises:
|
|
53
54
|
ValueError: If db_names is an empty list or contains invalid database names.
|
|
54
55
|
"""
|
|
56
|
+
db_names = [db_name_or_names] if type(db_name_or_names) is str else db_name_or_names
|
|
55
57
|
if db_names is not None and len(db_names) == 0:
|
|
56
58
|
raise ValueError("db_names cannot be an empty list")
|
|
57
59
|
|
|
@@ -9,6 +9,7 @@ def try_and_log_with_status(
|
|
|
9
9
|
*functions: Callable,
|
|
10
10
|
slack_channel: str = 'alerts-status',
|
|
11
11
|
job_name: str = "alerts",
|
|
12
|
+
slack_client: Optional[slack_connector.SlackClient] = None,
|
|
12
13
|
botname: Optional[str] = None,
|
|
13
14
|
print_status: bool = False,
|
|
14
15
|
):
|
|
@@ -27,6 +28,9 @@ def try_and_log_with_status(
|
|
|
27
28
|
slack_channel = 'alerts-debug'
|
|
28
29
|
print_status = True
|
|
29
30
|
|
|
31
|
+
if slack_client is None:
|
|
32
|
+
slack_client = slack_connector.SlackClient()
|
|
33
|
+
|
|
30
34
|
tracebacks = []
|
|
31
35
|
msgs = []
|
|
32
36
|
for func in functions:
|
|
@@ -64,4 +68,4 @@ def try_and_log_with_status(
|
|
|
64
68
|
else:
|
|
65
69
|
status_msg = f':white_check_mark: {count_succeeded_msg}'
|
|
66
70
|
|
|
67
|
-
|
|
71
|
+
slack_client.post_message([status_msg] + ["\n".join(msgs)] + tracebacks, slack_channel, botname=botname)
|
|
@@ -56,7 +56,7 @@ class GoogleSheetsClient:
|
|
|
56
56
|
auth_dict = json.loads(auth_dict_contents, strict=False)
|
|
57
57
|
|
|
58
58
|
creds = service_account.Credentials.from_service_account_info(auth_dict, scopes=SCOPES)
|
|
59
|
-
client = gspread.authorize(creds, http_client=BackOffHTTPClient)
|
|
59
|
+
client = gspread.authorize(creds, http_client=BackOffHTTPClient)
|
|
60
60
|
|
|
61
61
|
return client
|
|
62
62
|
|
|
@@ -115,7 +115,7 @@ class GoogleSheetsClient:
|
|
|
115
115
|
try:
|
|
116
116
|
worksheet = spreadsheet.worksheet(sheet_name)
|
|
117
117
|
except WorksheetNotFound:
|
|
118
|
-
worksheet = spreadsheet.add_worksheet(title=sheet_name, rows=
|
|
118
|
+
worksheet = spreadsheet.add_worksheet(title=sheet_name, rows=1, cols=1)
|
|
119
119
|
|
|
120
120
|
# Build the list of values to add.
|
|
121
121
|
df = df.fillna('')
|
|
@@ -421,7 +421,7 @@ def _parse_raw_configs(raw_config: dict[str, Any], raw_secrets: dict[str, Option
|
|
|
421
421
|
# Load non-nested configs, then overwrite with the chain configs
|
|
422
422
|
config_dict = raw_secrets
|
|
423
423
|
config_dict.update(raw_config)
|
|
424
|
-
config_dict.update(chain_configs)
|
|
424
|
+
config_dict.update(chain_configs)
|
|
425
425
|
return Config(**config_dict) # type: ignore
|
|
426
426
|
|
|
427
427
|
|
|
@@ -6,6 +6,7 @@ README.md
|
|
|
6
6
|
pyproject.toml
|
|
7
7
|
.github/workflows/lint.yml
|
|
8
8
|
.github/workflows/publish.yml
|
|
9
|
+
.github/workflows/test.yml
|
|
9
10
|
.github/workflows/version.yaml
|
|
10
11
|
strideutils/Makefile
|
|
11
12
|
strideutils/__init__.py
|
|
@@ -23,20 +24,6 @@ strideutils/stride_requests.py
|
|
|
23
24
|
strideutils/stride_upstash.py
|
|
24
25
|
strideutils/twilio_connector.py
|
|
25
26
|
strideutils/types.py
|
|
26
|
-
strideutils-stubs/__init__.pyi
|
|
27
|
-
strideutils-stubs/coingecko.pyi
|
|
28
|
-
strideutils-stubs/cryptography.pyi
|
|
29
|
-
strideutils-stubs/exec_tx.pyi
|
|
30
|
-
strideutils-stubs/invariant_helpers.pyi
|
|
31
|
-
strideutils-stubs/redis_connector.pyi
|
|
32
|
-
strideutils-stubs/run_safely.pyi
|
|
33
|
-
strideutils-stubs/sheets_connector.pyi
|
|
34
|
-
strideutils-stubs/slack_connector.pyi
|
|
35
|
-
strideutils-stubs/stride_alerts.pyi
|
|
36
|
-
strideutils-stubs/stride_config.pyi
|
|
37
|
-
strideutils-stubs/stride_requests.pyi
|
|
38
|
-
strideutils-stubs/stride_upstash.pyi
|
|
39
|
-
strideutils-stubs/twilio_connector.pyi
|
|
40
27
|
strideutils.egg-info/PKG-INFO
|
|
41
28
|
strideutils.egg-info/SOURCES.txt
|
|
42
29
|
strideutils.egg-info/dependency_links.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
strideutils
|
|
File without changes
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
from dataclasses import dataclass
|
|
2
|
-
from strideutils import stride_requests as stride_requests
|
|
3
|
-
from strideutils.stride_config import config as config
|
|
4
|
-
|
|
5
|
-
@dataclass
|
|
6
|
-
class TxResponse:
|
|
7
|
-
stdout: str
|
|
8
|
-
stderr: str
|
|
9
|
-
tx_response: dict | None = ...
|
|
10
|
-
tx_hash: str | None = ...
|
|
11
|
-
success: bool = ...
|
|
12
|
-
raw_log: str | None = ...
|
|
13
|
-
def __init__(self, stdout, stderr, tx_response=..., tx_hash=..., success=..., raw_log=...) -> None: ...
|
|
14
|
-
|
|
15
|
-
def execute_tx(command: str, api_endpoint: str = ...) -> TxResponse: ...
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
from typing import Dict, List, Optional
|
|
2
|
-
import redis
|
|
3
|
-
|
|
4
|
-
DATABASE_ENVIRONMENT_CONFIGS: Dict[str, tuple[str, str, str]]
|
|
5
|
-
ALL_DATABASE_NAMES: List[str]
|
|
6
|
-
|
|
7
|
-
class RedisClient:
|
|
8
|
-
_instance: Optional['RedisClient']
|
|
9
|
-
_dbs: Dict[str, redis.Redis]
|
|
10
|
-
_initialized: bool
|
|
11
|
-
|
|
12
|
-
def __new__(cls, db_names: Optional[List[str]] = None) -> 'RedisClient': ...
|
|
13
|
-
|
|
14
|
-
def __init__(self, db_names: Optional[List[str]] = None) -> None: ...
|
|
15
|
-
|
|
16
|
-
def _init_dbs(self, db_names: Optional[List[str]] = None) -> None: ...
|
|
17
|
-
|
|
18
|
-
@staticmethod
|
|
19
|
-
def _init_db(database_name: str) -> redis.Redis: ...
|
|
20
|
-
|
|
21
|
-
def get_db(self, name: Optional[str] = None) -> redis.Redis: ...
|
|
22
|
-
|
|
23
|
-
def get(self, key: str, db_name: Optional[str] = None) -> Optional[str]: ...
|
|
24
|
-
|
|
25
|
-
def get_multiple_keys(self, keys: List[str], db_name: Optional[str] = None) -> List[Optional[str]]: ...
|
|
26
|
-
|
|
27
|
-
def get_all_keys(self, db_name: Optional[str] = None) -> List[str]: ...
|
|
28
|
-
|
|
29
|
-
def set(self, key: str, val: str, db_name: Optional[str] = None) -> None: ...
|
|
30
|
-
|
|
31
|
-
def set_keys(self, dict_to_upload: Dict[str, str], db_name: Optional[str] = None, prefix: str = '') -> None: ...
|
|
32
|
-
|
|
33
|
-
@property
|
|
34
|
-
def dbs(self) -> Dict[str, redis.Redis]: ...
|
|
35
|
-
|
|
36
|
-
@classmethod
|
|
37
|
-
def _reset(cls) -> None: ...
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
from strideutils import slack_connector as slack_connector
|
|
2
|
-
from strideutils.stride_config import config as config
|
|
3
|
-
from typing import Callable
|
|
4
|
-
|
|
5
|
-
def try_and_log_with_status(*functions: Callable, slack_channel: str = 'alerts-status', job_name: str = 'alerts', botname: str | None = None): ...
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
from typing import List, Dict, Optional, Tuple
|
|
2
|
-
import gspread
|
|
3
|
-
import pandas as pd
|
|
4
|
-
|
|
5
|
-
SCOPES: Tuple[str, ...]
|
|
6
|
-
|
|
7
|
-
class GoogleSheetsClient:
|
|
8
|
-
_instance: Optional['GoogleSheetsClient']
|
|
9
|
-
client: gspread.Client
|
|
10
|
-
cache_enabled: bool
|
|
11
|
-
_cache: Dict[str, pd.DataFrame]
|
|
12
|
-
|
|
13
|
-
def __new__(cls) -> 'GoogleSheetsClient': ...
|
|
14
|
-
|
|
15
|
-
def __init__(self, cache_enabled: bool = False) -> None: ...
|
|
16
|
-
|
|
17
|
-
@staticmethod
|
|
18
|
-
def _get_auth_client() -> gspread.Client: ...
|
|
19
|
-
|
|
20
|
-
def grab_sheet(
|
|
21
|
-
self,
|
|
22
|
-
sheet_id: str,
|
|
23
|
-
sheet_name: str,
|
|
24
|
-
columns_labeled: bool = True,
|
|
25
|
-
) -> pd.DataFrame: ...
|
|
26
|
-
|
|
27
|
-
def write_sheet(
|
|
28
|
-
self,
|
|
29
|
-
df: pd.DataFrame,
|
|
30
|
-
sheet_id: str,
|
|
31
|
-
sheet_name: str,
|
|
32
|
-
) -> None: ...
|
|
33
|
-
|
|
34
|
-
def reorder_sheet(
|
|
35
|
-
self,
|
|
36
|
-
sheet_id: str,
|
|
37
|
-
sheet_name: str,
|
|
38
|
-
new_location: int = 0,
|
|
39
|
-
) -> None: ...
|
|
40
|
-
|
|
41
|
-
def get_sheet_names(self, sheet_id: str) -> List[str]: ...
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
from strideutils.stride_config import config as config
|
|
2
|
-
from typing import Union, List, Optional
|
|
3
|
-
from slack_sdk import WebClient
|
|
4
|
-
|
|
5
|
-
class SlackClient:
|
|
6
|
-
_instance: 'SlackClient'
|
|
7
|
-
api_token: str
|
|
8
|
-
client: WebClient
|
|
9
|
-
|
|
10
|
-
def __new__(cls) -> 'SlackClient': ...
|
|
11
|
-
def __init__(self) -> None: ...
|
|
12
|
-
def post_message(self, message: Union[str, List[str]], channel: str, botname: Optional[str] = None, thread_ts: Optional[str] = None) -> str: ...
|
|
13
|
-
def upload_file(self, file_name: str, content: str) -> str: ...
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import pandas as pd
|
|
2
|
-
from enum import Enum
|
|
3
|
-
from strideutils import slack_connector as slack_connector, twilio_connector as twilio_connector
|
|
4
|
-
from strideutils.stride_config import config as config
|
|
5
|
-
from typing import Callable, Iterable
|
|
6
|
-
|
|
7
|
-
class AlertType(Enum):
|
|
8
|
-
DEBUG: str
|
|
9
|
-
INFO: str
|
|
10
|
-
WARNING: str
|
|
11
|
-
CRITICAL: str
|
|
12
|
-
|
|
13
|
-
def get_tags(individuals: str | Iterable[str]) -> str: ...
|
|
14
|
-
def df_to_message_body(df: pd.DataFrame) -> str: ...
|
|
15
|
-
def wrap_in_code_block(message: str) -> str: ...
|
|
16
|
-
def notify(msgs: str | list[str], urgency, tag: str | Iterable[str] | None = None, call: str | Iterable[str] | None = None, beta_alert: bool = False, debug_readme_section: str = '') -> None: ...
|
|
17
|
-
def raise_alert(urgency: AlertType | str, tag: str | Iterable[str] | None = None, call: str | Iterable[str] | None = None, beta_alert: bool = False, debug_readme_section: str = '') -> Callable: ...
|
|
18
|
-
def run_daily(utc_hour_or_alert: int | Callable) -> Callable: ...
|
|
19
|
-
def run_epochly(f: Callable) -> Callable: ...
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import yaml
|
|
2
|
-
from _typeshed import Incomplete
|
|
3
|
-
from collections.abc import Generator
|
|
4
|
-
from dataclasses import dataclass
|
|
5
|
-
|
|
6
|
-
MISSING_CONFIG_MSG: str
|
|
7
|
-
ENV: Incomplete
|
|
8
|
-
|
|
9
|
-
class ConfigObj:
|
|
10
|
-
def __getattr__(self, name) -> None: ...
|
|
11
|
-
def __getattribute__(self, name): ...
|
|
12
|
-
def __iter__(self): ...
|
|
13
|
-
|
|
14
|
-
class ConfigDict(dict):
|
|
15
|
-
def __getitem__(self, key): ...
|
|
16
|
-
|
|
17
|
-
class Loader(yaml.FullLoader):
|
|
18
|
-
def construct_yaml_map(self, node) -> Generator[Incomplete, None, None]: ...
|
|
19
|
-
|
|
20
|
-
@dataclass(repr=False)
|
|
21
|
-
class ChainConfig(ConfigObj):
|
|
22
|
-
name: str = ...
|
|
23
|
-
id: str = ...
|
|
24
|
-
coingecko_name: str = ...
|
|
25
|
-
denom: str = ...
|
|
26
|
-
denom_decimals: int = ...
|
|
27
|
-
inflation_frequency_hours: int = ...
|
|
28
|
-
ticker: str = ...
|
|
29
|
-
stride_token_hash: str = ...
|
|
30
|
-
api_endpoint: str = ...
|
|
31
|
-
rpc_endpoint: str = ...
|
|
32
|
-
library_api: str = ...
|
|
33
|
-
library_rpc: str = ...
|
|
34
|
-
def __init__(self, name=..., id=..., coingecko_name=..., denom=..., denom_decimals=..., inflation_frequency_hours=..., ticker=..., stride_token_hash=..., api_endpoint=..., rpc_endpoint=..., library_api=..., library_rpc=...) -> None: ...
|
|
35
|
-
|
|
36
|
-
@dataclass(repr=False)
|
|
37
|
-
class HostZoneChainConfig(ConfigObj):
|
|
38
|
-
cosmoshub: ChainConfig = ...
|
|
39
|
-
osmosis: ChainConfig = ...
|
|
40
|
-
evmos: ChainConfig = ...
|
|
41
|
-
injective: ChainConfig = ...
|
|
42
|
-
juno: ChainConfig = ...
|
|
43
|
-
stargaze: ChainConfig = ...
|
|
44
|
-
terra: ChainConfig = ...
|
|
45
|
-
umee: ChainConfig = ...
|
|
46
|
-
comdex: ChainConfig = ...
|
|
47
|
-
sommelier: ChainConfig = ...
|
|
48
|
-
dydx: ChainConfig = ...
|
|
49
|
-
saga: ChainConfig = ...
|
|
50
|
-
def __init__(self, cosmoshub=..., osmosis=..., evmos=..., injective=..., juno=..., stargaze=..., terra=..., umee=..., comdex=..., sommelier=..., dydx=..., saga=...) -> None: ...
|
|
51
|
-
|
|
52
|
-
@dataclass(repr=False)
|
|
53
|
-
class AppConfig(ConfigObj):
|
|
54
|
-
neutron: ChainConfig = ...
|
|
55
|
-
kava: ChainConfig = ...
|
|
56
|
-
iris: ChainConfig = ...
|
|
57
|
-
akash: ChainConfig = ...
|
|
58
|
-
sentinel: ChainConfig = ...
|
|
59
|
-
persistence: ChainConfig = ...
|
|
60
|
-
cryptoorg: ChainConfig = ...
|
|
61
|
-
kichain: ChainConfig = ...
|
|
62
|
-
bitcanna: ChainConfig = ...
|
|
63
|
-
regen: ChainConfig = ...
|
|
64
|
-
gravity: ChainConfig = ...
|
|
65
|
-
desmos: ChainConfig = ...
|
|
66
|
-
chihuahua: ChainConfig = ...
|
|
67
|
-
secret: ChainConfig = ...
|
|
68
|
-
axelar: ChainConfig = ...
|
|
69
|
-
crescent: ChainConfig = ...
|
|
70
|
-
mantle: ChainConfig = ...
|
|
71
|
-
mars: ChainConfig = ...
|
|
72
|
-
canto: ChainConfig = ...
|
|
73
|
-
agoric: ChainConfig = ...
|
|
74
|
-
celestia: ChainConfig = ...
|
|
75
|
-
dymension: ChainConfig = ...
|
|
76
|
-
def __init__(self, neutron=..., kava=..., iris=..., akash=..., sentinel=..., persistence=..., cryptoorg=..., kichain=..., bitcanna=..., regen=..., gravity=..., desmos=..., chihuahua=..., secret=..., axelar=..., crescent=..., mantle=..., mars=..., canto=..., agoric=..., celestia=..., dymension=...) -> None: ...
|
|
77
|
-
|
|
78
|
-
@dataclass(repr=False)
|
|
79
|
-
class Config(ConfigObj):
|
|
80
|
-
ENV: str
|
|
81
|
-
timezone: str = ...
|
|
82
|
-
TWILIO_ALERTS_NUMBER: str = ...
|
|
83
|
-
TWILIO_ACCOUNT_ID: str = ...
|
|
84
|
-
TWILIO_API_TOKEN: str = ...
|
|
85
|
-
PHONE_NUMBERS: ConfigDict = ...
|
|
86
|
-
STRIDEBOT_API_TOKEN: str = ...
|
|
87
|
-
PUBLICSHEETS_AUTH: str | ConfigDict = ...
|
|
88
|
-
COINGECKO_API_TOKEN: str = ...
|
|
89
|
-
PROTOCOL_STAKING_API_TOKEN: str = ...
|
|
90
|
-
alerts_playbook: str = ...
|
|
91
|
-
slack_channels: ConfigDict = ...
|
|
92
|
-
UPSTASH_PUBLIC_PASSWORD: str = ...
|
|
93
|
-
UPSTASH_STRIDE_FRONTEND_PASSWORD: str = ...
|
|
94
|
-
UPSTASH_STRIDE_BACKEND_PASSWORD: str = ...
|
|
95
|
-
UPSTASH_STRIDE_DYDX_PUBLIC_PASSWORD: str = ...
|
|
96
|
-
SLACK_BEARER_TOKEN: str = ...
|
|
97
|
-
SLACK_SUCCESS_CHANNEL_ID: str = ...
|
|
98
|
-
SLACK_INVARIANT_FAILURE_CHANNEL_ID: str = ...
|
|
99
|
-
SLACK_PACKET_FAILURE_CHANNEL_ID: str = ...
|
|
100
|
-
NUMIA_API_TOKEN: str = ...
|
|
101
|
-
founders: list[str] = ...
|
|
102
|
-
stride: ChainConfig = ...
|
|
103
|
-
host_zones: HostZoneChainConfig = ...
|
|
104
|
-
app_chains: AppConfig = ...
|
|
105
|
-
def __post_init__(self) -> None: ...
|
|
106
|
-
def get_chain(self, name: str | None = None, id: str | None = None, ticker: str | None = None, denom: str | None = None, stride_token_hash: str | None = None) -> ChainConfig: ...
|
|
107
|
-
def __init__(self, ENV, timezone=..., TWILIO_ALERTS_NUMBER=..., TWILIO_ACCOUNT_ID=..., TWILIO_API_TOKEN=..., PHONE_NUMBERS=..., STRIDEBOT_API_TOKEN=..., PUBLICSHEETS_AUTH=..., COINGECKO_API_TOKEN=..., PROTOCOL_STAKING_API_TOKEN=..., alerts_playbook=..., slack_channels=..., UPSTASH_PUBLIC_PASSWORD=..., UPSTASH_STRIDE_FRONTEND_PASSWORD=..., UPSTASH_STRIDE_BACKEND_PASSWORD=..., UPSTASH_STRIDE_DYDX_PUBLIC_PASSWORD=..., SLACK_BEARER_TOKEN=..., SLACK_SUCCESS_CHANNEL_ID=..., SLACK_INVARIANT_FAILURE_CHANNEL_ID=..., SLACK_PACKET_FAILURE_CHANNEL_ID=..., NUMIA_API_TOKEN=..., founders=..., stride=..., host_zones=..., app_chains=...) -> None: ...
|
|
108
|
-
|
|
109
|
-
config: Config
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import datetime
|
|
2
|
-
import pandas as pd
|
|
3
|
-
from _typeshed import Incomplete
|
|
4
|
-
from strideutils import stride_upstash as stride_upstash
|
|
5
|
-
from strideutils.stride_config import config as config
|
|
6
|
-
from typing import Any
|
|
7
|
-
|
|
8
|
-
ACCOUNT_QUERY: str
|
|
9
|
-
ACCOUNT_BALANCE_QUERY: str
|
|
10
|
-
ACCOUNT_DELEGATIONS_QUERY: str
|
|
11
|
-
ACCOUNT_UNBONDINGS_QUERY: str
|
|
12
|
-
MODULE_ACCOUNTS_QUERY: str
|
|
13
|
-
SUPPLY_QUERY: str
|
|
14
|
-
CONNECTION_QUERY: str
|
|
15
|
-
CHANNELS_QUERY: str
|
|
16
|
-
CHANNEL_QUERY: str
|
|
17
|
-
TXS_QUERY: str
|
|
18
|
-
TX_BY_ACCOUNT_EVENT: str
|
|
19
|
-
HOST_ZONE_QUERY: str
|
|
20
|
-
EPOCHS_QUERY: str
|
|
21
|
-
RATE_LIMIT_QUERY: str
|
|
22
|
-
STAKETIA: str
|
|
23
|
-
STAKEDYM: str
|
|
24
|
-
MULTISIG_HOST_ZONE_QUERY: str
|
|
25
|
-
MULTISIG_DELEGATION_RECORDS_QUERY: str
|
|
26
|
-
MULTISIG_UNBONDING_RECORDS_QUERY: str
|
|
27
|
-
MULTISIG_REDEMPTION_RECORDS_QUERY: str
|
|
28
|
-
COSMWASM_CONTRACT_QUERY: str
|
|
29
|
-
requests_session: Incomplete
|
|
30
|
-
retries: Incomplete
|
|
31
|
-
|
|
32
|
-
def request(url: str, headers: dict = {}, params: dict | list[tuple[str, str]] = {}, block_height: int = 0, cache_response: bool = False, _cache: dict[str, Any] = {}): ...
|
|
33
|
-
def query_list_with_pagination(endpoint: str, rel_key: str, block_height: int = 0, max_pages: int = 50) -> list[dict]: ...
|
|
34
|
-
def get_all_host_zones() -> list[dict]: ...
|
|
35
|
-
def get_host_zone_json(zone_id: str, cast_types: bool = True, **kwargs) -> dict[str, Any]: ...
|
|
36
|
-
def get_celestia_host_zone(cast_types: bool = True) -> dict[str, Any]: ...
|
|
37
|
-
def get_dymension_host_zone(cast_types: bool = True) -> dict[str, Any]: ...
|
|
38
|
-
def get_multisig_delegation_records(module: str, include_archived: bool = False) -> list[dict]: ...
|
|
39
|
-
def get_multisig_unbonding_records(module: str, include_archived: bool = False) -> list[dict]: ...
|
|
40
|
-
def get_multisig_redemption_records(module: str, address: str | None = None, unbonding_record_id: int | None = None) -> list[dict]: ...
|
|
41
|
-
def get_rate_limits(**kwargs): ...
|
|
42
|
-
def get_validators(api_endpoint: str = ...) -> list[dict[str, Any]]: ...
|
|
43
|
-
def get_redemption_rate(token: str) -> float: ...
|
|
44
|
-
def get_tvl_in_utokens(host_zone_id: str) -> float: ...
|
|
45
|
-
def get_latest_block(rpc_endpoint: str = ...) -> int: ...
|
|
46
|
-
def convert_cosmos_address(address: str, new_prefix: str) -> str: ...
|
|
47
|
-
def get_balances(address: str, block_height: int = 0, api_endpoint: str = ..., cache_response: bool = False) -> dict[str, int]: ...
|
|
48
|
-
def get_balance(address: str, denom: str, block_height: int = 0, api_endpoint: str = ..., cache_response: bool = False) -> int: ...
|
|
49
|
-
def get_supply(denom: str, block_height: int = 0, api_endpoint: str = ..., cache_response: bool = False) -> int: ...
|
|
50
|
-
def get_block_time(height: int, rpc_endpoint: str = ...) -> datetime.datetime: ...
|
|
51
|
-
def get_icns_name(address: str) -> str: ...
|
|
52
|
-
def get_account_info(address: str, api_endpoint: str = ...): ...
|
|
53
|
-
def get_txs(event_filters: list[str], api_endpoint: str = ..., limit: Incomplete | None = None) -> dict: ...
|
|
54
|
-
def get_tx_info(address: str, sequence: str | int, api_endpoint: str = ...) -> dict: ...
|
|
55
|
-
def generate_vesting_account(start_time_in_local_tz: str, total_tokens: int, seconds_in_period: int = 3600, number_of_days: int = 30, output_file: str = 'vesting_account.json') -> str: ...
|
|
56
|
-
def get_block_height_in_past(time_in_past: datetime.timedelta = ..., max_acceptable_error_seconds: int = ..., seconds_per_block: int = 6, prev_time: str | None = None, verbose: bool = False, rpc_endpoint: str = ...) -> int: ...
|
|
57
|
-
def get_block_height_one_day_ago(verbose: bool = False) -> int: ...
|
|
58
|
-
def get_sttoken_apr(token: str) -> float | None: ...
|
|
59
|
-
def get_delegated_tokens_on_address(delegator_address: str, api_endpoint: str = ...) -> dict[str, int]: ...
|
|
60
|
-
def get_unbonding_tokens_on_address(delegator_address: str, api_endpoint: str = ...) -> dict[str, int]: ...
|
|
61
|
-
def get_host_zone_delegations(host_zone_id: str, ground_truth_included: bool = True) -> pd.DataFrame: ...
|
|
62
|
-
def get_epochs() -> list[dict]: ...
|
|
63
|
-
def get_day_epoch() -> int: ...
|
|
64
|
-
def query_wasm_contract(contract_address: str, query_msg: dict, api_endpoint: str, block_height: int = 0) -> dict: ...
|
|
65
|
-
def get_module_accounts(api_endpoint: str = ...) -> list[dict]: ...
|
|
66
|
-
def get_empirical_annual_fees(ticker: str) -> float: ...
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import redis
|
|
2
|
-
from _typeshed import Incomplete
|
|
3
|
-
from strideutils.stride_config import config as config
|
|
4
|
-
|
|
5
|
-
redis_dbs: Incomplete
|
|
6
|
-
|
|
7
|
-
def get_redis_db(redis_db_name: str) -> redis.Redis: ...
|
|
8
|
-
def get(redis_key: str, db_name: str = 'frontend') -> str | None: ...
|
|
9
|
-
def set(redis_key: str, redis_val: str, db_name: str = 'frontend'): ...
|
|
10
|
-
def set_keys(dict_to_upload: dict[str, str], db_name: str = 'frontend', prefix: str = ''): ...
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
from _typeshed import Incomplete
|
|
2
|
-
from strideutils.stride_config import config as config
|
|
3
|
-
from typing import Iterable, Union, List
|
|
4
|
-
|
|
5
|
-
_: Incomplete
|
|
6
|
-
CALL_TEMPLATE: str
|
|
7
|
-
client: Incomplete
|
|
8
|
-
|
|
9
|
-
def send_calls(msg: str, to: Union[str, Iterable[str], List[str]]) -> None: ...
|
|
10
|
-
|
|
11
|
-
class TwilioClient:
|
|
12
|
-
_instance: 'TwilioClient'
|
|
13
|
-
call_template: str
|
|
14
|
-
account_id: str
|
|
15
|
-
api_token: str
|
|
16
|
-
alert_numbers: str
|
|
17
|
-
client: Incomplete
|
|
18
|
-
|
|
19
|
-
def __new__(cls) -> 'TwilioClient': ...
|
|
20
|
-
def __init__(self) -> None: ...
|
|
21
|
-
def call(self, msg: str, to: Union[str, Iterable[str], List[str]]) -> None: ...
|
|
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
|
{strideutils-0.7.0 → strideutils-0.7.2}/strideutils/config_examples/strideutils_config.yaml.example
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|