diff --git a/src/App.vue b/src/App.vue index 61ba952..9c31a65 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,7 +5,7 @@ import TopBar from "./components/TopBar.vue"; diff --git a/src/components/TopBar.vue b/src/components/TopBar.vue index 757cd4b..0a09092 100644 --- a/src/components/TopBar.vue +++ b/src/components/TopBar.vue @@ -11,7 +11,7 @@ const connectMetaMask = () => { ethers.connectProvider(); }; -const formatWalletAddress = (): string => { +const formatWalletAddress = (): string => { const walletAddressLength = walletAddress.value.length; const initialText = walletAddress.value.substring(0, 5); const finalText = walletAddress.value.substring( @@ -39,12 +39,7 @@ const formatWalletBalance = (): string => { height="75" />
- +
- Ethereum image - - Ethereum - - Chevron Down + Ethereum image + Ethereum + Chevron Down
- Account image + Account image {{ formatWalletAddress() }} - Chevron Down + Chevron Down
-
- MBRZ: {{ formatWalletBalance() }} +
+ + MBRZ: {{ formatWalletBalance() }} +
@@ -92,18 +75,18 @@ header { @apply flex flex-row justify-between w-full items-center; } -.default-button{ - @apply px-4 py-2 rounded text-gray-50 font-semibold text-base +.default-button { + @apply px-4 py-2 rounded text-gray-50 font-semibold text-base; } -.account-info{ - @apply flex items-center gap-6 +.account-info { + @apply flex items-center gap-6; } -.default-text{ - @apply text-gray-50 font-semibold text-base +.default-text { + @apply text-gray-50 font-semibold text-base; } -.top-bar-info{ - @apply flex justify-between gap-2 px-4 py-2 border-amber-500 border-2 rounded +.top-bar-info { + @apply flex justify-between gap-2 px-4 py-2 border-amber-500 border-2 rounded; } diff --git a/src/model/Pix.ts b/src/model/Pix.ts index 2bb546d..bb96b27 100644 --- a/src/model/Pix.ts +++ b/src/model/Pix.ts @@ -1,11 +1,11 @@ export type Pix = { - pixKey: string; - merchantCity?: string; - merchantName?: string; - value?: number; - transactionId?: string; - message?: string; - cep?: string; - currency?: number; - countryCode?: string; - }; \ No newline at end of file + pixKey: string; + merchantCity?: string; + merchantName?: string; + value?: number; + transactionId?: string; + message?: string; + cep?: string; + currency?: number; + countryCode?: string; +}; diff --git a/src/utils/QrCodePix.ts b/src/utils/QrCodePix.ts index 05f410a..b75b676 100644 --- a/src/utils/QrCodePix.ts +++ b/src/utils/QrCodePix.ts @@ -1,7 +1,7 @@ import qrcode from "qrcode"; import type { QRCodeToDataURLOptions } from "qrcode"; import { crc16ccitt } from "crc"; -import {type Pix } from "@/model/Pix"; +import { type Pix } from "@/model/Pix"; const pix = ({ pixKey, diff --git a/src/utils/ethers.ts b/src/utils/ethers.ts index 4081830..071a89c 100644 --- a/src/utils/ethers.ts +++ b/src/utils/ethers.ts @@ -2,16 +2,15 @@ import { useEtherStore } from "@/store/ether"; import { ethers } from "ethers"; // smart contract imports -import mockToken from "./smart_contract_files/MockToken.json" -import p2pix from "./smart_contract_files/P2PIX.json" -import addresses from "./smart_contract_files/localhost.json" - +import mockToken from "./smart_contract_files/MockToken.json"; +//import p2pix from "./smart_contract_files/P2PIX.json"; +import addresses from "./smart_contract_files/localhost.json"; const updateWalletStatus = async (walletAddress: string) => { const etherStore = useEtherStore(); const provider = getProvider(); - if(!provider) return; - + if (!provider) return; + const signer = provider.getSigner(); const contract = new ethers.Contract(addresses.token, mockToken.abi, signer); @@ -46,14 +45,17 @@ const connectProvider = async () => { const makeTransaction = async () => { const etherStore = useEtherStore(); const provider = getProvider(); - if(!provider) return; + if (!provider) return; const signer = provider.getSigner(); const contract = new ethers.Contract(addresses.token, mockToken.abi, signer); - const fixedAccount1Address = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" - const tx = await contract.transfer(fixedAccount1Address, ethers.utils.parseEther("100.0")); - await tx.wait() + const fixedAccount1Address = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8"; + const tx = await contract.transfer( + fixedAccount1Address, + ethers.utils.parseEther("100.0") + ); + await tx.wait(); updateWalletStatus(etherStore.walletAddress); }; @@ -70,6 +72,6 @@ const getProvider = (): ethers.providers.Web3Provider | null => { if (!connection) return null; return new ethers.providers.Web3Provider(connection); -} +}; export default { connectProvider, formatEther, makeTransaction }; diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index dd302d7..20d2bfe 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -1,5 +1,5 @@ - + diff --git a/src/views/QrCodeForm.vue b/src/views/QrCodeForm.vue index ec7cdb0..980c4d4 100644 --- a/src/views/QrCodeForm.vue +++ b/src/views/QrCodeForm.vue @@ -88,7 +88,9 @@ const submit = () => {
- + (Esse campo é obrigatório) @@ -167,9 +169,7 @@ const submit = () => { > {{ pixModel.value }}
-
+
Código QR Code: {{ qrCodePayload }}
@@ -179,10 +179,7 @@ const submit = () => {
-
+