mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-06-05 13:09:11 +02:00
clean up nip89 with suggested params in the nip, replace nip04 with nip44 for encryption
This commit is contained in:
parent
b88f4a54ca
commit
e2f720becc
@ -24,8 +24,8 @@ def main():
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I use a LLM connected via OLLAMA",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
|
||||
}
|
||||
|
@ -24,8 +24,8 @@ def main():
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I Generate Speech from Text",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"language": {
|
||||
"required": False,
|
||||
|
@ -24,8 +24,8 @@ def main():
|
||||
"name": name,
|
||||
"picture": "https://unleashed.chat/_app/immutable/assets/hero.pehsu4x_.jpeg",
|
||||
"about": "I generate Text with Unleashed.chat",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {}
|
||||
}
|
||||
|
||||
|
4
main.py
4
main.py
@ -26,8 +26,8 @@ def playground(announce=False):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/28da676a19841dcfa7dcf7124be6816842d14b84f6046462d2a3f1268fe58d03.png",
|
||||
"about": "I'm just a demo DVM, not doing much.'",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,8 @@ import os
|
||||
import signal
|
||||
from multiprocessing.connection import Connection
|
||||
|
||||
from nostr_sdk import (Keys, Timestamp, Filter, nip04_decrypt, HandleNotification, EventBuilder, PublicKey,
|
||||
Options, Tag, Event, nip04_encrypt, EventId, Nip19Event, Kind, KindEnum, NostrSigner,
|
||||
from nostr_sdk import (Keys, Timestamp, Filter, nip04_decrypt, nip44_decrypt, HandleNotification, EventBuilder, PublicKey,
|
||||
Options, Tag, Event, EventId, Nip19Event, Kind, KindEnum, NostrSigner, nip44_encrypt,
|
||||
UnsignedEvent, UnwrappedGift, uniffi_set_event_loop, ClientBuilder, make_private_msg)
|
||||
|
||||
from nostr_dvm.utils.admin_utils import admin_make_database_updates
|
||||
@ -28,9 +28,11 @@ class Bot:
|
||||
# This is a simple list just to keep track which events we created and manage, so we don't pay for other requests
|
||||
|
||||
def __init__(self, dvm_config, admin_config=None):
|
||||
self.signer = None
|
||||
self.dvm_config = None
|
||||
self.keys = None
|
||||
self.admin_config = None
|
||||
|
||||
self.client = None
|
||||
asyncio.run(self.run_bot(dvm_config, admin_config))
|
||||
uniffi_set_event_loop(asyncio.get_running_loop())
|
||||
@ -46,6 +48,7 @@ class Bot:
|
||||
self.dvm_config.NIP89 = nip89config
|
||||
self.admin_config = admin_config
|
||||
self.keys = Keys.parse(dvm_config.PRIVATE_KEY)
|
||||
self.signer = NostrSigner.keys(self.keys)
|
||||
self.CHATBOT = False
|
||||
|
||||
opts = Options().gossip(True)
|
||||
@ -125,7 +128,7 @@ class Bot:
|
||||
if giftwrap:
|
||||
try:
|
||||
# Extract rumor
|
||||
unwrapped_gift = await UnwrappedGift.from_gift_wrap(self.keys, nostr_event)
|
||||
unwrapped_gift = await UnwrappedGift.from_gift_wrap(NostrSigner.keys(self.keys), nostr_event)
|
||||
sender = unwrapped_gift.sender().to_hex()
|
||||
rumor: UnsignedEvent = unwrapped_gift.rumor()
|
||||
|
||||
@ -185,7 +188,7 @@ class Bot:
|
||||
params_as_str = json.dumps(tags_str)
|
||||
print(params_as_str)
|
||||
# and encrypt them
|
||||
encrypted_params = nip04_encrypt(self.keys.secret_key(),
|
||||
encrypted_params = nip44_encrypt(self.keys.secret_key(),
|
||||
PublicKey.from_hex(
|
||||
self.dvm_config.SUPPORTED_DVMS[
|
||||
index].PUBLIC_KEY),
|
||||
@ -240,7 +243,7 @@ class Bot:
|
||||
else:
|
||||
message = invoice
|
||||
if giftwrap:
|
||||
event = await make_private_msg(self.keys, PublicKey.parse(sender), message,
|
||||
event = await make_private_msg(self.signer, PublicKey.parse(sender), message,
|
||||
None)
|
||||
await self.client.send_event(event)
|
||||
|
||||
@ -262,8 +265,7 @@ class Bot:
|
||||
"100 sats (or any other amount) "
|
||||
"to top up your balance")
|
||||
if giftwrap:
|
||||
event = await make_private_msg(self.keys, PublicKey.parse(sender), message,
|
||||
None)
|
||||
event = await make_private_msg(NostrSigner.keys(self.keys), PublicKey.parse(sender), message)
|
||||
await self.client.send_event(event)
|
||||
else:
|
||||
await send_nip04_dm(self.client, message, PublicKey.parse(sender), self.dvm_config)
|
||||
@ -281,8 +283,7 @@ class Bot:
|
||||
message = "Error: " + cashu_message + ". Token has not been redeemed."
|
||||
|
||||
if giftwrap:
|
||||
event = await make_private_msg(self.keys, PublicKey.parse(sender), message,
|
||||
None)
|
||||
event = await make_private_msg(self.signer, PublicKey.parse(sender), message)
|
||||
await self.client.send_event(event)
|
||||
else:
|
||||
await send_nip04_dm(self.client, message, PublicKey.parse(sender), self.dvm_config)
|
||||
@ -290,8 +291,7 @@ class Bot:
|
||||
await asyncio.sleep(2.0)
|
||||
message = "No, there is no second best.\n\nhttps://cdn.nostr.build/p/mYLv.mp4"
|
||||
if giftwrap:
|
||||
event = await make_private_msg(self.keys, PublicKey.parse(sender), message,
|
||||
None)
|
||||
event = await make_private_msg(self.signer, PublicKey.parse(sender), message)
|
||||
await self.client.send_event(event)
|
||||
else:
|
||||
await send_nip04_dm(self.client, message, PublicKey.parse(sender), self.dvm_config)
|
||||
@ -356,8 +356,13 @@ class Bot:
|
||||
|
||||
if is_encrypted:
|
||||
if ptag == self.keys.public_key().to_hex():
|
||||
tags_str = nip04_decrypt(Keys.parse(dvm_config.PRIVATE_KEY).secret_key(),
|
||||
nostr_event.author(), nostr_event.content())
|
||||
try:
|
||||
tags_str = nip44_decrypt(Keys.parse(dvm_config.PRIVATE_KEY).secret_key(),
|
||||
nostr_event.author(), nostr_event.content())
|
||||
except:
|
||||
tags_str = nip04_decrypt(Keys.parse(dvm_config.PRIVATE_KEY).secret_key(),
|
||||
nostr_event.author(), nostr_event.content())
|
||||
|
||||
params = json.loads(tags_str)
|
||||
params.append(Tag.parse(["p", ptag]).as_vec())
|
||||
params.append(Tag.parse(["encrypted"]).as_vec())
|
||||
@ -386,8 +391,7 @@ class Bot:
|
||||
client=self.client, config=self.dvm_config)
|
||||
await asyncio.sleep(2.0)
|
||||
if entry["giftwrap"]:
|
||||
event = await make_private_msg(self.keys, PublicKey.parse(PublicKey.parse(entry["npub"])), content,
|
||||
None)
|
||||
event = await make_private_msg(self.signer, PublicKey.parse(PublicKey.parse(entry["npub"])), content)
|
||||
await self.client.send_event(event)
|
||||
else:
|
||||
await send_nip04_dm(self.client, content, PublicKey.parse(entry['npub']), self.dvm_config)
|
||||
@ -417,8 +421,7 @@ class Bot:
|
||||
amount) + " Sats from balance to DVM. New balance is " + str(
|
||||
balance) + " Sats.\n"
|
||||
if entry["giftwrap"]:
|
||||
event = await make_private_msg(self.keys, PublicKey.parse(PublicKey.parse(entry["npub"])), message,
|
||||
None)
|
||||
event = await make_private_msg(self.signer, PublicKey.parse(PublicKey.parse(entry["npub"])), message)
|
||||
await self.client.send_event(event)
|
||||
else:
|
||||
await send_nip04_dm(self.client, content, PublicKey.parse(entry['npub']),
|
||||
@ -434,8 +437,7 @@ class Bot:
|
||||
int(amount - user.balance)) + " Sats, then try again."
|
||||
|
||||
if entry["giftwrap"]:
|
||||
event = await make_private_msg(self.keys, PublicKey.parse(PublicKey.parse((entry["npub"]))), message,
|
||||
None)
|
||||
event = await make_private_msg(self.signer, PublicKey.parse(PublicKey.parse((entry["npub"]))), message)
|
||||
await self.client.send_event(event)
|
||||
else:
|
||||
await send_nip04_dm(self.client, message, PublicKey.parse(entry['npub']),
|
||||
@ -496,7 +498,10 @@ class Bot:
|
||||
content = nostr_event.content()
|
||||
if is_encrypted:
|
||||
if ptag == self.keys.public_key().to_hex():
|
||||
content = nip04_decrypt(self.keys.secret_key(), nostr_event.author(), content)
|
||||
try:
|
||||
content = nip44_decrypt(self.keys.secret_key(), nostr_event.author(), content)
|
||||
except:
|
||||
content = nip04_decrypt(self.keys.secret_key(), nostr_event.author(), content)
|
||||
else:
|
||||
return
|
||||
|
||||
@ -513,8 +518,8 @@ class Bot:
|
||||
print("[" + self.NAME + "] Received results, message to orignal sender " + user.name)
|
||||
await asyncio.sleep(2.0)
|
||||
if entry["giftwrap"]:
|
||||
event = await make_private_msg(self.keys, PublicKey.parse(user.npub), content,
|
||||
None)
|
||||
event = await make_private_msg(self.signer, PublicKey.parse(user.npub), content)
|
||||
|
||||
await self.client.send_event(event)
|
||||
else:
|
||||
await send_nip04_dm(self.client, content, PublicKey.parse(user.npub), self.dvm_config)
|
||||
@ -581,7 +586,7 @@ class Bot:
|
||||
|
||||
text = message + "\nSelect an Index and provide an input (e.g. \"2 A purple ostrich\")\nType \"index info\" to learn more about each DVM. (e.g. \"2 info\")\n\n Type \"balance\" to see your current balance"
|
||||
if giftwrap:
|
||||
event = await make_private_msg(self.keys, PublicKey.parse(sender), text)
|
||||
event = await make_private_msg(self.signer, PublicKey.parse(sender), text)
|
||||
await self.client.send_event(event)
|
||||
else:
|
||||
await send_nip04_dm(self.client, text, PublicKey.parse(sender), self.dvm_config)
|
||||
@ -589,7 +594,7 @@ class Bot:
|
||||
async def answer_blacklisted(nostr_event, giftwrap, sender):
|
||||
message = "Your are currently blocked from this service."
|
||||
if giftwrap:
|
||||
event = await make_private_msg(self.keys, PublicKey.parse(sender), message)
|
||||
event = await make_private_msg(self.signer, PublicKey.parse(sender), message)
|
||||
await self.client.send_event(event)
|
||||
else:
|
||||
await send_nip04_dm(self.client, message, PublicKey.parse(sender), self.dvm_config)
|
||||
@ -601,7 +606,7 @@ class Bot:
|
||||
await asyncio.sleep(2.0)
|
||||
|
||||
if giftwrap:
|
||||
event = await make_private_msg(self.keys, PublicKey.parse(sender), info)
|
||||
event = await make_private_msg(self.signer, PublicKey.parse(sender), info)
|
||||
await self.client.send_event(event)
|
||||
else:
|
||||
await send_nip04_dm(self.client, info, PublicKey.parse(sender), self.dvm_config)
|
||||
@ -747,10 +752,10 @@ class Bot:
|
||||
info += nip89content.get("image") + "\n"
|
||||
if nip89content.get("about"):
|
||||
info += "About:\n" + nip89content.get("about") + "\n\n"
|
||||
if nip89content.get("cashuAccepted"):
|
||||
cashu_accepted = str(nip89content.get("cashuAccepted"))
|
||||
if nip89content.get("encryptionSupported"):
|
||||
encryption_supported = str(nip89content.get("encryptionSupported"))
|
||||
if nip89content.get("acceptsNutZaps"):
|
||||
cashu_accepted = str(nip89content.get("acceptsNutZaps"))
|
||||
if nip89content.get("supportsEncryption"):
|
||||
encryption_supported = str(nip89content.get("supportsEncryption"))
|
||||
|
||||
info += "Encryption supported: " + str(encryption_supported) + "\n"
|
||||
info += "Cashu accepted: " + str(cashu_accepted) + "\n\n"
|
||||
|
@ -4,7 +4,8 @@ import os
|
||||
from sys import platform
|
||||
|
||||
from nostr_sdk import PublicKey, Keys, Client, Tag, Event, EventBuilder, Filter, HandleNotification, Timestamp, \
|
||||
LogLevel, Options, nip04_encrypt, Kind, RelayLimits, uniffi_set_event_loop, ClientBuilder, NostrSigner
|
||||
LogLevel, Options, nip04_encrypt, nip44_encrypt, Nip44Version, Kind, RelayLimits, uniffi_set_event_loop, ClientBuilder, NostrSigner
|
||||
|
||||
|
||||
from nostr_dvm.utils.admin_utils import admin_make_database_updates, AdminConfig
|
||||
from nostr_dvm.utils.backend_utils import get_amount_per_task, check_task_is_supported, get_task
|
||||
@ -107,7 +108,7 @@ class DVM:
|
||||
|
||||
async def handle_nip90_job_event(nip90_event):
|
||||
# decrypted encrypted events
|
||||
nip90_event = check_and_decrypt_tags(nip90_event, self.dvm_config)
|
||||
nip90_event, use_legacy_encryption = check_and_decrypt_tags(nip90_event, self.dvm_config)
|
||||
# if event is encrypted, but we can't decrypt it (e.g. because its directed to someone else), return
|
||||
if nip90_event is None:
|
||||
return
|
||||
@ -235,7 +236,7 @@ class DVM:
|
||||
if dvm_config.SEND_FEEDBACK_EVENTS:
|
||||
await send_job_status_reaction(nip90_event, "processing", True, 0,
|
||||
content=self.dvm_config.CUSTOM_PROCESSING_MESSAGE,
|
||||
client=self.client, dvm_config=self.dvm_config, user=user)
|
||||
client=self.client, dvm_config=self.dvm_config)
|
||||
|
||||
# when we reimburse users on error make sure to not send anything if it was free
|
||||
if user.iswhitelisted or task_is_free:
|
||||
@ -337,7 +338,7 @@ class DVM:
|
||||
job_event = await get_event_by_id(tag.as_vec()[1], client=self.client,
|
||||
config=self.dvm_config)
|
||||
if job_event is not None:
|
||||
job_event = check_and_decrypt_tags(job_event, self.dvm_config)
|
||||
job_event, use_legacy_encryption = check_and_decrypt_tags(job_event, self.dvm_config)
|
||||
if job_event is None:
|
||||
return
|
||||
else:
|
||||
@ -357,7 +358,7 @@ class DVM:
|
||||
print("[" + self.dvm_config.NIP89.NAME + "] Payment-request fulfilled...")
|
||||
await send_job_status_reaction(job_event, "processing", client=self.client,
|
||||
content=self.dvm_config.CUSTOM_PROCESSING_MESSAGE,
|
||||
dvm_config=self.dvm_config, user=user)
|
||||
dvm_config=self.dvm_config)
|
||||
indices = [i for i, x in enumerate(self.job_list) if
|
||||
x.event == job_event]
|
||||
index = -1
|
||||
@ -419,7 +420,7 @@ class DVM:
|
||||
job_event = await get_event_by_id(tag.as_vec()[1], client=self.client,
|
||||
config=self.dvm_config)
|
||||
if job_event is not None:
|
||||
job_event = check_and_decrypt_tags(job_event, self.dvm_config)
|
||||
job_event, use_legacy_encryption = check_and_decrypt_tags(job_event, self.dvm_config)
|
||||
if job_event is None:
|
||||
return
|
||||
else:
|
||||
@ -531,11 +532,11 @@ class DVM:
|
||||
if self.dvm_config.SHOW_RESULT_BEFORE_PAYMENT and not is_paid:
|
||||
await send_nostr_reply_event(data, original_event.as_json())
|
||||
await send_job_status_reaction(original_event, "success", amount,
|
||||
dvm_config=self.dvm_config,
|
||||
dvm_config=self.dvm_config
|
||||
) # or payment-required, or both?
|
||||
elif not self.dvm_config.SHOW_RESULT_BEFORE_PAYMENT and not is_paid:
|
||||
await send_job_status_reaction(original_event, "success", amount,
|
||||
dvm_config=self.dvm_config,
|
||||
dvm_config=self.dvm_config
|
||||
) # or payment-required, or both?
|
||||
|
||||
if self.dvm_config.SHOW_RESULT_BEFORE_PAYMENT and is_paid:
|
||||
@ -595,11 +596,15 @@ class DVM:
|
||||
reply_tags.append(relay_tag)
|
||||
|
||||
encrypted = False
|
||||
is_legacy_encryption = False
|
||||
encryption_tags = []
|
||||
for tag in original_event.tags().to_vec():
|
||||
if tag.as_vec()[0] == "encrypted":
|
||||
encrypted = True
|
||||
encrypted_tag = Tag.parse(["encrypted"])
|
||||
reply_tags.append(encrypted_tag)
|
||||
encryption_tags.append(encrypted_tag)
|
||||
#_, is_legacy_encryption = check_and_decrypt_tags(original_event, dvm_config)
|
||||
|
||||
|
||||
for tag in original_event.tags().to_vec():
|
||||
if tag.as_vec()[0] == "i":
|
||||
@ -607,14 +612,30 @@ class DVM:
|
||||
if not encrypted:
|
||||
reply_tags.append(i_tag)
|
||||
|
||||
if encrypted:
|
||||
encryption_tags.append(p_tag)
|
||||
encryption_tags.append(e_tag)
|
||||
|
||||
else:
|
||||
reply_tags.append(p_tag)
|
||||
|
||||
if encrypted:
|
||||
print(content)
|
||||
content = nip04_encrypt(self.keys.secret_key(), PublicKey.from_hex(original_event.author().to_hex()),
|
||||
content)
|
||||
if is_legacy_encryption:
|
||||
content = nip04_encrypt(self.keys.secret_key(), PublicKey.from_hex(original_event.author().to_hex()),
|
||||
content)
|
||||
else:
|
||||
|
||||
content = nip44_encrypt(self.keys.secret_key(),
|
||||
PublicKey.from_hex(original_event.author().to_hex()),
|
||||
content, Nip44Version.V2)
|
||||
|
||||
reply_tags = encryption_tags
|
||||
|
||||
|
||||
reply_event = EventBuilder(Kind(original_event.kind().as_u16() + 1000), str(content)).tags(reply_tags).sign_with_keys(
|
||||
self.keys)
|
||||
|
||||
print(reply_event)
|
||||
# send_event(reply_event, client=self.client, dvm_config=self.dvm_config)
|
||||
await send_event_outbox(reply_event, client=self.client, dvm_config=self.dvm_config)
|
||||
if self.dvm_config.LOGLEVEL.value >= LogLevel.DEBUG.value:
|
||||
@ -626,7 +647,7 @@ class DVM:
|
||||
|
||||
async def send_job_status_reaction(original_event, status, is_paid=True, amount=0, client=None,
|
||||
content=None,
|
||||
dvm_config=None, user=None):
|
||||
dvm_config=None):
|
||||
|
||||
task = await get_task(original_event, client=client, dvm_config=dvm_config)
|
||||
alt_description, reaction = build_status_reaction(status, task, amount, content, dvm_config)
|
||||
@ -649,11 +670,13 @@ class DVM:
|
||||
encryption_tags = []
|
||||
|
||||
encrypted = False
|
||||
is_legacy_encryption = False
|
||||
for tag in original_event.tags().to_vec():
|
||||
if tag.as_vec()[0] == "encrypted":
|
||||
encrypted = True
|
||||
encrypted_tag = Tag.parse(["encrypted"])
|
||||
encryption_tags.append(encrypted_tag)
|
||||
#_, is_legacy_encryption = check_and_decrypt_tags(original_event, dvm_config)
|
||||
|
||||
if encrypted:
|
||||
encryption_tags.append(p_tag)
|
||||
@ -720,8 +743,13 @@ class DVM:
|
||||
str_tags.append(element.as_vec())
|
||||
|
||||
content = json.dumps(str_tags)
|
||||
content = nip04_encrypt(self.keys.secret_key(), PublicKey.from_hex(original_event.author().to_hex()),
|
||||
content)
|
||||
if is_legacy_encryption:
|
||||
content = nip04_encrypt(self.keys.secret_key(), PublicKey.from_hex(original_event.author().to_hex()),
|
||||
content)
|
||||
else:
|
||||
content = nip44_encrypt(self.keys.secret_key(),
|
||||
PublicKey.from_hex(original_event.author().to_hex()),
|
||||
content, version=Nip44Version.V2)
|
||||
reply_tags = encryption_tags
|
||||
|
||||
else:
|
||||
|
@ -5,8 +5,8 @@ import os
|
||||
import signal
|
||||
from datetime import timedelta
|
||||
|
||||
from nostr_sdk import (Keys, Client, Timestamp, Filter, nip04_decrypt, HandleNotification, EventBuilder, PublicKey,
|
||||
Options, Tag, Event, nip04_encrypt, NostrSigner, EventId, uniffi_set_event_loop, make_private_msg)
|
||||
from nostr_sdk import (Keys, Client, Timestamp, Filter, nip04_decrypt, nip44_decrypt, HandleNotification, EventBuilder, PublicKey,
|
||||
Options, Tag, Event, nip44_encrypt, NostrSigner, EventId, uniffi_set_event_loop, make_private_msg)
|
||||
|
||||
from nostr_dvm.utils.database_utils import fetch_user_metadata
|
||||
from nostr_dvm.utils.definitions import EventDefinitions, relay_timeout
|
||||
@ -146,7 +146,7 @@ class Subscription:
|
||||
str_tags.append(element.as_vec())
|
||||
|
||||
content = json.dumps(str_tags)
|
||||
content = nip04_encrypt(self.keys.secret_key(), PublicKey.from_hex(original_event.author().to_hex()),
|
||||
content = nip44_encrypt(self.keys.secret_key(), PublicKey.from_hex(original_event.author().to_hex()),
|
||||
content)
|
||||
reply_tags = encryption_tags
|
||||
|
||||
@ -229,7 +229,12 @@ class Subscription:
|
||||
return
|
||||
|
||||
try:
|
||||
decrypted_text = nip04_decrypt(self.keys.secret_key(), nostr_event.author(), nostr_event.content())
|
||||
|
||||
try:
|
||||
decrypted_text = nip44_decrypt(self.keys.secret_key(), nostr_event.author(), nostr_event.content())
|
||||
except:
|
||||
decrypted_text = nip04_decrypt(self.keys.secret_key(), nostr_event.author(), nostr_event.content())
|
||||
|
||||
subscriber = ""
|
||||
nwc = ""
|
||||
try:
|
||||
|
@ -164,8 +164,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://nostr.band/android-chrome-192x192.png",
|
||||
"about": "I search notes on Nostr.band.",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"users": {
|
||||
"required": False,
|
||||
|
@ -149,8 +149,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/d844d6a963724b9f9deb6b3326984fd95352343336718812424d5e99d93a6f2d.jpg",
|
||||
"about": "I search notes on nostr.wine using the nostr-wine API",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"users": {
|
||||
"required": False,
|
||||
|
@ -158,8 +158,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I create songs based on prompts with suno.ai",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"nip90Params": {}
|
||||
}
|
||||
|
||||
|
@ -230,8 +230,8 @@ def build_example(name, identifier, admin_config, options, cost=0, update_rate=1
|
||||
"picture": image,
|
||||
"about": "I show the latest longform notes.",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -275,8 +275,8 @@ def build_example_subscription(name, identifier, admin_config, options, update_r
|
||||
"picture": image,
|
||||
"about": "I show the latest longform notes",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"subscription": True,
|
||||
"personalized": False,
|
||||
"nip90Params": {
|
||||
|
@ -229,8 +229,8 @@ def build_example(name, identifier, admin_config, options, cost=0, update_rate=1
|
||||
"picture": image,
|
||||
"about": "I show the latest longform notes.",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -274,8 +274,8 @@ def build_example_subscription(name, identifier, admin_config, options, update_r
|
||||
"picture": image,
|
||||
"about": "I show the latest longform notes",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"subscription": True,
|
||||
"personalized": False,
|
||||
"nip90Params": {
|
||||
|
@ -228,8 +228,8 @@ def build_example(name, identifier, admin_config, options, cost=0, update_rate=1
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently popular",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -272,8 +272,8 @@ def build_example_subscription(name, identifier, admin_config, options, update_r
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently popular all over Nostr. I'm also used for testing subscriptions.",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"subscription": True,
|
||||
"personalized": False,
|
||||
"nip90Params": {
|
||||
|
@ -272,8 +272,8 @@ def build_example(name, identifier, admin_config, options, cost=0, update_rate=1
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently zapped the most.",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -316,8 +316,8 @@ def build_example_subscription(name, identifier, admin_config, options, update_r
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently popular all over Nostr. I'm also used for testing subscriptions.",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"subscription": True,
|
||||
"personalized": False,
|
||||
"nip90Params": {
|
||||
|
@ -246,8 +246,8 @@ def build_example(name, identifier, admin_config, options, cost=0, update_rate=3
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently popular from people you follow",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": True,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -289,8 +289,8 @@ def build_example_subscription(name, identifier, admin_config, options, processi
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently popular, just like the free DVM, I'm also used for testing subscriptions. (beta)",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": True,
|
||||
"subscription": True,
|
||||
"nip90Params": {
|
||||
|
@ -296,8 +296,8 @@ def build_example(name, identifier, admin_config, options, cost=0, update_rate=1
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently popular",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -340,8 +340,8 @@ def build_example_subscription(name, identifier, admin_config, options, update_r
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently popular all over Nostr. I'm also used for testing subscriptions.",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"subscription": True,
|
||||
"personalized": False,
|
||||
"nip90Params": {
|
||||
|
@ -250,8 +250,8 @@ def build_example(name, identifier, admin_config, options, cost=0, update_rate=1
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently popular",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -295,8 +295,8 @@ def build_example_subscription(name, identifier, admin_config, options, update_r
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently popular all over Nostr. I'm also used for testing subscriptions.",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"subscription": True,
|
||||
"personalized": False,
|
||||
"nip90Params": {
|
||||
|
@ -282,8 +282,8 @@ def build_example(name, identifier, admin_config, options, image, description, u
|
||||
"picture": image,
|
||||
"about": description,
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -321,8 +321,8 @@ def build_example_subscription(name, identifier, admin_config, options, image, d
|
||||
"picture": image,
|
||||
"about": description,
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"subscription": True,
|
||||
"personalized": False,
|
||||
"nip90Params": {
|
||||
|
@ -259,8 +259,8 @@ def build_example(name, identifier, admin_config, options, image, description, u
|
||||
"picture": image,
|
||||
"about": description,
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -298,8 +298,8 @@ def build_example_subscription(name, identifier, admin_config, options, image, d
|
||||
"picture": image,
|
||||
"about": description,
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"subscription": True,
|
||||
"personalized": False,
|
||||
"nip90Params": {
|
||||
|
@ -208,8 +208,8 @@ def build_example(name, identifier, admin_config):
|
||||
"picture": "https://i.nostr.build/H6SMmCl7eRDvkbAn.jpg",
|
||||
"about": "I discover users you follow, but that have been inactive on Nostr",
|
||||
"action": "unfollow", # follow, mute, unmute
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"user": {
|
||||
"required": False,
|
||||
|
@ -220,8 +220,8 @@ def build_example(name, identifier, admin_config, options, image, description, u
|
||||
"picture": image,
|
||||
"about": description,
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -259,8 +259,8 @@ def build_example_subscription(name, identifier, admin_config, options, image, d
|
||||
"picture": image,
|
||||
"about": description,
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"subscription": True,
|
||||
"personalized": False,
|
||||
"nip90Params": {
|
||||
|
@ -89,8 +89,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I convert videos from urls to given output format.",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"format": {
|
||||
"required": False,
|
||||
|
@ -165,8 +165,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/981b560820bc283c58de7989b7abc6664996b487a531d852e4ef7322586a2122.jpg",
|
||||
"about": "I hunt down bot farms.",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"action": "mute", # follow, unfollow, mute, unmute
|
||||
"nip90Params": {
|
||||
"max_results": {
|
||||
|
@ -173,8 +173,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/19872a2edd866258fa9eab137631efda89310d52b2c6ea8f99ef057325aa1c7b.jpg",
|
||||
"about": "I show users that have been reported by either your followers or your Web of Trust. Note: Anyone can report, so you might double check and decide for yourself who to mute. Considers spam, illegal and impersonation reports. Notice: This works with NIP51 mute lists. Not all clients support the new mute list format.",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"action": "mute", # follow, unfollow, mute, unmute
|
||||
"nip90Params": {
|
||||
"since_days": {
|
||||
|
@ -194,8 +194,8 @@ def build_example(name, identifier, admin_config):
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I discover users you follow, but that have been inactive on Nostr",
|
||||
"action": "unfollow", # follow, mute, unmute
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"user": {
|
||||
"required": False,
|
||||
|
@ -197,8 +197,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I discover users you follow, but that don't follow you back.",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"user": {
|
||||
"required": False,
|
||||
|
@ -128,8 +128,8 @@ def build_example(name, identifier, admin_config, custom_processing_msg):
|
||||
"picture": "https://image.nostr.build/0c760b3ecdbc993ba47b785d0adecf00c760b3ecdbc993ba47b785d0adecf0ec71fd9c59808e27d0665b9f77a32d8de.png",
|
||||
"about": "I show trending notes from Soapbox Ditto",
|
||||
"amount": "Free",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {}
|
||||
}
|
||||
nip89config = NIP89Config()
|
||||
|
@ -120,8 +120,8 @@ def build_example(name, identifier, admin_config, custom_processing_msg):
|
||||
"picture": "https://nostr.band/android-chrome-192x192.png",
|
||||
"about": "I show trending notes from nostr.band",
|
||||
"amount": "Free",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {}
|
||||
}
|
||||
nip89config = NIP89Config()
|
||||
|
@ -85,8 +85,8 @@ def build_example(name, identifier, admin_config, announce=False):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/28da676a19841dcfa7dcf7124be6816842d14b84f6046462d2a3f1268fe58d03.png",
|
||||
"about": "I'm an all purpose DVM'",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
}
|
||||
}
|
||||
|
@ -135,8 +135,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I use OpenAI's DALL·E 3",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"size": {
|
||||
"required": False,
|
||||
|
@ -150,8 +150,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I use Replicate to run StableDiffusion 3",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"nip90Params": {
|
||||
"ratio": {
|
||||
"required": False,
|
||||
|
@ -145,8 +145,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I use Replicate to run FluxPro",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"nip90Params": {
|
||||
"ratio": {
|
||||
"required": False,
|
||||
|
@ -143,8 +143,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I use Replicate to run Recraft",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"nip90Params": {
|
||||
"ratio": {
|
||||
"required": False,
|
||||
|
@ -129,8 +129,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I use Replicate to run StableDiffusion XL",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"nip90Params": {
|
||||
"size": {
|
||||
"required": False,
|
||||
|
@ -158,8 +158,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I use Replicate to run StableDiffusion XL",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"size": {
|
||||
"required": False,
|
||||
|
@ -266,9 +266,9 @@ def build_example(name, identifier, admin_config, server_address, default_model=
|
||||
"name": name,
|
||||
"picture": "https://i.nostr.build/NOXcCIPmOZrDTK35.jpg",
|
||||
"about": "I draw images using Stable diffusion ultra",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"nip90Params": {
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params":{
|
||||
"negative_prompt": {
|
||||
"required": False,
|
||||
"values": []
|
||||
|
@ -177,8 +177,8 @@ def build_example(name, identifier, admin_config, server_address, default_model=
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I draw images based on a prompt with a Model called unstable diffusion",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"negative_prompt": {
|
||||
"required": False,
|
||||
|
@ -199,8 +199,8 @@ def build_example(name, identifier, admin_config, server_address, default_lora="
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/229c14e440895da30de77b3ca145d66d4b04efb4027ba3c44ca147eecde891f1.jpg",
|
||||
"about": "I convert an image to another image, kinda random for now. ",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"negative_prompt": {
|
||||
"required": False,
|
||||
|
@ -116,8 +116,8 @@ def build_example(name, identifier, admin_config, server_address):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/229c14e440895da30de77b3ca145d66d4b04efb4027ba3c44ca147eecde891f1.jpg",
|
||||
"about": "I analyse Images an return a prompt or a prompt analysis",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"method": {
|
||||
"required": False,
|
||||
|
@ -121,8 +121,8 @@ def build_example(name, identifier, admin_config, server_address):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/229c14e440895da30de77b3ca145d66d4b04efb4027ba3c44ca147eecde891f1.jpg",
|
||||
"about": "I upscale an image using realESRGan up to factor 4 (default is factor 4)",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"upscale": {
|
||||
"required": False,
|
||||
|
@ -310,8 +310,8 @@ def build_example(name, identifier, admin_config, options, cost=0, update_rate=1
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently popular",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -354,8 +354,8 @@ def build_example_subscription(name, identifier, admin_config, options, update_r
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently popular all over Nostr. I'm also used for testing subscriptions.",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"subscription": True,
|
||||
"personalized": False,
|
||||
"nip90Params": {
|
||||
|
@ -314,8 +314,8 @@ def build_example(name, identifier, admin_config, options, cost=0, update_rate=1
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently popular",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -358,8 +358,8 @@ def build_example_subscription(name, identifier, admin_config, options, update_r
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently popular all over Nostr. I'm also used for testing subscriptions.",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"subscription": True,
|
||||
"personalized": False,
|
||||
"nip90Params": {
|
||||
|
@ -206,8 +206,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/a99ab925084029d9468fef8330ff3d9be2cf67da473b024f2a6d48b5cd77197f.jpg",
|
||||
"about": "I search users.",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"nip90Params": {
|
||||
"users": {
|
||||
"required": False,
|
||||
|
@ -122,8 +122,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/28da676a19841dcfa7dcf7124be6816842d14b84f6046462d2a3f1268fe58d03.png",
|
||||
"about": "I summarize Text",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {}
|
||||
}
|
||||
|
||||
|
@ -127,8 +127,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/720eadc9af89084bb09de659af43ad17fec1f4b0887084e83ac0ae708dfa83a6.png",
|
||||
"about": "I use a LLM connected via Huggingchat to summarize Inputs",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {}
|
||||
}
|
||||
|
||||
|
@ -151,8 +151,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://unleashed.chat/_app/immutable/assets/hero.pehsu4x_.jpeg",
|
||||
"about": "I summarize Text with https://unleashed.chat",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"nip90Params": {}
|
||||
}
|
||||
|
||||
|
@ -139,8 +139,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I extract text from media files with the Google API. I understand English by default",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"language": {
|
||||
"required": False,
|
||||
|
@ -102,8 +102,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I extract text from pdf documents. I only support Latin letters",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"nip90Params": {}
|
||||
}
|
||||
|
||||
|
@ -163,8 +163,8 @@ def build_example(name, identifier, admin_config, server_address):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I extract text from media files with WhisperX",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"model": {
|
||||
"required": False,
|
||||
|
@ -92,8 +92,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/720eadc9af89084bb09de659af43ad17fec1f4b0887084e83ac0ae708dfa83a6.png",
|
||||
"about": "I use a LLM connected via Huggingchat",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {}
|
||||
}
|
||||
|
||||
|
@ -107,8 +107,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I use a LLM connected via OLLAMA",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {}
|
||||
}
|
||||
|
||||
|
@ -115,8 +115,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://unleashed.chat/_app/immutable/assets/hero.pehsu4x_.jpeg",
|
||||
"about": "I generate Text with Unleashed.chat",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"nip90Params": {}
|
||||
}
|
||||
|
||||
|
@ -177,8 +177,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I Generate Speech from Text",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"language": {
|
||||
"required": False,
|
||||
|
@ -121,8 +121,8 @@ def build_example(name, identifier, admin_config):
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I translate text from given text/event/job. Currently using Google TranslationGoogle Services to translate "
|
||||
"input into the language defined in params.",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"nip90Params": {
|
||||
"language": {
|
||||
"required": False,
|
||||
|
@ -119,8 +119,8 @@ def build_example(name, identifier, admin_config):
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I translate text from given text/event/job using LibreTranslate Services to translate "
|
||||
"input into the language defined in params.",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"language": {
|
||||
"required": False,
|
||||
|
@ -122,8 +122,8 @@ def build_example(name, identifier, admin_config):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I use Replicate to run StableDiffusion XL",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"nip90Params": {}
|
||||
}
|
||||
|
||||
|
@ -110,8 +110,8 @@ def build_example(name, identifier, admin_config, server_address):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I create a short video based on an image",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {}
|
||||
}
|
||||
nip89config = NIP89Config()
|
||||
|
@ -5,7 +5,7 @@ from dataclasses import dataclass
|
||||
from logging import Filter
|
||||
from sqlite3 import Error
|
||||
|
||||
from nostr_sdk import Timestamp, Keys, PublicKey, Filter, Kind, make_private_msg
|
||||
from nostr_sdk import Timestamp, Keys, PublicKey, Filter, Kind, make_private_msg, NostrSigner
|
||||
|
||||
from nostr_dvm.utils.definitions import relay_timeout
|
||||
from nostr_dvm.utils.nostr_utils import send_nip04_dm
|
||||
@ -192,8 +192,7 @@ async def update_user_balance(db, npub, additional_sats, client, config, giftwra
|
||||
|
||||
# always send giftwrapped. sorry not sorry.
|
||||
#if giftwrap:
|
||||
event = await make_private_msg(keys, PublicKey.parse(npub), message,
|
||||
None)
|
||||
event = await make_private_msg(NostrSigner.keys(keys), PublicKey.parse(npub), message)
|
||||
await client.send_event(event)
|
||||
#else:
|
||||
# await send_nip04_dm(client, message, PublicKey.parse(npub), config)
|
||||
|
@ -52,18 +52,18 @@ def build_external_dvm(pubkey, task, kind, fix_cost, per_unit_cost, config,
|
||||
about = nip89content.get("about")
|
||||
if nip89content.get("nip90Params"):
|
||||
nip90params = nip89content["nip90Params"]
|
||||
if nip89content.get("encryptionSupported"):
|
||||
encryption_supported = nip89content["encryptionSupported"]
|
||||
if nip89content.get("cashuAccepted"):
|
||||
cashu_accepted = nip89content["cashuAccepted"]
|
||||
if nip89content.get("supportsEncryption"):
|
||||
encryption_supported = nip89content["supportsEncryption"]
|
||||
if nip89content.get("acceptsNutZaps"):
|
||||
cashu_accepted = nip89content["acceptsNutZaps"]
|
||||
else:
|
||||
print("No NIP89 set for " + name)
|
||||
nip89info = {
|
||||
"name": name,
|
||||
"picture": image,
|
||||
"about": about,
|
||||
"encryptionSupported": encryption_supported,
|
||||
"cashuAccepted": cashu_accepted,
|
||||
"supportsEncryption": encryption_supported,
|
||||
"acceptsNutZaps": cashu_accepted,
|
||||
"nip90Params": nip90params
|
||||
}
|
||||
nip89config = NIP89Config()
|
||||
|
@ -5,7 +5,7 @@ from pathlib import Path
|
||||
from typing import List
|
||||
|
||||
import dotenv
|
||||
from nostr_sdk import Filter, Client, Alphabet, EventId, Event, PublicKey, Tag, Keys, nip04_decrypt, Metadata, Options, \
|
||||
from nostr_sdk import Filter, Client, Alphabet, EventId, Event, PublicKey, Tag, Keys, nip04_decrypt, nip44_decrypt, Metadata, Options, \
|
||||
Nip19Event, SingleLetterTag, RelayLimits, SecretKey, Connection, ConnectionTarget, \
|
||||
EventBuilder, Kind, ClientBuilder, SendEventOutput, NostrSigner
|
||||
|
||||
@ -295,9 +295,10 @@ async def send_event(event: Event, client: Client, dvm_config):
|
||||
|
||||
|
||||
def check_and_decrypt_tags(event, dvm_config):
|
||||
try:
|
||||
is_encrypted = False
|
||||
use_legacy_encryption = False
|
||||
|
||||
is_encrypted = False
|
||||
try:
|
||||
p = ""
|
||||
for tag in event.tags().to_vec():
|
||||
if tag.as_vec()[0] == 'encrypted':
|
||||
@ -309,11 +310,21 @@ def check_and_decrypt_tags(event, dvm_config):
|
||||
if p != dvm_config.PUBLIC_KEY:
|
||||
print("[" + dvm_config.NIP89.NAME + "] Task encrypted and not addressed to this DVM, "
|
||||
"skipping..")
|
||||
return None
|
||||
return None, False
|
||||
|
||||
elif p == dvm_config.PUBLIC_KEY:
|
||||
tags_str = nip04_decrypt(Keys.parse(dvm_config.PRIVATE_KEY).secret_key(),
|
||||
event.author(), event.content())
|
||||
try:
|
||||
tags_str = nip04_decrypt(Keys.parse(dvm_config.PRIVATE_KEY).secret_key(),
|
||||
event.author(), event.content())
|
||||
except:
|
||||
try:
|
||||
tags_str = nip44_decrypt(Keys.parse(dvm_config.PRIVATE_KEY).secret_key(),
|
||||
event.author(), event.content())
|
||||
except:
|
||||
print("Wrong Nip44 Format")
|
||||
return None, False
|
||||
use_legacy_encryption = True
|
||||
|
||||
params = json.loads(tags_str)
|
||||
params.append(Tag.parse(["p", p]).as_vec())
|
||||
params.append(Tag.parse(["encrypted"]).as_vec())
|
||||
@ -324,7 +335,7 @@ def check_and_decrypt_tags(event, dvm_config):
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
return event
|
||||
return event, use_legacy_encryption
|
||||
|
||||
|
||||
def check_and_decrypt_own_tags(event, dvm_config):
|
||||
@ -344,8 +355,12 @@ def check_and_decrypt_own_tags(event, dvm_config):
|
||||
return None
|
||||
|
||||
elif event.author().to_hex() == dvm_config.PUBLIC_KEY:
|
||||
tags_str = nip04_decrypt(Keys.parse(dvm_config.PRIVATE_KEY).secret_key(),
|
||||
PublicKey.from_hex(p), event.content())
|
||||
try:
|
||||
tags_str = nip44_decrypt(Keys.parse(dvm_config.PRIVATE_KEY).secret_key(),
|
||||
PublicKey.from_hex(p), event.content())
|
||||
except:
|
||||
tags_str = nip04_decrypt(Keys.parse(dvm_config.PRIVATE_KEY).secret_key(),
|
||||
PublicKey.from_hex(p), event.content())
|
||||
params = json.loads(tags_str)
|
||||
params.append(Tag.parse(["p", p]).as_vec())
|
||||
params.append(Tag.parse(["encrypted"]).as_vec())
|
||||
|
@ -82,7 +82,10 @@ AVOID_OUTBOX_RELAY_LIST = ["wss://nos.lol", "wss://nostr.fmt.wiz.biz", "wss://no
|
||||
"wss://onchain.pub", "wss://relay.nostr.info", "wss://relay.chicagoplebs.com",
|
||||
"wss://relay.current.fyi", "wss://relay.stemstr.app", "wss://nostr.zenon.info",
|
||||
"ws://localhost:7777", "wss://nostr.fmt.wiz.biz", "wss://nostrich.friendship.tw",
|
||||
"wss://public.relaying.io", "wss://relay.me3d.app",
|
||||
"wss://public.relaying.io", "wss://relay.me3d.app", "wss://dreamofthe90s.nostr1.com",
|
||||
"wss://lnbits.eldamar.icu/nostrrelay/relay", "wss://nostr.olwe.link",
|
||||
"wss://nostr.cheeserobot.org",
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -49,8 +49,8 @@ def playground(announce = False):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/28da676a19841dcfa7dcf7124be6816842d14b84f6046462d2a3f1268fe58d03.png",
|
||||
"about": "I'm briding DuckDuckAI'",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
}
|
||||
}
|
||||
|
@ -37,8 +37,8 @@ def build_dalle(name, identifier):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/22f2267ca9d4ee9d5e8a0c7818a9fa325bbbcdac5573a60a2d163e699bb69923.jpg",
|
||||
"about": "I create Images bridging OpenAI's DALL·E 3",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"size": {
|
||||
"required": False,
|
||||
|
@ -78,8 +78,8 @@ def build_db_scheduler(name, identifier, admin_config, options, image, descripti
|
||||
"picture": image,
|
||||
"about": description,
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -120,8 +120,8 @@ def build_example_gallery(name, identifier, admin_config, options, image, cost=0
|
||||
"picture": image,
|
||||
"about": "I show popular gallery entries",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": True,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -157,8 +157,8 @@ def build_example_nostrband(name, identifier, admin_config, image, about, custom
|
||||
"picture": image,
|
||||
"about": about,
|
||||
"amount": "Free",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {}
|
||||
}
|
||||
nip89config = NIP89Config()
|
||||
@ -196,8 +196,8 @@ def build_longform(name, identifier, admin_config, options, cost=0, update_rate=
|
||||
"picture": image,
|
||||
"about": "I show the latest longform notes.",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -248,8 +248,8 @@ def build_wiki(name, identifier, admin_config, options, cost=0, update_rate=180,
|
||||
"picture": image,
|
||||
"about": "I show the latest wikifreedia entries.",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -296,8 +296,8 @@ def build_example_topic(name, identifier, admin_config, options, image, descript
|
||||
"picture": image,
|
||||
"about": description,
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -338,8 +338,8 @@ def build_example_popular(name, identifier, admin_config, options, image, cost=0
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently popular",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -381,8 +381,8 @@ def build_example_popular_followers(name, identifier, admin_config, options, ima
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently popular from people you follow",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": True,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -430,8 +430,8 @@ def build_example_popular_non_followers(name, identifier, admin_config, options,
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently popular from people you do not follow",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"subscription": False,
|
||||
"personalized": True,
|
||||
"amount": create_amount_tag(cost),
|
||||
@ -496,8 +496,8 @@ def build_example_top_zapped(name, identifier, admin_config, options, image, cos
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently zapped the most.",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -544,8 +544,8 @@ def build_example_mostr(name, identifier, admin_config, options, image, cost=0,
|
||||
"picture": image,
|
||||
"about": "I show notes from Mostr.pub and Momostr.pink that are currently popular on Nostr",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -586,8 +586,8 @@ def build_example_oneperfollow(name, identifier, admin_config, options, image, c
|
||||
"picture": image,
|
||||
"about": "I show the single latest note of people you follow",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
|
@ -49,8 +49,8 @@ def build_example_topic(name, identifier, admin_config, options, image, descript
|
||||
"picture": image,
|
||||
"about": description,
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": True,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
|
@ -40,8 +40,8 @@ def build_example_gallery(name, identifier, admin_config, options, image, cost=0
|
||||
"picture": image,
|
||||
"about": "I show popular gallery entries",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": True,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
|
@ -54,8 +54,8 @@ def build_example_mostr(name, identifier, admin_config, options, image, cost=0,
|
||||
"picture": image,
|
||||
"about": "I show popular notes from Mostr.pub and Momostr.pink",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
|
@ -43,8 +43,8 @@ def build_example_oneperfollow(name, identifier, admin_config, options, image, c
|
||||
"picture": image,
|
||||
"about": "I show the single latest note of people you follow",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
|
@ -48,8 +48,8 @@ def build_example_wot(name, identifier, admin_config, options, image, cost=0, up
|
||||
"picture": image,
|
||||
"about": "I show people to follow from your WOT",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": True,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
|
@ -75,8 +75,8 @@ def build_db_scheduler(name, identifier, admin_config, options, image, descripti
|
||||
"picture": image,
|
||||
"about": description,
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -117,8 +117,8 @@ def build_example_gallery(name, identifier, admin_config, options, image, cost=0
|
||||
"picture": image,
|
||||
"about": "I show popular gallery entries",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": True,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -153,8 +153,8 @@ def build_example_nostrband(name, identifier, admin_config, image, about, custom
|
||||
"picture": image,
|
||||
"about": about,
|
||||
"amount": "Free",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {}
|
||||
}
|
||||
nip89config = NIP89Config()
|
||||
@ -191,8 +191,8 @@ def build_longform(name, identifier, admin_config, options, cost=0, update_rate=
|
||||
"picture": image,
|
||||
"about": "I show the latest longform notes.",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -242,8 +242,8 @@ def build_wiki(name, identifier, admin_config, options, cost=0, update_rate=180,
|
||||
"picture": image,
|
||||
"about": "I show the latest wikifreedia entries.",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -287,8 +287,8 @@ def build_example_topic(name, identifier, admin_config, options, image, descript
|
||||
"picture": image,
|
||||
"about": description,
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -328,8 +328,8 @@ def build_example_popular(name, identifier, admin_config, options, image, cost=0
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently popular",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -368,8 +368,8 @@ def build_example_popular_followers(name, identifier, admin_config, options, ima
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently popular from people you follow",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": True,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -416,8 +416,8 @@ def build_example_popular_non_followers(name, identifier, admin_config, options,
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently popular from people you do not follow",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"subscription": True,
|
||||
"personalized": False,
|
||||
"nip90Params": {
|
||||
@ -478,8 +478,8 @@ def build_example_top_zapped(name, identifier, admin_config, options, image, cos
|
||||
"picture": image,
|
||||
"about": "I show notes that are currently zapped the most.",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -525,8 +525,8 @@ def build_example_mostr(name, identifier, admin_config, options, image, cost=0,
|
||||
"picture": image,
|
||||
"about": "I show notes from Mostr.pub and Momostr.pink that are currently popular on Nostr",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
@ -565,8 +565,8 @@ def build_example_oneperfollow(name, identifier, admin_config, options, image, c
|
||||
"picture": image,
|
||||
"about": "I show the single latest note of people you follow",
|
||||
"lud16": dvm_config.LN_ADDRESS,
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"personalized": False,
|
||||
"amount": create_amount_tag(cost),
|
||||
"nip90Params": {
|
||||
|
@ -26,8 +26,8 @@ def playground(announce=False):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/28da676a19841dcfa7dcf7124be6816842d14b84f6046462d2a3f1268fe58d03.png",
|
||||
"about": "I'm an all purpose DVM'",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
}
|
||||
}
|
||||
|
@ -81,8 +81,8 @@ def playground(announce=False):
|
||||
"name": name,
|
||||
"picture": "https://i.nostr.build/I8fJo0n355cbNEbS.png", # "https://image.nostr.build/28da676a19841dcfa7dcf7124be6816842d14b84f6046462d2a3f1268fe58d03.png",
|
||||
"about": "I create a personalized feed based on topics you were writing about recently",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
}
|
||||
}
|
||||
|
@ -46,8 +46,8 @@ def playground(announce=False):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/28da676a19841dcfa7dcf7124be6816842d14b84f6046462d2a3f1268fe58d03.png",
|
||||
"about": "I'm briding DuckDuckAI'",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
}
|
||||
}
|
||||
|
@ -51,8 +51,8 @@ def playground(announce=False):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/28da676a19841dcfa7dcf7124be6816842d14b84f6046462d2a3f1268fe58d03.png",
|
||||
"about": "I produce images with Flux-Schnell'",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
}
|
||||
}
|
||||
|
@ -60,8 +60,8 @@ def build_sd35(name, identifier, announce):
|
||||
"name": name,
|
||||
"picture": "https://i.nostr.build/NOXcCIPmOZrDTK35.jpg",
|
||||
"about": "I draw images using Stable diffusion ultra",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"nip90Params": {
|
||||
"negative_prompt": {
|
||||
"required": False,
|
||||
@ -109,8 +109,8 @@ def build_dalle(name, identifier, announce):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/22f2267ca9d4ee9d5e8a0c7818a9fa325bbbcdac5573a60a2d163e699bb69923.jpg",
|
||||
"about": "I create Images bridging OpenAI's DALL·E 3",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"nip90Params": {
|
||||
"size": {
|
||||
"required": False,
|
||||
@ -145,8 +145,8 @@ def build_svd(name, identifier, announce):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I use Stable Video Diffusion to create short videos",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"nip90Params": {}
|
||||
}
|
||||
|
||||
@ -172,8 +172,8 @@ def build_media_converter(name, identifier, announce):
|
||||
"name": name,
|
||||
"picture": "https://cdn.nostr.build/i/a177be1159da5aad8396a1188f686728d55647d3a7371549584daf2b5e50eec9.jpg",
|
||||
"about": "I convert videos from urls to given output format.",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"nip90Params": {
|
||||
"media_format": {
|
||||
"required": False,
|
||||
@ -207,7 +207,7 @@ def build_inactive_follows_finder(name, identifier, announce):
|
||||
"picture": "https://image.nostr.build/50621bbf8082c478bc06a06684e1c443b5d37f1362ad56d679cab7328e0481db.jpg",
|
||||
"about": "I discover npubs you follow, but that have been inactive on Nostr for the last 90 days",
|
||||
"action": "unfollow",
|
||||
"cashuAccepted": True,
|
||||
"acceptsNutZaps": False,
|
||||
"nip90Params": {
|
||||
"user": {
|
||||
"required": False,
|
||||
@ -246,8 +246,8 @@ def build_1984(name, identifier, announce):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/19872a2edd866258fa9eab137631efda89310d52b2c6ea8f99ef057325aa1c7b.jpg",
|
||||
"about": "I show users that have been reported by either your followers or your Web of Trust. Note: Anyone can report, so you might double check and decide for yourself who to mute. Considers spam, illegal and impersonation reports. Notice: This works with NIP51 mute lists. Not all clients support the new mute list format.",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"action": "mute", # follow, unfollow, mute, unmute
|
||||
"nip90Params": {
|
||||
"since_days": {
|
||||
@ -281,8 +281,8 @@ def build_botfarms(name, identifier, announce):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/981b560820bc283c58de7989b7abc6664996b487a531d852e4ef7322586a2122.jpg",
|
||||
"about": "I hunt down bot farms.",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"action": "mute", # follow, unfollow, mute, unmute
|
||||
"nip90Params": {
|
||||
"max_results": {
|
||||
@ -319,8 +319,8 @@ def build_replicate(name, identifier, model, announce):
|
||||
"name": name,
|
||||
"picture": "https://i.nostr.build/qnoBIN4jSkfF8IHk.png",
|
||||
"about": "I use Replicate to run StableDiffusion XL",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"nip90Params": {
|
||||
"size": {
|
||||
"required": False,
|
||||
@ -356,8 +356,8 @@ def build_replicate_recraft(name, identifier, announce):
|
||||
"name": name,
|
||||
"picture": "https://i.nostr.build/jSbrXvYglXCzSeAc.jpg",
|
||||
"about": "I use Replicate to run Recraft v3",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"nip90Params": {
|
||||
"size": {
|
||||
"required": False,
|
||||
@ -391,8 +391,8 @@ def build_replicate_fluxpro(name, identifier, announce):
|
||||
"name": name,
|
||||
"picture": "https://i.nostr.build/AQTujqzVmLxLmG16.jpg",
|
||||
"about": "I use Replicate to FluxPro 1.1.",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": False,
|
||||
"nip90Params": {
|
||||
"size": {
|
||||
"required": False,
|
||||
|
@ -35,8 +35,8 @@ def build_sd35(name, identifier):
|
||||
"name": name,
|
||||
"picture": "https://i.nostr.build/NOXcCIPmOZrDTK35.jpg",
|
||||
"about": "I draw images using Stable diffusion ultra",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"negative_prompt": {
|
||||
"required": False,
|
||||
|
@ -52,6 +52,7 @@ def build_advanced_search(name, identifier):
|
||||
dvm_config.SYNC_DB_RELAY_LIST = SYNC_DB_RELAY_LIST
|
||||
|
||||
|
||||
|
||||
admin_config = AdminConfig()
|
||||
admin_config.REBROADCAST_NIP89 = rebroadcast_NIP89
|
||||
admin_config.REBROADCAST_NIP65_RELAY_LIST = rebroadcast_NIP65_Relay_List
|
||||
@ -63,8 +64,8 @@ def build_advanced_search(name, identifier):
|
||||
"name": name,
|
||||
"picture": "https://nostr.band/android-chrome-192x192.png",
|
||||
"about": "I search notes on nostr.band",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"users": {
|
||||
"required": False,
|
||||
@ -119,8 +120,8 @@ def build_advanced_search_wine(name, identifier):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/d844d6a963724b9f9deb6b3326984fd95352343336718812424d5e99d93a6f2d.jpg",
|
||||
"about": "I search notes on nostr.wine using the nostr-wine API",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"users": {
|
||||
"required": False,
|
||||
@ -175,8 +176,8 @@ def build_user_search(name, identifier):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/bd0181a3089181f1d92a5da1ef85cffbe37ba80fbcc695b9d85648dc2fa92583.jpg",
|
||||
"about": "I search users based on their profile info.",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"max_results": {
|
||||
"required": False,
|
||||
@ -206,8 +207,8 @@ def playground():
|
||||
advanced_search_wine = build_advanced_search_wine("Nostr.wine Search", "discovery_content_searchwine")
|
||||
advanced_search_wine.run()
|
||||
|
||||
profile_search = build_user_search("Profile Searcher", "profile_search")
|
||||
profile_search.run()
|
||||
#profile_search = build_user_search("Profile Searcher", "profile_search")
|
||||
#profile_search.run()
|
||||
|
||||
|
||||
|
||||
|
@ -50,7 +50,7 @@ async def test():
|
||||
print("Decrypting NIP59 event")
|
||||
try:
|
||||
# Extract rumor
|
||||
unwrapped_gift = UnwrappedGift.from_gift_wrap(keys, event)
|
||||
unwrapped_gift = UnwrappedGift.from_gift_wrap(NostrSigner(keys), event)
|
||||
sender = unwrapped_gift.sender()
|
||||
rumor: UnsignedEvent = unwrapped_gift.rumor()
|
||||
|
||||
|
@ -24,8 +24,8 @@ def playground(announce=False):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/28da676a19841dcfa7dcf7124be6816842d14b84f6046462d2a3f1268fe58d03.png",
|
||||
"about": "I summarize Text",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {}
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ from nostr_dvm.utils.print_utils import bcolors
|
||||
|
||||
import dotenv
|
||||
from nostr_sdk import Keys, Client, Tag, EventBuilder, Filter, HandleNotification, Timestamp, nip04_decrypt, \
|
||||
nip04_encrypt, NostrSigner, Event, Kind, RelayOptions
|
||||
nip44_encrypt, Nip44Version, NostrSigner, Event, Kind, RelayOptions
|
||||
|
||||
from nostr_dvm.utils.dvmconfig import DVMConfig
|
||||
from nostr_dvm.utils.nostr_utils import send_event, check_and_set_private_key
|
||||
@ -377,8 +377,8 @@ async def nostr_client_test_image_private(prompt, cashutoken):
|
||||
encrypted_params_string = json.dumps([i_tag.as_vec(), outTag.as_vec(), paramTag1.as_vec(), bid_tag.as_vec(),
|
||||
relays_tag.as_vec(), alt_tag.as_vec(), cashu_tag.as_vec()])
|
||||
|
||||
encrypted_params = nip04_encrypt(keys.secret_key(), receiver_keys.public_key(),
|
||||
encrypted_params_string)
|
||||
encrypted_params = nip44_encrypt(keys.secret_key(), receiver_keys.public_key(),
|
||||
encrypted_params_string, Nip44Version.V2)
|
||||
|
||||
encrypted_tag = Tag.parse(['encrypted'])
|
||||
nip90request = EventBuilder(EventDefinitions.KIND_NIP90_GENERATE_IMAGE, encrypted_params).tags(
|
||||
|
@ -34,8 +34,8 @@ if __name__ == '__main__':
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/c33ca6fc4cc038ca4adb46fdfdfda34951656f87ee364ef59095bae1495ce669.jpg",
|
||||
"about": "I Generate Speech from Text",
|
||||
"encryptionSupported": True,
|
||||
"cashuAccepted": True,
|
||||
"supportsEncryption": True,
|
||||
"acceptsNutZaps": dvm_config.ENABLE_NUTZAP,
|
||||
"nip90Params": {
|
||||
"language": {
|
||||
"required": False,
|
||||
|
@ -55,7 +55,7 @@ def run_dvm(identifier, announce):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/28da676a19841dcfa7dcf7124be6816842d14b84f6046462d2a3f1268fe58d03.png",
|
||||
"about": "I'm a very simply DVM that always responds with the same message.",
|
||||
"encryptionSupported": True,
|
||||
"supportsEncryption": True,
|
||||
"nip90Params": {
|
||||
"some_option": {
|
||||
"required": False,
|
||||
|
@ -119,7 +119,7 @@ def run_dvm(identifier, announce):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/28da676a19841dcfa7dcf7124be6816842d14b84f6046462d2a3f1268fe58d03.png",
|
||||
"about": "I'm a very simply DVM that always responds with the same message.",
|
||||
"encryptionSupported": True,
|
||||
"supportsEncryption": True,
|
||||
"nip90Params": {
|
||||
"some_option": {
|
||||
"required": False,
|
||||
|
@ -94,7 +94,7 @@ def run_dvm(identifier, announce):
|
||||
"name": name,
|
||||
"picture": "https://image.nostr.build/28da676a19841dcfa7dcf7124be6816842d14b84f6046462d2a3f1268fe58d03.png",
|
||||
"about": "I'm a very simply DVM that always responds with the same message.",
|
||||
"encryptionSupported": True,
|
||||
"supportsEncryption": True,
|
||||
"nip90Params": {
|
||||
"some_option": {
|
||||
"required": False,
|
||||
|
@ -181,7 +181,7 @@ async function listen() {
|
||||
if (JSON.parse(el.event).pubkey === event.author.toHex().toString() && el.kind === "5050") {
|
||||
jsonentry.name = el.name
|
||||
jsonentry.about = el.about
|
||||
jsonentry.image = el.image
|
||||
jsonentry.picture = el.picture
|
||||
jsonentry.nip90Params = el.nip90Params
|
||||
//jsonentry.reactions = await dvmreactions(PublicKey.parse(el.id), store.state.followings)
|
||||
//jsonentry.reactions.negativeUser = false
|
||||
|
@ -67,7 +67,6 @@ async function generate_feed(id) {
|
||||
try {
|
||||
|
||||
let client = store.state.client
|
||||
//console.log(dvms.find(i => i.id === id).encryptionSupported)
|
||||
|
||||
let current_dvm = dvms.find(i => i.id === id)
|
||||
|
||||
@ -85,7 +84,7 @@ async function generate_feed(id) {
|
||||
let requestid;
|
||||
|
||||
// for now we only want to use encrypted events for subscribed dvms (might change later, also we dont encrypt on amber because decryption and update doesnt work)
|
||||
if (current_dvm.encryptionSupported && current_dvm.nip88 && current_dvm.nip88.hasActiveSubscription && localStorage.getItem('nostr-key-method') !== 'android-signer' && localStorage.getItem('nostr-key-method') !== 'nostr-login') {
|
||||
if (current_dvm.supportsEncryption && current_dvm.nip88 && current_dvm.nip88.hasActiveSubscription && localStorage.getItem('nostr-key-method') !== 'android-signer' && localStorage.getItem('nostr-key-method') !== 'nostr-login') {
|
||||
|
||||
let tags_str = []
|
||||
for (let tag of tags) {
|
||||
@ -101,7 +100,7 @@ async function generate_feed(id) {
|
||||
|
||||
|
||||
let pk = PublicKey.parse(id)
|
||||
let content = await signer.nip04Encrypt(pk, params_as_str)
|
||||
let content = await signer.nip44Encrypt(pk, params_as_str)
|
||||
|
||||
let tags_t = []
|
||||
tags_t.push(Tag.parse(["p", id]))
|
||||
@ -150,7 +149,7 @@ async function listen() {
|
||||
let client = store.state.client
|
||||
let pubkey = store.state.pubkey
|
||||
|
||||
const filter = new Filter().kinds([7000, 6301]).pubkey(pubkey).since(Timestamp.now());
|
||||
const filter = new Filter().kinds([Kind(7000), Kind(6301)]).pubkey(pubkey).since(Timestamp.now());
|
||||
await client.subscribe([filter]);
|
||||
|
||||
const handle = {
|
||||
@ -197,7 +196,7 @@ async function listen() {
|
||||
return
|
||||
// tags_str = await amberSignerService.nip04Decrypt(event.author.toHex(), event.content)
|
||||
} else {
|
||||
tags_str = await signer.nip04Decrypt(event.author, event.content)
|
||||
tags_str = await signer.nip44Decrypt(event.author, event.content)
|
||||
}
|
||||
|
||||
|
||||
@ -301,7 +300,7 @@ async function listen() {
|
||||
if (is_encrypted) {
|
||||
if (ptag === store.state.pubkey.toHex()) {
|
||||
let signer = store.state.signer
|
||||
content = await signer.nip04Decrypt(event.author, event.content)
|
||||
content = await signer.nip44Decrypt(event.author, event.content)
|
||||
|
||||
} else {
|
||||
console.log("not addressed to us")
|
||||
@ -465,7 +464,7 @@ async function addAllContentDVMs() {
|
||||
|
||||
console.log(active_dvms)
|
||||
|
||||
const filtera = new Filter().authors(relevant_dvms).kinds([6301, 7000])
|
||||
const filtera = new Filter().authors(relevant_dvms).kinds([Kind(6301), Kind(7000)])
|
||||
let client = store.state.client
|
||||
let activities = await client.getEventsOf([filtera], Duration.fromSecs(1))
|
||||
|
||||
@ -503,8 +502,8 @@ async function addAllContentDVMs() {
|
||||
about: el.about,
|
||||
image: el.image,
|
||||
amount: el.amount,
|
||||
encryptionSupported: el.encryptionSupported,
|
||||
cashuAccepted: el.cashuAccepted,
|
||||
supportsEncryption: el.supportsEncryption,
|
||||
acceptsNutZaps: el.acceptsNutZaps,
|
||||
bolt11: "",
|
||||
lud16: el.lud16,
|
||||
subscription: "",
|
||||
@ -538,8 +537,8 @@ async function addDVM(event) {
|
||||
bolt11: "",
|
||||
lud16: "",
|
||||
subscription: "",
|
||||
encryptionSupported: false,
|
||||
cashuAccepted: false
|
||||
supportsEncryption: false,
|
||||
acceptsNutZaps: false
|
||||
}
|
||||
|
||||
for (const tag in event.tags) {
|
||||
@ -584,8 +583,8 @@ async function addDVM(event) {
|
||||
jsonentry.about = el.about
|
||||
jsonentry.image = el.image
|
||||
jsonentry.lud16 = el.lud16
|
||||
jsonentry.encryptionSupported = el.encryptionSupported
|
||||
jsonentry.cashuAccepted = el.cashuAccepted
|
||||
jsonentry.supportsEncryption = el.supportsEncryption
|
||||
jsonentry.acceptsNutZaps = el.acceptsNutZaps
|
||||
jsonentry.action = el.action
|
||||
|
||||
console.log(jsonentry)
|
||||
@ -713,7 +712,7 @@ async function subscribe_to_dvm() {
|
||||
|
||||
try {
|
||||
|
||||
let msg = await (await nclient.signer()).nip04Encrypt(nwcdvm, tags_as_str)
|
||||
let msg = await (await nclient.signer()).nip44Encrypt(nwcdvm, tags_as_str)
|
||||
let tags_t = []
|
||||
tags_t.push(Tag.parse(["p", store.state.subscription_verifier_pubkey]))
|
||||
tags_t.push(Tag.parse(["encrypted"]))
|
||||
@ -789,7 +788,7 @@ async function mute_all(results) {
|
||||
|
||||
try {
|
||||
let eventasjson = JSON.parse(list.asJson())
|
||||
let content = await (await signer).nip04Decrypt(store.state.pubkey, list.content)
|
||||
let content = await (await signer).nip44Decrypt(store.state.pubkey, list.content)
|
||||
let jsonObject = JSON.parse(content)
|
||||
console.log(content)
|
||||
|
||||
@ -817,7 +816,7 @@ async function mute_all(results) {
|
||||
let newcontent = JSON.stringify(jsonObject)
|
||||
console.log(newcontent)
|
||||
let lol = "[]"
|
||||
eventasjson.content = await (await signer).nip04Encrypt(store.state.pubkey, newcontent)
|
||||
eventasjson.content = await (await signer).nip44Encrypt(store.state.pubkey, newcontent)
|
||||
let newList = new EventBuilder(list.kind, eventasjson.content, list.tags).toUnsignedEvent(store.state.pubkey)
|
||||
|
||||
try {
|
||||
@ -841,7 +840,7 @@ async function mute_all(results) {
|
||||
|
||||
|
||||
let newcontent = JSON.stringify(jsonObject)
|
||||
let content = await (await signer).nip04Encrypt(store.state.pubkey, newcontent)
|
||||
let content = await (await signer).nip44Encrypt(store.state.pubkey, newcontent)
|
||||
let tags = []
|
||||
let newList = new EventBuilder(10000, content, tags).toUnsignedEvent(store.state.pubkey)
|
||||
try {
|
||||
@ -873,7 +872,7 @@ async function mute(result) {
|
||||
try {
|
||||
// console.log(list.content)
|
||||
let signer = await store.state.signer
|
||||
content = await signer.nip04Decrypt(store.state.pubkey, list.content)
|
||||
content = await signer.nip44Decrypt(store.state.pubkey, list.content)
|
||||
// console.log(content)
|
||||
|
||||
} catch (error) {
|
||||
@ -895,7 +894,7 @@ async function mute(result) {
|
||||
store.state.mutes.push(result.authorid)
|
||||
let newcontent = JSON.stringify(jsonObject)
|
||||
console.log(newcontent)
|
||||
eventasjson.content = await store.state.signer.nip04Encrypt(store.state.pubkey, newcontent)
|
||||
eventasjson.content = await store.state.signer.nip44Encrypt(store.state.pubkey, newcontent)
|
||||
let newList = new EventBuilder(list.kind, eventasjson.content, list.tags).toUnsignedEvent(store.state.pubkey)
|
||||
//console.log(signedMuteList.asJson())
|
||||
try {
|
||||
@ -924,7 +923,7 @@ async function mute(result) {
|
||||
|
||||
|
||||
let newcontent = JSON.stringify(jsonObject)
|
||||
let content = await (await signer).nip04Encrypt(store.state.pubkey, newcontent)
|
||||
let content = await (await signer).nip44Encrypt(store.state.pubkey, newcontent)
|
||||
let tags = []
|
||||
let newList = new EventBuilder(10000, content, tags).toUnsignedEvent(store.state.pubkey)
|
||||
try {
|
||||
@ -1301,7 +1300,7 @@ const submitHandler = async () => {
|
||||
|
||||
<div class="flex">
|
||||
<div class="tooltip" style="border-width: 0">
|
||||
<svg v-if="dvm.encryptionSupported && dvm.nip88" aria-hidden="true"
|
||||
<svg v-if="dvm.supportsEncryption && dvm.nip88" aria-hidden="true"
|
||||
class="w-4 h-4 text-gray-800 dark:text-white flex" fill="currentColor"
|
||||
style="margin-left: auto; margin-right: 5px" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg">
|
||||
<path
|
||||
|
@ -191,7 +191,7 @@ async function listen() {
|
||||
if (JSON.parse(el.event).pubkey === event.author.toHex().toString() && el.kind === "5100") {
|
||||
jsonentry.name = el.name
|
||||
jsonentry.about = el.about
|
||||
jsonentry.image = el.image
|
||||
jsonentry.picture = el.picture
|
||||
jsonentry.nip90Params = el.nip90Params
|
||||
jsonentry.reactions = await dvmreactions(PublicKey.parse(el.id), store.state.followings)
|
||||
jsonentry.reactions.negativeUser = false
|
||||
|
@ -749,8 +749,8 @@ export default {
|
||||
|
||||
}
|
||||
|
||||
if (jsonentry.picture) {
|
||||
jsonentry.image = jsonentry.picture
|
||||
if (jsonentry.image) {
|
||||
jsonentry.picture = jsonentry.image
|
||||
}
|
||||
|
||||
if (!jsonentry.amount) {
|
||||
|
@ -1,7 +1,17 @@
|
||||
<script setup>
|
||||
|
||||
|
||||
import {Event, EventBuilder, EventId, Filter, Nip19Event, PublicKey, Tag, Timestamp} from "@rust-nostr/nostr-sdk";
|
||||
import {
|
||||
Event,
|
||||
EventBuilder,
|
||||
EventId,
|
||||
Filter,
|
||||
Nip19Event,
|
||||
NIP44Version,
|
||||
PublicKey,
|
||||
Tag,
|
||||
Timestamp
|
||||
} from "@rust-nostr/nostr-sdk";
|
||||
import store from '../store';
|
||||
import miniToastr from "mini-toastr";
|
||||
import VueNotifications from "vue-notifications";
|
||||
@ -143,10 +153,10 @@ async function send_search_request(msg) {
|
||||
let winesearch = "4897ca2ad3e081f7e98dff6fc8f11b5dfa2909b33dbea6fa59b8d8665686181d"
|
||||
let profilesearch = "d378e056a3a4d01c785d24f9b352f1e9cfbec02450a6d6babf5baeda54d4a6de"
|
||||
|
||||
let contentnb = await signer.nip04Encrypt(PublicKey.parse(nostrbadnsearch), tags_as_str)
|
||||
let contentnb = await signer.nip44Encrypt(PublicKey.parse(nostrbadnsearch), tags_as_str, NIP44Version.V2)
|
||||
console.log(contentnb)
|
||||
let contentwine = await signer.nip04Encrypt(PublicKey.parse(winesearch), tags_as_str)
|
||||
let contentprofile = await signer.nip04Encrypt(PublicKey.parse(profilesearch), tags_profile_as_str)
|
||||
let contentwine = await signer.nip44Encrypt(PublicKey.parse(winesearch), tags_as_str, NIP44Version.V2)
|
||||
let contentprofile = await signer.nip44Encrypt(PublicKey.parse(profilesearch), tags_profile_as_str, NIP44Version.V2)
|
||||
|
||||
|
||||
let tags_nb = [
|
||||
@ -232,7 +242,7 @@ async function listen() {
|
||||
/* if (store.state.hasEventListener === false){
|
||||
return true
|
||||
}*/
|
||||
console.log("Received new event from", relayUrl);
|
||||
//console.log("Received new event from", relayUrl);
|
||||
let resonsetorequest = false
|
||||
|
||||
sleep(500).then(async () => {
|
||||
@ -292,7 +302,8 @@ async function listen() {
|
||||
if (is_encrypted) {
|
||||
let signer = store.state.signer
|
||||
if (ptag === store.state.pubkey.toHex()) {
|
||||
let tags_str = await signer.nip04Decrypt(event.author, event.content)
|
||||
let tags_str = await signer.nip44Decrypt(event.author, event.content)
|
||||
console.log(tags_str)
|
||||
let params = JSON.parse(tags_str)
|
||||
params.push(Tag.parse(["p", ptag]).asVec())
|
||||
params.push(Tag.parse(["encrypted"]).asVec())
|
||||
@ -350,7 +361,7 @@ async function listen() {
|
||||
if (JSON.parse(el.event).pubkey === event.author.toHex().toString()) {
|
||||
jsonentry.name = el.name
|
||||
jsonentry.about = content
|
||||
jsonentry.image = el.image
|
||||
jsonentry.picture = el.picture
|
||||
console.log(jsonentry)
|
||||
|
||||
}
|
||||
@ -380,7 +391,7 @@ async function listen() {
|
||||
if (is_encrypted) {
|
||||
let signer = store.state.signer
|
||||
if (ptag === store.state.pubkey.toHex()) {
|
||||
content = await signer.nip04Decrypt(event.author, event.content)
|
||||
content = await signer.nip44Decrypt(event.author, event.content)
|
||||
}
|
||||
}
|
||||
|
||||
@ -451,7 +462,7 @@ async function listen() {
|
||||
if (is_encrypted) {
|
||||
let signer = store.state.signer
|
||||
if (ptag === store.state.pubkey.toHex()) {
|
||||
content = await signer.nip04Decrypt(event.author, event.content)
|
||||
content = await signer.nip44Decrypt(event.author, event.content)
|
||||
}
|
||||
}
|
||||
|
||||
@ -616,7 +627,7 @@ defineProps({
|
||||
|
||||
<div className="col-end-1">
|
||||
<h2 className="card-title">{{ dvm.name }}</h2>
|
||||
<figure v-if="dvm.image!==''" className="w-40"><img :src="dvm.image" alt="DVM Picture" className="h-30"/>
|
||||
<figure v-if="dvm.picture!==''" className="w-40"><img :src="dvm.picture" alt="DVM Picture" className="h-30"/>
|
||||
</figure>
|
||||
</div>
|
||||
|
||||
|
@ -170,7 +170,7 @@ async function listen() {
|
||||
if (JSON.parse(el.event).pubkey === event.author.toHex().toString()) {
|
||||
jsonentry.name = el.name
|
||||
jsonentry.about = el.about
|
||||
jsonentry.image = el.image
|
||||
jsonentry.picture = el.picture
|
||||
|
||||
console.log(jsonentry)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user