Skip to content

Commit

Permalink
Added Custody API.yml which will automatically generate API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MazurakIhor committed Nov 16, 2023
1 parent a8c9edd commit 50b4fdd
Show file tree
Hide file tree
Showing 10 changed files with 588 additions and 44 deletions.
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
id: create-custody-transaction
title: "Create Custody Transaction"
description: "Create Custody Transaction"
description: "Custody Server creates custody transaction record in DB."
sidebar_label: "Create Custody Transaction"
hide_title: true
hide_table_of_contents: true
api: { "tags": [ "SEP-6", "SEP-24", "SEP-31" ], "description": "Custody Server creates custody transaction record in DB.\n", "operationId": "createCustodyTransaction", "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "id": { "description": "SEP transaction ID", "type": "string" }, "memo": { "description": "Memo value, that is used to identify inbound or outbound payments", "type": "string" }, "memoType": { "description": "Type of memo, that is used to identify inbound or outbound payments", "type": "string", "enum": [ "id", "hash", "text" ] }, "protocol": { "description": "Protocol of SEP transaction", "type": "string", "enum": [ "6", "24", "31" ] }, "fromAccount": { "description": "Source Stellar account", "type": "string" }, "toAccount": { "description": "Destination Stellar account", "type": "string" }, "amount": { "description": "Amount of the asset, that is sent/received", "type": "string" }, "amountFee": { "description": "Fee of SEP transaction", "type": "string" }, "asset": { "description": "Asset, that is sent/received", "type": "string" }, "kind": { "description": "Kind of the SEP transaction", "type": "string", "enum": [ "deposit", "withdrawal", "receive" ] } }, "title": "CreateCustodyTransactionRequest" } } } }, "responses": { "200": { "description": "Success.", "content": { "application/json": { "schema": { "type": "object", "properties": {}, "title": "CreateCustodyTransactionResponse" } } } }, "500": { "description": "Internal Server Error.", "content": { "application/json": { "schema": { "type": "object", "properties": { "error": { "type": "string" } }, "title": "Error" } } } } }, "method": "post", "path": "/transactions", "jsonRequestBodyExample": { "id": "123e4567-e89b-12d3-a456-426614174000", "memo": "12345", "memoType": "id", "protocol": "24", "fromAccount": "GA3X53JGZ5SLT733GNKH3CVV7RKCL4DXWCIZG2Y24HA24L6XNEHSQXT4", "toAccount": "GA3X53JGZ5SLT733GNKH3CVV7RKCL4DXWCIZG2Y24HA24L6XNEHSQXT4", "amount": "50", "amountAsset": "stellar:USDC:GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5", "kind": "deposit" }, "info": { "version": "2.0.0", "description": "The Custody Server API specification for the Stellar Anchor Platform project.\n\nThe Custody Server API defines requests made by the Platform to interact with custody services.\n", "title": "Custody Server API" }, "postman": { "name": "Create Custody Transaction", "description": { "content": "The Custody Server provides set of endpoints to interact with custody services.\n", "type": "text/plain" }, "url": { "path": [ "transactions" ], "host": [ "{{baseUrl}}" ], "query": [], "variable": [] }, "header": [ { "key": "Content-Type", "value": "application/json" }, { "key": "Accept", "value": "application/json" } ], "method": "POST", "body": { "mode": "raw", "raw": "\"\"", "options": { "raw": { "language": "json" } } } } }
sidebar_class_name: "put api-method"
info_path: api/anchor-platform/custody-server-api
api: {"description":"Custody Server creates custody transaction record in DB.","operationId":"createCustodyTransaction","tags":["Custody Transactions","SEP-6","SEP-24","SEP-31"],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"description":"SEP transaction ID.","type":"string"},"memo":{"description":"Memo value, that is used to identify inbound or outbound payments.","type":"string"},"memoType":{"description":"Type of memo, that is used to identify inbound or outbound payments.","type":"string","enum":["id","hash","text"]},"protocol":{"description":"Protocol of SEP transaction.","type":"string","enum":[6,24,31]},"fromAccount":{"description":"Source Stellar account.","type":"string"},"toAccount":{"description":"Destination Stellar account.","type":"string"},"amount":{"description":"Amount of the asset, that is sent/received.","type":"string"},"amountFee":{"description":"Fee of SEP transaction.","type":"string"},"asset":{"description":"Asset, that is sent/received.","type":"string"},"kind":{"description":"Kind of the SEP transaction.","type":"string","enum":["deposit","withdrawal","receive"]}}}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"type":"object","required":["error"],"properties":{"error":{"type":"string"}},"title":"CustodyError"}}}}},"method":"post","path":"/transactions","jsonRequestBodyExample":{"id":"string","memo":"string","memoType":"id","protocol":6,"fromAccount":"string","toAccount":"string","amount":"string","amountFee":"string","asset":"string","kind":"deposit"},"info":{"version":"2.0.0","description":"","title":"Custody Server API"},"postman":{"name":"Create Custody Transaction","description":{"content":"Custody Server creates custody transaction record in DB.","type":"text/plain"},"url":{"path":["transactions"],"host":["{{baseUrl}}"],"query":[],"variable":[]},"header":[{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}],"method":"POST","body":{"mode":"raw","raw":"\"\"","options":{"raw":{"language":"json"}}}}}
sidebar_class_name: "post api-method"
info_path: api/anchor-platform/custody-server/custody-server-api
custom_edit_url: null
---

