Merge pull request #1 from more-tech4-magnum-opus/blockchain-and-clans

add create wallet
This commit is contained in:
Alexandr Karpov 2022-10-08 12:42:57 +03:00 committed by GitHub
commit c56f8e018f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

18
app/utils/blockchain.py Normal file
View File

@ -0,0 +1,18 @@
from xml.dom import pulldom
from pydantic import BaseModel
import requests as r
URL = 'https://hackathon.lsp.team/hk'
"""TODO: Сделать обвязку апишки блокчейна"""
class WalletCreation(BaseModel):
publicKey: str
privateKey: str
def create_wallet() -> WalletCreation:
response = r.post(URL+'/v1/wallets/new')
data = response.json()
return WalletCreation(publicKey=data['publicKey'], privateKey=data['privateKey'])