mirror of
https://github.com/fusion44/blitz_api.git
synced 2026-08-14 12:02:46 +02:00
* new parameters (include_closed, peer_alias_lookup) * returns the channel state, initiator and the closer if applicable * CLN gRPC remains TODO refs #199
23 lines
711 B
Python
23 lines
711 B
Python
from fastapi import HTTPException, status
|
|
|
|
|
|
class OpenChannelPushAmountError(HTTPException):
|
|
"""Raised when a the push amount is lower than the channel size."""
|
|
|
|
def __init__(self, local_funding, push_amt):
|
|
self.status_code = status.HTTP_400_BAD_REQUEST
|
|
self.detail = (
|
|
f"Push amount {push_amt} must be lower than "
|
|
f"local funding amount {local_funding}"
|
|
)
|
|
|
|
|
|
class NodeNotFoundError(HTTPException):
|
|
"""Raised when a node is not found in the graph."""
|
|
|
|
node_pub: str = ""
|
|
|
|
def __init__(self, node_pub=""):
|
|
self.status_code = status.HTTP_404_NOT_FOUND
|
|
self.detail = f"Node {node_pub} not found"
|
|
self.node_pub = node_pub
|