Skip to content

Instantly share code, notes, and snippets.

@Ronserruya
Created March 31, 2019 11:10
Show Gist options
  • Select an option

  • Save Ronserruya/4ae3ac2f63fec1ad3c2f65b19c91783d to your computer and use it in GitHub Desktop.

Select an option

Save Ronserruya/4ae3ac2f63fec1ad3c2f65b19c91783d to your computer and use it in GitHub Desktop.
swagger: "2.0"
info:
description: "Micro service to invoke common kin stuff using the kin-python-sdk."
version: "1.0.0"
title: "Kin Python Microservice"
license:
name: "MIT"
url: "https://opensource.org/licenses/MIT"
schemes:
- "https"
paths:
/pay:
post:
tags:
- "Endpoints:"
summary: "Send KIN to an address"
operationId: "sendKin"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
description: "Payment Request object"
required: true
schema:
$ref: '#/definitions/PaymentReqeust'
responses:
200:
$ref: '#/definitions/TransactionResponse'
/create:
post:
tags:
- "Endpoints:"
summary: "Create an account on the blockchain"
operationId: "createAccount"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
description: "Creation request object"
required: true
schema:
$ref: '#/definitions/CreationRequest'
responses:
200:
$ref: '#/definitions/TransactionResponse'
/balance:
get:
tags:
- "Endpoints:"
summary: "Get the KIN balance of an account"
operationId: "getBalance"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
description: "Balance request object"
required: true
schema:
$ref: '#/definitions/BalanceRequest'
responses:
200:
$ref: '#/definitions/BalanceResponse'
/whitelist:
post:
tags:
- "Endpoints:"
summary: "Whitelist a transaction"
operationId: "whitelist"
consumes:
- "application/json"
produces:
- "application/json"
parameters:
- in: "body"
name: "body"
description: "Whitelist request object"
required: true
schema:
$ref: '#/definitions/WhitelistRequest'
responses:
200:
$ref: '#/definitions/WhitelistResponse'
/status:
get:
tags:
- "Endpoints:"
summary: "Get the current config/status of the service (Use as healthcheck)"
operationId: "status"
produces:
- "application/json"
responses:
200:
$ref: '#/definitions/StatusResponse'
definitions:
PaymentReqeust:
type: object
required: [destination, amount]
properties:
destination:
type: string
example: GCJEHC2UOSIDPPIHJ2SH3B2ZL5XBB7KYK2M6OHXZTUW4NI2NEVVFVDLD
amount:
type: number
example: 130
memo:
type: string
example: "Order-123"
default: null
CreationRequest:
type: object
required: [destination]
properties:
destination:
type: string
example: GCJEHC2UOSIDPPIHJ2SH3B2ZL5XBB7KYK2M6OHXZTUW4NI2NEVVFVDLD
starting_balance:
type: number
example: 5
default: 0
memo:
type: string
example: "User-123"
default: null
TransactionResponse:
description: 'Successfull payment'
type: object
properties:
tx_id:
type: string
example: ae9b957a857c843cd8d921820f9695daa5aa00f51f1665ff925999ab0ccd54bd
BalanceRequest:
type: object
required: [address]
properties:
address:
type: string
example: GCJEHC2UOSIDPPIHJ2SH3B2ZL5XBB7KYK2M6OHXZTUW4NI2NEVVFVDLD
BalanceResponse:
description: 'Successfull request'
type: object
properties:
balance:
type: number
example: 154.5
WhitelistRequest:
type: object
required: [tx_envelope]
properties:
tx_envelope:
type: string
example: AAAAACQpNXQ4NCGx5OeZCkDJTzqAdXYY4qedTmyUwcE2c02wAAAAAAANfdwAAAADAAAAAAAAAAEAAAAcMS1sNjhiLVQwQzJuUUZwOU1VeE5tRDc3RE5wcQAAAAEAAAAAAAAAAQAAAADSTsz/bFP7AezxTQVxZrzaHXErPrT49yakAlKWKxMSEQAAAAAAAAAAAJiWgAAAAAAAAAACNnNNsAAAAEDymQhlExH6oyNIVzxLDhTdQrEu567QmRguIsJ/nnCd2UsMxphe88NYAtcPsRGtLDeq/T3dVO6TuUp+BCTClIIHMU/hGAAAAEAbmxZQ81NFZAcpYHJgCctxeeWdKanlK92JoqX58ui0wAoaSb1DtpHMCdBQE/UGulz29zLC8A4Mgk/nq/rmqlMI
WhitelistResponse:
description: 'Successfull request'
type: object
properties:
tx_envelope:
type: string
example: AAAAACQpNXQ4NCGx5OeZCkDJTzqAdXYY4qedTmyUwcE2c02wAAAAAAANfdwAAAADAAAAAAAAAAEAAAAcMS1sNjhiLVQwQzJuUUZwOU1VeE5tRDc3RE5wcQAAAAEAAAAAAAAAAQAAAADSTsz/bFP7AezxTQVxZrzaHXErPrT49yakAlKWKxMSEQAAAAAAAAAAAJiWgAAAAAAAAAACNnNNsAAAAEDymQhlExH6oyNIVzxLDhTdQrEu567QmRguIsJ/nnCd2UsMxphe88NYAtcPsRGtLDeq/T3dVO6TuUp+BCTClIIHMU/hGAAAAEAbmxZQ81NFZAcpYHJgCctxeeWdKanlK92JoqX58ui0wAoaSb1DtpHMCdBQE/UGulz29zLC8A4Mgk/nq/rmqlMI
StatusResponse:
description: 'Successfull request'
type: object
properties:
service_version:
type: string
example: "1.4.2"
horizon:
type: string
example: "http://horizon.kinfederation.com"
app_id:
type: string
example: "rc43"
public_address:
type: string
example: "GA5VKONC2ABAHER37Q6WZ7JLBEQ2RENLU2GVP2K2E2HAJT2T6CNPZ7QX"
balance:
type: number
example: 179875
channels:
type: object
properties:
free_channels:
type: number
example: 17
non_free_channels:
type: number
example: 3
total_channels:
type: number
example: 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment