How to implement minting TalentLayer IDs?
Minting a TalentLayer ID is the first step that your users will need to do when registering for an account on your platform.
Good to Know
In this example, we will use reactJS, Ether.js and formik to handle the form on the frontend. You will find a full code example with all imports at the end of tutorial.
① Create a Form for Choosing a TalentLayer ID Handle
The user will create his handle.
Bonus: You can check if an handle is already taken and include it in the form validation by using a subgraph query.
② Handle Submit and Post to the Blockchain
On submit, we create a new transaction and call the mint function of the TalentLayerId contract.
③ Get Your New User Information With Subgraph API
After the transaction succeeds, the new user will be viewable via our subgraph api.
See the Full Code Implemented on Our Demo DAPP
processRequest utils function: https://github.com/TalentLayer-Labs/indie-frontend/blob/00e882431f3ad820374841070b7f7fe1a8053c44/src/utils/graphql.ts
Last updated