Authentication
- Getting Started
- React
- API Reference
Transactions
- Overview
- Getting Started
- Usage
- Helper Functions
Assets
- Overview
- Getting Started
- Collectibles/NFTs
- Asset Register Transaction Message (ARTM)
- Swappables
- Tokens
- Asset Tree
- Error messages
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
.
Copy
Ask AI
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>
</>
)
}
Copy
Ask AI
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>
</>
)
}
Copy
Ask AI
import { ProfilesClient } from '@futureverse/asset-register/profiles'
import { ProfileModel } from '@futureverse/asset-register'
const pc = new ProfilesClient({
...
})
const setProfileAvatar = async () => {
const results = await pc.setProfileAvatar({
collectionId: '7672:root:123456',
tokenId: '1',
owner: '<FUTUREPASS_ADDRESS or EOA_ADDRESS>',
profileId: 'f9da67a9-db13-49e2-927d-0920110eb4a4',
}).execute()
const profile = results[0] as ProfileModel
return profile
}
setProfileAvatar()
Mutation
Copy
Ask AI
<pre class="language-graphql"><code class="lang-graphql">mutation SetProfileAvatar($input: SetProfileAvatarInput!) {
setProfileAvatar(input: $input) {
profile {
displayName
profileId
owner
avatar {
asset {
tokenId
collectionId
}
}
}
}
<strong>}
</strong></code></pre>
Variables
Copy
Ask AI
{
"input": {
"collectionId": "7672:root:123456",
"tokenId: "1",
"owner": "<FUTUREPASS_ADDRESS or EOA_ADDRESS>",
"profileId": "f9da67a9-db13-49e2-927d-0920110eb4a4"
}
}
Auth header
Copy
Ask AI
authorization: <FUTUREPASS_ACCESS_TOKEN>
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.