From c9c19adac64187abfb25fabf59fc22145b0655e1 Mon Sep 17 00:00:00 2001 From: Bruno Date: Wed, 14 Dec 2022 18:26:25 -0300 Subject: [PATCH 1/4] Fixing 'amount' error, separating getWalletTransactions in different functions for future use --- src/components/ListComponent.vue | 42 ++++-------- src/components/QrCodeComponent.vue | 1 - src/components/SearchComponent.vue | 6 +- src/utils/blockchain.ts | 100 +++++++++++++++++++++++------ src/views/HomeView.vue | 33 ++++------ src/views/MockView.vue | 8 ++- 6 files changed, 118 insertions(+), 72 deletions(-) diff --git a/src/components/ListComponent.vue b/src/components/ListComponent.vue index a417ed5..52dcc83 100644 --- a/src/components/ListComponent.vue +++ b/src/components/ListComponent.vue @@ -1,19 +1,13 @@ @@ -115,8 +108,8 @@ const releaseTransaction = async ({ e2eId }: any) => {
(); const depositPixKey = ref(""); // Split tokens between wallets in wallets.json -const splitTokens = () => { +const splitTokens = async () => { blockchain.splitTokens(); }; @@ -40,13 +40,15 @@ const mockDeposit = () => { // Get specific deposit data by its ID const mapDeposit = (depositId: BigNumber) => { - blockchain.mapDeposits(depositId); + const deposit = blockchain.mapDeposits(depositId); + return deposit; }; // Lock methods // Get specific lock data by its ID const mapLock = (lockId: string) => { - blockchain.mapLocks(lockId); + const lock = blockchain.mapLocks(lockId); + return lock; }; From 37f7a051972e79db770afd7638781f8cda767176 Mon Sep 17 00:00:00 2001 From: RcleydsonR Date: Wed, 14 Dec 2022 20:13:59 -0300 Subject: [PATCH 2/4] improve list component css --- src/components/ListComponent.vue | 45 ++++++++++++++++---------------- src/utils/blockchain.ts | 2 +- src/views/HomeView.vue | 3 +-- 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/src/components/ListComponent.vue b/src/components/ListComponent.vue index 52dcc83..ff4896b 100644 --- a/src/components/ListComponent.vue +++ b/src/components/ListComponent.vue @@ -2,7 +2,7 @@ import CustomButton from "@/components/CustomButton.vue"; import blockchain from "../utils/blockchain"; -// props and store references +// props const props = defineProps({ lastWalletReleaseTransactions: Array, tokenAmount: Number, @@ -49,31 +49,27 @@ const openEtherscanUrl = (url: string) => { @buttonClicked="() => {}" />
- -
-
-
+
Últimas transações
-
+
+
+ Valor + Tipo de transação + Checar transação +
@@ -95,14 +91,17 @@ const openEtherscanUrl = (url: string) => { Redirect image
- +
+ +
+

Não há nenhuma transação anterior

@@ -131,7 +130,7 @@ p { } .blur-container { - @apply flex flex-col justify-center items-center px-8 py-6 gap-2 rounded-lg shadow-md shadow-gray-600 backdrop-blur-md mt-8 w-1/3; + @apply flex flex-col justify-center items-center px-8 py-6 gap-4 rounded-lg shadow-md shadow-gray-600 backdrop-blur-md mt-10 w-auto; } .last-release-info { diff --git a/src/utils/blockchain.ts b/src/utils/blockchain.ts index 9552c12..cf2f036 100644 --- a/src/utils/blockchain.ts +++ b/src/utils/blockchain.ts @@ -21,7 +21,7 @@ const updateWalletStatus = async () => { const walletAddress = await provider.send("eth_requestAccounts", []); const balance = await contract.balanceOf(walletAddress[0]); - +etherStore.setBalance(formatBigNumber(balance)); + etherStore.setBalance(formatBigNumber(balance)); etherStore.setWalletAddress(ethers.utils.getAddress(walletAddress[0])); }; diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 6e22600..e43914c 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -81,9 +81,8 @@ const releaseTransaction = async ({ e2eId }: any) => { walletAddress.value.toLowerCase() ); + await blockchain.updateWalletStatus(); loadingRelease.value = false; - - blockchain.updateWalletStatus(); } }; From 1edaf5dd1ee813836fb3952b89c13168eb674bc5 Mon Sep 17 00:00:00 2001 From: RcleydsonR Date: Wed, 14 Dec 2022 20:32:41 -0300 Subject: [PATCH 3/4] emit event to go back to home view from search screen --- src/components/ListComponent.vue | 17 ++++++++++------- src/components/TopBar.vue | 1 - src/views/HomeView.vue | 1 + 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/components/ListComponent.vue b/src/components/ListComponent.vue index ff4896b..8f6597a 100644 --- a/src/components/ListComponent.vue +++ b/src/components/ListComponent.vue @@ -8,6 +8,9 @@ const props = defineProps({ tokenAmount: Number, }); +// Emits +const emit = defineEmits(["makeAnotherTransaction"]); + const formatEventsAmount = (amount: any) => { try { const formated = blockchain.formatBigNumber(amount); @@ -52,7 +55,7 @@ const openEtherscanUrl = (url: string) => { @@ -73,12 +76,12 @@ const openEtherscanUrl = (url: string) => { v-for="release in lastWalletReleaseTransactions" :key="release?.blockNumber" > -

+ {{ formatEventsAmount(release?.args.amount) }} BRZ -

-

+ + {{ "Compra" }} -

+
-

Etherscan

+ Etherscan Redirect image
@@ -134,7 +137,7 @@ p { } .last-release-info { - @apply font-medium text-base; + @apply font-medium text-base text-gray-900; } input[type="number"] { diff --git a/src/components/TopBar.vue b/src/components/TopBar.vue index ca53687..d74fcf7 100644 --- a/src/components/TopBar.vue +++ b/src/components/TopBar.vue @@ -37,7 +37,6 @@ const formatWalletBalance = (): string => { src="@/assets/logo.svg" width="75" height="75" - @load="connectMetaMask()" />
diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index e43914c..7627d11 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -109,6 +109,7 @@ const releaseTransaction = async ({ e2eId }: any) => { v-if="!loadingRelease" :last-wallet-release-transactions="lastWalletReleaseTransactions" :tokenAmount="tokenAmount" + @make-another-transaction="flowStep = Step.Search" /> Date: Wed, 14 Dec 2022 20:37:26 -0300 Subject: [PATCH 4/4] update background svg file --- src/assets/bg.svg | 52 +++++++++++++++++++++++------------------------ 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/src/assets/bg.svg b/src/assets/bg.svg index 4d68b68..f17cb3f 100644 --- a/src/assets/bg.svg +++ b/src/assets/bg.svg @@ -1,36 +1,34 @@ - - - - - - + + + + + + + - - - - - - - + + + + - - - - - - - - - - - - + + - + + + + + + + + + + + - +