update cycleview, pageview + profileview

This commit is contained in:
EmberSpirit
2023-08-30 18:08:51 +02:00
parent c8f7c7cd5e
commit cd773e16c9
19 changed files with 2093 additions and 20238 deletions
+12 -41
View File
@@ -39,7 +39,8 @@ export const useWalletStoreV2 = defineStore("walletV2", {
walletClient: null,
config: null,
chain: null,
token: [],
token: [],
initialized: false
}),
getters: {
sacrificeToken: (state) => state.token.filter((obj) => obj.contractAddress !== MemeToken.contractAddress),
@@ -48,42 +49,7 @@ export const useWalletStoreV2 = defineStore("walletV2", {
actions: {
async init() {
console.log("wallet init");
const goerliKey = import.meta.env.VITE_GOERLI_KEY;
const projectId = "d8e5ecb0353c02e21d4c0867d4473ac5";
const { chains, publicClient, webSocketPublicClient } = configureChains(
[goerli, mainnet],
[alchemyProvider({ apiKey: goerliKey }), publicProvider()]
);
this.config = createConfig({
autoConnect: true,
connectors: [
new CoinbaseWalletConnector({
chains,
options: {
appName: "wagmi demo",
},
}),
new MetaMaskConnector({ chains }),
new WalletConnectConnector({
chains,
options: {
projectId: projectId,
showQrModal: true,
metadata: {
name: "Bloodline-App",
description: "TODO Bloodline Description",
url: "https://gitea.loseyourip.com/",
icons: ["https://gitea.loseyourip.com/assets/img/vampir.png"],
},
},
}),
],
publicClient,
webSocketPublicClient,
});
this.publicClient = publicClient;
console.log("hier123");
const account = getAccount();
@@ -148,7 +114,9 @@ export const useWalletStoreV2 = defineStore("walletV2", {
});
console.log("data", data);
for (let index = 0; index < tokenStore.token.length; index++) {
const token = tokenStore.token[index];
const token = tokenStore.token[index];
console.log("token", token);
console.log("data[index].result", data[index].result);
const balanceOfDecimal = data[index].result / BigInt(Math.pow(10, token.decimals));
this.token.push({
contractAddress: token.contractAddress,
@@ -157,15 +125,18 @@ export const useWalletStoreV2 = defineStore("walletV2", {
}
},
async loadWalletData() {
if (!this.connected) {
return
}
console.log("loadWalletData");
const rewardlockerStore = useRewardLockerStore();
await this.getTokenBalances();
await this.getTokenBalances();
//MemeToken Staked
const tokenStore = useTokenStore();
const staked = await rewardlockerStore.getStaked(this.address);
console.log("staked", staked);
this.memeToken.staked = Number(staked / BigInt(Math.pow(10, tokenStore.memeToken.decimals)));
}