import { SepBadge } from "@site/src/components/SepBadge";

<SepBadge tags={"SEP-6,SEP-24,SEP-31"}/>
<SepBadge tags={"Custody Transactions,SEP-6,SEP-24,SEP-31"}/>

import ApiTabs from "@theme/ApiTabs";
import MimeTabs from "@theme/MimeTabs";
Expand All @@ -26,14 +26,16 @@ import TabItem from "@theme/TabItem";

## Create Custody Transaction



Custody Server creates custody transaction record in DB.

<MimeTabs><TabItem label={"application/json"} value={"application/json-schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Request Body</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"SEP transaction ID.","type":"string"}}></SchemaItem> <SchemaItem collapsible={false} name={"memo"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Memo value, that is used to identify inbound or outbound payments.","type":"string"}}></SchemaItem> <SchemaItem collapsible={false} name={"memoType"} required={false} schemaName={"string"} qualifierMessage={"**Possible values:** [`id`, `hash`, `text`]"} schema={{"description":"Type of memo, that is used to identify inbound or outbound payments.","type":"string","enum":["id","hash","text"]}}></SchemaItem> <SchemaItem collapsible={false} name={"protocol"} required={false} schemaName={"string"} qualifierMessage={"**Possible values:** [`6`, `24`, `31`]"} schema={{"description":"Protocol of SEP transaction.","type":"string","enum":["6","24","31"]}}></SchemaItem> <SchemaItem collapsible={false} name={"fromAccount"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Source Stellar account.","type":"string"}}></SchemaItem> <SchemaItem collapsible={false} name={"toAccount"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Destination Stellar account.","type":"string"}}></SchemaItem> <SchemaItem collapsible={false} name={"amount"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Amount of the asset, that is sent/received.","type":"string"}}></SchemaItem> <SchemaItem collapsible={false} name={"amountFee"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Fee of SEP transaction.","type":"string"}}></SchemaItem> <SchemaItem collapsible={false} name={"asset"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Asset, that is sent/received.","type":"string"}}></SchemaItem> <SchemaItem collapsible={false} name={"kind"} required={false} schemaName={"string"} qualifierMessage={"**Possible values:** [`deposit`, `withdrawal`, `receive`]"} schema={{"description":"Kind of the SEP transaction.","type":"string","enum":["deposit","withdrawal","receive"]}}></SchemaItem></ul></details></TabItem></MimeTabs><div><ApiTabs><TabItem label={"200"} value={"200"}><div>
<MimeTabs><TabItem label={"application/json"} value={"application/json-schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Request Body</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"id"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"SEP transaction ID.","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"memo"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Memo value, that is used to identify inbound or outbound payments.","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"memoType"} required={false} schemaName={"string"} qualifierMessage={"**Possible values:** [`id`, `hash`, `text`]"} schema={{"description":"Type of memo, that is used to identify inbound or outbound payments.","type":"string","enum":["id","hash","text"]}}></SchemaItem><SchemaItem collapsible={false} name={"protocol"} required={false} schemaName={"string"} qualifierMessage={"**Possible values:** [`6`, `24`, `31`]"} schema={{"description":"Protocol of SEP transaction.","type":"string","enum":[6,24,31]}}></SchemaItem><SchemaItem collapsible={false} name={"fromAccount"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Source Stellar account.","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"toAccount"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Destination Stellar account.","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"amount"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Amount of the asset, that is sent/received.","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"amountFee"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Fee of SEP transaction.","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"asset"} required={false} schemaName={"string"} qualifierMessage={undefined} schema={{"description":"Asset, that is sent/received.","type":"string"}}></SchemaItem><SchemaItem collapsible={false} name={"kind"} required={false} schemaName={"string"} qualifierMessage={"**Possible values:** [`deposit`, `withdrawal`, `receive`]"} schema={{"description":"Kind of the SEP transaction.","type":"string","enum":["deposit","withdrawal","receive"]}}></SchemaItem></ul></details></TabItem></MimeTabs><div><ApiTabs><TabItem label={"200"} value={"200"}><div>

Success.
Success

</div><div><MimeTabs schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs><TabItem label={"Schema"} value={"Schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"500"} value={"500"}><div>
</div><div><MimeTabs schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs><TabItem label={"Schema"} value={"Schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><li><div><strong>object</strong></div></li></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem><TabItem label={"500"} value={"500"}><div>

Internal Server Error.
Internal Server Error

</div><div><MimeTabs schemaType={"response"}><TabItem label={"application/json"} value={"application/json"}><SchemaTabs><TabItem label={"Schema"} value={"Schema"}><details style={{}} data-collapsed={false} open={true}><summary style={{"textAlign":"left"}}><strong>Schema</strong></summary><div style={{"textAlign":"left","marginLeft":"1rem"}}></div><ul style={{"marginLeft":"1rem"}}><SchemaItem collapsible={false} name={"error"} required={true} schemaName={"string"} qualifierMessage={undefined} schema={{"type":"string"}}></SchemaItem></ul></details></TabItem><TabItem label={"Example (from schema)"} value={"Example (from schema)"}><ResponseSamples responseExample={"{\n \"error\": \"string\"\n}"} language={"json"}></ResponseSamples></TabItem></SchemaTabs></TabItem></MimeTabs></div></TabItem></ApiTabs></div>
Loading

0 comments on commit 50b4fdd

Please sign in to comment.