Created
April 1, 2019 08:47
-
-
Save Ronserruya/707da06bedc938aec1f6eaa81aa0bba8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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/{address}: | |
| get: | |
| tags: | |
| - "Endpoints:" | |
| summary: "Get the KIN balance of an account" | |
| operationId: "getBalance" | |
| produces: | |
| - "application/json" | |
| parameters: | |
| - in: path | |
| name: address | |
| required: true | |
| type: string | |
| description: The public address of the account to query | |
| responses: | |
| 200: | |
| $ref: '#/definitions/BalanceResponse' | |
| /payment/{tx_hash}: | |
| get: | |
| tags: | |
| - "Endpoints:" | |
| summary: "Get info about a kin payment" | |
| operationId: "getPayment" | |
| produces: | |
| - "application/json" | |
| parameters: | |
| - in: path | |
| name: tx_hash | |
| required: true | |
| type: string | |
| description: The hash of the payment transaction | |
| responses: | |
| 200: | |
| $ref: '#/definitions/PaymentInfoResponse' | |
| /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 | |
| BalanceResponse: | |
| description: 'Successfull request' | |
| type: object | |
| properties: | |
| balance: | |
| type: number | |
| example: 154.5 | |
| PaymentInfoResponse: | |
| description: 'Successfull request' | |
| type: object | |
| properties: | |
| source: | |
| type: string | |
| example: "GDG57ST5LAJNFKSZHSSX7ME3ET6JTZQHDQF5LX7OM2GJNRSE2VJ2OSKB" | |
| destination: | |
| type: string | |
| example: "GA3YVWB2N3RJCDNAGRD6WC6QIDYC5VP6KRBSG3EDL4UFQKMJBVMAET6Y" | |
| amount: | |
| type: number | |
| example: 15 | |
| timestamp: | |
| type: integer | |
| example: 1547545819 | |
| 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