Create a .env file with the following:
MONGODB_URI- a ref to the mongodb instanceAPI_SECRET- a string that must be passed for transactions to work (applies globally)API_SECRET_MARKET- a string that must be passed for transactions to work (market only)API_SECRET_CALCULATED- a string that must be passed for transactions to work (calculated only)
API_SECRET is a global master password. If it is specified, the other two are not required. However, if not specified, API_SECRET_MARKET must match the auth token for the market, and API_SECRET_CALCULATED must match the auth token for the calculated routes.
npm startto start the API
All routes that are not /static take secret as a header - Authorization: Bearer <secret>. This must match API_SECRET (if set) or the request will fail.
- GET
/static/leaderboard- get the entire leaderboard - GET
/static/characters/name/:id- get character name by id - GET
/static/weapons/name/:id- get weapon name by id - GET
/static/fights/:accountAddress- get fight logs by account address - GET
/notifications- get all notifications in the last few days
Every endpoint additionally supports gas for logging and analytics purposes only.
- POST
/leaderboard/fight/add- passhash,accountAddress,characterId,characterLevel,weaponId,enemyId,wonFight,enemyRoll,playerRoll,xpGain,skillGain - POST
/leaderboard/weapon/mint/add- passhash,accountAddress,weaponId,stars - POST
/leaderboard/weapon/reforge/add- passhash,accountAddress,weaponId,burnId - POST
/leaderboard/character/mint/add- passhash,accountAddress,charId - POST
/leaderboard/character/level/add- passhash,accountAddress,charId,level - POST
/leaderboard/market/list/add- passhash,accountAddress,nftAddress,nftId,price - POST
/leaderboard/market/change/add- passhash,accountAddress,nftAddress,nftId,price - POST
/leaderboard/market/sell/add- passhash,accountAddress,buyerAddress,nftAddress,nftId,price - POST
/leaderboard/market/cancel/add- passhash,accountAddress,nftAddress,nftId
- POST
/wax/add- passwaxWallet,bscWallet(optional),waxAmount,waxChainTransactionId,waxChainBlockNumber,bscTransactionIdas URL parameters
- GET
/static/market/character- passelement(string),minLevel(num),maxLevel(num),sortBy(string; any character key),sortDir(-1 or 1),pageSize(default 60),pageNum(default 0),sellerAddress,minPrice,maxPrice - PUT
/market/character/:charId- passprice, (number),charLevel(num),charElement(string),timestamp(number),sellerAddress(string),buyerAddress(optional, string) - GET
/market/character/:charId/sell- mark this as sold (copy the entry from the market character collection) - DELETE
/market/character/:charId - DELETE
/market/character/all/:accountAddress
- GET
/static/market/weapon- passelement(string),minStars(num),maxStars(num),sortBy(string; any weapon key),sortDir(-1 or 1),pageSize(default 60),pageNum(default 0),sellerAddress,minPrice,maxPrice - PUT
/market/weapon/:weaponId- passprice, (string),weaponStars(num),weaponElement(string),stat1Element(string),stat1Value(number),stat2Element(string),stat2Value(number),stat3Element(string),stat3Value(number),timestamp(number),sellerAddress(string),buyerAddress(optional, string) - GET
/market/weapon/:weaponId/sell- mark this as sold (copy the entry from the market weapon collection) - DELETE
/market/weapon/:weaponId - DELETE
/market/weapon/all/:accountAddress - GET
/static/market/transactions/:accountId
- GET
/static/market/shield- passelement(string),minStars(num),maxStars(num),sortBy(string; any weapon key),sortDir(-1 or 1),pageSize(default 60),pageNum(default 0),sellerAddress,minPrice,maxPrice - PUT
/market/shield/:shieldId- passprice, (string),shieldStars(num),shieldElement(string),stat1Element(string),stat1Value(number),stat2Element(string),stat2Value(number),stat3Element(string),stat3Value(number),timestamp(number),sellerAddress(string),buyerAddress(optional, string) - GET
/market/shield/:shieldId/sell- mark this as sold (copy the entry from the market shield collection) - DELETE
/market/shield/:shieldId - DELETE
/market/shield/all/:accountAddress - GET
/static/market/transactions/:accountId
- GET
/static/calculated/skill/price- current SKILL price in USD - POST
/calculated/skill/price- passprice(number),timestamp(optional, number) - GET
/static/calculated/skill/circulating- current SKILL price in USD - POST
/calculated/skill/circulating- passtotal(number),timestamp(optional, number) - GET
/static/calculated/skill/contract- current SKILL in dev contract - POST
/calculated/skill/contract- passtotal(number),timestamp(optional, number) - GET
/static/calculated/skill/holders- current number of SKILL holders - POST
/calculated/skill/holders- passtotal(number),timestamp(optional, number) - GET
/static/calculated/skill/liquidity- current liquidity value - POST
/calculated/skill/liquidity- passtotal(number),timestamp(optional, number) - GET
/static/calculated/skill/total- current liquidity value - POST
/calculated/skill/total- passtotal(number),timestamp(optional, number)