github.com/s7techlab/cckit@v0.10.5/examples/token/service/balance/balance.swagger.json (about)

     1  {
     2    "swagger": "2.0",
     3    "info": {
     4      "title": "token/service/balance/balance.proto",
     5      "version": "version not set"
     6    },
     7    "consumes": [
     8      "application/json"
     9    ],
    10    "produces": [
    11      "application/json"
    12    ],
    13    "paths": {
    14      "/token/balances": {
    15        "get": {
    16          "operationId": "BalanceService_ListBalances",
    17          "responses": {
    18            "200": {
    19              "description": "A successful response.",
    20              "schema": {
    21                "$ref": "#/definitions/balanceBalances"
    22              }
    23            },
    24            "default": {
    25              "description": "An unexpected error response.",
    26              "schema": {
    27                "$ref": "#/definitions/runtimeError"
    28              }
    29            }
    30          },
    31          "tags": [
    32            "BalanceService"
    33          ]
    34        }
    35      },
    36      "/token/balances/{address}": {
    37        "get": {
    38          "operationId": "BalanceService_ListAddressBalances",
    39          "responses": {
    40            "200": {
    41              "description": "A successful response.",
    42              "schema": {
    43                "$ref": "#/definitions/balanceBalances"
    44              }
    45            },
    46            "default": {
    47              "description": "An unexpected error response.",
    48              "schema": {
    49                "$ref": "#/definitions/runtimeError"
    50              }
    51            }
    52          },
    53          "parameters": [
    54            {
    55              "name": "address",
    56              "in": "path",
    57              "required": true,
    58              "type": "string"
    59            }
    60          ],
    61          "tags": [
    62            "BalanceService"
    63          ]
    64        }
    65      },
    66      "/token/balances/{address}/{token}": {
    67        "get": {
    68          "summary": "Returns the amount of tokens owned by account.",
    69          "operationId": "BalanceService_GetBalance",
    70          "responses": {
    71            "200": {
    72              "description": "A successful response.",
    73              "schema": {
    74                "$ref": "#/definitions/balanceBalance"
    75              }
    76            },
    77            "default": {
    78              "description": "An unexpected error response.",
    79              "schema": {
    80                "$ref": "#/definitions/runtimeError"
    81              }
    82            }
    83          },
    84          "parameters": [
    85            {
    86              "name": "address",
    87              "in": "path",
    88              "required": true,
    89              "type": "string"
    90            },
    91            {
    92              "name": "token",
    93              "in": "path",
    94              "required": true,
    95              "type": "array",
    96              "items": {
    97                "type": "string"
    98              },
    99              "collectionFormat": "csv",
   100              "minItems": 1
   101            }
   102          ],
   103          "tags": [
   104            "BalanceService"
   105          ]
   106        }
   107      },
   108      "/token/transfer": {
   109        "post": {
   110          "summary": "Moves amount tokens from the caller’s account to recipient.\nReturns transfer details",
   111          "operationId": "BalanceService_Transfer",
   112          "responses": {
   113            "200": {
   114              "description": "A successful response.",
   115              "schema": {
   116                "$ref": "#/definitions/balanceTransferResponse"
   117              }
   118            },
   119            "default": {
   120              "description": "An unexpected error response.",
   121              "schema": {
   122                "$ref": "#/definitions/runtimeError"
   123              }
   124            }
   125          },
   126          "parameters": [
   127            {
   128              "name": "body",
   129              "in": "body",
   130              "required": true,
   131              "schema": {
   132                "$ref": "#/definitions/balanceTransferRequest"
   133              }
   134            }
   135          ],
   136          "tags": [
   137            "BalanceService"
   138          ]
   139        }
   140      }
   141    },
   142    "definitions": {
   143      "balanceAddMetaRequest": {
   144        "type": "object",
   145        "properties": {
   146          "key": {
   147            "type": "string"
   148          },
   149          "value": {
   150            "type": "string"
   151          }
   152        }
   153      },
   154      "balanceBalance": {
   155        "type": "object",
   156        "properties": {
   157          "address": {
   158            "type": "string"
   159          },
   160          "token": {
   161            "type": "array",
   162            "items": {
   163              "type": "string"
   164            }
   165          },
   166          "amount": {
   167            "type": "string",
   168            "format": "uint64"
   169          }
   170        },
   171        "title": "Balance"
   172      },
   173      "balanceBalances": {
   174        "type": "object",
   175        "properties": {
   176          "items": {
   177            "type": "array",
   178            "items": {
   179              "$ref": "#/definitions/balanceBalance"
   180            }
   181          }
   182        },
   183        "title": "List"
   184      },
   185      "balanceMeta": {
   186        "type": "object",
   187        "properties": {
   188          "key": {
   189            "type": "string"
   190          },
   191          "value": {
   192            "type": "string"
   193          }
   194        }
   195      },
   196      "balanceTransferRequest": {
   197        "type": "object",
   198        "properties": {
   199          "recipient_address": {
   200            "type": "string"
   201          },
   202          "token": {
   203            "type": "array",
   204            "items": {
   205              "type": "string"
   206            }
   207          },
   208          "amount": {
   209            "type": "string",
   210            "format": "uint64"
   211          },
   212          "meta": {
   213            "type": "array",
   214            "items": {
   215              "$ref": "#/definitions/balanceAddMetaRequest"
   216            }
   217          }
   218        }
   219      },
   220      "balanceTransferResponse": {
   221        "type": "object",
   222        "properties": {
   223          "sender_address": {
   224            "type": "string"
   225          },
   226          "recipient_address": {
   227            "type": "string"
   228          },
   229          "token": {
   230            "type": "array",
   231            "items": {
   232              "type": "string"
   233            }
   234          },
   235          "amount": {
   236            "type": "string",
   237            "format": "uint64"
   238          },
   239          "meta": {
   240            "type": "array",
   241            "items": {
   242              "$ref": "#/definitions/balanceMeta"
   243            }
   244          }
   245        }
   246      },
   247      "protobufAny": {
   248        "type": "object",
   249        "properties": {
   250          "type_url": {
   251            "type": "string"
   252          },
   253          "value": {
   254            "type": "string",
   255            "format": "byte"
   256          }
   257        }
   258      },
   259      "runtimeError": {
   260        "type": "object",
   261        "properties": {
   262          "error": {
   263            "type": "string"
   264          },
   265          "code": {
   266            "type": "integer",
   267            "format": "int32"
   268          },
   269          "message": {
   270            "type": "string"
   271          },
   272          "details": {
   273            "type": "array",
   274            "items": {
   275              "$ref": "#/definitions/protobufAny"
   276            }
   277          }
   278        }
   279      }
   280    }
   281  }