Skip to main content
Version: V2

Register Essence

Workflow

1. Generate Typed Data

caution

All typedData mutations require an Authorization header with the Bearer token. You can learn how to get a bearer token in the User Login section.

Registering an essence can be implemented in just a few easy steps. What registering an essence essentially means is that the user will deploy an NFT contract by calling a couple of APIs.

First, data should be presented to the user in a readable format when signing from the wallet. To do that you’ll need to call the createRegisterEssenceTypedData API that takes care of this.

If you’re unfamiliar with typed data, you can read more about it here.

2. Get User Signature ✍️

  1. Second, once you received data in a readable format, you’ll need to get the user’s signature (eth_signTypedData_v4) for it. Basically, you’ll need to write a function and pass it a message as a param and return the signature that is necessary for the next step.

3. Call relay and get relayActionID

caution

In order to call the relay mutation, you must include your X-API-KEY in the header. You can learn more about how to get one here.

  1. Third, you’ll have to call the relay API that will broadcast the transaction and mint the essence NFT, you will need to put as params the typedDataID you received from createRegisterEssenceTypedData mutation call and the user's signature.

4. Call relayActionStatus to receive txHash

Finally you poll the relayActionStatus API using the relayActionId returned from the previous step to get the status of the related transaction. There are three possible response types:

  1. RelayActionStatusResult
  2. RelayActionQueued
  3. RelayActionError

You can now verify the transaction by looking up the txHash from the response on bscscan. That’s it! You’re all done!

Designed by