Configuration
Primary configuration can be done during the plugin install. Passing the optional second argument with your desired settings will initialize Vueth for your needs.
const options = { ... }
createApp(App)
.use(Vueth, options)
.mount('#app')
Without any configuration, Vueth can only read data while connected to MetaMask. It's common to want to fetch data on page load, before the use connects. For this we must set a default RPC & Chain to connect to.
const options = {
rpc: 'https://rpc.ftm.tools', // Your preferred RPC
chainId: 250, // Desired Chain ID
}
Another common property is to 'Auto Connect'. This will only reconnect if the user has previously connected. it won't connect on the very first page load.
const options = {
autoConnect: true
}
Additionally, Polling of background data by default occurs every 60 seconds. This can be adjusted as following (in milliseconds)
const options = {
pollingInterval: 120_000,
}
When connecting to a new network, The supplied Multicall addresses may not be enough. If You are having multicall issues, It may be required to supply your own contract
const options = {
multicall: '0x11473D6E641dF17cd6331D45b135E35B49edBea8'
}