Skip to content

Commit

Permalink
docs: Update tab in decodeDeployData example and add abi import (#2585)
Browse files Browse the repository at this point in the history
* docs: Update tab in decodeDeployData example and add abi import for other functions

* Update site/pages/docs/contract/encodeFunctionResult.md

* Update site/pages/docs/contract/decodeErrorResult.md

---------

Co-authored-by: awkweb <tom@meagher.co>
  • Loading branch information
iosh and tmm committed Aug 5, 2024
1 parent b5aa965 commit 8570315
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion site/pages/docs/contract/decodeDeployData.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { decodeDeployData } from 'viem'

```ts [example.ts]
import { decodeDeployData } from 'viem'
import { wagmiAbi } from './abi.ts'

const { args } = decodeDeployData({
abi: wagmiAbi,
Expand All @@ -29,7 +30,7 @@ const { args } = decodeDeployData({
// { args: [69420n], bytecode: '0x6080604...' }
```

```ts
```ts [abi.ts]
export const wagmiAbi = [
...
{
Expand Down
1 change: 1 addition & 0 deletions site/pages/docs/contract/decodeErrorResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { decodeErrorResult } from 'viem'

```ts [example.ts]
import { decodeErrorResult } from 'viem'
import { wagmiAbi } from './abi.ts'

const value = decodeErrorResult({
abi: wagmiAbi,
Expand Down
1 change: 1 addition & 0 deletions site/pages/docs/contract/decodeEventLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { decodeEventLog } from 'viem'

```ts [example.ts]
import { decodeEventLog } from 'viem'
import { wagmiAbi } from './abi.ts'

const topics = decodeEventLog({
abi: wagmiAbi,
Expand Down
1 change: 1 addition & 0 deletions site/pages/docs/contract/decodeFunctionData.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Below is a very basic example of how to decode a function to calldata.

```ts [example.ts]
import { decodeFunctionData } from 'viem'
import { wagmiAbi } from './abi.ts'

const { functionName } = decodeFunctionData({
abi: wagmiAbi,
Expand Down
1 change: 1 addition & 0 deletions site/pages/docs/contract/decodeFunctionResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Given an ABI (`abi`) and a function (`functionName`), pass through the encoded c

```ts [example.ts]
import { decodeFunctionResult } from 'viem'
import { wagmiAbi } from './abi.ts'

const value = decodeFunctionResult({
abi: wagmiAbi,
Expand Down
1 change: 1 addition & 0 deletions site/pages/docs/contract/encodeDeployData.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Below is a very basic example of how to encode deploy data.

```ts [example.ts]
import { encodeDeployData } from 'viem'
import { wagmiAbi } from './abi.ts'

const data = encodeDeployData({
abi: wagmiAbi,
Expand Down
1 change: 1 addition & 0 deletions site/pages/docs/contract/encodeErrorResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { encodeErrorResult } from 'viem'

```ts [example.ts]
import { decodeErrorResult } from 'viem'
import { wagmiAbi } from './abi.ts'

const value = encodeErrorResult({
abi: wagmiAbi,
Expand Down
1 change: 1 addition & 0 deletions site/pages/docs/contract/encodeEventTopics.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Below is a very basic example of how to encode event topics without arguments.

```ts [example.ts]
import { encodeEventTopics } from 'viem'
import { wagmiAbi } from './abi.ts'

const topics = encodeEventTopics({
abi: wagmiAbi,
Expand Down
1 change: 1 addition & 0 deletions site/pages/docs/contract/encodeFunctionData.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Below is a very basic example of how to encode a function to calldata.

```ts [example.ts]
import { encodeFunctionData } from 'viem'
import { wagmiAbi } from './abi.ts'

const data = encodeFunctionData({
abi: wagmiAbi,
Expand Down
1 change: 1 addition & 0 deletions site/pages/docs/contract/encodeFunctionResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Given an ABI (`abi`) and a function (`functionName`), pass through the values (`

```ts [example.ts]
import { encodeFunctionResult } from 'viem';
import { wagmiAbi } from './abi.ts'

const data = encodeFunctionResult({
abi: wagmiAbi,
Expand Down

0 comments on commit 8570315

Please sign in to comment.