Refactor methods from blockchain to use new code structure

Co-authored-by: brunoedcf <brest.dallacosta@outlook.com>
This commit is contained in:
RcleydsonR
2023-01-13 19:35:17 -03:00
parent f40db935d3
commit 6fd2120b63
11 changed files with 186 additions and 171 deletions

View File

@@ -1,5 +1,5 @@
<script setup lang="ts">
import blockchain from "@/utils/blockchain";
import { formatEther } from "@ethersproject/units";
import { ref, watch } from "vue";
// props
@@ -17,7 +17,7 @@ const showInitialItems = () => {
const formatEventsAmount = (amount: any) => {
try {
const formated = blockchain.formatBigNumber(amount);
const formated = formatEther(amount);
return formated;
} catch {
return "";

View File

@@ -4,7 +4,7 @@ import CustomButton from "../components/CustomButton.vue";
import { debounce } from "@/utils/debounce";
import { useEtherStore } from "@/store/ether";
import { storeToRefs } from "pinia";
import blockchain from "../utils/blockchain";
import { connectProvider } from "@/blockchain/provider";
// Store reference
const etherStore = useEtherStore();
@@ -23,7 +23,7 @@ const emit = defineEmits(["tokenBuy"]);
// Blockchain methods
const connectAccount = async () => {
await blockchain.connectProvider();
await connectProvider();
verifyLiquidity();
};