Create a .env file with the following:
- MONGODB_URI - a ref to the mongodb instance
- API_SECRET - a string that must be passed for transactions to work
- npm start to 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 - pass hash, accountAddress, characterId, characterLevel, weaponId, enemyId, wonFight, enemyRoll, playerRoll, xpGain, skillGain
- POST /leaderboard/weapon/mint/add - pass hash, accountAddress, weaponId, stars
- POST /leaderboard/weapon/reforge/add - pass hash, accountAddress, weaponId, burnId
- POST /leaderboard/character/mint/add - pass hash, accountAddress, charId
- POST /leaderboard/character/level/add - pass hash, accountAddress, charId, level
- POST /leaderboard/market/list/add - pass hash, accountAddress, nftAddress, nftId, price
- POST /leaderboard/market/change/add - pass hash, accountAddress, nftAddress, nftId, price
- POST /leaderboard/market/sell/add - pass hash, accountAddress, buyerAddress, nftAddress, nftId, price
- POST /leaderboard/market/cancel/add - pass hash, accountAddress, nftAddress, nftId
- POST /wax/add - pass waxWallet, bscWallet (optional), waxAmount, waxChainTransactionId, waxChainBlockNumber, bscTransactionId as URL parameters
- GET /static/market/character - pass element (string), minLevel (num), maxLevel (num), sortBy (string; any character key), sortDir (-1 or 1), pageSize (default 60), pageNum (default 0), sellerAddress
- PUT /market/character/:charId - pass price, (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
- GET /static/market/weapon - pass element (string), minStars (num), maxStars (num), sortBy (string; any weapon key), sortDir (-1 or 1), pageSize (default 60), pageNum (default 0), sellerAddress
- PUT /market/weapon/:weaponId - pass price, (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
- GET /static/market/transactions/:accountId
- GET /static/calculated/skill/price - current SKILL price in USD
- POST /calculated/skill/price - pass price (number), timestamp (optional, number)
- GET /static/calculated/skill/circulating - current SKILL price in USD
- POST /calculated/skill/circulating - pass total (number), timestamp (optional, number)
- GET /static/calculated/skill/contract - current SKILL in dev contract
- POST /calculated/skill/contract - pass total (number), timestamp (optional, number)
- GET /static/calculated/skill/holders - current number of SKILL holders
- POST /calculated/skill/holders - pass total (number), timestamp (optional, number)
- GET /static/calculated/skill/liquidity - current liquidity value
- POST /calculated/skill/liquidity - pass total (number), timestamp (optional, number)
- GET /static/calculated/skill/total - current liquidity value
- POST /calculated/skill/total - pass total (number), timestamp (optional, number)