From d4c8c8a539d1f9d840a2447ac98eebce981b438a Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Mon, 29 Jul 2024 15:14:13 +0200 Subject: [PATCH 1/5] mint info icon --- cashu/core/models.py | 1 + cashu/core/settings.py | 1 + cashu/mint/router.py | 1 + cashu/wallet/mint_info.py | 1 + cashu/wallet/v1_api.py | 2 +- cashu/wallet/wallet.py | 1 - 6 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cashu/core/models.py b/cashu/core/models.py index 065c6a33..7de67b60 100644 --- a/cashu/core/models.py +++ b/cashu/core/models.py @@ -38,6 +38,7 @@ class GetInfoResponse(BaseModel): description_long: Optional[str] = None contact: Optional[List[MintInfoContact]] = None motd: Optional[str] = None + mint_icon_url: Optional[str] = None nuts: Optional[Dict[int, Any]] = None def supports(self, nut: int) -> Optional[bool]: diff --git a/cashu/core/settings.py b/cashu/core/settings.py index 1c012ad7..1d666925 100644 --- a/cashu/core/settings.py +++ b/cashu/core/settings.py @@ -144,6 +144,7 @@ class MintInformation(CashuSettings): mint_info_description_long: str = Field(default=None) mint_info_contact: List[List[str]] = Field(default=[]) mint_info_motd: str = Field(default=None) + mint_info_icon: str = Field(default=None) class WalletSettings(CashuSettings): diff --git a/cashu/mint/router.py b/cashu/mint/router.py index 56226f32..517d7efb 100644 --- a/cashu/mint/router.py +++ b/cashu/mint/router.py @@ -55,6 +55,7 @@ async def info() -> GetInfoResponse: description_long=settings.mint_info_description_long, contact=contact_info, nuts=mint_features, + mint_icon_url=settings.mint_info_icon, motd=settings.mint_info_motd, ) diff --git a/cashu/wallet/mint_info.py b/cashu/wallet/mint_info.py index 760f43c9..41c41aef 100644 --- a/cashu/wallet/mint_info.py +++ b/cashu/wallet/mint_info.py @@ -15,6 +15,7 @@ class MintInfo(BaseModel): description_long: Optional[str] contact: Optional[List[MintInfoContact]] motd: Optional[str] + mint_icon_url: Optional[str] nuts: Optional[Dict[int, Any]] def __str__(self): diff --git a/cashu/wallet/v1_api.py b/cashu/wallet/v1_api.py index d5d9ce50..e68c5560 100644 --- a/cashu/wallet/v1_api.py +++ b/cashu/wallet/v1_api.py @@ -295,7 +295,7 @@ async def mint_quote(self, amount: int, unit: Unit) -> PostMintQuoteResponse: Raises: Exception: If the mint request fails """ - logger.trace("Requesting mint: GET /v1/mint/bolt11") + logger.trace("Requesting mint: POST /v1/mint/bolt11") payload = PostMintQuoteRequest(unit=unit.name, amount=amount) resp = await self.httpx.post( join(self.url, "/v1/mint/quote/bolt11"), json=payload.dict() diff --git a/cashu/wallet/wallet.py b/cashu/wallet/wallet.py index ae303e73..da016d74 100644 --- a/cashu/wallet/wallet.py +++ b/cashu/wallet/wallet.py @@ -107,7 +107,6 @@ def __init__(self, url: str, db: str, name: str = "no_name", unit: str = "sat"): self.proofs: List[Proof] = [] self.name = name self.unit = Unit[unit] - super().__init__(url=url, db=self.db) logger.debug("Wallet initialized") logger.debug(f"Mint URL: {url}") From f3b33bec230228d8ccfcb3fb54ac741ae7837cd7 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 8 Sep 2024 14:34:33 +0200 Subject: [PATCH 2/5] Update cashu/core/models.py Co-authored-by: Pavol Rusnak --- cashu/core/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cashu/core/models.py b/cashu/core/models.py index 7de67b60..0d69515e 100644 --- a/cashu/core/models.py +++ b/cashu/core/models.py @@ -38,7 +38,7 @@ class GetInfoResponse(BaseModel): description_long: Optional[str] = None contact: Optional[List[MintInfoContact]] = None motd: Optional[str] = None - mint_icon_url: Optional[str] = None + icon_url: Optional[str] = None nuts: Optional[Dict[int, Any]] = None def supports(self, nut: int) -> Optional[bool]: From e5aecab3617191ee19cab786a6a3533bb5afbda2 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 8 Sep 2024 14:34:39 +0200 Subject: [PATCH 3/5] Update cashu/mint/router.py Co-authored-by: Pavol Rusnak --- cashu/mint/router.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cashu/mint/router.py b/cashu/mint/router.py index 517d7efb..fb6b6dee 100644 --- a/cashu/mint/router.py +++ b/cashu/mint/router.py @@ -55,7 +55,7 @@ async def info() -> GetInfoResponse: description_long=settings.mint_info_description_long, contact=contact_info, nuts=mint_features, - mint_icon_url=settings.mint_info_icon, + icon_url=settings.mint_info_icon_url, motd=settings.mint_info_motd, ) From beb285765e89e7be403c624e41fb0c7bbbd8b6fa Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 8 Sep 2024 14:34:45 +0200 Subject: [PATCH 4/5] Update cashu/wallet/mint_info.py Co-authored-by: Pavol Rusnak --- cashu/wallet/mint_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cashu/wallet/mint_info.py b/cashu/wallet/mint_info.py index 41c41aef..bfc78dab 100644 --- a/cashu/wallet/mint_info.py +++ b/cashu/wallet/mint_info.py @@ -15,7 +15,7 @@ class MintInfo(BaseModel): description_long: Optional[str] contact: Optional[List[MintInfoContact]] motd: Optional[str] - mint_icon_url: Optional[str] + icon_url: Optional[str] nuts: Optional[Dict[int, Any]] def __str__(self): From d95f6800f819d57839aba60a2c7d874e2c6ecd23 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Sun, 8 Sep 2024 14:37:11 +0200 Subject: [PATCH 5/5] fix setting --- cashu/core/settings.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cashu/core/settings.py b/cashu/core/settings.py index 0e840d93..e7cf5d0c 100644 --- a/cashu/core/settings.py +++ b/cashu/core/settings.py @@ -144,7 +144,7 @@ class MintInformation(CashuSettings): mint_info_description_long: str = Field(default=None) mint_info_contact: List[List[str]] = Field(default=[]) mint_info_motd: str = Field(default=None) - mint_info_icon: str = Field(default=None) + mint_info_icon_url: str = Field(default=None) class WalletSettings(CashuSettings): @@ -202,11 +202,13 @@ class LndRestFundingSource(MintSettings): mint_lnd_rest_invoice_macaroon: Optional[str] = Field(default=None) mint_lnd_enable_mpp: bool = Field(default=False) + class LndRPCFundingSource(MintSettings): mint_lnd_rpc_endpoint: Optional[str] = Field(default=None) mint_lnd_rpc_cert: Optional[str] = Field(default=None) mint_lnd_rpc_macaroon: Optional[str] = Field(default=None) + class CLNRestFundingSource(MintSettings): mint_clnrest_url: Optional[str] = Field(default=None) mint_clnrest_cert: Optional[str] = Field(default=None)