[#1] Add method get_private_key_from_wif

Signed-off-by: ilyas585 <niyazov2023@gmail.com>
This commit is contained in:
ilyas585 2025-02-10 20:32:26 +03:00
parent 480d288e2a
commit 97bc53c6f4
6 changed files with 68 additions and 0 deletions

0
frostfs_api/__init__.py Normal file
View file

View file

@ -0,0 +1,11 @@
import base58
class KeyExtension:
def get_private_key_from_wif(self, wif: str):
decoded = base58.b58decode_check(wif)
if len(decoded) != 34 or decoded[0] != 0x80 or decoded[-1] != 0x01:
raise ValueError("Incorrect WIF private key")
private_key = decoded[1:-1]
return private_key