diff --git a/tests/gui/vuejs/noogle/package.json b/tests/gui/vuejs/noogle/package.json
index e9e543e..9d5804a 100644
--- a/tests/gui/vuejs/noogle/package.json
+++ b/tests/gui/vuejs/noogle/package.json
@@ -9,7 +9,7 @@
"preview": "vite preview"
},
"dependencies": {
- "@rust-nostr/nostr-sdk": "^0.8.0",
+ "@rust-nostr/nostr-sdk": "^0.9.0",
"bootstrap": "^5.3.2",
"daisyui": "^4.6.0",
"mini-toastr": "^0.8.1",
diff --git a/tests/gui/vuejs/noogle/src/App.vue b/tests/gui/vuejs/noogle/src/App.vue
index fbbcd6f..f6a4bb2 100644
--- a/tests/gui/vuejs/noogle/src/App.vue
+++ b/tests/gui/vuejs/noogle/src/App.vue
@@ -14,6 +14,7 @@ import Nip07 from "@/components/Nip07.vue";
+
@@ -22,10 +23,7 @@ header {
line-height: 1.5;
}
-.logo {
- display: block;
- margin: 0 auto 2rem;
-}
+
@media (min-width: 768px) {
header {
diff --git a/tests/gui/vuejs/noogle/src/components/Donate.vue b/tests/gui/vuejs/noogle/src/components/Donate.vue
index 38d25d8..b61caa4 100644
--- a/tests/gui/vuejs/noogle/src/components/Donate.vue
+++ b/tests/gui/vuejs/noogle/src/components/Donate.vue
@@ -2,21 +2,60 @@
import { requestProvider } from "webln";
import miniToastr from "mini-toastr";
import VueNotifications from "vue-notifications";
+import {PublicKey, ZapDetails, ZapEntity, ZapType} from "@rust-nostr/nostr-sdk";
+import store from "@/store.js";
+import {data} from "autoprefixer";
+
+
export default {
+ data() {
+ return {
+ dvmlnaddress: "hype@bitcoinfixesthis.org",
+ dvmpaymentaddr: "",
+ dvminvoice: "",
+ nostrsdklnaddress: "yuki@getalby.com",
+ nostrsdkpaymentaddr: "",
+ nostrsdkinvoice: "",
+ amount: 1000
+ }},
+
methods: {
- async zap() {
+ async handleZap(){
+ try {
+ let pk = PublicKey.fromBech32("npub1nxa4tywfz9nqp7z9zp7nr7d4nchhclsf58lcqt5y782rmf2hefjquaa6q8");
+ let entity = ZapEntity.publicKey(pk);
+ let details = new ZapDetails(ZapType.Private).message("Zap for Rust Nostr!");
+ await store.state.client.zap(entity, 1000, details);
+ } catch (error) {
+ console.log(error)
+ }
+ },
+
+ async copyinvoice(invoice){
+ await navigator.clipboard.writeText(invoice)
+ miniToastr.showMessage("", "Copied Invoice to clipboard", VueNotifications.types.info)
+ },
+
+ async zap(lnaddress, amount) {
let webln;
- let invoice = await this.createBolt11Lud16("hype@bitcoinfixesthis.org", 1000)
+ let invoice = await this.createBolt11Lud16(lnaddress, amount)
+ if (lnaddress === this.nostrsdklnaddress){
+ this.nostrsdkpaymentaddr = `https://chart.googleapis.com/chart?cht=qr&chl=${invoice}&chs=250x250&chld=M|0`;
+ this.nostrsdkinvoice = invoice
+ }
+ else{
+ this.dvmpaymentaddr = `https://chart.googleapis.com/chart?cht=qr&chl=${invoice}&chs=250x250&chld=M|0`;
+ this.dvminvoice = invoice
+ }
+
try {
webln = await requestProvider();
} catch (err) {
- await navigator.clipboard.writeText(invoice)
- miniToastr.showMessage("", "Copied Invoice to clipboard", VueNotifications.types.info)
+ await this.copyinvoice(invoice)
}
if (webln) {
-
console.log(invoice)
let response = await webln.sendPayment(invoice)
console.log(response)
@@ -41,35 +80,52 @@ export default {
const callbackResponse = await fetch(`${callback}?amount=${amountInSats}`);
const obCallback = await callbackResponse.json();
return obCallback.pr;
- } catch (e) {
- console.log(`LUD16: ${e}`);
- return null;
+ }
+ catch (e) {
+ console.log(`LUD16: ${e}`);
+ return null;
}
}
-
}
}
-
+ Sats: {{ this.current_user }}Donate to Noogle
+
+
-
-
-
-
+
Donate to NostrSDK
+
+
+
-
+
-
-
-
+
-
-
-
-
+
@@ -45,8 +42,7 @@ async function getnip89s(){
let keys = Keys.fromSkStr("ece3c0aa759c3e895ecb3c13ab3813c0f98430c6d4bd22160b9c2219efc9cf0e")
let signer = ClientSigner.keys(keys) //TODO store keys
- let database = await NostrDatabase.open("nip89.db")
- let client = new ClientBuilder().database(database).signer(signer).build()
+ let client = new ClientBuilder().signer(signer).build()
//await client.addRelay("wss://nos.lol");
await client.addRelay("wss://relay.f7z.io")
await client.addRelay("wss://pablof7z.nostr1.com")
@@ -112,9 +108,6 @@ export default {
async mounted(){
await getnip89s()
-
-
-
},
setup() {
diff --git a/tests/gui/vuejs/noogle/src/components/Search.vue b/tests/gui/vuejs/noogle/src/components/Search.vue
index 6b9e39f..49c8062 100644
--- a/tests/gui/vuejs/noogle/src/components/Search.vue
+++ b/tests/gui/vuejs/noogle/src/components/Search.vue
@@ -129,11 +129,6 @@ async function listen() {
try {
console.log("7000:", event.content);
miniToastr.showMessage("DVM replied", event.content, VueNotifications.types.info)
-
-
- //if (content === "stop") {
- // return true
- //}
} catch (error) {
console.log("Error: ", error);
}
@@ -194,21 +189,12 @@ function nextInput(e) {
}
}
-function prevInput(e) {
- const prev = e.currentTarget.previousElementSibling;
- if (prev) {
- prev.focus();
- }
-}
-
defineProps({
msg: {
type: String,
required: false
},
-
-
})
@@ -218,25 +204,14 @@ defineProps({