[docs] Javascript Wagmi Smart Contract Interaction
Summary
As stated in the docs:
Wagmi actions can help us interact with wallets and smart contracts:
import { readContract } from '@wagmi/core'
import { USDTAbi } from '../abi/USDTAbi'
const USDTAddress = '0x...'
const data = readContract({
address: USDTAddress,
abi: USDTAbi,
functionName: 'symbol'
})
Read more about Wagmi actions for smart contract interaction here.
But if you follow the link:
import { readContract } from '@wagmi/core'
import { abi } from './abi'
import { config } from './config'
const result = await readContract(config, {
abi,
address: '0x6b175474e89094c44da98b954eedeac495271d0f',
functionName: 'totalSupply',
})
Is config missing from the docs?
Link to the related docs page
https://docs.reown.com/appkit/javascript/core/installation?platform=wagmi
modal of class AppKit doesnt have disconnect function
modal of class AppKit doesnt have disconnect function We are solving this issue soon. https://linear.app/reown/issue/APKT-1045/[bug]-disconnect-is-not-exposed
@rtomas what about config?
@vanyasav Where I can find that config import ?
@vanyasav Where I can find that config import ?
modal.adapter.wagmiConfig
You can directly get the wagmi config from the adapter like this.
const wagmiAdapter = new WagmiAdapter({
ssr: true,
networks: [], // Add networks here
projectId: "YOUR_PROJECT_ID"
})
wagmiAdapter.wagmiConfig // Here
I'll close this issue for now, but please let me know if you're still stuck.