Function useFetch

  • React Hook for a lookup by contractId against the /v1/fetch endpoint of the JSON API.

    Type Parameters

    • T extends object
    • K
    • I extends string

    Parameters

    • template: TemplateOrInterface<T, K, I>

      The template of the contract to fetch.

    • contractId: ContractId<T>

      The contractId to fetch.

    Returns FetchResult<T, K, I>

    The fetched contract.

    T The contract template type of the query.

    K The contract key type of the query.

    I The template id type.