Giter Club home page Giter Club logo

cctx-exercise's Introduction

What is done & what has been used:

Tools:

  • TypeScript
  • Koa
  • Winston
  • Joi
  • Jest

What's done:

  • All listed API endpoints
  • Query param validation
  • Decryption & Encryption (methods are commented for testing purposes)
  • Global error handling
  • Cluster API
  • Logging by cluster.pid by error / info

To run

Install modules: yarn

Instance

yarn prod:start

Tests

yarn test

Documentation

Ordebook

  url: http://localhost:3000/orderbook
  params:
    id: string (required)
    symbol: string (required)

  response: {
    bids": [
      [
        0.08184,
        6
      ],
      ...
    ]
  }

Example

  url: http://localhost:3000/orderbook
  params:
    id: kraken
    symbol: BCH/BTC

URL: http://localhost:3000/orderbook?id=hitbtc&symbol=BCH%2FBTC


Symbols

  url: http://localhost:3000/symbols
  params:
    id: string (required)

  response: [
    "ADA/BTC",
    "ADA/CAD",
    "ADA/ETH",
    "ADA/EUR",
    ...
  ]

Example

  url: http://localhost:3000/symbols
  params:
    id: bxinth

URL: http://localhost:3000/symbols?id=kraken


Ticker

  url: http://localhost:3000/ticker
  params:
    id: string (required)
    symbol: string (required)

  response: {
    "symbol": "BCH/BTC",
    "timestamp": 1538148033751,
    ...
  }

Example

  url: http://localhost:3000/ticker
  params:
    id: kraken
    symbol: BCH/BTC

URL: http://localhost:3000/ticker?id=kraken&symbol=BCH/BTC


Balance

  url: http://localhost:3000/balance
  params:
    id: string (required)
    apiKey: string (required)
    secret: string (required)

  response: {
    "symbol": "BCH/BTC",
    "timestamp": 1538148033751,
    ...
  }

Example

  url: http://localhost:3000/balance
  params:
    id: bxinth
    apiKey: 484a63e83ccd
    secret: 80c6c46d100a

URL: http://localhost:3000/balance?id=bxinth&apiKey=484a63e83ccd&secret=80c6c46d100a


Place Order

  url: http://localhost:3000/placeOrder
  params:
    id: string (required)
    symbol: string (required)
    orderType: string (required)
    side: string (required - buy | sell)
    amount: number (required)
    price: number (required)
    apiKey: string (required)
    secret: string (required)

  response: {
    ...error, need verification
  }

Example

  url: http://localhost:3000/placeOrder
  params:
    id: bxinth
    symbol: BTC/THB
    orderType: limit
    side: sell
    amount: 0.321
    price: 100
    apiKey: 484a63e83ccd
    secret: 80c6c46d100a

URL: http://localhost:3000/placeOrder?id=bxinth&symbol=BTC/THB&orderType=limit&side=sell&amount=0.321&price=0123&apiKey=484a63e83ccd&secret=80c6c46d100a

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.