Refactor methods from blockchain to use new code structure
Co-authored-by: brunoedcf <brest.dallacosta@outlook.com>
This commit is contained in:
@@ -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 "";
|
||||
|
||||
@@ -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();
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user