From f55ca29e31be4028bed8250ec205fc0e37426957 Mon Sep 17 00:00:00 2001 From: Tempe Techie <95053628+tempe-techie@users.noreply.github.com> Date: Sun, 6 Oct 2024 12:22:39 +0200 Subject: [PATCH] redundant code removed --- README.md | 56 ++++++++++++++++++++++++------------------------ plugins/chain.js | 4 ++-- store/user.ts | 35 ++++-------------------------- 3 files changed, 34 insertions(+), 61 deletions(-) diff --git a/README.md b/README.md index a96b098..2d9a828 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,34 @@ Iggy Social is a Web3 Social frontend website based on the [Iggy Social](https:/ Demo 1 (Netlify): https://demo.iggy.social/ Demo 2 (Vercel): https://demo2.iggy.social/ +## Add Arweave info + +To support posts/comments & image uploads, create an Arweave Wallet (e.g. here: https://arweave.app/) and send some AR to it. + +Then go to the wallet settings and download Backup Keyfile. + +In this file you'll find 10 different variables, enter these into your .env file: + +```bash +ARWEAVE_KTY= +ARWEAVE_N= +ARWEAVE_E= +ARWEAVE_D= +ARWEAVE_P= +ARWEAVE_Q= +ARWEAVE_DP= +ARWEAVE_DQ= +ARWEAVE_QI= +``` + +And add the arweave address too: + +```bash +ARWEAVE_ADDRESS= +``` + +Also make sure these variables are set on your hosting provider (Netlify, Vercel, etc). + ## Delete mirror.yml in the .github folder The mirror.yml file is just for the purpose of mirroring this repo to other git servers (for backup reasons). You don't need this in your cloned project. @@ -62,34 +90,6 @@ If you want to have GIF search implemented, create your own Tenor API Key on Goo Then enter the key in environment variables (`TENOR_KEY`). -## Image upload (Arweave) - -To support image uploads, create an Arweave Wallet (e.g. here: https://arweave.app/) and send some AR to it. - -Then go to the wallet settings and download Backup Keyfile. - -In this file you'll find 10 different variables, enter these into your .env file: - -```bash -ARWEAVE_KTY= -ARWEAVE_N= -ARWEAVE_E= -ARWEAVE_D= -ARWEAVE_P= -ARWEAVE_Q= -ARWEAVE_DP= -ARWEAVE_DQ= -ARWEAVE_QI= -``` - -And add the arweave address too: - -```bash -ARWEAVE_ADDRESS= -``` - -Also make sure these variables are set on your hosting provider (Netlify, Vercel, etc). - ## ImageKit upload It is recommended to use ImageKit as the fallback option, in case Arweave has technical issues. diff --git a/plugins/chain.js b/plugins/chain.js index e6bf416..661c5f1 100644 --- a/plugins/chain.js +++ b/plugins/chain.js @@ -1,7 +1,7 @@ import { ethers } from 'ethers' export default defineNuxtPlugin(() => { - const config = useRuntimeConfig() // access env vars like this: config.alchemyPolygonKey + //const config = useRuntimeConfig() // access env vars like this: config.alchemyPolygonKey function getChainName(chainId) { let chain = chains.find(chain => chain.chainId == chainId) @@ -121,7 +121,7 @@ const chains = [ { chainId: 137, name: 'Polygon', - currency: 'MATIC', + currency: 'POL', rpcs: ['https://rpc.ankr.com/polygon'], blockExplorer: 'https://polygonscan.com', }, diff --git a/store/user.ts b/store/user.ts index 2e1ff2c..a1afb95 100644 --- a/store/user.ts +++ b/store/user.ts @@ -10,9 +10,6 @@ export const useUserStore = defineStore({ address: null, chatTokenBalanceWei: BigInt(0), defaultDomain: null, - followers: 0, - following: 0, - lastActivityTimestamp: null, lpTokenBalanceWei: BigInt(0), image: null, stakeTokenBalanceWei: BigInt(0), // receipt token from the staking contract (aka governance token) @@ -44,26 +41,14 @@ export const useUserStore = defineStore({ return state.defaultDomain }, - getFollowers(state) { - return state.followers - }, - - getFollowing(state) { - return state.following - }, - - getLastActivityTimestamp(state) { - return state.lastActivityTimestamp + getImage(state) { + return state.image }, getLpTokenBalanceWei(state) { return ethers.BigNumber.from(state.lpTokenBalanceWei) }, - getImage(state) { - return state.image - }, - getStakeTokenBalanceWei(state) { return ethers.BigNumber.from(state.stakeTokenBalanceWei) }, @@ -98,26 +83,14 @@ export const useUserStore = defineStore({ this.defaultDomain = domain }, - setFollowers(followers: any) { - this.followers = followers - }, - - setFollowing(following: any) { - this.following = following - }, - - setLastActivityTimestamp(timestamp: any) { - this.lastActivityTimestamp = timestamp + setImage(image: any) { + this.image = image }, setLpTokenBalanceWei(balance: ethers.BigNumber) { this.lpTokenBalanceWei = balance.toBigInt() }, - setImage(image: any) { - this.image = image - }, - setStakeTokenBalanceWei(balance: ethers.BigNumber) { this.stakeTokenBalanceWei = balance.toBigInt() },