py-near 1.1.41__tar.gz → 1.1.43__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.
- {py_near-1.1.41 → py_near-1.1.43}/PKG-INFO +1 -1
- {py_near-1.1.41 → py_near-1.1.43}/pyproject.toml +2 -2
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/providers.py +40 -32
- {py_near-1.1.41 → py_near-1.1.43}/LICENSE +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/README.md +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/__init__.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/account.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/constants.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/__init__.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/__pycache__/__init__.cpython-311.pyc +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/__pycache__/core.cpython-311.pyc +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/__pycache__/fts.cpython-311.pyc +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/core.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/ft/__init__.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/ft/__pycache__/__init__.cpython-311.pyc +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/ft/__pycache__/async_client.cpython-311.pyc +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/ft/__pycache__/exceptions.cpython-311.pyc +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/ft/__pycache__/models.cpython-311.pyc +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/ft/async_client.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/ft/exceptions.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/ft/models.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/fts.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/keypom/__init__.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/keypom/async_client.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/keypom/exceptions.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/keypom/models.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/staking/__init__.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/staking/__pycache__/__init__.cpython-311.pyc +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/staking/__pycache__/async_client.cpython-311.pyc +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/staking/__pycache__/exceptions.cpython-311.pyc +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/staking/__pycache__/models.cpython-311.pyc +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/staking/async_client.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/staking/exceptions.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/staking/models.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/exceptions/__init__.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/exceptions/__pycache__/__init__.cpython-311.pyc +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/exceptions/__pycache__/exceptions.cpython-311.pyc +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/exceptions/__pycache__/provider.cpython-311.pyc +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/exceptions/exceptions.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/exceptions/provider.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/models.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/transactions.py +0 -0
- {py_near-1.1.41 → py_near-1.1.43}/src/py_near/utils.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
[tool.poetry]
|
2
2
|
name = "py-near"
|
3
|
-
version = "1.1.
|
3
|
+
version = "1.1.43"
|
4
4
|
description="Pretty simple and fully asynchronous framework for working with NEAR blockchain"
|
5
5
|
authors = ["pvolnov <petr@herewallet.app>"]
|
6
6
|
readme = "README.md"
|
@@ -22,7 +22,7 @@ base58 = "^2.1.1"
|
|
22
22
|
|
23
23
|
[project]
|
24
24
|
name = "py-near"
|
25
|
-
version = "1.1.
|
25
|
+
version = "1.1.43"
|
26
26
|
description = "Pretty simple and fully asynchronous framework for working with NEAR blockchaink"
|
27
27
|
authors = [ {name = "pvolnov", email = "petr@herewallet.app"} ]
|
28
28
|
requires-python = ">=3.7"
|
@@ -93,28 +93,29 @@ class JsonProvider(object):
|
|
93
93
|
"params": {"finality": "final"},
|
94
94
|
"id": 1,
|
95
95
|
}
|
96
|
-
async with
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
96
|
+
async with aiohttp.ClientSession() as session:
|
97
|
+
async with session.post(rpc_addr, json=data) as r:
|
98
|
+
if r.status == 200:
|
99
|
+
data = json.loads(await r.text())["result"]
|
100
|
+
if data["sync_info"]["syncing"]:
|
101
|
+
last_block_ts = datetime.datetime.fromisoformat(
|
102
|
+
data["sync_info"]["latest_block_time"]
|
103
|
+
)
|
104
|
+
diff = (
|
105
|
+
datetime.datetime.utcnow().timestamp()
|
106
|
+
- last_block_ts.timestamp()
|
107
|
+
)
|
108
|
+
is_syncing = diff > 60
|
109
|
+
else:
|
110
|
+
is_syncing = False
|
111
|
+
if is_syncing:
|
112
|
+
logger.error(f"Remove async RPC : {rpc_addr} ({diff})")
|
113
|
+
continue
|
114
|
+
available_rpcs.append(rpc_addr)
|
108
115
|
else:
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
continue
|
113
|
-
available_rpcs.append(rpc_addr)
|
114
|
-
else:
|
115
|
-
logger.error(
|
116
|
-
f"Remove rpc because of error {r.status}: {rpc_addr}"
|
117
|
-
)
|
116
|
+
logger.error(
|
117
|
+
f"Remove rpc because of error {r.status}: {rpc_addr}"
|
118
|
+
)
|
118
119
|
except Exception as e:
|
119
120
|
if rpc_addr in self._available_rpcs:
|
120
121
|
logger.error(f"Remove rpc: {e}")
|
@@ -137,17 +138,24 @@ class JsonProvider(object):
|
|
137
138
|
if "@" in rpc_call_addr:
|
138
139
|
auth_key = rpc_call_addr.split("//")[1].split("@")[0]
|
139
140
|
rpc_call_addr = rpc_call_addr.replace(auth_key + "@", "")
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
141
|
+
async with aiohttp.ClientSession() as session:
|
142
|
+
r = await session.post(
|
143
|
+
rpc_call_addr,
|
144
|
+
json=j,
|
145
|
+
timeout=self._timeout,
|
146
|
+
headers={
|
147
|
+
"Referer": "https://tgapp.herewallet.app",
|
148
|
+
"Authorization": f"Bearer {auth_key}",
|
149
|
+
}, # NEAR RPC requires Referer header
|
150
|
+
)
|
151
|
+
if r.status == 200:
|
152
|
+
return json.loads(await r.text())
|
153
|
+
return {
|
154
|
+
"error": {
|
155
|
+
"cause": {"name": "RPC_ERROR", "message": f"Status: {r.status}"},
|
156
|
+
"data": await r.text(),
|
157
|
+
}
|
158
|
+
}
|
151
159
|
|
152
160
|
if broadcast or threshold:
|
153
161
|
pending = [
|
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
|
{py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/ft/__pycache__/async_client.cpython-311.pyc
RENAMED
File without changes
|
{py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/ft/__pycache__/exceptions.cpython-311.pyc
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
|
{py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/staking/__pycache__/__init__.cpython-311.pyc
RENAMED
File without changes
|
{py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/staking/__pycache__/async_client.cpython-311.pyc
RENAMED
File without changes
|
{py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/staking/__pycache__/exceptions.cpython-311.pyc
RENAMED
File without changes
|
{py_near-1.1.41 → py_near-1.1.43}/src/py_near/dapps/staking/__pycache__/models.cpython-311.pyc
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{py_near-1.1.41 → py_near-1.1.43}/src/py_near/exceptions/__pycache__/__init__.cpython-311.pyc
RENAMED
File without changes
|
{py_near-1.1.41 → py_near-1.1.43}/src/py_near/exceptions/__pycache__/exceptions.cpython-311.pyc
RENAMED
File without changes
|
{py_near-1.1.41 → py_near-1.1.43}/src/py_near/exceptions/__pycache__/provider.cpython-311.pyc
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|