Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NUT-06: add icon URL #604

Merged
merged 6 commits into from
Sep 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cashu/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class GetInfoResponse(BaseModel):
description_long: Optional[str] = None
contact: Optional[List[MintInfoContact]] = None
motd: Optional[str] = None
icon_url: Optional[str] = None
time: Optional[int] = None
nuts: Optional[Dict[int, Any]] = None

Expand Down
3 changes: 3 additions & 0 deletions cashu/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_url: str = Field(default=None)


class WalletSettings(CashuSettings):
Expand Down Expand Up @@ -201,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)
Expand Down
1 change: 1 addition & 0 deletions cashu/mint/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ async def info() -> GetInfoResponse:
description_long=settings.mint_info_description_long,
contact=contact_info,
nuts=mint_features,
icon_url=settings.mint_info_icon_url,
motd=settings.mint_info_motd,
time=int(time.time()),
)
Expand Down
1 change: 1 addition & 0 deletions cashu/wallet/mint_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class MintInfo(BaseModel):
description_long: Optional[str]
contact: Optional[List[MintInfoContact]]
motd: Optional[str]
icon_url: Optional[str]
time: Optional[int]
nuts: Optional[Dict[int, Any]]

Expand Down
2 changes: 1 addition & 1 deletion cashu/wallet/v1_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions cashu/wallet/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ 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]

url = url.rstrip("/")
super().__init__(url=url, db=self.db)
logger.debug("Wallet initialized")
Expand Down
Loading