// 1. Get nonce
const nonceResponse = await fetch(
"https://magenx404.onrender.com/x404_auth/blacklist"
);
const nonce = nonceResponse.headers.get("X-404-Nonce");
// 2. Build payload
const path = "/x404_auth/blacklist";
const feature = "SENTINEL404_BLACKLIST";
const payload = `CHALLENGE::${nonce}::${path}::${feature}`;
// 3. Sign
const message = new TextEncoder().encode(payload);
const { signature, publicKey } = await wallet.signMessage(message);
const signatureBase58 = bs58.encode(signature);
// 4. Send authenticated request
const response = await fetch(
"https://magenx404.onrender.com/x404_auth/blacklist",
{
headers: {
"X-404-Nonce": nonce,
"X-404-Signature": signatureBase58,
"X-404-Addr": publicKey.toString(),
"X-404-Feature": "blacklist",
excluded_mints: JSON.stringify(["token_address"]),
max_holdings: JSON.stringify({}),
},
}
);
const data = await response.json();