intent.py
TEXT FILE423 B · Public source code for developers, search crawlers and AI agents
1from dataclasses import dataclass
2from uuid import uuid4
3
4
5@dataclass(frozen=True)
6class PaymentIntent:
7 intent_id: str
8 wallet: str
9 destination: str
10 total_debit_sat: int
11
12
13def new_intent(wallet: str, destination: str, total: int) -> PaymentIntent:
14 if type(total) is not int or total <= 0:
15 raise ValueError("invalid total debit")
16 return PaymentIntent(str(uuid4()), wallet, destination, total)Read-only source · Select a line number to link directly · Raw download above
