lnbits-legend/lnbits/extensions/boltz/models.py
dni ⚡ d89a6a337a
boltz extension v2, recurring swaps (#981)
* add status to statusdialog

* first commits for boltz update

* formatting

* add latest boltz-clien package

* big refactor, depending on boltz_client package, clean up, mypy issues, not tested yet

* blacking, sorting and stuff

* remove unused req_wrap helper

* remove api docs from frontend

* bug: frontend boltz limits error

* clean up buttons

* update to boltz-client 0.0.8

* fix tests to poetry version 1.3.1

* update requirements

* formatting

* recurring swap works now, need more finetuning

* add exceptions for multiple auto swaps and swapping in with active auto swap

* black

* auto reverse swap actually works :)

* remove swap status dialogs

* update to boltz_client 0.0.9

* update to boltz-client 0.1.1, and fix startup

* update requirement.txt for boltz-client

* fixup columns in table, remove unused payment.extra, change deezy label

* remove balance check for auto swap out

* update boltzc-lient to 0.1.2, fix mypy issue inside boltz package

* nitpicks calle tasks.py

* calle nitpicks crud

* calle nitpicks crud

* refactor

* fix formatting

* circular import

* black :)

Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
2023-01-19 10:30:47 +01:00

68 lines
1.4 KiB
Python

from fastapi import Query
from pydantic import BaseModel
class SubmarineSwap(BaseModel):
id: str
wallet: str
amount: int
payment_hash: str
time: int
status: str
refund_privkey: str
refund_address: str
boltz_id: str
expected_amount: int
timeout_block_height: int
address: str
bip21: str
redeem_script: str
class CreateSubmarineSwap(BaseModel):
wallet: str = Query(...)
refund_address: str = Query(...)
amount: int = Query(...)
class ReverseSubmarineSwap(BaseModel):
id: str
wallet: str
amount: int
onchain_address: str
instant_settlement: bool
time: int
status: str
boltz_id: str
preimage: str
claim_privkey: str
lockup_address: str
invoice: str
onchain_amount: int
timeout_block_height: int
redeem_script: str
class CreateReverseSubmarineSwap(BaseModel):
wallet: str = Query(...)
amount: int = Query(...)
instant_settlement: bool = Query(...)
onchain_address: str = Query(...)
class AutoReverseSubmarineSwap(BaseModel):
id: str
wallet: str
amount: int
balance: int
onchain_address: str
instant_settlement: bool
time: int
class CreateAutoReverseSubmarineSwap(BaseModel):
wallet: str = Query(...)
amount: int = Query(...)
balance: int = Query(0)
instant_settlement: bool = Query(...)
onchain_address: str = Query(...)