1. API Request
Request Payload
{
'account': '',
'sigAccount': '',
'chainId': ''
// Remaining Issuer specific Request Payload
}Field
Description
sigAccount
const { Signer, Wallet } = require("ethers");
export const signAccount = async (
signer: typeof Signer
): Promise<typeof DataHexString> => {
const DIGEST_TO_SIGN = "Welcome to Quadrata! By signing, you agree to the Terms of Service.";
const sig = await signer.signMessage(DIGEST_TO_SIGN);
return sig;
};
const signer = new Wallet(ACCOUNT_PRIVATE_KEY);
const account = signer.address;
const sigAccount = await signAccount(signer)import codecs
import eth_abi
from web3 import Web3 # type: ignore
W3_TIMEOUT = 60
NETWORK_URI = "" # INFURA_RPC_NODE
ACCOUNT_PRIVATE_KEY = "" # PRIVATE_KEY_USED_TO_SIGN]
def generate_mint_signature() -> Optional[str]:
decoder = codecs.getdecoder('hex_codec')
digest = "Welcome to Quadrata! By signing, you agree to the Terms of Service."
decoder = codecs.getdecoder('hex_codec')
w3 = Web3(Web3.HTTPProvider(NETWORK_URI, request_kwargs={'timeout': W3_TIMEOUT}))
return w3.eth.account.sign_message(
encode_defunct(hexstr=digest),
private_key=decoder(str.encode(ACCOUNT_PRIVATE_KEY))[0],
).signature.hex()Signature Verification
Last updated