Create Profile
A user can create profiles on signup by setting a display name. Your handle will be auto generated based on the display name of your first created profile.
import {
useCreateProfile,
} from '@futureverse/asset-register-react/profiles'
const Page = () => {
const { createAsync } = useCreateProfile()
const createProfile = async () => {
const profile = await createAsync({
displayName: 'John Smith',
owner: '<FUTUREPASS_ADDRESS>',
})
console.log('profile', profile)
}
return (
<>
<button onClick={createProfile}>Create Profile</button>
</>
)
}
import { ProfilesClient } from '@futureverse/asset-register/profiles'
import { ProfileModel } from '@futureverse/asset-register';
const pc = new ProfilesClient({
...
})
const createProfile = async () => {
const results = await pc.createProfile({
displayName: 'John Doe',
owner: '<FUTUREPASS_ADDRESS>'
}).execute()
const profile = results[0] as ProfileModel
return profile
}
createProfile()
Mutation
mutation CreateProfile($input: CreateProfileInput!) {
createProfile(input: $input) {
profile {
displayName
profileId
owner
}
}
}
Variables
{
"input": {
"displayName": "John Doe",
"owner": "<FUTUREPASS_ADDRESS>"
}
}
Auth header
authorization: <FUTUREPASS_ACCESS_TOKEN>
Last updated