@@ -41,9 +48,12 @@ const formatWalletAddress = (): string => {
>
Conectar carteira
-
- {{ formatWalletAddress() }}
-
+
+
+ {{ formatWalletAddress() }}
+
+ ETH: {{ formatWalletBalance() }}
+
diff --git a/src/store/ether.ts b/src/store/ether.ts
index d5c308d..b777179 100644
--- a/src/store/ether.ts
+++ b/src/store/ether.ts
@@ -1,21 +1,16 @@
-import type { ethers } from "ethers";
import { defineStore } from "pinia";
export const useEtherStore = defineStore("ether", {
state: () => ({
walletAddress: "",
- balance: 0,
- provider: null as ethers.providers.Web3Provider | null,
+ balance: "",
}),
actions: {
setWalletAddress(walletAddress: string) {
this.walletAddress = walletAddress;
},
- setBalance(balance: number) {
+ setBalance(balance: string) {
this.balance = balance;
},
- setProvider(provider: ethers.providers.Web3Provider | null) {
- this.provider = provider;
- },
},
});
diff --git a/src/utils/ethers.ts b/src/utils/ethers.ts
index 242b58e..351691b 100644
--- a/src/utils/ethers.ts
+++ b/src/utils/ethers.ts
@@ -1,29 +1,44 @@
import { useEtherStore } from "@/store/ether";
import { ethers } from "ethers";
-const connectProvider =
- async (): Promise