I am working with wagmi core in svelte and am looking to make a basic wallet connect and disconnect flow.
I am able to successfully connect by pressing the connect
button, and having it call handleConnect
.
async function handleConnect() { await connect(config, { connector: injected() }) const account = await getAccount(config) console.log(account) }
The console successfully shows an account.
After I do this, I can see my wallet has successfully connect.
However, upon refreshing, when checking the status of my connection, it says undefined when calling getAccount
.
onMount(async () => { const account = await getAccount(config) console.log(account) })
I get the following:
{address: undefined, addresses: undefined, chain: undefined, chainId: undefined, connector: undefined, …}
Why is that?