Skip to content

Commit 376559a

Browse files
committed
core: added create_offers method for payment providers (server)
1 parent efd9dd4 commit 376559a

File tree

6 files changed

+145
-59
lines changed

6 files changed

+145
-59
lines changed

fewsats/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.0.8"
1+
__version__ = "0.0.9"

fewsats/_modidx.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
'fewsats.core.Client._wait_for_settlement': ('core.html#client._wait_for_settlement', 'fewsats/core.py'),
1414
'fewsats.core.Client.as_tools': ('core.html#client.as_tools', 'fewsats/core.py'),
1515
'fewsats.core.Client.balance': ('core.html#client.balance', 'fewsats/core.py'),
16+
'fewsats.core.Client.create_offers': ('core.html#client.create_offers', 'fewsats/core.py'),
1617
'fewsats.core.Client.me': ('core.html#client.me', 'fewsats/core.py'),
1718
'fewsats.core.Client.pay': ('core.html#client.pay', 'fewsats/core.py'),
1819
'fewsats.core.Client.payment_info': ('core.html#client.payment_info', 'fewsats/core.py'),

fewsats/core.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,14 @@ def pay(self:Client,
153153

154154
# %% ../nbs/00_core.ipynb 46
155155
@patch
156+
def create_offers(self:Client,
157+
offers:List[Dict[str,Any]], # List of offer objects following OfferCreateV0 schema
158+
) -> dict:
159+
"Create offers for L402 payment server"
160+
return _process_response(self._request("POST", "v0/l402/offers", json={"offers": offers}))
161+
162+
# %% ../nbs/00_core.ipynb 49
163+
@patch
156164
def as_tools(self:Client):
157165
"Return list of available tools for AI agents"
158166
return [

0 commit comments

Comments
 (0)