MCPcopy Create free account
hub / github.com/ShafiqSadat/HamsterKeyGenWeb / generateKey

Function generateKey

script.js:401–419  ·  view source on GitHub ↗
(clientToken, promoId)

Source from the content-addressed store, hash-verified

399 };
400
401 const generateKey = async (clientToken, promoId) => {
402 const response = await fetch('https://api.gamepromo.io/promo/create-code', {
403 method: 'POST',
404 headers: {
405 'Authorization': `Bearer ${clientToken}`,
406 'Content-Type': 'application/json'
407 },
408 body: JSON.stringify({
409 promoId
410 })
411 });
412
413 if (!response.ok) {
414 throw new Error('Failed to generate key');
415 }
416
417 const data = await response.json();
418 return data.promoCode;
419 };
420
421 const generateUUID = () => {
422 return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {

Callers 1

generateKeyProcessFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected