mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-09-26 13:56:18 +02:00
update
This commit is contained in:
@@ -13,7 +13,7 @@ from nostr_dvm.utils.definitions import EventDefinitions
|
|||||||
from nostr_dvm.utils.nip89_utils import nip89_fetch_events_pubkey, NIP89Config
|
from nostr_dvm.utils.nip89_utils import nip89_fetch_events_pubkey, NIP89Config
|
||||||
from nostr_dvm.utils.nostr_utils import send_event
|
from nostr_dvm.utils.nostr_utils import send_event
|
||||||
from nostr_dvm.utils.output_utils import PostProcessFunctionType, post_process_list_to_users, post_process_list_to_events
|
from nostr_dvm.utils.output_utils import PostProcessFunctionType, post_process_list_to_users, post_process_list_to_events
|
||||||
from nostr_dvm.utils.zap_utils import parse_zap_event_tags, pay_bolt11_ln_bits, zap
|
from nostr_dvm.utils.zap_utils import parse_zap_event_tags, pay_bolt11_ln_bits, zaprequest
|
||||||
from nostr_dvm.utils.cashu_utils import redeem_cashu
|
from nostr_dvm.utils.cashu_utils import redeem_cashu
|
||||||
|
|
||||||
|
|
||||||
@@ -294,7 +294,7 @@ class Bot:
|
|||||||
user = get_or_add_user(db=self.dvm_config.DB, npub=nostr_event.pubkey().to_hex(),
|
user = get_or_add_user(db=self.dvm_config.DB, npub=nostr_event.pubkey().to_hex(),
|
||||||
client=self.client, config=self.dvm_config)
|
client=self.client, config=self.dvm_config)
|
||||||
print("Paying: " + user.name)
|
print("Paying: " + user.name)
|
||||||
bolt11 = zap(user.lud16, amount, "Zap", nostr_event, self.keys, self.dvm_config,
|
bolt11 = zaprequest(user.lud16, amount, "Zap", nostr_event, self.keys, self.dvm_config,
|
||||||
"private")
|
"private")
|
||||||
if bolt11 == None:
|
if bolt11 == None:
|
||||||
print("Receiver has no Lightning address")
|
print("Receiver has no Lightning address")
|
||||||
|
@@ -18,7 +18,7 @@ from nostr_dvm.utils.mediasource_utils import input_data_file_duration
|
|||||||
from nostr_dvm.utils.nostr_utils import get_event_by_id, get_referenced_event_by_id, send_event, check_and_decrypt_tags
|
from nostr_dvm.utils.nostr_utils import get_event_by_id, get_referenced_event_by_id, send_event, check_and_decrypt_tags
|
||||||
from nostr_dvm.utils.output_utils import build_status_reaction
|
from nostr_dvm.utils.output_utils import build_status_reaction
|
||||||
from nostr_dvm.utils.zap_utils import check_bolt11_ln_bits_is_paid, create_bolt11_ln_bits, parse_zap_event_tags, \
|
from nostr_dvm.utils.zap_utils import check_bolt11_ln_bits_is_paid, create_bolt11_ln_bits, parse_zap_event_tags, \
|
||||||
parse_amount_from_bolt11_invoice, zap, pay_bolt11_ln_bits
|
parse_amount_from_bolt11_invoice, zaprequest, pay_bolt11_ln_bits
|
||||||
from nostr_dvm.utils.cashu_utils import redeem_cashu
|
from nostr_dvm.utils.cashu_utils import redeem_cashu
|
||||||
|
|
||||||
use_logger = False
|
use_logger = False
|
||||||
@@ -334,7 +334,7 @@ class DVM:
|
|||||||
user = get_or_add_user(self.dvm_config.DB, original_event.pubkey().to_hex(),
|
user = get_or_add_user(self.dvm_config.DB, original_event.pubkey().to_hex(),
|
||||||
client=self.client, config=self.dvm_config)
|
client=self.client, config=self.dvm_config)
|
||||||
print(user.lud16 + " " + str(amount))
|
print(user.lud16 + " " + str(amount))
|
||||||
bolt11 = zap(user.lud16, amount, "Couldn't finish job, returning sats", original_event,
|
bolt11 = zaprequest(user.lud16, amount, "Couldn't finish job, returning sats", original_event,
|
||||||
self.keys, self.dvm_config, zaptype="private")
|
self.keys, self.dvm_config, zaptype="private")
|
||||||
if bolt11 is None:
|
if bolt11 is None:
|
||||||
print("Receiver has no Lightning address, can't zap back.")
|
print("Receiver has no Lightning address, can't zap back.")
|
||||||
@@ -511,7 +511,7 @@ class DVM:
|
|||||||
user = get_or_add_user(self.dvm_config.DB, job_event.pubkey().to_hex(),
|
user = get_or_add_user(self.dvm_config.DB, job_event.pubkey().to_hex(),
|
||||||
client=self.client, config=self.dvm_config)
|
client=self.client, config=self.dvm_config)
|
||||||
print(user.lud16 + " " + str(amount))
|
print(user.lud16 + " " + str(amount))
|
||||||
bolt11 = zap(user.lud16, amount, "Couldn't finish job, returning sats", job_event,
|
bolt11 = zaprequest(user.lud16, amount, "Couldn't finish job, returning sats", job_event,
|
||||||
self.keys, self.dvm_config, zaptype="private")
|
self.keys, self.dvm_config, zaptype="private")
|
||||||
if bolt11 is None:
|
if bolt11 is None:
|
||||||
print("Receiver has no Lightning address, can't zap back.")
|
print("Receiver has no Lightning address, can't zap back.")
|
||||||
|
Reference in New Issue
Block a user