import { ExternalProvider } from "@ethersproject/providers";
import { getVESS } from "vess-sdk"
const isDev:boolean = true // set environment
const provider:any // any ethereum provider that is already connected
const address = "0x....."
const vessKit = getVESSKit(isDev) // initialize vess kit
const { session } = await vessKit.connect(address, provider, isDev ? 'testnet-clay': 'mainnet')const { session } = await vess.connect(provider)
import { Connector, useConnect, useDisconnect } from 'wagmi'
import { getVESSKit } from 'vess-kit-web'
const { connectAsync } = useConnect()
const loginWithWallet = async (connector?: Connector<any, any>) => {
try {
// connect wallt and get provider with wagmi (or any other services)
const res = await connectAsync({ connector })
const provider = await connector?.getProvider()
const isDev:boolean = true // set environment
const vessKit = getVESSKit(isDev) // initialize vess kit
const { session } = await vessKit.connect(res.account, provider, isDev ? 'testnet-clay': 'mainnet')
console.log({ session })
} catch (error) {
console.error(error)
}
}