Hook to set the NFT of the current user in a stream. You should be validating if the NFT belongs to the user before setting it.

Imports

import { useSetNft } from '@river-build/react-sdk'

Definition

function useSetNft(
  streamId: string,
  config?: ActionConfig<Myself['setNft']>,
): {
    data: void | undefined;
    error: Error | undefined;
    isPending: boolean;
    isSuccess: boolean;
    isError: boolean;
    setNft: (nft: NftModel) => Promise<void>;
}

Source: useSetNft

Parameters

streamId

  • Type: string

The id of the stream to set the NFT of.

config

  • Type: ActionConfig<Myself['setNft']>
  • Optional

Configuration options for the action.

Return Type

The setNft action and its loading state.

{
    data: void | undefined;
    error: Error | undefined;
    isPending: boolean;
    isSuccess: boolean;
    isError: boolean;
    setNft: (nft: NftModel) => Promise<void>;
}