Skip to content

Commit fa773d6

Browse files
committed
add readContract
1 parent cf44b1c commit fa773d6

31 files changed

+2037
-418
lines changed

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Simple WalletConnect v2 integration package for Vue3 apps.
1515
- [Usage](#usage)
1616
- [Connect wallet button](#connect-wallet-button)
1717
- [Multicall](#multicall)
18+
- [ReadContract](#readcontract)
1819
- [Demo](#demo)
1920
- [Example](#example)
2021
- [Faq](#faq)
@@ -77,12 +78,12 @@ import {account, disconnect, connect} from '@kolirt/vue-web3-auth'
7778

7879
## Multicall
7980
```js
80-
import {MulticallAbi, multicall, chain} from '@kolirt/vue-web3-auth'
81+
import {multicallABI, multicall, chain} from '@kolirt/vue-web3-auth'
8182

8283
let data = await multicall({
8384
calls: [
8485
{
85-
abi: MulticallAbi,
86+
abi: multicallABI,
8687
contractAddress: chain.value.contracts.multicall3.address,
8788
calls: [
8889
['getEthBalance', ['0x2D4C407BBe49438ED859fe965b140dcF1aaB71a9']],
@@ -104,6 +105,26 @@ let data = await multicall({
104105
*/
105106
```
106107

108+
## ReadContract
109+
110+
```js
111+
import {erc20ABI, readContract} from '@kolirt/vue-web3-auth'
112+
113+
let data = await readContract({
114+
address: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c', // wbnb on bsc
115+
abi: erc20ABI,
116+
functionName: 'balanceOf',
117+
args: ['0x36696169c63e42cd08ce11f5deebbcebae652050']
118+
})
119+
120+
/**
121+
* Result in data
122+
*
123+
* 107109316688516684525777n
124+
*/
125+
```
126+
127+
107128
# Demo
108129
[Demo here](https://kolirt.github.io/vue-web3-auth/).
109130

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)