2.1 KiB
2.1 KiB
title, description
| title | description |
|---|---|
| useBlobBaseFee | Hook for fetching the current blob base fee (in wei). |
useBlobBaseFee
Hook for fetching the current blob base fee (in wei).
Import
import { useBlobBaseFee } from 'wagmi'
Usage
::: code-group
import { useBlobBaseFee } from 'wagmi'
function App() {
const result = useBlobBaseFee()
}
<<< @/snippets/react/config.ts[config.ts] :::
Parameters
import { type UseBlobBaseFeeParameters } from 'wagmi'
chainId
config['chains'][number]['id'] | undefined
ID of chain to use when fetching data.
::: code-group
import { useBlobBaseFee } from 'wagmi'
import { mainnet } from 'wagmi/chains' // [!code focus]
function App() {
const result = useBlobBaseFee({
chainId: mainnet.id, // [!code focus]
})
}
<<< @/snippets/react/config.ts[config.ts] :::
config
Config | undefined
Config to use instead of retrieving from the nearest WagmiProvider.
::: code-group
import { useBlobBaseFee } from 'wagmi'
import { config } from './config' // [!code focus]
function App() {
const result = useBlobBaseFee({
config, // [!code focus]
})
}
<<< @/snippets/react/config.ts[config.ts] :::
scopeKey
string | undefined
Scopes the cache to a given context. Hooks that have identical context will share the same cache.
::: code-group
import { useBlobBaseFee } from 'wagmi'
import { config } from './config' // [!code focus]
function App() {
const result = useBlobBaseFee({
scopeKey: 'foo', // [!code focus]
})
}
<<< @/snippets/react/config.ts[config.ts] :::
Return Type
import { type UseBlobBaseFeeReturnType } from 'wagmi'