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

     1  {
     2    "swagger": "2.0",
     3    "info": {
     4      "title": "token/service/allowance/allowance.proto",
     5      "version": "version not set"
     6    },
     7    "consumes": [
     8      "application/json"
     9    ],
    10    "produces": [
    11      "application/json"
    12    ],
    13    "paths": {
    14      "/allowance/{owner_address}/{spender_address}/{token}": {
    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": "AllowanceService_GetAllowance",
    18          "responses": {
    19            "200": {
    20              "description": "A successful response.",
    21              "schema": {
    22                "$ref": "#/definitions/allowanceAllowance"
    23              }
    24            },
    25            "default": {
    26              "description": "An unexpected error response.",
    27              "schema": {
    28                "$ref": "#/definitions/runtimeError"
    29              }
    30            }
    31          },
    32          "parameters": [
    33            {
    34              "name": "owner_address",
    35              "in": "path",
    36              "required": true,
    37              "type": "string"
    38            },
    39            {
    40              "name": "spender_address",
    41              "in": "path",
    42              "required": true,
    43              "type": "string"
    44            },
    45            {
    46              "name": "token",
    47              "in": "path",
    48              "required": true,
    49              "type": "array",
    50              "items": {
    51                "type": "string"
    52              },
    53              "collectionFormat": "csv",
    54              "minItems": 1
    55            }
    56          ],
    57          "tags": [
    58            "AllowanceService"
    59          ]
    60        }
    61      },
    62      "/approve": {
    63        "post": {
    64          "summary": "Sets amount as the allowance of spender over the caller’s tokens.\nEmits an ApprovalEvent",
    65          "operationId": "AllowanceService_Approve",
    66          "responses": {
    67            "200": {
    68              "description": "A successful response.",
    69              "schema": {
    70                "$ref": "#/definitions/allowanceAllowance"
    71              }
    72            },
    73            "default": {
    74              "description": "An unexpected error response.",
    75              "schema": {
    76                "$ref": "#/definitions/runtimeError"
    77              }
    78            }
    79          },
    80          "tags": [
    81            "AllowanceService"
    82          ]
    83        }
    84      },
    85      "/transfer-from": {
    86        "post": {
    87          "summary": "Moves amount tokens from sender to recipient using the allowance mechanism.\nAmount is then deducted from the caller’s allowance.\nEmits TransferEvent",
    88          "operationId": "AllowanceService_TransferFrom",
    89          "responses": {
    90            "200": {
    91              "description": "A successful response.",
    92              "schema": {
    93                "$ref": "#/definitions/allowanceTransferFromResponse"
    94              }
    95            },
    96            "default": {
    97              "description": "An unexpected error response.",
    98              "schema": {
    99                "$ref": "#/definitions/runtimeError"
   100              }
   101            }
   102          },
   103          "tags": [
   104            "AllowanceService"
   105          ]
   106        }
   107      }
   108    },
   109    "definitions": {
   110      "allowanceAllowance": {
   111        "type": "object",
   112        "properties": {
   113          "owner_address": {
   114            "type": "string"
   115          },
   116          "spender_address": {
   117            "type": "string"
   118          },
   119          "token": {
   120            "type": "array",
   121            "items": {
   122              "type": "string"
   123            }
   124          },
   125          "amount": {
   126            "type": "string",
   127            "format": "uint64"
   128          }
   129        },
   130        "title": "Allowance"
   131      },
   132      "allowanceTransferFromResponse": {
   133        "type": "object",
   134        "properties": {
   135          "owner_address": {
   136            "type": "string"
   137          },
   138          "recipient_address": {
   139            "type": "string"
   140          },
   141          "token": {
   142            "type": "array",
   143            "items": {
   144              "type": "string"
   145            }
   146          },
   147          "amount": {
   148            "type": "string",
   149            "format": "uint64"
   150          }
   151        }
   152      },
   153      "protobufAny": {
   154        "type": "object",
   155        "properties": {
   156          "type_url": {
   157            "type": "string"
   158          },
   159          "value": {
   160            "type": "string",
   161            "format": "byte"
   162          }
   163        }
   164      },
   165      "runtimeError": {
   166        "type": "object",
   167        "properties": {
   168          "error": {
   169            "type": "string"
   170          },
   171          "code": {
   172            "type": "integer",
   173            "format": "int32"
   174          },
   175          "message": {
   176            "type": "string"
   177          },
   178          "details": {
   179            "type": "array",
   180            "items": {
   181              "$ref": "#/definitions/protobufAny"
   182            }
   183          }
   184        }
   185      }
   186    }
   187  }