Skip to main content

useBlock

Callable

  • useBlock(tag?: MaybeRefOrGetter<best | finalized>, options?: ChainComposableOptions): DeepReadonly<MutableAsyncState<any, unknown, undefined>> & { refresh: () => void } & PromiseLike<AsyncState<any, unknown, any>>

  • Composable for fetching information about the latest block.


    Parameters

    • tag: MaybeRefOrGetter<best | finalized> = "finalized"

      Which block to target

    • optionaloptions: ChainComposableOptions

      Additional options

    Returns DeepReadonly<MutableAsyncState<any, unknown, undefined>> & { refresh: () => void } & PromiseLike<AsyncState<any, unknown, any>>

    The latest finalized or best block