Skip to content

syyunn/0xchange-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

0xchange-server

This is the server component of the 0xchange project for ETHWaterloo 2017!

We won the 0x API Prize!

API reference:

GET: /order - gets all orders in the DB

POST: /order - gets some orders in the DB

  • body:
{
  sortBy: DBColumnID
  asc: acending? true/false
  limit: numberPerPage
  page: pageNumber
  (tokenAddress: address)
}
  • Possible sortBy columns: makerfee, makertokenaddress, makertokenamount, takerfee, takertokenaddress, or takertokenamount

POST: /order/new - adds new order to DB if valid

  • body: ZeroEx.SignedOrder

GET: /token - gets all tokens in the DB

POST: /token/new - adds new token to DB

  • body: address, symbol, name, & decimals

Setup

npm i

Make a config.js file like this:

module.exports = {
  infuraURL: 'https://mainnet.infura.io/YOUR_TOKEN',
  pg: {  // node-postgres config
    host: '',
    user: '',
    password: '',
    database: ''
  }
}

Making a PostgreSQL database

Run server

npm run serve

  • On port 3000 for now

About

ETHWaterloo 2017 0x Winner!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%