py-near 1.1.44__tar.gz → 1.1.46__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.
Files changed (43) hide show
  1. {py_near-1.1.44 → py_near-1.1.46}/PKG-INFO +1 -1
  2. {py_near-1.1.44 → py_near-1.1.46}/pyproject.toml +2 -2
  3. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/providers.py +8 -3
  4. {py_near-1.1.44 → py_near-1.1.46}/LICENSE +0 -0
  5. {py_near-1.1.44 → py_near-1.1.46}/README.md +0 -0
  6. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/__init__.py +0 -0
  7. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/account.py +0 -0
  8. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/constants.py +0 -0
  9. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/__init__.py +0 -0
  10. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/__pycache__/__init__.cpython-311.pyc +0 -0
  11. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/__pycache__/core.cpython-311.pyc +0 -0
  12. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/__pycache__/fts.cpython-311.pyc +0 -0
  13. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/core.py +0 -0
  14. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/ft/__init__.py +0 -0
  15. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/ft/__pycache__/__init__.cpython-311.pyc +0 -0
  16. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/ft/__pycache__/async_client.cpython-311.pyc +0 -0
  17. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/ft/__pycache__/exceptions.cpython-311.pyc +0 -0
  18. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/ft/__pycache__/models.cpython-311.pyc +0 -0
  19. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/ft/async_client.py +0 -0
  20. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/ft/exceptions.py +0 -0
  21. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/ft/models.py +0 -0
  22. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/fts.py +0 -0
  23. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/keypom/__init__.py +0 -0
  24. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/keypom/async_client.py +0 -0
  25. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/keypom/exceptions.py +0 -0
  26. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/keypom/models.py +0 -0
  27. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/staking/__init__.py +0 -0
  28. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/staking/__pycache__/__init__.cpython-311.pyc +0 -0
  29. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/staking/__pycache__/async_client.cpython-311.pyc +0 -0
  30. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/staking/__pycache__/exceptions.cpython-311.pyc +0 -0
  31. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/staking/__pycache__/models.cpython-311.pyc +0 -0
  32. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/staking/async_client.py +0 -0
  33. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/staking/exceptions.py +0 -0
  34. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/dapps/staking/models.py +0 -0
  35. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/exceptions/__init__.py +0 -0
  36. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/exceptions/__pycache__/__init__.cpython-311.pyc +0 -0
  37. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/exceptions/__pycache__/exceptions.cpython-311.pyc +0 -0
  38. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/exceptions/__pycache__/provider.cpython-311.pyc +0 -0
  39. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/exceptions/exceptions.py +0 -0
  40. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/exceptions/provider.py +0 -0
  41. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/models.py +0 -0
  42. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/transactions.py +0 -0
  43. {py_near-1.1.44 → py_near-1.1.46}/src/py_near/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: py-near
3
- Version: 1.1.44
3
+ Version: 1.1.46
4
4
  Summary: Pretty simple and fully asynchronous framework for working with NEAR blockchain
5
5
  Author: pvolnov
6
6
  Author-email: petr@herewallet.app
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "py-near"
3
- version = "1.1.44"
3
+ version = "1.1.46"
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.44"
25
+ version = "1.1.46"
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"
@@ -61,10 +61,9 @@ class JsonProvider(object):
61
61
  self._last_rpc_addr_check = 0
62
62
  self.allow_broadcast = allow_broadcast
63
63
  self._timeout = timeout
64
- self.session = aiohttp.ClientSession()
65
64
 
66
65
  async def shutdown(self):
67
- await self.session.close()
66
+ pass
68
67
 
69
68
  async def check_available_rpcs(self):
70
69
  if (
@@ -173,6 +172,8 @@ class JsonProvider(object):
173
172
 
174
173
  responses = []
175
174
  correct_responses = []
175
+ result = None
176
+
176
177
  while pending and len(pending):
177
178
  done, pending = await asyncio.wait(
178
179
  pending, return_when=asyncio.FIRST_COMPLETED
@@ -195,8 +196,11 @@ class JsonProvider(object):
195
196
  for task in pending:
196
197
  task.cancel()
197
198
  return most_frequent_element
198
- raise RpcEmptyResponse(f"Threshold not reached: {len(correct_responses)}/{threshold}")
199
+ if threshold and threshold > 0:
200
+ raise RpcEmptyResponse(f"Threshold not reached: {len(correct_responses)}/{threshold}")
201
+ return result
199
202
  else:
203
+ res = None
200
204
  for rpc_addr in self._available_rpcs:
201
205
  try:
202
206
  res = await f(rpc_addr)
@@ -205,6 +209,7 @@ class JsonProvider(object):
205
209
  except Exception as e:
206
210
  logger.error(f"Rpc error: {e}")
207
211
  continue
212
+ return res
208
213
  raise RpcEmptyResponse("RPC returned empty response")
209
214
 
210
215
  @staticmethod
File without changes
File without changes
File without changes
File without changes