Skip to content

Commit

Permalink
Use form network to update account
Browse files Browse the repository at this point in the history
  • Loading branch information
samuveth committed Jan 23, 2024
1 parent 88d8d4a commit 6377db6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/composables/useAccount.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import snapshot from '@snapshot-labs/snapshot.js';
import { ERC20ABI } from '@/helpers/constants';
import { getInstance } from '@snapshot-labs/lock/plugins/vue3';
import getProvider from '@snapshot-labs/snapshot.js/src/utils/provider';

async function getERC20Account(
provider: any,
Expand All @@ -16,7 +16,6 @@ async function getERC20Account(
}

export function useAccount() {
const auth = getInstance();
const { web3Account } = useWeb3();

const account = ref<{
Expand All @@ -32,9 +31,12 @@ export function useAccount() {
) {
account.value = {};
updatingAccount.value = true;
const broviderUrl = import.meta.env.VITE_BROVIDER_URL;
const provider = getProvider(chainId, { broviderUrl });

try {
account.value = await getERC20Account(
auth.web3,
provider,
web3Account.value,
token,
chainId,
Expand Down

0 comments on commit 6377db6

Please sign in to comment.