Endpoint used for generation of minting parameters for listings that required verified minter address
For general information on how to generate minting parameters visit POST /api/v1/mint
This endpoint is used for generating minting parameters in case our backend needs a verified minter address. This is the case when the ENS name is listed with a whitelisting or token-gated access feature.
The request and response of this endpoint are the same ones as /api/v1/mint, the only difference is that this endpoint requires a special token to be sent so that our backend can verify that the request comes from a verified minter.
Generating the authentication token (example with TypeScript and Viem):
import axios from"axios";import { createWalletClient, Address, http } from"viem"import { privateKeyToAccount } from'viem/accounts'import { mainnet } from'viem/chains'constnamespaceBackendApi=process.env.NAMESPACE_BACKEND_API;constwallet=privateKeyToAccount(process.env.WALLET_KEY);constwalletClient=createWalletClient({ transport:http(), chain: mainnet, account: wallet });interfaceTokenClaims { princial:Address// address of wallet that is signing the message nonce:string// random string that needs to be fetched from /siwe/nonce endpoint}constgenerateAuthToken=async (principal:Address):Promise<string> => {constnonce=awaitgetNonce();constclaims:TokenClaims= { principal, nonce };constclaimsJSON=JSON.stringify(claims);constsignature=awaitwalletClient.signMessage( { message: claimsJSON } );constbase64Signature=base64(signature);constbase64Claims=base64(claimsJSON);constauthToken=`${base64Claims}.${base64Signature}`;return authToken;}constgetNonce= ():Promise<string> => {returnawaitaxios.get<string>(`${namespaceBackendApi}/siwe/nonce`).then(res =>res.data)}constbase64= (value:string) => {returnBuffer.from(value,'base64').toString();}
When sending the request to /api/v1/mint/verified, the generated token has to be provided as an Authorization header