Skip to content

Instantly share code, notes, and snippets.

@tigreped
Created October 18, 2018 00:11
Show Gist options
  • Save tigreped/5dc930c148c5ca18a41e2b3f3f7af302 to your computer and use it in GitHub Desktop.
Save tigreped/5dc930c148c5ca18a41e2b3f3f7af302 to your computer and use it in GitHub Desktop.
swagger: '2.0'
info:
version: '1.0.0'
title: 'GoldMine / MarketMaker cryptocurrency exchange API'
description: 'This is an REST API Specification for Brokers for BoostIT`s Market Maker and GoldMine projects.'
termsOfService: 'http://marketmaker.bostit.com/terms/'
contact:
email: 'pedro@georanker.com'
# TODO: these are just scaffolding settings. Must change to real choice setup!
license:
name: 'Apache 2.0'
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
################################################################################
# Host, Base Path, Tags, Schemes and Content Types #
################################################################################
# TODO: these are just scaffolding settings. Must change to real choice setup!
host: "marketmaker.bostit.com" # replace it with propper one
basePath: "/v1"
tags:
- name: "exchange"
description: "Buy/sell exchange order operations"
externalDocs:
description: "Find out more"
url: "http://marketmaker.bostit.com/docs/exchange"
- name: "wallet"
description: "Wallet account operations"
externalDocs:
description: "Find out more"
url: "http://marketmaker.bostit.com/docs/wallet"
- name: "user"
description: "User account operations"
externalDocs:
description: "Find out more"
url: "http://marketmaker.boostit.com/docs/user"
schemes:
- 'https'
- 'http'
################################################################################
# Security #
################################################################################
# TODO: these are just scaffolding settings. Must change to real choice setup!
securityDefinitions:
BasicAuth:
type: basic
ApiKeyAuth:
type: apiKey
in: header
name: X-API-Key
OAuth2:
type: oauth2
flow: accessCode
authorizationUrl: 'http://marketmaker.boostit.com/oauth/dialog'
tokenUrl: 'https://marketmaker.boostit.com/oauth/token'
scopes:
read: 'Grants read access'
write: 'Grants write access'
description: >-
'Look for more request details in /authorize request. TradingView will set
Authorization header to 'Bearer ' + access_token for all requests with
authorization.'
################################################################################
# Paths #
################################################################################
paths:
# Buy order operations #
/buyOrder/{id}:
get:
tags:
- 'exchange'
summary: "Returns a buy order given its buy order id"
parameters:
- in: path
name: id
type: integer
required: true
description: Numeric id of the buy order to search for
responses:
'200':
description: 'Successfully returned buy order'
/buyOrder:
post:
tags:
- "exchange"
summary: "Creates a new buy order"
consumes:
- application/json
parameters:
- in: body
name: buyOrder
description: 'The buy order to create and place on a given market'
schema:
$ref: '#/definitions/BuyOrder'
responses:
'200':
description: 'Successfully created buy order'
get:
tags:
- 'exchange'
summary: "Returns a list of buy orders available in a given market when specified, or in all markets available, when otherwise."
consumes:
- application/x-www-form-urlencoded
parameters:
- in: formData
name: marketId
type: integer
required: false
description: 'Numeric id of the market in which to search for the buy order list'
- in: formData
name: acountId
type: integer
required: false
description: 'Numeric id of the user account for the buy order list to search for'
- in: formData
name: currencyPair
type: string
required: false
description: 'Currency pair for the buy order list to search for'
responses:
'200':
description: 'Successfully returned buy order list from market'
# Sell order operations #
/sellOrder/{id}:
get:
tags:
- 'exchange'
summary: "Returns a sell order given its sell order id"
parameters:
- in: path
name: id
type: integer
required: true
description: Numeric id of the sell order to search for
responses:
'200':
description: 'Successfully returned sell order'
/sellOrder:
post:
tags:
- "exchange"
summary: "Creates a new sell order"
consumes:
- application/json
parameters:
- in: body
name: sellOrder
description: 'The sell order to create and place on a given market'
schema:
$ref: '#/definitions/SellOrder'
responses:
'200':
description: 'Successfully created sell order'
get:
tags:
- 'exchange'
summary: "Returns a list of sell orders available in a given market when specified, or in all markets available, when otherwise."
consumes:
- application/x-www-form-urlencoded
parameters:
- in: formData
name: marketId
type: integer
required: false
description: 'Numeric id of the market in which to search for the sell order list'
- in: formData
name: acountId
type: integer
required: false
description: 'Numeric id of the user account for the sell order list to search for'
- in: formData
name: currencyPair
type: string
required: false
description: 'Currency pair for the sell order list to search for'
responses:
'200':
description: 'Successfully returned sell order list from market'
################################################################################
# Definitions #
################################################################################
definitions:
BuyOrder:
type: "object"
properties:
id:
type: "integer"
format: "int64"
ticker:
type: "string"
quantity:
type: "integer"
format: "int32"
status:
type: "string"
description: "BuyOrder Status"
enum:
- "placed"
- "approved"
- "delivered"
- "canceled"
complete:
type: "boolean"
default: false
xml:
name: "BuyOrder"
SellOrder:
type: "object"
properties:
id:
type: "integer"
format: "int64"
ticker:
type: "string"
quantity:
type: "integer"
format: "int32"
status:
type: "string"
description: "SellOrder Status"
enum:
- "placed"
- "approved"
- "delivered"
- "canceled"
complete:
type: "boolean"
default: false
xml:
name: "SellOrder"
User:
type: "object"
properties:
id:
type: "integer"
format: "int64"
username:
type: "string"
firstName:
type: "string"
lastName:
type: "string"
email:
type: "string"
password:
type: "string"
phone:
type: "string"
userStatus:
type: "string"
description: "User Status"
enum:
- "active"
- "inactive"
- "deleted"
xml:
name: "User"
ApiResponse:
type: "object"
properties:
code:
type: "integer"
format: "int32"
type:
type: "string"
message:
type: "string"
externalDocs:
description: "Find out more about MarketMaker"
url: "http://marketmaker.boostit.com/docs"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment