py-near 1.1.57__py3-none-any.whl → 1.1.59__py3-none-any.whl
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/mpc/wallet.py +14 -8
- {py_near-1.1.57.dist-info → py_near-1.1.59.dist-info}/METADATA +1 -1
- {py_near-1.1.57.dist-info → py_near-1.1.59.dist-info}/RECORD +6 -6
- {py_near-1.1.57.dist-info → py_near-1.1.59.dist-info}/WHEEL +0 -0
- {py_near-1.1.57.dist-info → py_near-1.1.59.dist-info}/licenses/LICENSE +0 -0
- {py_near-1.1.57.dist-info → py_near-1.1.59.dist-info}/top_level.txt +0 -0
py_near/mpc/wallet.py
CHANGED
@@ -45,9 +45,9 @@ class MPCWallet:
|
|
45
45
|
:param default_root_pk: Default auth key for HOT Protocol, if provided, derive = sha256(default_root_pk.public_key).digest()
|
46
46
|
"""
|
47
47
|
self.near_account = near_account
|
48
|
-
if len(default_root_pk) != 32:
|
49
|
-
raise ValueError("Default root pk should be 32 bytes")
|
50
48
|
if default_root_pk:
|
49
|
+
if len(default_root_pk) != 32:
|
50
|
+
raise ValueError("Default root pk should be 32 bytes")
|
51
51
|
self.default_root_pk = default_root_pk
|
52
52
|
private_key_obj = self.derive_private_key(0)
|
53
53
|
derive = sha256(private_key_obj.verify_key.encode()).digest()
|
@@ -98,7 +98,12 @@ class MPCWallet:
|
|
98
98
|
)
|
99
99
|
|
100
100
|
async def create_wallet(
|
101
|
-
self,
|
101
|
+
self,
|
102
|
+
auth_account_id: str,
|
103
|
+
metadata: str = "",
|
104
|
+
auth_to_add_msg="",
|
105
|
+
key_gen=1,
|
106
|
+
timeout=30,
|
102
107
|
):
|
103
108
|
"""
|
104
109
|
Create wallet with keys.auth.hot.tg auth method.
|
@@ -132,16 +137,16 @@ class MPCWallet:
|
|
132
137
|
"metadata": metadata or None,
|
133
138
|
},
|
134
139
|
),
|
135
|
-
timeout=
|
140
|
+
timeout=timeout,
|
136
141
|
)
|
137
142
|
return s.json()
|
138
143
|
|
139
|
-
async def get_ecdsa_public_key(self) -> bytes:
|
144
|
+
async def get_ecdsa_public_key(self, timeout=10) -> bytes:
|
140
145
|
resp = (
|
141
146
|
await self._client.post(
|
142
147
|
f"{self.hot_rpc}/public_key",
|
143
148
|
json=dict(wallet_derive=base58.b58encode(self.derive).decode()),
|
144
|
-
timeout=
|
149
|
+
timeout=timeout,
|
145
150
|
follow_redirects=True,
|
146
151
|
)
|
147
152
|
).json()
|
@@ -158,6 +163,7 @@ class MPCWallet:
|
|
158
163
|
message_body: Optional[bytes] = None,
|
159
164
|
curve_type: CurveType = CurveType.SECP256K1,
|
160
165
|
auth_methods: List[AuthContract] = None,
|
166
|
+
timeout=10,
|
161
167
|
):
|
162
168
|
if not self.default_root_pk:
|
163
169
|
raise ValueError("Default auth key is required")
|
@@ -184,7 +190,7 @@ class MPCWallet:
|
|
184
190
|
proof=proof,
|
185
191
|
key_type=curve_type,
|
186
192
|
),
|
187
|
-
timeout=
|
193
|
+
timeout=timeout,
|
188
194
|
follow_redirects=True,
|
189
195
|
)
|
190
196
|
resp = resp.json()
|
@@ -258,4 +264,4 @@ class MPCWallet:
|
|
258
264
|
"user_payloads": user_payloads,
|
259
265
|
},
|
260
266
|
included=True,
|
261
|
-
)
|
267
|
+
)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: py-near
|
3
|
-
Version: 1.1.
|
3
|
+
Version: 1.1.59
|
4
4
|
Summary: Pretty simple and fully asynchronous framework for working with NEAR blockchain
|
5
5
|
Author-email: pvolnov <petr@herewallet.app>
|
6
6
|
License: Permission is hereby granted, free of charge, to any
|
@@ -25,15 +25,15 @@ py_near/exceptions/exceptions.py,sha256=DEFipaAHm0y7oCuN2QKzHsiQvUTUQVl-Ce36Ag7n
|
|
25
25
|
py_near/exceptions/provider.py,sha256=K-wexgjPJ8sw42JePwaP7R5dJEIn9DoFJRvVcURsx6s,7718
|
26
26
|
py_near/mpc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
27
27
|
py_near/mpc/models.py,sha256=9MSfBDqfqkaJu6eJxnwyjgihsexZboehbJ6vAGa4BTU,663
|
28
|
-
py_near/mpc/wallet.py,sha256=
|
28
|
+
py_near/mpc/wallet.py,sha256=eYUdNz8pWNMWKRXOpjCdwlY5kp6uY70ahAm901rJSZk,9877
|
29
29
|
py_near/mpc/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
30
30
|
py_near/mpc/auth/auth_2fa.py,sha256=ZxO8mGO95ixb0qXnKrfmVxP7ivpDKerH4-udV_vUmbs,3124
|
31
31
|
py_near/mpc/auth/base.py,sha256=IoFdRWUQcerYZq8TCkpjXJQRcENnzA9WwFbVPgmHgcs,629
|
32
32
|
py_near/mpc/auth/core.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
33
33
|
py_near/mpc/auth/default_auth.py,sha256=i70412yXYx3MlFSsPxHLKbF0CXTjC39Qtl34et8kAEw,751
|
34
34
|
py_near/mpc/auth/keys_auth.py,sha256=DJPi37DnV6r6cSskHEhHBiR_QiaAQJkg0AEsYp6cePA,2359
|
35
|
-
py_near-1.1.
|
36
|
-
py_near-1.1.
|
37
|
-
py_near-1.1.
|
38
|
-
py_near-1.1.
|
39
|
-
py_near-1.1.
|
35
|
+
py_near-1.1.59.dist-info/licenses/LICENSE,sha256=I_GOA9xJ35FiL-KnYXZJdATkbO2KcV2dK2enRGVxzKM,1023
|
36
|
+
py_near-1.1.59.dist-info/METADATA,sha256=UZ6jTFlk1kj0jv3lJq-X8o9K7kvPfnsuUMN4sWGxCig,6012
|
37
|
+
py_near-1.1.59.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
38
|
+
py_near-1.1.59.dist-info/top_level.txt,sha256=p8CZgfKEVmXnRfVX5VHR0Ls7OVFC2ZVEwthvNB8Rb2Q,8
|
39
|
+
py_near-1.1.59.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|