github.com/s7techlab/cckit@v0.10.5/examples/erc20_service/erc20.swagger.json (about)

     1  {
     2    "swagger": "2.0",
     3    "info": {
     4      "title": "erc20_service/erc20.proto",
     5      "version": "version not set"
     6    },
     7    "consumes": [
     8      "application/json"
     9    ],
    10    "produces": [
    11      "application/json"
    12    ],
    13    "paths": {
    14      "/allowance/{sender_address}/{recipient_address}": {
    15        "get": {
    16          "summary": "Returns the remaining number of tokens that spender will be allowed to spend on behalf of owner through transfersender.\nThis is zero by default.",
    17          "operationId": "ERC20_Allowance",
    18          "responses": {
    19            "200": {
    20              "description": "A successful response.",
    21              "schema": {
    22                "$ref": "#/definitions/erc20_serviceAllowanceResponse"
    23              }
    24            },
    25            "default": {
    26              "description": "An unexpected error response.",
    27              "schema": {
    28                "$ref": "#/definitions/runtimeError"
    29              }
    30            }
    31          },
    32          "parameters": [
    33            {
    34              "name": "sender_address",
    35              "in": "path",
    36              "required": true,
    37              "type": "string"
    38            },
    39            {
    40              "name": "recipient_address",
    41              "in": "path",
    42              "required": true,
    43              "type": "string"
    44            }
    45          ],
    46          "tags": [
    47            "ERC20"
    48          ]
    49        }
    50      },
    51      "/approve": {
    52        "post": {
    53          "summary": "Sets amount as the allowance of spender over the caller’s tokens.\nEmits an ApprovalEvent",
    54          "operationId": "ERC20_Approve",
    55          "responses": {
    56            "200": {
    57              "description": "A successful response.",
    58              "schema": {
    59                "$ref": "#/definitions/erc20_serviceApproveResponse"
    60              }
    61            },
    62            "default": {
    63              "description": "An unexpected error response.",
    64              "schema": {
    65                "$ref": "#/definitions/runtimeError"
    66              }
    67            }
    68          },
    69          "tags": [
    70            "ERC20"
    71          ]
    72        }
    73      },
    74      "/balance/{address}": {
    75        "get": {
    76          "summary": "Returns the amount of tokens owned by account.",
    77          "operationId": "ERC20_BalanceOf",
    78          "responses": {
    79            "200": {
    80              "description": "A successful response.",
    81              "schema": {
    82                "$ref": "#/definitions/erc20_serviceBalanceOfResponse"
    83              }
    84            },
    85            "default": {
    86              "description": "An unexpected error response.",
    87              "schema": {
    88                "$ref": "#/definitions/runtimeError"
    89              }
    90            }
    91          },
    92          "parameters": [
    93            {
    94              "name": "address",
    95              "in": "path",
    96              "required": true,
    97              "type": "string"
    98            }
    99          ],
   100          "tags": [
   101            "ERC20"
   102          ]
   103        }
   104      },
   105      "/decimals": {
   106        "get": {
   107          "summary": "Returns the number of decimals used to get its user representation.\nFor example, if decimals equals 2, a balance of 505 tokens should be displayed to a user as 5,05 (505 / 10 ** 2).",
   108          "operationId": "ERC20_Decimals",
   109          "responses": {
   110            "200": {
   111              "description": "A successful response.",
   112              "schema": {
   113                "$ref": "#/definitions/erc20_serviceDecimalsResponse"
   114              }
   115            },
   116            "default": {
   117              "description": "An unexpected error response.",
   118              "schema": {
   119                "$ref": "#/definitions/runtimeError"
   120              }
   121            }
   122          },
   123          "tags": [
   124            "ERC20"
   125          ]
   126        }
   127      },
   128      "/name": {
   129        "get": {
   130          "summary": "Returns the name of the token.",
   131          "operationId": "ERC20_Name",
   132          "responses": {
   133            "200": {
   134              "description": "A successful response.",
   135              "schema": {
   136                "$ref": "#/definitions/erc20_serviceNameResponse"
   137              }
   138            },
   139            "default": {
   140              "description": "An unexpected error response.",
   141              "schema": {
   142                "$ref": "#/definitions/runtimeError"
   143              }
   144            }
   145          },
   146          "tags": [
   147            "ERC20"
   148          ]
   149        }
   150      },
   151      "/symbol": {
   152        "get": {
   153          "summary": "Returns the symbol of the token, usually a shorter version of the name.",
   154          "operationId": "ERC20_Symbol",
   155          "responses": {
   156            "200": {
   157              "description": "A successful response.",
   158              "schema": {
   159                "$ref": "#/definitions/erc20_serviceSymbolResponse"
   160              }
   161            },
   162            "default": {
   163              "description": "An unexpected error response.",
   164              "schema": {
   165                "$ref": "#/definitions/runtimeError"
   166              }
   167            }
   168          },
   169          "tags": [
   170            "ERC20"
   171          ]
   172        }
   173      },
   174      "/total-supply": {
   175        "get": {
   176          "summary": "Returns the amount of tokens in existence.",
   177          "operationId": "ERC20_TotalSupply",
   178          "responses": {
   179            "200": {
   180              "description": "A successful response.",
   181              "schema": {
   182                "$ref": "#/definitions/erc20_serviceTotalSupplyResponse"
   183              }
   184            },
   185            "default": {
   186              "description": "An unexpected error response.",
   187              "schema": {
   188                "$ref": "#/definitions/runtimeError"
   189              }
   190            }
   191          },
   192          "tags": [
   193            "ERC20"
   194          ]
   195        }
   196      },
   197      "/transfer": {
   198        "post": {
   199          "summary": "Moves amount tokens from the caller’s account to recipient.\nReturns a boolean value indicating whether the operation succeeded.",
   200          "operationId": "ERC20_Transfer",
   201          "responses": {
   202            "200": {
   203              "description": "A successful response.",
   204              "schema": {
   205                "$ref": "#/definitions/erc20_serviceTransferResponse"
   206              }
   207            },
   208            "default": {
   209              "description": "An unexpected error response.",
   210              "schema": {
   211                "$ref": "#/definitions/runtimeError"
   212              }
   213            }
   214          },
   215          "tags": [
   216            "ERC20"
   217          ]
   218        }
   219      },
   220      "/transfer-from": {
   221        "post": {
   222          "summary": "Moves amount tokens from sender to recipient using the allowance mechanism.\nAmount is then deducted from the caller’s allowance.\nEmits TransferEvent",
   223          "operationId": "ERC20_TransferFrom",
   224          "responses": {
   225            "200": {
   226              "description": "A successful response.",
   227              "schema": {
   228                "$ref": "#/definitions/erc20_serviceTransferResponse"
   229              }
   230            },
   231            "default": {
   232              "description": "An unexpected error response.",
   233              "schema": {
   234                "$ref": "#/definitions/runtimeError"
   235              }
   236            }
   237          },
   238          "tags": [
   239            "ERC20"
   240          ]
   241        }
   242      }
   243    },
   244    "definitions": {
   245      "erc20_serviceAllowanceResponse": {
   246        "type": "object",
   247        "properties": {
   248          "sender_address": {
   249            "type": "string"
   250          },
   251          "recipient_address": {
   252            "type": "string"
   253          },
   254          "amount": {
   255            "type": "string",
   256            "format": "uint64"
   257          }
   258        }
   259      },
   260      "erc20_serviceApproveResponse": {
   261        "type": "object",
   262        "properties": {
   263          "sender_address": {
   264            "type": "string"
   265          },
   266          "recipient_address": {
   267            "type": "string"
   268          },
   269          "amount": {
   270            "type": "string",
   271            "format": "uint64"
   272          }
   273        }
   274      },
   275      "erc20_serviceBalanceOfResponse": {
   276        "type": "object",
   277        "properties": {
   278          "address": {
   279            "type": "string"
   280          },
   281          "balance": {
   282            "type": "string",
   283            "format": "uint64"
   284          }
   285        }
   286      },
   287      "erc20_serviceDecimalsResponse": {
   288        "type": "object",
   289        "properties": {
   290          "decimals": {
   291            "type": "integer",
   292            "format": "int64"
   293          }
   294        }
   295      },
   296      "erc20_serviceNameResponse": {
   297        "type": "object",
   298        "properties": {
   299          "name": {
   300            "type": "string"
   301          }
   302        }
   303      },
   304      "erc20_serviceSymbolResponse": {
   305        "type": "object",
   306        "properties": {
   307          "symbol": {
   308            "type": "string"
   309          }
   310        }
   311      },
   312      "erc20_serviceTotalSupplyResponse": {
   313        "type": "object",
   314        "properties": {
   315          "total_supply": {
   316            "type": "string",
   317            "format": "uint64"
   318          }
   319        }
   320      },
   321      "erc20_serviceTransferResponse": {
   322        "type": "object",
   323        "properties": {
   324          "sender_address": {
   325            "type": "string"
   326          },
   327          "recipient_address": {
   328            "type": "string"
   329          },
   330          "amount": {
   331            "type": "string",
   332            "format": "uint64"
   333          }
   334        }
   335      },
   336      "protobufAny": {
   337        "type": "object",
   338        "properties": {
   339          "type_url": {
   340            "type": "string"
   341          },
   342          "value": {
   343            "type": "string",
   344            "format": "byte"
   345          }
   346        }
   347      },
   348      "runtimeError": {
   349        "type": "object",
   350        "properties": {
   351          "error": {
   352            "type": "string"
   353          },
   354          "code": {
   355            "type": "integer",
   356            "format": "int32"
   357          },
   358          "message": {
   359            "type": "string"
   360          },
   361          "details": {
   362            "type": "array",
   363            "items": {
   364              "$ref": "#/definitions/protobufAny"
   365            }
   366          }
   367        }
   368      }
   369    }
   370  }