fix lint errors
Co-authored-by: brunoedcf <brest.dallacosta@outlook.com>
This commit is contained in:
parent
d5467286b0
commit
15e5fed07b
@ -39,12 +39,7 @@ const formatWalletBalance = (): string => {
|
|||||||
height="75"
|
height="75"
|
||||||
/>
|
/>
|
||||||
<div class="flex gap-4 items-center">
|
<div class="flex gap-4 items-center">
|
||||||
<button
|
<button type="button" class="default-button">Quero vender</button>
|
||||||
type="button"
|
|
||||||
class="default-button"
|
|
||||||
>
|
|
||||||
Quero vender
|
|
||||||
</button>
|
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
v-if="!walletAddress"
|
v-if="!walletAddress"
|
||||||
@ -55,31 +50,19 @@ const formatWalletBalance = (): string => {
|
|||||||
</button>
|
</button>
|
||||||
<div v-if="walletAddress" class="account-info">
|
<div v-if="walletAddress" class="account-info">
|
||||||
<div class="top-bar-info">
|
<div class="top-bar-info">
|
||||||
<img
|
<img alt="Ethereum image" src="@/assets/ethereum.svg" />
|
||||||
alt="Ethereum image"
|
<span class="default-text"> Ethereum </span>
|
||||||
src="@/assets/ethereum.svg"
|
<img alt="Chevron Down" src="@/assets/chevronDown.svg" />
|
||||||
/>
|
|
||||||
<span class="default-text">
|
|
||||||
Ethereum
|
|
||||||
</span>
|
|
||||||
<img
|
|
||||||
alt="Chevron Down"
|
|
||||||
src="@/assets/chevronDown.svg"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="top-bar-info">
|
<div class="top-bar-info">
|
||||||
<img
|
<img alt="Account image" src="@/assets/account.svg" />
|
||||||
alt="Account image"
|
|
||||||
src="@/assets/account.svg"
|
|
||||||
/>
|
|
||||||
<span class="default-text text-sm">{{ formatWalletAddress() }}</span>
|
<span class="default-text text-sm">{{ formatWalletAddress() }}</span>
|
||||||
<img
|
<img alt="Chevron Down" src="@/assets/chevronDown.svg" />
|
||||||
alt="Chevron Down"
|
|
||||||
src="@/assets/chevronDown.svg"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="top-bar-info">
|
<div class="top-bar-info">
|
||||||
<span class="default-text text-sm"> MBRZ: {{ formatWalletBalance() }} </span>
|
<span class="default-text text-sm">
|
||||||
|
MBRZ: {{ formatWalletBalance() }}
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<!-- Temporary div, just to show a wallet's balance -->
|
<!-- Temporary div, just to show a wallet's balance -->
|
||||||
</div>
|
</div>
|
||||||
@ -93,17 +76,17 @@ header {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.default-button {
|
.default-button {
|
||||||
@apply px-4 py-2 rounded text-gray-50 font-semibold text-base
|
@apply px-4 py-2 rounded text-gray-50 font-semibold text-base;
|
||||||
}
|
}
|
||||||
.account-info {
|
.account-info {
|
||||||
@apply flex items-center gap-6
|
@apply flex items-center gap-6;
|
||||||
}
|
}
|
||||||
|
|
||||||
.default-text {
|
.default-text {
|
||||||
@apply text-gray-50 font-semibold text-base
|
@apply text-gray-50 font-semibold text-base;
|
||||||
}
|
}
|
||||||
|
|
||||||
.top-bar-info {
|
.top-bar-info {
|
||||||
@apply flex justify-between gap-2 px-4 py-2 border-amber-500 border-2 rounded
|
@apply flex justify-between gap-2 px-4 py-2 border-amber-500 border-2 rounded;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -2,10 +2,9 @@ import { useEtherStore } from "@/store/ether";
|
|||||||
import { ethers } from "ethers";
|
import { ethers } from "ethers";
|
||||||
|
|
||||||
// smart contract imports
|
// smart contract imports
|
||||||
import mockToken from "./smart_contract_files/MockToken.json"
|
import mockToken from "./smart_contract_files/MockToken.json";
|
||||||
import p2pix from "./smart_contract_files/P2PIX.json"
|
//import p2pix from "./smart_contract_files/P2PIX.json";
|
||||||
import addresses from "./smart_contract_files/localhost.json"
|
import addresses from "./smart_contract_files/localhost.json";
|
||||||
|
|
||||||
|
|
||||||
const updateWalletStatus = async (walletAddress: string) => {
|
const updateWalletStatus = async (walletAddress: string) => {
|
||||||
const etherStore = useEtherStore();
|
const etherStore = useEtherStore();
|
||||||
@ -51,9 +50,12 @@ const makeTransaction = async () => {
|
|||||||
const signer = provider.getSigner();
|
const signer = provider.getSigner();
|
||||||
const contract = new ethers.Contract(addresses.token, mockToken.abi, signer);
|
const contract = new ethers.Contract(addresses.token, mockToken.abi, signer);
|
||||||
|
|
||||||
const fixedAccount1Address = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"
|
const fixedAccount1Address = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8";
|
||||||
const tx = await contract.transfer(fixedAccount1Address, ethers.utils.parseEther("100.0"));
|
const tx = await contract.transfer(
|
||||||
await tx.wait()
|
fixedAccount1Address,
|
||||||
|
ethers.utils.parseEther("100.0")
|
||||||
|
);
|
||||||
|
await tx.wait();
|
||||||
|
|
||||||
updateWalletStatus(etherStore.walletAddress);
|
updateWalletStatus(etherStore.walletAddress);
|
||||||
};
|
};
|
||||||
@ -70,6 +72,6 @@ const getProvider = (): ethers.providers.Web3Provider | null => {
|
|||||||
if (!connection) return null;
|
if (!connection) return null;
|
||||||
|
|
||||||
return new ethers.providers.Web3Provider(connection);
|
return new ethers.providers.Web3Provider(connection);
|
||||||
}
|
};
|
||||||
|
|
||||||
export default { connectProvider, formatEther, makeTransaction };
|
export default { connectProvider, formatEther, makeTransaction };
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts"></script>
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
<h2 v-bind:hidden="true">Home View</h2>
|
||||||
</template>
|
</template>
|
||||||
|
@ -88,7 +88,9 @@ const submit = () => {
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-div">
|
<div class="col-div">
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<label for="city" class="form-label">Cidade do beneficiário</label>
|
<label for="city" class="form-label"
|
||||||
|
>Cidade do beneficiário</label
|
||||||
|
>
|
||||||
<span v-if="errors['cityRequiredError']" class="required-error"
|
<span v-if="errors['cityRequiredError']" class="required-error"
|
||||||
>(Esse campo é obrigatório)</span
|
>(Esse campo é obrigatório)</span
|
||||||
>
|
>
|
||||||
@ -167,9 +169,7 @@ const submit = () => {
|
|||||||
>
|
>
|
||||||
<span class="text-gray-700">{{ pixModel.value }}</span>
|
<span class="text-gray-700">{{ pixModel.value }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div class="flex flex-col w-auto break-all justify-center items-center">
|
||||||
class="flex flex-col w-auto break-all justify-center items-center"
|
|
||||||
>
|
|
||||||
<span class="text-black font-semibold mb-2">Código QR Code:</span>
|
<span class="text-black font-semibold mb-2">Código QR Code:</span>
|
||||||
<span class="text-gray-700">{{ qrCodePayload }}</span>
|
<span class="text-gray-700">{{ qrCodePayload }}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -179,10 +179,7 @@ const submit = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div v-if="toggleModal" class="fixed z-40 inset-0 opacity-25 bg-black"></div>
|
||||||
v-if="toggleModal"
|
|
||||||
class="fixed z-40 inset-0 opacity-25 bg-black"
|
|
||||||
></div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@ -192,7 +189,7 @@ const submit = () => {
|
|||||||
|
|
||||||
.form-container {
|
.form-container {
|
||||||
background-color: var(--color-background-indigo);
|
background-color: var(--color-background-indigo);
|
||||||
@apply rounded-md w-full p-2 w-1/2
|
@apply rounded-md w-full p-2 w-1/2;
|
||||||
}
|
}
|
||||||
|
|
||||||
.col-div {
|
.col-div {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user