py-near 1.1.49__tar.gz → 1.1.50__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.49 → py_near-1.1.50}/PKG-INFO +1 -1
- {py_near-1.1.49 → py_near-1.1.50}/pyproject.toml +2 -2
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/models.py +2 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/providers.py +6 -25
- {py_near-1.1.49 → py_near-1.1.50}/LICENSE +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/README.md +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/__init__.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/account.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/constants.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/__init__.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/__pycache__/__init__.cpython-311.pyc +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/__pycache__/core.cpython-311.pyc +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/__pycache__/fts.cpython-311.pyc +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/core.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/ft/__init__.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/ft/__pycache__/__init__.cpython-311.pyc +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/ft/__pycache__/async_client.cpython-311.pyc +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/ft/__pycache__/exceptions.cpython-311.pyc +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/ft/__pycache__/models.cpython-311.pyc +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/ft/async_client.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/ft/exceptions.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/ft/models.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/fts.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/keypom/__init__.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/keypom/async_client.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/keypom/exceptions.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/keypom/models.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/staking/__init__.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/staking/__pycache__/__init__.cpython-311.pyc +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/staking/__pycache__/async_client.cpython-311.pyc +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/staking/__pycache__/exceptions.cpython-311.pyc +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/staking/__pycache__/models.cpython-311.pyc +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/staking/async_client.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/staking/exceptions.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/staking/models.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/exceptions/__init__.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/exceptions/__pycache__/__init__.cpython-311.pyc +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/exceptions/__pycache__/exceptions.cpython-311.pyc +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/exceptions/__pycache__/provider.cpython-311.pyc +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/exceptions/exceptions.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/exceptions/provider.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/src/py_near/transactions.py +0 -0
- {py_near-1.1.49 → py_near-1.1.50}/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.50"
|
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.50"
|
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"
|
@@ -48,8 +48,10 @@ class ReceiptOutcome:
|
|
48
48
|
tokens_burnt: str
|
49
49
|
executor_id: str
|
50
50
|
gas_burnt: int
|
51
|
+
receipt_id: str
|
51
52
|
|
52
53
|
def __init__(self, data):
|
54
|
+
self.receipt_id = data['id']
|
53
55
|
self.logs = data["outcome"]["logs"]
|
54
56
|
self.metadata = data["outcome"]["metadata"]
|
55
57
|
self.receipt_ids = data["outcome"]["receipt_ids"]
|
@@ -6,6 +6,7 @@ from collections import Counter
|
|
6
6
|
from typing import Optional
|
7
7
|
|
8
8
|
import httpx
|
9
|
+
from httpx import Limits
|
9
10
|
from loguru import logger
|
10
11
|
|
11
12
|
from py_near.constants import TIMEOUT_WAIT_RPC
|
@@ -60,29 +61,13 @@ class JsonProvider(object):
|
|
60
61
|
self._last_rpc_addr_check = 0
|
61
62
|
self.allow_broadcast = allow_broadcast
|
62
63
|
self._timeout = timeout
|
63
|
-
self._client
|
64
|
+
self._client = httpx.AsyncClient(
|
65
|
+
limits=Limits(max_connections=1000, max_keepalive_connections=200)
|
66
|
+
)
|
64
67
|
|
65
68
|
async def shutdown(self):
|
66
69
|
pass
|
67
70
|
|
68
|
-
async def check_available_rpcs(self):
|
69
|
-
if (
|
70
|
-
self._last_rpc_addr_check < datetime.datetime.now().timestamp() - 30
|
71
|
-
or not self._available_rpcs
|
72
|
-
):
|
73
|
-
self._last_rpc_addr_check = datetime.datetime.now().timestamp()
|
74
|
-
asyncio.create_task(self._check_available_rpcs())
|
75
|
-
|
76
|
-
for _ in range(5):
|
77
|
-
if self._available_rpcs:
|
78
|
-
break
|
79
|
-
await self._check_available_rpcs()
|
80
|
-
await asyncio.sleep(3)
|
81
|
-
|
82
|
-
if not self._available_rpcs:
|
83
|
-
self._available_rpcs = self._rpc_addresses.copy()
|
84
|
-
logger.error("All RPCs are async, reset to default list")
|
85
|
-
|
86
71
|
async def _check_available_rpcs(self):
|
87
72
|
available_rpcs = []
|
88
73
|
for rpc_addr in self._rpc_addresses:
|
@@ -132,7 +117,7 @@ class JsonProvider(object):
|
|
132
117
|
except Exception as e:
|
133
118
|
if rpc_addr in self._available_rpcs:
|
134
119
|
logger.error(f"Remove rpc: {e}")
|
135
|
-
logger.
|
120
|
+
logger.exception(e)
|
136
121
|
self._available_rpcs = available_rpcs
|
137
122
|
|
138
123
|
@staticmethod
|
@@ -144,7 +129,6 @@ class JsonProvider(object):
|
|
144
129
|
async def call_rpc_request(
|
145
130
|
self, method, params, broadcast=False, threshold: int = 0
|
146
131
|
):
|
147
|
-
await self.check_available_rpcs()
|
148
132
|
j = {"method": method, "params": params, "id": "dontcare", "jsonrpc": "2.0"}
|
149
133
|
|
150
134
|
async def f(rpc_call_addr):
|
@@ -325,7 +309,6 @@ class JsonProvider(object):
|
|
325
309
|
return await self.wait_for_trx(trx_hash, receiver_id)
|
326
310
|
|
327
311
|
async def get_status(self):
|
328
|
-
await self.check_available_rpcs()
|
329
312
|
for rpc_addr in self._available_rpcs.copy():
|
330
313
|
try:
|
331
314
|
data = {
|
@@ -340,9 +323,7 @@ class JsonProvider(object):
|
|
340
323
|
if "@" in rpc_addr:
|
341
324
|
auth_key = rpc_addr.split("//")[1].split("@")[0]
|
342
325
|
rpc_addr = rpc_addr.replace(auth_key + "@", "")
|
343
|
-
headers = {
|
344
|
-
"Authorization": f"Bearer {auth_key}"
|
345
|
-
}
|
326
|
+
headers = {"Authorization": f"Bearer {auth_key}"}
|
346
327
|
r = await self._client.post(rpc_addr, json=data, headers=headers)
|
347
328
|
if r.status_code == 200:
|
348
329
|
return json.loads(r.text)["result"]
|
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.49 → py_near-1.1.50}/src/py_near/dapps/ft/__pycache__/async_client.cpython-311.pyc
RENAMED
File without changes
|
{py_near-1.1.49 → py_near-1.1.50}/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.49 → py_near-1.1.50}/src/py_near/dapps/staking/__pycache__/__init__.cpython-311.pyc
RENAMED
File without changes
|
{py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/staking/__pycache__/async_client.cpython-311.pyc
RENAMED
File without changes
|
{py_near-1.1.49 → py_near-1.1.50}/src/py_near/dapps/staking/__pycache__/exceptions.cpython-311.pyc
RENAMED
File without changes
|
{py_near-1.1.49 → py_near-1.1.50}/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.49 → py_near-1.1.50}/src/py_near/exceptions/__pycache__/__init__.cpython-311.pyc
RENAMED
File without changes
|
{py_near-1.1.49 → py_near-1.1.50}/src/py_near/exceptions/__pycache__/exceptions.cpython-311.pyc
RENAMED
File without changes
|
{py_near-1.1.49 → py_near-1.1.50}/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
|