mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-20 18:44:20 +01:00
works
This commit is contained in:
11
mint/app.py
11
mint/app.py
@@ -5,10 +5,11 @@ from typing import Union
|
||||
|
||||
import click
|
||||
import uvicorn
|
||||
from ecc.curve import Point, secp256k1
|
||||
from fastapi import FastAPI
|
||||
from loguru import logger
|
||||
|
||||
from secp256k1 import PublicKey
|
||||
|
||||
import core.settings as settings
|
||||
from core.base import MintPayloads, SplitPayload, MeltPayload, CheckPayload
|
||||
from core.settings import MINT_PRIVATE_KEY, MINT_SERVER_HOST, MINT_SERVER_PORT
|
||||
@@ -124,12 +125,8 @@ async def mint(payloads: MintPayloads, payment_hash: Union[str, None] = None):
|
||||
amounts = []
|
||||
B_s = []
|
||||
for payload in payloads.blinded_messages:
|
||||
v = payload.dict()
|
||||
amounts.append(v["amount"])
|
||||
x = int(v["B_"]["x"])
|
||||
y = int(v["B_"]["y"])
|
||||
B_ = Point(x, y, secp256k1)
|
||||
B_s.append(B_)
|
||||
amounts.append(payload.amount)
|
||||
B_s.append(PublicKey(bytes.fromhex(payload.B_), raw=True))
|
||||
try:
|
||||
promises = await ledger.mint(B_s, amounts, payment_hash=payment_hash)
|
||||
return promises
|
||||
|
||||
Reference in New Issue
Block a user