reown-com / appkit

The full stack toolkit to build onchain app UX
https://reown.com/appkit
Apache License 2.0
4.91k stars 1.4k forks source link

[docs] Javascript Wagmi Smart Contract Interaction #3084

Open vanyasav opened 2 weeks ago

vanyasav commented 2 weeks ago

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

vanyasav commented 2 weeks ago

image

modal of class AppKit doesnt have disconnect function

rtomas commented 2 weeks ago

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

vanyasav commented 2 weeks ago

@rtomas what about config?

rtomas commented 1 week ago

@vanyasav Where I can find that config import ?

bolom commented 1 week ago

@vanyasav Where I can find that config import ?

modal.adapter.wagmiConfig