QubicTypeScript

useIssuedAssets

Query all assets issued by a Qubic identity.

Returns all assets that a given identity originally issued. An issuer is the identity that created the asset.

Requires QubicProvider as an ancestor.

Signature

function useIssuedAssets(
  identity: Identity | string | undefined,
  options?: { refetchInterval?: number | false }
): {
  data: Asset[] | undefined
  isLoading: boolean
  error: QubicRpcError | null
}

Usage

import { useIssuedAssets } from "@qubic.org/react"

function IssuedAssets({ identity }: { identity: string }) {
  const { data, isLoading, error } = useIssuedAssets(identity)

  if (isLoading) return <p>Loading...</p>
  if (error) return <p>Error: {error.message}</p>

  return (
    <ul>
      {data?.map((asset) => (
        <li key={asset.assetName}>{asset.assetName}</li>
      ))}
    </ul>
  )
}

Parameters

NameTypeDescription
identityIdentity | string | undefinedThe identity to query. Pass undefined to skip the fetch.
options.refetchIntervalnumber | falsePolling interval in milliseconds. Pass false to disable.

Returns

FieldTypeDescription
dataAsset[] | undefinedList of assets issued by the identity, or undefined while loading.
isLoadingbooleantrue while the first fetch is in progress.
errorQubicRpcError | nullNetwork or parse error.

On this page