Solana
Last updated
Last updated
Let the user decide what name they want
You'll want to provide some sort of input box that allows a user to see if the name they want is available.
Check if the name is valid
There are some restrictions for registering a name. In short, the name must fit in 32 bytes, must not have a space, or a /.
Once you know the name is valid, make sure the name is not taken
Get the raw transaction data for the on-chain transaction
This call will get you the on-chain transaction data to register the names you want at the minimum registration fee of 0.01 ETH (converted to lamports).
If you want to impose a specific registration amount, you can do so in the names array. Input these amounts in Wei and they'll be converted to SOL. Check out the documentation on getting the transaction data to learn more.
You can now display the registration fee
Submit the transaction
Track the status of the transaction
Once the transaction is submitted, you can check when the registration has been processed. An alternative method is pinging the getNameAvailability()
function to see when the name becomes taken.