Add transactions history with withdeawn option at buy confirmed step

This commit is contained in:
RcleydsonR
2023-02-16 22:29:53 -03:00
parent dc0c28f685
commit 1451ff4ee3
3 changed files with 61 additions and 38 deletions

View File

@@ -25,28 +25,16 @@ const callWithdraw = async (amount: string) => {
loadingWithdraw.value = true;
const withdraw = await withdrawDeposit(amount);
if (withdraw) {
alert("Saque realizado!");
await updateRemaining();
console.log("Saque realizado!");
await getWalletTransactions();
loadingWithdraw.value = false;
} else {
alert("Não foi possível realizar o saque!");
console.log("Não foi possível realizar o saque!");
loadingWithdraw.value = false;
}
}
};
const updateRemaining = async () => {
const walletDeposits = await listValidDepositTransactionsByWalletAddress(
walletAddress.value
);
depositList.value = walletDeposits;
const allUserTransactions = await listAllTransactionByWalletAddress(
walletAddress.value
);
transactionsList.value = allUserTransactions;
};
const getWalletTransactions = async () => {
etherStore.setLoadingWalletTransactions(true);
if (walletAddress.value) {