Set Avatar

An on chain asset can be used as the profile avatar. The user must own the asset on the wallet provided in the owner field. The access token will be used to verify whether the user has access to the given owner.

import {
  useSetProfileAvatar,
} from '@futureverse/asset-register-react/profiles'

const Page = () => {
  const { setAsync } = useSetProfileAvatar()

  const onClick = async () => {
      const profile = await setAsync({
        collectionId: '7672:root:123456',
        tokenId: '1',
        owner: '<FUTUREPASS ADDRESS OR EOA ADDRESS>',
        profileId: 'f9da67a9-db13-49e2-927d-0920110eb4a4',
      })
      
      console.log('profile', profile)
  }

  return (
    <>
      <button onClick={onClick}>Submit</button>
    </>
  )
}

Last updated