kolirt / vue-web3-auth

💎 Web3 authentication for Vue3 apps based on WalletConnect Web3Modal v2 and wagmi
https://kolirt.github.io/vue-web3-auth/
MIT License
34 stars 8 forks source link

The documentation lacking integration of web.js or ethers.js #4

Closed abdulmanan7 closed 1 year ago

abdulmanan7 commented 1 year ago

I have configured the wallet, using vuejs now I want to do web3.js for methods calls, etc. How to integrate with the current wallet? or is the library already preloaded with web3.js. I want to know I appreciate any help you can provide.

I have few simple call to make e.g creditContract.methods.runPlay(account.address)call(); creditContract.methods.burn(account.address,1)call(); creditContract.methods.balanceOf(account.address)call(); I am using polygon georli testnet

kolirt commented 1 year ago

I have configured the wallet, using vuejs now I want to do web3.js for methods calls, etc. How to integrate with the current wallet? or is the library already preloaded with web3.js. I want to know I appreciate any help you can provide.

I have few simple call to make e.g creditContract.methods.runPlay(account.address)call(); creditContract.methods.burn(account.address,1)call(); creditContract.methods.balanceOf(account.address)call(); I am using polygon georli testnet

The package depends on wagmi and viem. viem's an alternative to ethers.js and web3.js. wagmi's just a wrapper over viem.

Check this https://github.com/kolirt/vue-web3-auth#writecontract

kolirt commented 1 year ago

I have configured the wallet, using vuejs now I want to do web3.js for methods calls, etc. How to integrate with the current wallet? or is the library already preloaded with web3.js. I want to know I appreciate any help you can provide.

I have few simple call to make e.g creditContract.methods.runPlay(account.address)call(); creditContract.methods.burn(account.address,1)call(); creditContract.methods.balanceOf(account.address)call(); I am using polygon georli testnet

import {erc20ABI, writeContract} from '@kolirt/vue-web3-auth'

await writeContract({
    abi: creditContractABI,
    address: creditContractAddress,
    functionName: 'runPlay',
    args: [account.address]
})
    .then(async (data) => {
        console.log('hash', data.hash)

        await data.wait()

        console.log('transaction successfully')
    })