github.com/decred/dcrlnd@v0.7.6/lnrpc/chainrpc/chainnotifier.swagger.json (about) 1 { 2 "swagger": "2.0", 3 "info": { 4 "title": "chainrpc/chainnotifier.proto", 5 "version": "version not set" 6 }, 7 "tags": [ 8 { 9 "name": "ChainNotifier" 10 } 11 ], 12 "consumes": [ 13 "application/json" 14 ], 15 "produces": [ 16 "application/json" 17 ], 18 "paths": { 19 "/v2/chainnotifier/register/blocks": { 20 "post": { 21 "summary": "RegisterBlockEpochNtfn is a synchronous response-streaming RPC that\nregisters an intent for a client to be notified of blocks in the chain. The\nstream will return a hash and height tuple of a block for each new/stale\nblock in the chain. It is the client's responsibility to determine whether\nthe tuple returned is for a new or stale block in the chain.", 22 "description": "A client can also request a historical backlog of blocks from a particular\npoint. This allows clients to be idempotent by ensuring that they do not\nmissing processing a single block within the chain.", 23 "operationId": "ChainNotifier_RegisterBlockEpochNtfn", 24 "responses": { 25 "200": { 26 "description": "A successful response.(streaming responses)", 27 "schema": { 28 "type": "object", 29 "properties": { 30 "result": { 31 "$ref": "#/definitions/chainrpcBlockEpoch" 32 }, 33 "error": { 34 "$ref": "#/definitions/rpcStatus" 35 } 36 }, 37 "title": "Stream result of chainrpcBlockEpoch" 38 } 39 }, 40 "default": { 41 "description": "An unexpected error response.", 42 "schema": { 43 "$ref": "#/definitions/rpcStatus" 44 } 45 } 46 }, 47 "parameters": [ 48 { 49 "name": "body", 50 "in": "body", 51 "required": true, 52 "schema": { 53 "$ref": "#/definitions/chainrpcBlockEpoch" 54 } 55 } 56 ], 57 "tags": [ 58 "ChainNotifier" 59 ] 60 } 61 }, 62 "/v2/chainnotifier/register/confirmations": { 63 "post": { 64 "summary": "RegisterConfirmationsNtfn is a synchronous response-streaming RPC that\nregisters an intent for a client to be notified once a confirmation request\nhas reached its required number of confirmations on-chain.", 65 "description": "A client can specify whether the confirmation request should be for a\nparticular transaction by its hash or for an output script by specifying a\nzero hash.", 66 "operationId": "ChainNotifier_RegisterConfirmationsNtfn", 67 "responses": { 68 "200": { 69 "description": "A successful response.(streaming responses)", 70 "schema": { 71 "type": "object", 72 "properties": { 73 "result": { 74 "$ref": "#/definitions/chainrpcConfEvent" 75 }, 76 "error": { 77 "$ref": "#/definitions/rpcStatus" 78 } 79 }, 80 "title": "Stream result of chainrpcConfEvent" 81 } 82 }, 83 "default": { 84 "description": "An unexpected error response.", 85 "schema": { 86 "$ref": "#/definitions/rpcStatus" 87 } 88 } 89 }, 90 "parameters": [ 91 { 92 "name": "body", 93 "in": "body", 94 "required": true, 95 "schema": { 96 "$ref": "#/definitions/chainrpcConfRequest" 97 } 98 } 99 ], 100 "tags": [ 101 "ChainNotifier" 102 ] 103 } 104 }, 105 "/v2/chainnotifier/register/spends": { 106 "post": { 107 "summary": "RegisterSpendNtfn is a synchronous response-streaming RPC that registers an\nintent for a client to be notification once a spend request has been spent\nby a transaction that has confirmed on-chain.", 108 "description": "A client can specify whether the spend request should be for a particular\noutpoint or for an output script by specifying a zero outpoint.", 109 "operationId": "ChainNotifier_RegisterSpendNtfn", 110 "responses": { 111 "200": { 112 "description": "A successful response.(streaming responses)", 113 "schema": { 114 "type": "object", 115 "properties": { 116 "result": { 117 "$ref": "#/definitions/chainrpcSpendEvent" 118 }, 119 "error": { 120 "$ref": "#/definitions/rpcStatus" 121 } 122 }, 123 "title": "Stream result of chainrpcSpendEvent" 124 } 125 }, 126 "default": { 127 "description": "An unexpected error response.", 128 "schema": { 129 "$ref": "#/definitions/rpcStatus" 130 } 131 } 132 }, 133 "parameters": [ 134 { 135 "name": "body", 136 "in": "body", 137 "required": true, 138 "schema": { 139 "$ref": "#/definitions/chainrpcSpendRequest" 140 } 141 } 142 ], 143 "tags": [ 144 "ChainNotifier" 145 ] 146 } 147 } 148 }, 149 "definitions": { 150 "chainrpcBlockEpoch": { 151 "type": "object", 152 "properties": { 153 "hash": { 154 "type": "string", 155 "format": "byte", 156 "description": "The hash of the block." 157 }, 158 "height": { 159 "type": "integer", 160 "format": "int64", 161 "description": "The height of the block." 162 } 163 } 164 }, 165 "chainrpcConfDetails": { 166 "type": "object", 167 "properties": { 168 "raw_tx": { 169 "type": "string", 170 "format": "byte", 171 "description": "The raw bytes of the confirmed transaction." 172 }, 173 "block_hash": { 174 "type": "string", 175 "format": "byte", 176 "description": "The hash of the block in which the confirmed transaction was included in." 177 }, 178 "block_height": { 179 "type": "integer", 180 "format": "int64", 181 "description": "The height of the block in which the confirmed transaction was included\nin." 182 }, 183 "tx_index": { 184 "type": "integer", 185 "format": "int64", 186 "description": "The index of the confirmed transaction within the transaction." 187 } 188 } 189 }, 190 "chainrpcConfEvent": { 191 "type": "object", 192 "properties": { 193 "conf": { 194 "$ref": "#/definitions/chainrpcConfDetails", 195 "description": "An event that includes the confirmation details of the request\n(txid/ouput script)." 196 }, 197 "reorg": { 198 "$ref": "#/definitions/chainrpcReorg", 199 "description": "An event send when the transaction of the request is reorged out of the\nchain." 200 } 201 } 202 }, 203 "chainrpcConfRequest": { 204 "type": "object", 205 "properties": { 206 "txid": { 207 "type": "string", 208 "format": "byte", 209 "description": "The transaction hash for which we should request a confirmation notification\nfor. If set to a hash of all zeros, then the confirmation notification will\nbe requested for the script instead." 210 }, 211 "script": { 212 "type": "string", 213 "format": "byte", 214 "description": "An output script within a transaction with the hash above which will be used\nby light clients to match block filters. If the transaction hash is set to a\nhash of all zeros, then a confirmation notification will be requested for\nthis script instead." 215 }, 216 "num_confs": { 217 "type": "integer", 218 "format": "int64", 219 "description": "The number of desired confirmations the transaction/output script should\nreach before dispatching a confirmation notification." 220 }, 221 "height_hint": { 222 "type": "integer", 223 "format": "int64", 224 "description": "The earliest height in the chain for which the transaction/output script\ncould have been included in a block. This should in most cases be set to the\nbroadcast height of the transaction/output script." 225 } 226 } 227 }, 228 "chainrpcOutpoint": { 229 "type": "object", 230 "properties": { 231 "hash": { 232 "type": "string", 233 "format": "byte", 234 "description": "The hash of the transaction." 235 }, 236 "index": { 237 "type": "integer", 238 "format": "int64", 239 "description": "The index of the output within the transaction." 240 } 241 } 242 }, 243 "chainrpcReorg": { 244 "type": "object" 245 }, 246 "chainrpcSpendDetails": { 247 "type": "object", 248 "properties": { 249 "spending_outpoint": { 250 "$ref": "#/definitions/chainrpcOutpoint", 251 "description": "The outpoint was that spent." 252 }, 253 "raw_spending_tx": { 254 "type": "string", 255 "format": "byte", 256 "description": "The raw bytes of the spending transaction." 257 }, 258 "spending_tx_hash": { 259 "type": "string", 260 "format": "byte", 261 "description": "The hash of the spending transaction." 262 }, 263 "spending_input_index": { 264 "type": "integer", 265 "format": "int64", 266 "description": "The input of the spending transaction that fulfilled the spend request." 267 }, 268 "spending_height": { 269 "type": "integer", 270 "format": "int64", 271 "description": "The height at which the spending transaction was included in a block." 272 } 273 } 274 }, 275 "chainrpcSpendEvent": { 276 "type": "object", 277 "properties": { 278 "spend": { 279 "$ref": "#/definitions/chainrpcSpendDetails", 280 "description": "An event that includes the details of the spending transaction of the\nrequest (outpoint/output script)." 281 }, 282 "reorg": { 283 "$ref": "#/definitions/chainrpcReorg", 284 "description": "An event sent when the spending transaction of the request was\nreorged out of the chain." 285 } 286 } 287 }, 288 "chainrpcSpendRequest": { 289 "type": "object", 290 "properties": { 291 "outpoint": { 292 "$ref": "#/definitions/chainrpcOutpoint", 293 "description": "The outpoint for which we should request a spend notification for. If set to\na zero outpoint, then the spend notification will be requested for the\nscript instead." 294 }, 295 "script": { 296 "type": "string", 297 "format": "byte", 298 "description": "The output script for the outpoint above. This will be used by light clients\nto match block filters. If the outpoint is set to a zero outpoint, then a\nspend notification will be requested for this script instead." 299 }, 300 "height_hint": { 301 "type": "integer", 302 "format": "int64", 303 "description": "The earliest height in the chain for which the outpoint/output script could\nhave been spent. This should in most cases be set to the broadcast height of\nthe outpoint/output script." 304 } 305 } 306 }, 307 "protobufAny": { 308 "type": "object", 309 "properties": { 310 "type_url": { 311 "type": "string" 312 }, 313 "value": { 314 "type": "string", 315 "format": "byte" 316 } 317 } 318 }, 319 "rpcStatus": { 320 "type": "object", 321 "properties": { 322 "code": { 323 "type": "integer", 324 "format": "int32" 325 }, 326 "message": { 327 "type": "string" 328 }, 329 "details": { 330 "type": "array", 331 "items": { 332 "$ref": "#/definitions/protobufAny" 333 } 334 } 335 } 336 } 337 } 338 }