Code Monkey home page Code Monkey logo

cryptoblades-api's Introduction

Wax API

Setup

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

Run

  • npm start to start the API

Routes

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.

Getters

  • 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

Transactions

Every endpoint additionally supports gas for logging and analytics purposes only.

Leaderboard

  • 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

WAX

  • POST /wax/add - pass waxWallet, bscWallet (optional), waxAmount, waxChainTransactionId, waxChainBlockNumber, bscTransactionId as URL parameters

Marketplace

  • 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

Calculated

  • 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)

cryptoblades-api's People

Contributors

ed3ath avatar kcper avatar seiyria avatar zbnf avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.