@@ -717,6 +717,15 @@ def dev_slowcmd(self, msec=None):
717
717
}
718
718
return self .call ("dev" , payload )
719
719
720
+ def disableoffer (self , offer_id ):
721
+ """
722
+ Disable an offer, so that no further invoices will be given out.
723
+ """
724
+ payload = {
725
+ "offer_id" : offer_id ,
726
+ }
727
+ return self .call ("disableoffer" , payload )
728
+
720
729
def disconnect (self , peer_id , force = False ):
721
730
"""
722
731
Disconnect from peer with {peer_id}, optional {force} even if has active channel.
@@ -727,6 +736,15 @@ def disconnect(self, peer_id, force=False):
727
736
}
728
737
return self .call ("disconnect" , payload )
729
738
739
+ def enableoffer (self , offer_id ):
740
+ """
741
+ Enable an offer, after it has been disabled.
742
+ """
743
+ payload = {
744
+ "offer_id" : offer_id ,
745
+ }
746
+ return self .call ("enableoffer" , payload )
747
+
730
748
def feerates (self , style , urgent = None , normal = None , slow = None ):
731
749
"""
732
750
Supply feerate estimates manually.
@@ -739,6 +757,26 @@ def feerates(self, style, urgent=None, normal=None, slow=None):
739
757
}
740
758
return self .call ("feerates" , payload )
741
759
760
+ def fetchinvoice (self , offer , amount_msat = None , quantity = None , recurrence_counter = None ,
761
+ recurrence_start = None , recurrence_label = None , timeout = None , payer_note = None ,
762
+ payer_metadata = None , bip353 = None ):
763
+ """
764
+ Fetch an invoice for an offer.
765
+ """
766
+ payload = {
767
+ "offer" : offer ,
768
+ "amount_msat" : amount_msat ,
769
+ "quantity" : quantity ,
770
+ "recurrence_counter" : recurrence_counter ,
771
+ "recurrence_start" : recurrence_start ,
772
+ "recurrence_label" : recurrence_label ,
773
+ "timeout" : timeout ,
774
+ "payer_note" : payer_note ,
775
+ "payer_metadata" : payer_metadata ,
776
+ "bip353" : bip353 ,
777
+ }
778
+ return self .call ("fetchinvoice" , payload )
779
+
742
780
def fundchannel (self , node_id , amount , feerate = None , announce = True ,
743
781
minconf = None , utxos = None , push_msat = None , close_to = None ,
744
782
request_amt = None , compact_lease = None ,
@@ -981,6 +1019,18 @@ def listnodes(self, node_id=None):
981
1019
}
982
1020
return self .call ("listnodes" , payload )
983
1021
1022
+ def listoffers (self , offer_id = None , active_only = None ):
1023
+ """List offers
1024
+
1025
+ List all offers, or with {offer_id}, only the offer with that {offer_id} (if it exists).
1026
+
1027
+ """
1028
+ payload = {
1029
+ "offer_id" : offer_id ,
1030
+ "active_only" : active_only ,
1031
+ }
1032
+ return self .call ("listoffers" , payload )
1033
+
984
1034
def listpays (self , bolt11 = None , payment_hash = None , status = None , index = None , start = None , limit = None ):
985
1035
"""
986
1036
Show outgoing payments, regarding {bolt11} or {payment_hash} if set
@@ -1074,6 +1124,29 @@ def newaddr(self, addresstype=None):
1074
1124
"""
1075
1125
return self .call ("newaddr" , {"addresstype" : addresstype })
1076
1126
1127
+ def offer (self , amount , description = None , issuer = None , label = None , quantity_max = None , absolute_expiry = None ,
1128
+ recurrence = None , recurrence_base = None , recurrence_paywindow = None , recurrence_limit = None ,
1129
+ single_use = None , recurrence_start_any_period = None ):
1130
+ """
1131
+ Create an offer (or returns an existing one), which is a precursor to creating one or more invoices.
1132
+ It automatically enables the processing of an incoming invoice_request, and issuing of invoices.
1133
+ """
1134
+ payload = {
1135
+ "amount" : amount ,
1136
+ "description" : description ,
1137
+ "issuer" : issuer ,
1138
+ "label" : label ,
1139
+ "quantity_max" : quantity_max ,
1140
+ "absolute_expiry" : absolute_expiry ,
1141
+ "recurrence" : recurrence ,
1142
+ "recurrence_base" : recurrence_base ,
1143
+ "recurrence_paywindow" : recurrence_paywindow ,
1144
+ "recurrence_limit" : recurrence_limit ,
1145
+ "single_use" : single_use ,
1146
+ "recurrence_start_any_period" : recurrence_start_any_period ,
1147
+ }
1148
+ return self .call ("offer" , payload )
1149
+
1077
1150
def pay (self , bolt11 , amount_msat = None , label = None , riskfactor = None ,
1078
1151
maxfeepercent = None , retry_for = None ,
1079
1152
maxdelay = None , exemptfee = None , localinvreqid = None , exclude = None ,
0 commit comments