py-near 1.1.32__tar.gz → 1.1.34__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.32 → py_near-1.1.34}/PKG-INFO +1 -1
- {py_near-1.1.32 → py_near-1.1.34}/pyproject.toml +2 -2
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/account.py +6 -3
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/providers.py +26 -2
- {py_near-1.1.32 → py_near-1.1.34}/LICENSE +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/README.md +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/__init__.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/constants.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/dapps/__init__.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/dapps/core.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/dapps/ft/__init__.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/dapps/ft/async_client.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/dapps/ft/exceptions.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/dapps/ft/models.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/dapps/fts.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/dapps/keypom/__init__.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/dapps/keypom/async_client.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/dapps/keypom/exceptions.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/dapps/keypom/models.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/dapps/staking/__init__.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/dapps/staking/async_client.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/dapps/staking/exceptions.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/dapps/staking/models.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/exceptions/__init__.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/exceptions/exceptions.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/exceptions/provider.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/models.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/src/py_near/transactions.py +0 -0
- {py_near-1.1.32 → py_near-1.1.34}/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.34"
|
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.34"
|
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"
|
@@ -237,7 +237,7 @@ class Account(object):
|
|
237
237
|
gas: int = constants.DEFAULT_ATTACHED_GAS,
|
238
238
|
amount: int = 0,
|
239
239
|
nowait: bool = False,
|
240
|
-
included=False
|
240
|
+
included=False,
|
241
241
|
):
|
242
242
|
"""
|
243
243
|
Call function on smart contract
|
@@ -259,7 +259,7 @@ class Account(object):
|
|
259
259
|
)
|
260
260
|
],
|
261
261
|
nowait,
|
262
|
-
included
|
262
|
+
included,
|
263
263
|
)
|
264
264
|
|
265
265
|
async def create_account(
|
@@ -342,6 +342,7 @@ class Account(object):
|
|
342
342
|
delegate_action: Union[DelegateAction, DelegateActionModel],
|
343
343
|
signature: Union[bytes, str],
|
344
344
|
nowait=False,
|
345
|
+
included=False,
|
345
346
|
):
|
346
347
|
if isinstance(signature, str):
|
347
348
|
signature = base58.b58decode(signature.replace("ed25519:", ""))
|
@@ -351,7 +352,9 @@ class Account(object):
|
|
351
352
|
actions = [
|
352
353
|
transactions.create_signed_delegate(delegate_action, signature),
|
353
354
|
]
|
354
|
-
return await self.sign_and_submit_tx(
|
355
|
+
return await self.sign_and_submit_tx(
|
356
|
+
delegate_action.sender_id, actions, nowait, included
|
357
|
+
)
|
355
358
|
|
356
359
|
async def deploy_contract(self, contract_code: bytes, nowait=False):
|
357
360
|
"""
|
@@ -120,6 +120,31 @@ class JsonProvider(object):
|
|
120
120
|
await self.check_available_rpcs()
|
121
121
|
j = {"method": method, "params": params, "id": "dontcare", "jsonrpc": "2.0"}
|
122
122
|
res = {}
|
123
|
+
if broadcast:
|
124
|
+
async def f(rpc_call_addr):
|
125
|
+
async with aiohttp.ClientSession() as session:
|
126
|
+
r = await session.post(
|
127
|
+
rpc_call_addr,
|
128
|
+
json=j,
|
129
|
+
timeout=timeout,
|
130
|
+
headers={
|
131
|
+
"Referer": "https://tgapp.herewallet.app/"
|
132
|
+
}, # NEAR RPC requires Referer header
|
133
|
+
)
|
134
|
+
r.raise_for_status()
|
135
|
+
res = json.loads(await r.text())
|
136
|
+
return res
|
137
|
+
|
138
|
+
tasks = [
|
139
|
+
asyncio.create_task(f(rpc_addr)) for rpc_addr in self._available_rpcs
|
140
|
+
]
|
141
|
+
for t in tasks:
|
142
|
+
try:
|
143
|
+
res = await t
|
144
|
+
return res
|
145
|
+
except Exception as e:
|
146
|
+
logger.error(f"Rpc error: {e}")
|
147
|
+
continue
|
123
148
|
for rpc_addr in self._available_rpcs:
|
124
149
|
try:
|
125
150
|
async with aiohttp.ClientSession() as session:
|
@@ -133,8 +158,7 @@ class JsonProvider(object):
|
|
133
158
|
)
|
134
159
|
r.raise_for_status()
|
135
160
|
res = json.loads(await r.text())
|
136
|
-
|
137
|
-
return res
|
161
|
+
return res
|
138
162
|
except (
|
139
163
|
RPCTimeoutError,
|
140
164
|
ClientResponseError,
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|