getStorageAt
Action for returning the value from a storage slot at a given address.
Import
ts
import { getStorageAt } from '@wagmi/core'
import { getStorageAt } from '@wagmi/core'
Usage
ts
import { getStorageAt } from '@wagmi/core'
import { config } from './config'
await getStorageAt(config, {
address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
slot: '0x0',
})
import { getStorageAt } from '@wagmi/core'
import { config } from './config'
await getStorageAt(config, {
address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
slot: '0x0',
})
ts
import { http, createConfig } from '@wagmi/core'
import { mainnet, sepolia } from '@wagmi/core/chains'
export const config = createConfig({
chains: [mainnet, sepolia],
transports: {
[mainnet.id]: http(),
[sepolia.id]: http(),
},
})
import { http, createConfig } from '@wagmi/core'
import { mainnet, sepolia } from '@wagmi/core/chains'
export const config = createConfig({
chains: [mainnet, sepolia],
transports: {
[mainnet.id]: http(),
[sepolia.id]: http(),
},
})
Parameters
ts
import { type GetStorageAtParameters } from '@wagmi/core'
import { type GetStorageAtParameters } from '@wagmi/core'
address
Address
The contract address.
ts
import { getStorageAt } from '@wagmi/core'
import { config } from './config'
await getStorageAt(config, {
address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
slot: '0x0',
})
import { getStorageAt } from '@wagmi/core'
import { config } from './config'
await getStorageAt(config, {
address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
slot: '0x0',
})
ts
import { http, createConfig } from '@wagmi/core'
import { mainnet, sepolia } from '@wagmi/core/chains'
export const config = createConfig({
chains: [mainnet, sepolia],
transports: {
[mainnet.id]: http(),
[sepolia.id]: http(),
},
})
import { http, createConfig } from '@wagmi/core'
import { mainnet, sepolia } from '@wagmi/core/chains'
export const config = createConfig({
chains: [mainnet, sepolia],
transports: {
[mainnet.id]: http(),
[sepolia.id]: http(),
},
})
slot
Hex
The storage position (as a hex encoded value).
ts
import { getStorageAt } from '@wagmi/core'
import { config } from './config'
await getStorageAt(config, {
address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
slot: '0x0',
})
import { getStorageAt } from '@wagmi/core'
import { config } from './config'
await getStorageAt(config, {
address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
slot: '0x0',
})
ts
import { http, createConfig } from '@wagmi/core'
import { mainnet, sepolia } from '@wagmi/core/chains'
export const config = createConfig({
chains: [mainnet, sepolia],
transports: {
[mainnet.id]: http(),
[sepolia.id]: http(),
},
})
import { http, createConfig } from '@wagmi/core'
import { mainnet, sepolia } from '@wagmi/core/chains'
export const config = createConfig({
chains: [mainnet, sepolia],
transports: {
[mainnet.id]: http(),
[sepolia.id]: http(),
},
})
blockNumber
bigint | undefined
The block number to check the storage at.
ts
import { getStorageAt } from '@wagmi/core'
import { config } from './config'
await getStorageAt(config, {
address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
blockNumber: 16280770n,
slot: '0x0',
})
import { getStorageAt } from '@wagmi/core'
import { config } from './config'
await getStorageAt(config, {
address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
blockNumber: 16280770n,
slot: '0x0',
})
ts
import { http, createConfig } from '@wagmi/core'
import { mainnet, sepolia } from '@wagmi/core/chains'
export const config = createConfig({
chains: [mainnet, sepolia],
transports: {
[mainnet.id]: http(),
[sepolia.id]: http(),
},
})
import { http, createConfig } from '@wagmi/core'
import { mainnet, sepolia } from '@wagmi/core/chains'
export const config = createConfig({
chains: [mainnet, sepolia],
transports: {
[mainnet.id]: http(),
[sepolia.id]: http(),
},
})
blockTag
'latest' | 'earliest' | 'pending' | 'safe' | 'finalized' | undefined
The block tag to check the storage at.
ts
import { getStorageAt } from '@wagmi/core'
import { config } from './config'
await getStorageAt(config, {
address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
blockTag: 'safe',
slot: '0x0',
})
import { getStorageAt } from '@wagmi/core'
import { config } from './config'
await getStorageAt(config, {
address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
blockTag: 'safe',
slot: '0x0',
})
ts
import { http, createConfig } from '@wagmi/core'
import { mainnet, sepolia } from '@wagmi/core/chains'
export const config = createConfig({
chains: [mainnet, sepolia],
transports: {
[mainnet.id]: http(),
[sepolia.id]: http(),
},
})
import { http, createConfig } from '@wagmi/core'
import { mainnet, sepolia } from '@wagmi/core/chains'
export const config = createConfig({
chains: [mainnet, sepolia],
transports: {
[mainnet.id]: http(),
[sepolia.id]: http(),
},
})
chainId
config['chains'][number]['id'] | undefined
The chain ID to check the storage at.
ts
import { getStorageAt } from '@wagmi/core'
import { mainnet } from '@wagmi/core/chains'
import { config } from './config'
await getStorageAt(config, {
chainId: mainnet.id,
address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
slot: '0x0',
})
import { getStorageAt } from '@wagmi/core'
import { mainnet } from '@wagmi/core/chains'
import { config } from './config'
await getStorageAt(config, {
chainId: mainnet.id,
address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
slot: '0x0',
})
ts
import { http, createConfig } from '@wagmi/core'
import { mainnet, sepolia } from '@wagmi/core/chains'
export const config = createConfig({
chains: [mainnet, sepolia],
transports: {
[mainnet.id]: http(),
[sepolia.id]: http(),
},
})
import { http, createConfig } from '@wagmi/core'
import { mainnet, sepolia } from '@wagmi/core/chains'
export const config = createConfig({
chains: [mainnet, sepolia],
transports: {
[mainnet.id]: http(),
[sepolia.id]: http(),
},
})
Return Type
ts
import { type GetStorageAtReturnType } from '@wagmi/core'
import { type GetStorageAtReturnType } from '@wagmi/core'
Hex
The value of the storage slot.
Error
ts
import { type GetStorageAtErrorType } from '@wagmi/core'
import { type GetStorageAtErrorType } from '@wagmi/core'
TanStack Query
ts
import {
type getStorageAtData,
type getStorageAtOptions,
type getStorageAtQueryFnData,
type getStorageAtQueryKey,
getStorageAtQueryKey,
getStorageAtQueryOptions,
} from '@wagmi/core/query'
import {
type getStorageAtData,
type getStorageAtOptions,
type getStorageAtQueryFnData,
type getStorageAtQueryKey,
getStorageAtQueryKey,
getStorageAtQueryOptions,
} from '@wagmi/core/query'