From ccdaacfe8a75af888151096044f127c55ae9996c Mon Sep 17 00:00:00 2001 From: ilia Date: Sat, 8 Oct 2022 12:38:54 +0300 Subject: [PATCH] add create wallet --- app/utils/blockchain.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 app/utils/blockchain.py diff --git a/app/utils/blockchain.py b/app/utils/blockchain.py new file mode 100644 index 0000000..14179ae --- /dev/null +++ b/app/utils/blockchain.py @@ -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'])