From 9df95c1f7c41e584b62033c5d4c9832e4c340390 Mon Sep 17 00:00:00 2001 From: lza_menace Date: Thu, 30 Dec 2021 13:09:22 -0800 Subject: [PATCH] trying to improve js, setting up minting --- suchwowx/static/js/main.js | 9 ---- suchwowx/static/js/metamask.js | 9 ++++ suchwowx/templates/includes/footer.html | 2 +- suchwowx/templates/includes/web3.html | 15 ++++++ suchwowx/templates/meme.html | 61 ++++++++++++++++++++++++- suchwowx/templates/profile.html | 37 ++++----------- 6 files changed, 94 insertions(+), 39 deletions(-) create mode 100644 suchwowx/templates/includes/web3.html diff --git a/suchwowx/static/js/main.js b/suchwowx/static/js/main.js index 22461c2..992760e 100644 --- a/suchwowx/static/js/main.js +++ b/suchwowx/static/js/main.js @@ -1,12 +1,3 @@ -async function getSignedData(publicAddress, jsonData) { - const signedData = await window.ethereum.request({ - method: 'eth_signTypedData_v3', - params: [publicAddress, JSON.stringify(jsonData)] - }); - console.log(signedData); - return signedData -} - async function notif(s, t) { new Noty({ type: t, diff --git a/suchwowx/static/js/metamask.js b/suchwowx/static/js/metamask.js index 78297f2..90b159d 100644 --- a/suchwowx/static/js/metamask.js +++ b/suchwowx/static/js/metamask.js @@ -2,6 +2,15 @@ window.addEventListener('DOMContentLoaded', () => { onboardMetaMask(); }) +async function getSignedData(publicAddress, jsonData) { + const signedData = await window.ethereum.request({ + method: 'eth_signTypedData_v3', + params: [publicAddress, JSON.stringify(jsonData)] + }); + console.log(signedData); + return signedData +} + async function onboardMetaMask(){ const onboarding = new MetaMaskOnboarding(); const onboardButton = document.getElementById('metamaskConnect'); diff --git a/suchwowx/templates/includes/footer.html b/suchwowx/templates/includes/footer.html index 0a0425a..13d853f 100644 --- a/suchwowx/templates/includes/footer.html +++ b/suchwowx/templates/includes/footer.html @@ -1,5 +1,5 @@ diff --git a/suchwowx/templates/includes/web3.html b/suchwowx/templates/includes/web3.html new file mode 100644 index 0000000..ad146c9 --- /dev/null +++ b/suchwowx/templates/includes/web3.html @@ -0,0 +1,15 @@ + + diff --git a/suchwowx/templates/meme.html b/suchwowx/templates/meme.html index 3a0792d..feed5ce 100644 --- a/suchwowx/templates/meme.html +++ b/suchwowx/templates/meme.html @@ -27,7 +27,7 @@ {% else %} {% endif %} -
+

Title: {{ meme.title }}

Description: {{ meme.description }}

Poster Address: {{ meme.user.handle }}

@@ -39,7 +39,7 @@ {% endif %}

Meme ID: {{ meme }}

{% if not meme.meta_ipfs_hash %} -
+
Approve @@ -48,6 +48,25 @@ Deny
+ {% else %} +
+
+ {% if meme.minted %} +
+ Tip AVAX +
+
+ Tip WOWX +
+
+ Tip WOW +
+ {% else %} +
+ Mint +
+ {% endif %} +
{% endif %} @@ -56,5 +75,43 @@ {% include 'includes/footer.html' %} + {% include 'includes/web3.html' %} + diff --git a/suchwowx/templates/profile.html b/suchwowx/templates/profile.html index 13f1cff..01c2ea1 100644 --- a/suchwowx/templates/profile.html +++ b/suchwowx/templates/profile.html @@ -11,11 +11,8 @@ {% if user %}
-
- -
-
-

From Avalanche Blockchain

+
+

From Avalanche Blockchain

Handle: ?

Wownero Address: ?

Profile IPFS Hash: ?

@@ -23,8 +20,7 @@

Tipped WOWX: ?

Tipped WOW: ?

-

-

From Local Database

+

From Local Database

Handle: {% if is_user %} @@ -64,7 +60,7 @@

Website: {{ user.website_url }}

{% endif %} {% if is_user %} -


Save DB

+

Save DB

{% endif %}
@@ -74,21 +70,8 @@
{% include 'includes/footer.html' %} - + {% include 'includes/web3.html' %}