Skip to content

Commit

Permalink
wip: docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jxom committed May 2, 2024
1 parent e132073 commit bcc0e8a
Show file tree
Hide file tree
Showing 5 changed files with 657 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/.vitepress/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,14 @@ export function getSidebar() {
text: 'useSendCalls',
link: '/react/api/hooks/useSendCalls',
},
{
text: 'useShowCallsStatus',
link: '/react/api/hooks/useShowCallsStatus',
},
{
text: 'useWriteContracts',
link: '/react/api/hooks/useWriteContracts',
},
],
},
],
Expand Down Expand Up @@ -719,6 +727,14 @@ export function getSidebar() {
text: 'sendCalls',
link: '/core/api/actions/sendCalls',
},
{
text: 'showCallsStatus',
link: '/core/api/actions/showCallsStatus',
},
{
text: 'writeContracts',
link: '/core/api/actions/writeContracts',
},
],
},
],
Expand Down
101 changes: 101 additions & 0 deletions docs/core/api/actions/showCallsStatus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<script setup>
const packageName = '@wagmi/core/experimental'
const actionName = 'showCallsStatus'
const typeName = 'ShowCallsStatus'
</script>

# showCallsStatus

Action to request for the wallet to show information about a call batch that was sent via `showCalls`.

[Read more.](https://github.com/ethereum/EIPs/blob/1663ea2e7a683285f977eda51c32cec86553f585/EIPS/eip-5792.md#wallet_showcallsstatus)

::: warning
This is an experimental action that is not supported in most wallets. It is recommended to have a fallback mechanism if using this in production.
:::

## Import

```ts
import { showCallsStatus } from '@wagmi/core/experimental'
```

## Usage

::: code-group
```ts [index.ts]
import { showCallsStatus } from '@wagmi/core/experimental'
import { config } from './config'

await showCallsStatus(config, {
id: '0x1234567890abcdef',
})
```
<<< @/snippets/core/config.ts[config.ts]
:::

## Parameters

```ts
import { type ShowCallsStatusParameters } from '@wagmi/core/experimental'
```

### connector

`Connector | undefined`

Connector to show call statuses with.

::: code-group
```ts [index.ts]
import { getConnections, showCallsStatus } from '@wagmi/core/experimental'
import { config } from './config'

const connections = getConnections(config)
await showCallsStatus(config, {
connector: connections[0]?.connector, // [!code focus]
id: '0x1234567890abcdef',
})
```
<<< @/snippets/core/config.ts[config.ts]
:::

### id

`string`

Identifier of the call batch.

::: code-group
```ts [index.ts]
import { showCallsStatus } from '@wagmi/core/experimental'
import { config } from './config'

await showCallsStatus(config, {
id: '0x1234567890abcdef', // [!code focus]
})
```
<<< @/snippets/core/config.ts[config.ts]
:::

## Return Type

```ts
import { type ShowCallsStatusReturnType } from '@wagmi/core/experimental'
```

`bigint`

Most recent block number seen.

## Error

```ts
import { type ShowCallsStatusErrorType } from '@wagmi/core/experimental'
```

<!--@include: @shared/query-imports.md-->

## Viem

- [`showCallsStatus`](https://viem.sh/experimental/eip5792/showCallsStatus)
Loading

0 comments on commit bcc0e8a

Please sign in to comment.