diff --git a/lnrpc/autopilotrpc/autopilot.swagger.json b/lnrpc/autopilotrpc/autopilot.swagger.json new file mode 100644 index 00000000..78d291b9 --- /dev/null +++ b/lnrpc/autopilotrpc/autopilot.swagger.json @@ -0,0 +1,62 @@ +{ + "swagger": "2.0", + "info": { + "title": "autopilotrpc/autopilot.proto", + "version": "version not set" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "QueryScoresResponseHeuristicResult": { + "type": "object", + "properties": { + "heuristic": { + "type": "string" + }, + "scores": { + "type": "object", + "additionalProperties": { + "type": "number", + "format": "double" + } + } + } + }, + "autopilotrpcModifyStatusResponse": { + "type": "object" + }, + "autopilotrpcQueryScoresResponse": { + "type": "object", + "properties": { + "results": { + "type": "array", + "items": { + "$ref": "#/definitions/QueryScoresResponseHeuristicResult" + } + } + } + }, + "autopilotrpcSetScoresResponse": { + "type": "object" + }, + "autopilotrpcStatusResponse": { + "type": "object", + "properties": { + "active": { + "type": "boolean", + "format": "boolean", + "description": "Indicates whether the autopilot is active or not." + } + } + } + } +} diff --git a/lnrpc/chainrpc/chainnotifier.swagger.json b/lnrpc/chainrpc/chainnotifier.swagger.json new file mode 100644 index 00000000..7d101097 --- /dev/null +++ b/lnrpc/chainrpc/chainnotifier.swagger.json @@ -0,0 +1,208 @@ +{ + "swagger": "2.0", + "info": { + "title": "chainrpc/chainnotifier.proto", + "version": "version not set" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "chainrpcBlockEpoch": { + "type": "object", + "properties": { + "hash": { + "type": "string", + "format": "byte", + "description": "The hash of the block." + }, + "height": { + "type": "integer", + "format": "int64", + "description": "The height of the block." + } + } + }, + "chainrpcConfDetails": { + "type": "object", + "properties": { + "raw_tx": { + "type": "string", + "format": "byte", + "description": "The raw bytes of the confirmed transaction." + }, + "block_hash": { + "type": "string", + "format": "byte", + "description": "The hash of the block in which the confirmed transaction was included in." + }, + "block_height": { + "type": "integer", + "format": "int64", + "description": "The height of the block in which the confirmed transaction was included\nin." + }, + "tx_index": { + "type": "integer", + "format": "int64", + "description": "The index of the confirmed transaction within the transaction." + } + } + }, + "chainrpcConfEvent": { + "type": "object", + "properties": { + "conf": { + "$ref": "#/definitions/chainrpcConfDetails", + "description": "An event that includes the confirmation details of the request\n(txid/ouput script)." + }, + "reorg": { + "$ref": "#/definitions/chainrpcReorg", + "description": "An event send when the transaction of the request is reorged out of the\nchain." + } + } + }, + "chainrpcOutpoint": { + "type": "object", + "properties": { + "hash": { + "type": "string", + "format": "byte", + "description": "The hash of the transaction." + }, + "index": { + "type": "integer", + "format": "int64", + "description": "The index of the output within the transaction." + } + } + }, + "chainrpcReorg": { + "type": "object" + }, + "chainrpcSpendDetails": { + "type": "object", + "properties": { + "spending_outpoint": { + "$ref": "#/definitions/chainrpcOutpoint", + "description": "The outpoint was that spent." + }, + "raw_spending_tx": { + "type": "string", + "format": "byte", + "description": "The raw bytes of the spending transaction." + }, + "spending_tx_hash": { + "type": "string", + "format": "byte", + "description": "The hash of the spending transaction." + }, + "spending_input_index": { + "type": "integer", + "format": "int64", + "description": "The input of the spending transaction that fulfilled the spend request." + }, + "spending_height": { + "type": "integer", + "format": "int64", + "description": "The height at which the spending transaction was included in a block." + } + } + }, + "chainrpcSpendEvent": { + "type": "object", + "properties": { + "spend": { + "$ref": "#/definitions/chainrpcSpendDetails", + "description": "An event that includes the details of the spending transaction of the\nrequest (outpoint/output script)." + }, + "reorg": { + "$ref": "#/definitions/chainrpcReorg", + "description": "An event sent when the spending transaction of the request was\nreorged out of the chain." + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "type_url": { + "type": "string" + }, + "value": { + "type": "string", + "format": "byte" + } + } + }, + "runtimeStreamError": { + "type": "object", + "properties": { + "grpc_code": { + "type": "integer", + "format": "int32" + }, + "http_code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "http_status": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + } + }, + "x-stream-definitions": { + "chainrpcBlockEpoch": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/chainrpcBlockEpoch" + }, + "error": { + "$ref": "#/definitions/runtimeStreamError" + } + }, + "title": "Stream result of chainrpcBlockEpoch" + }, + "chainrpcConfEvent": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/chainrpcConfEvent" + }, + "error": { + "$ref": "#/definitions/runtimeStreamError" + } + }, + "title": "Stream result of chainrpcConfEvent" + }, + "chainrpcSpendEvent": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/chainrpcSpendEvent" + }, + "error": { + "$ref": "#/definitions/runtimeStreamError" + } + }, + "title": "Stream result of chainrpcSpendEvent" + } + } +} diff --git a/lnrpc/gen_protos.sh b/lnrpc/gen_protos.sh index 3157cf26..18d07b26 100755 --- a/lnrpc/gen_protos.sh +++ b/lnrpc/gen_protos.sh @@ -2,33 +2,29 @@ echo "Generating root gRPC server protos" -# Generate the protos. -protoc -I/usr/local/include -I. \ - -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ - --go_out=plugins=grpc,paths=source_relative:. \ - rpc.proto walletunlocker.proto - -# Generate the REST reverse proxy. -protoc -I/usr/local/include -I. \ - -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ - --grpc-gateway_out=logtostderr=true,paths=source_relative:. \ - rpc.proto walletunlocker.proto - -# Finally, generate the swagger file which describes the REST API in detail. -protoc -I/usr/local/include -I. \ - -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ - --swagger_out=logtostderr=true:. \ - rpc.proto walletunlocker.proto +PROTOS="rpc.proto walletunlocker.proto **/*.proto" # For each of the sub-servers, we then generate their protos, but a restricted # set as they don't yet require REST proxies, or swagger docs. -for file in **/*.proto -do - DIRECTORY=$(dirname ${file}) - echo "Generating protos from ${file}, into ${DIRECTORY}" +for file in $PROTOS; do + DIRECTORY=$(dirname "${file}") + echo "Generating protos from ${file}, into ${DIRECTORY}" - protoc -I/usr/local/include -I. \ - -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ - --go_out=plugins=grpc,paths=source_relative:. \ - ${file} + # Generate the protos. + protoc -I/usr/local/include -I. \ + -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ + --go_out=plugins=grpc,paths=source_relative:. \ + "${file}" + + # Generate the REST reverse proxy. + protoc -I/usr/local/include -I. \ + -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ + --grpc-gateway_out=logtostderr=true,paths=source_relative:. \ + "${file}" + + # Finally, generate the swagger file which describes the REST API in detail. + protoc -I/usr/local/include -I. \ + -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \ + --swagger_out=logtostderr=true:. \ + "${file}" done diff --git a/lnrpc/invoicesrpc/invoices.swagger.json b/lnrpc/invoicesrpc/invoices.swagger.json new file mode 100644 index 00000000..2c34a38f --- /dev/null +++ b/lnrpc/invoicesrpc/invoices.swagger.json @@ -0,0 +1,349 @@ +{ + "swagger": "2.0", + "info": { + "title": "invoicesrpc/invoices.proto", + "version": "version not set" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "InvoiceInvoiceState": { + "type": "string", + "enum": [ + "OPEN", + "SETTLED", + "CANCELED", + "ACCEPTED" + ], + "default": "OPEN" + }, + "invoicesrpcAddHoldInvoiceResp": { + "type": "object", + "properties": { + "payment_request": { + "type": "string", + "description": "A bare-bones invoice for a payment within the Lightning Network. With the\ndetails of the invoice, the sender has all the data necessary to send a\npayment to the recipient." + } + } + }, + "invoicesrpcCancelInvoiceResp": { + "type": "object" + }, + "invoicesrpcSettleInvoiceResp": { + "type": "object" + }, + "lnrpcFeature": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "is_required": { + "type": "boolean", + "format": "boolean" + }, + "is_known": { + "type": "boolean", + "format": "boolean" + } + } + }, + "lnrpcHopHint": { + "type": "object", + "properties": { + "node_id": { + "type": "string", + "description": "The public key of the node at the start of the channel." + }, + "chan_id": { + "type": "string", + "format": "uint64", + "description": "The unique identifier of the channel." + }, + "fee_base_msat": { + "type": "integer", + "format": "int64", + "description": "The base fee of the channel denominated in millisatoshis." + }, + "fee_proportional_millionths": { + "type": "integer", + "format": "int64", + "description": "The fee rate of the channel for sending one satoshi across it denominated in\nmillionths of a satoshi." + }, + "cltv_expiry_delta": { + "type": "integer", + "format": "int64", + "description": "The time-lock delta of the channel." + } + } + }, + "lnrpcInvoice": { + "type": "object", + "properties": { + "memo": { + "type": "string", + "description": "An optional memo to attach along with the invoice. Used for record keeping\npurposes for the invoice's creator, and will also be set in the description\nfield of the encoded payment request if the description_hash field is not\nbeing used." + }, + "r_preimage": { + "type": "string", + "format": "byte", + "description": "The hex-encoded preimage (32 byte) which will allow settling an incoming\nHTLC payable to this preimage. When using REST, this field must be encoded\nas base64." + }, + "r_hash": { + "type": "string", + "format": "byte", + "description": "The hash of the preimage. When using REST, this field must be encoded as\nbase64." + }, + "value": { + "type": "string", + "format": "int64", + "description": "The fields value and value_msat are mutually exclusive.", + "title": "The value of this invoice in satoshis" + }, + "value_msat": { + "type": "string", + "format": "int64", + "description": "The fields value and value_msat are mutually exclusive.", + "title": "The value of this invoice in millisatoshis" + }, + "settled": { + "type": "boolean", + "format": "boolean", + "title": "Whether this invoice has been fulfilled" + }, + "creation_date": { + "type": "string", + "format": "int64", + "title": "When this invoice was created" + }, + "settle_date": { + "type": "string", + "format": "int64", + "title": "When this invoice was settled" + }, + "payment_request": { + "type": "string", + "description": "A bare-bones invoice for a payment within the Lightning Network. With the\ndetails of the invoice, the sender has all the data necessary to send a\npayment to the recipient." + }, + "description_hash": { + "type": "string", + "format": "byte", + "description": "Hash (SHA-256) of a description of the payment. Used if the description of\npayment (memo) is too long to naturally fit within the description field\nof an encoded payment request. When using REST, this field must be encoded\nas base64." + }, + "expiry": { + "type": "string", + "format": "int64", + "description": "Payment request expiry time in seconds. Default is 3600 (1 hour)." + }, + "fallback_addr": { + "type": "string", + "description": "Fallback on-chain address." + }, + "cltv_expiry": { + "type": "string", + "format": "uint64", + "description": "Delta to use for the time-lock of the CLTV extended to the final hop." + }, + "route_hints": { + "type": "array", + "items": { + "$ref": "#/definitions/lnrpcRouteHint" + }, + "description": "Route hints that can each be individually used to assist in reaching the\ninvoice's destination." + }, + "private": { + "type": "boolean", + "format": "boolean", + "description": "Whether this invoice should include routing hints for private channels." + }, + "add_index": { + "type": "string", + "format": "uint64", + "description": "The \"add\" index of this invoice. Each newly created invoice will increment\nthis index making it monotonically increasing. Callers to the\nSubscribeInvoices call can use this to instantly get notified of all added\ninvoices with an add_index greater than this one." + }, + "settle_index": { + "type": "string", + "format": "uint64", + "description": "The \"settle\" index of this invoice. Each newly settled invoice will\nincrement this index making it monotonically increasing. Callers to the\nSubscribeInvoices call can use this to instantly get notified of all\nsettled invoices with an settle_index greater than this one." + }, + "amt_paid": { + "type": "string", + "format": "int64", + "description": "Deprecated, use amt_paid_sat or amt_paid_msat." + }, + "amt_paid_sat": { + "type": "string", + "format": "int64", + "description": "The amount that was accepted for this invoice, in satoshis. This will ONLY\nbe set if this invoice has been settled. We provide this field as if the\ninvoice was created with a zero value, then we need to record what amount\nwas ultimately accepted. Additionally, it's possible that the sender paid\nMORE that was specified in the original invoice. So we'll record that here\nas well." + }, + "amt_paid_msat": { + "type": "string", + "format": "int64", + "description": "The amount that was accepted for this invoice, in millisatoshis. This will\nONLY be set if this invoice has been settled. We provide this field as if\nthe invoice was created with a zero value, then we need to record what\namount was ultimately accepted. Additionally, it's possible that the sender\npaid MORE that was specified in the original invoice. So we'll record that\nhere as well." + }, + "state": { + "$ref": "#/definitions/InvoiceInvoiceState", + "description": "The state the invoice is in." + }, + "htlcs": { + "type": "array", + "items": { + "$ref": "#/definitions/lnrpcInvoiceHTLC" + }, + "description": "List of HTLCs paying to this invoice [EXPERIMENTAL]." + }, + "features": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/lnrpcFeature" + }, + "description": "List of features advertised on the invoice." + }, + "is_keysend": { + "type": "boolean", + "format": "boolean", + "description": "Indicates if this invoice was a spontaneous payment that arrived via keysend\n[EXPERIMENTAL]." + } + } + }, + "lnrpcInvoiceHTLC": { + "type": "object", + "properties": { + "chan_id": { + "type": "string", + "format": "uint64", + "description": "Short channel id over which the htlc was received." + }, + "htlc_index": { + "type": "string", + "format": "uint64", + "description": "Index identifying the htlc on the channel." + }, + "amt_msat": { + "type": "string", + "format": "uint64", + "description": "The amount of the htlc in msat." + }, + "accept_height": { + "type": "integer", + "format": "int32", + "description": "Block height at which this htlc was accepted." + }, + "accept_time": { + "type": "string", + "format": "int64", + "description": "Time at which this htlc was accepted." + }, + "resolve_time": { + "type": "string", + "format": "int64", + "description": "Time at which this htlc was settled or canceled." + }, + "expiry_height": { + "type": "integer", + "format": "int32", + "description": "Block height at which this htlc expires." + }, + "state": { + "$ref": "#/definitions/lnrpcInvoiceHTLCState", + "description": "Current state the htlc is in." + }, + "custom_records": { + "type": "object", + "additionalProperties": { + "type": "string", + "format": "byte" + }, + "description": "Custom tlv records." + }, + "mpp_total_amt_msat": { + "type": "string", + "format": "uint64", + "description": "The total amount of the mpp payment in msat." + } + }, + "title": "Details of an HTLC that paid to an invoice" + }, + "lnrpcInvoiceHTLCState": { + "type": "string", + "enum": [ + "ACCEPTED", + "SETTLED", + "CANCELED" + ], + "default": "ACCEPTED" + }, + "lnrpcRouteHint": { + "type": "object", + "properties": { + "hop_hints": { + "type": "array", + "items": { + "$ref": "#/definitions/lnrpcHopHint" + }, + "description": "A list of hop hints that when chained together can assist in reaching a\nspecific destination." + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "type_url": { + "type": "string" + }, + "value": { + "type": "string", + "format": "byte" + } + } + }, + "runtimeStreamError": { + "type": "object", + "properties": { + "grpc_code": { + "type": "integer", + "format": "int32" + }, + "http_code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "http_status": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + } + }, + "x-stream-definitions": { + "lnrpcInvoice": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/lnrpcInvoice" + }, + "error": { + "$ref": "#/definitions/runtimeStreamError" + } + }, + "title": "Stream result of lnrpcInvoice" + } + } +} diff --git a/lnrpc/lnclipb/lncli.swagger.json b/lnrpc/lnclipb/lncli.swagger.json new file mode 100644 index 00000000..043d7bc5 --- /dev/null +++ b/lnrpc/lnclipb/lncli.swagger.json @@ -0,0 +1,19 @@ +{ + "swagger": "2.0", + "info": { + "title": "lnclipb/lncli.proto", + "version": "version not set" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": {} +} diff --git a/lnrpc/routerrpc/router.swagger.json b/lnrpc/routerrpc/router.swagger.json new file mode 100644 index 00000000..09c5a124 --- /dev/null +++ b/lnrpc/routerrpc/router.swagger.json @@ -0,0 +1,848 @@ +{ + "swagger": "2.0", + "info": { + "title": "routerrpc/router.proto", + "version": "version not set" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "FailureFailureCode": { + "type": "string", + "enum": [ + "RESERVED", + "INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS", + "INCORRECT_PAYMENT_AMOUNT", + "FINAL_INCORRECT_CLTV_EXPIRY", + "FINAL_INCORRECT_HTLC_AMOUNT", + "FINAL_EXPIRY_TOO_SOON", + "INVALID_REALM", + "EXPIRY_TOO_SOON", + "INVALID_ONION_VERSION", + "INVALID_ONION_HMAC", + "INVALID_ONION_KEY", + "AMOUNT_BELOW_MINIMUM", + "FEE_INSUFFICIENT", + "INCORRECT_CLTV_EXPIRY", + "CHANNEL_DISABLED", + "TEMPORARY_CHANNEL_FAILURE", + "REQUIRED_NODE_FEATURE_MISSING", + "REQUIRED_CHANNEL_FEATURE_MISSING", + "UNKNOWN_NEXT_PEER", + "TEMPORARY_NODE_FAILURE", + "PERMANENT_NODE_FAILURE", + "PERMANENT_CHANNEL_FAILURE", + "EXPIRY_TOO_FAR", + "MPP_TIMEOUT", + "INTERNAL_FAILURE", + "UNKNOWN_FAILURE", + "UNREADABLE_FAILURE" + ], + "default": "RESERVED", + "description": " - RESERVED: The numbers assigned in this enumeration match the failure codes as\ndefined in BOLT #4. Because protobuf 3 requires enums to start with 0,\na RESERVED value is added.\n - INTERNAL_FAILURE: An internal error occurred.\n - UNKNOWN_FAILURE: The error source is known, but the failure itself couldn't be decoded.\n - UNREADABLE_FAILURE: An unreadable failure result is returned if the received failure message\ncannot be decrypted. In that case the error source is unknown." + }, + "HTLCAttemptHTLCStatus": { + "type": "string", + "enum": [ + "IN_FLIGHT", + "SUCCEEDED", + "FAILED" + ], + "default": "IN_FLIGHT" + }, + "lnrpcChannelUpdate": { + "type": "object", + "properties": { + "signature": { + "type": "string", + "format": "byte", + "description": "The signature that validates the announced data and proves the ownership\nof node id." + }, + "chain_hash": { + "type": "string", + "format": "byte", + "description": "The target chain that this channel was opened within. This value\nshould be the genesis hash of the target chain. Along with the short\nchannel ID, this uniquely identifies the channel globally in a\nblockchain." + }, + "chan_id": { + "type": "string", + "format": "uint64", + "description": "The unique description of the funding transaction." + }, + "timestamp": { + "type": "integer", + "format": "int64", + "description": "A timestamp that allows ordering in the case of multiple announcements.\nWe should ignore the message if timestamp is not greater than the\nlast-received." + }, + "message_flags": { + "type": "integer", + "format": "int64", + "description": "The bitfield that describes whether optional fields are present in this\nupdate. Currently, the least-significant bit must be set to 1 if the\noptional field MaxHtlc is present." + }, + "channel_flags": { + "type": "integer", + "format": "int64", + "description": "The bitfield that describes additional meta-data concerning how the\nupdate is to be interpreted. Currently, the least-significant bit must be\nset to 0 if the creating node corresponds to the first node in the\npreviously sent channel announcement and 1 otherwise. If the second bit\nis set, then the channel is set to be disabled." + }, + "time_lock_delta": { + "type": "integer", + "format": "int64", + "description": "The minimum number of blocks this node requires to be added to the expiry\nof HTLCs. This is a security parameter determined by the node operator.\nThis value represents the required gap between the time locks of the\nincoming and outgoing HTLC's set to this node." + }, + "htlc_minimum_msat": { + "type": "string", + "format": "uint64", + "description": "The minimum HTLC value which will be accepted." + }, + "base_fee": { + "type": "integer", + "format": "int64", + "description": "The base fee that must be used for incoming HTLC's to this particular\nchannel. This value will be tacked onto the required for a payment\nindependent of the size of the payment." + }, + "fee_rate": { + "type": "integer", + "format": "int64", + "description": "The fee rate that will be charged per millionth of a satoshi." + }, + "htlc_maximum_msat": { + "type": "string", + "format": "uint64", + "description": "The maximum HTLC value which will be accepted." + }, + "extra_opaque_data": { + "type": "string", + "format": "byte", + "description": "The set of data that was appended to this message, some of which we may\nnot actually know how to iterate or parse. By holding onto this data, we\nensure that we're able to properly validate the set of signatures that\ncover these new fields, and ensure we're able to make upgrades to the\nnetwork in a forwards compatible manner." + } + } + }, + "lnrpcFailure": { + "type": "object", + "properties": { + "code": { + "$ref": "#/definitions/FailureFailureCode", + "title": "Failure code as defined in the Lightning spec" + }, + "channel_update": { + "$ref": "#/definitions/lnrpcChannelUpdate", + "description": "An optional channel update message." + }, + "htlc_msat": { + "type": "string", + "format": "uint64", + "description": "A failure type-dependent htlc value." + }, + "onion_sha_256": { + "type": "string", + "format": "byte", + "description": "The sha256 sum of the onion payload." + }, + "cltv_expiry": { + "type": "integer", + "format": "int64", + "description": "A failure type-dependent cltv expiry value." + }, + "flags": { + "type": "integer", + "format": "int64", + "description": "A failure type-dependent flags value." + }, + "failure_source_index": { + "type": "integer", + "format": "int64", + "description": "The position in the path of the intermediate or final node that generated\nthe failure message. Position zero is the sender node." + }, + "height": { + "type": "integer", + "format": "int64", + "description": "A failure type-dependent block height." + } + } + }, + "lnrpcFeatureBit": { + "type": "string", + "enum": [ + "DATALOSS_PROTECT_REQ", + "DATALOSS_PROTECT_OPT", + "INITIAL_ROUING_SYNC", + "UPFRONT_SHUTDOWN_SCRIPT_REQ", + "UPFRONT_SHUTDOWN_SCRIPT_OPT", + "GOSSIP_QUERIES_REQ", + "GOSSIP_QUERIES_OPT", + "TLV_ONION_REQ", + "TLV_ONION_OPT", + "EXT_GOSSIP_QUERIES_REQ", + "EXT_GOSSIP_QUERIES_OPT", + "STATIC_REMOTE_KEY_REQ", + "STATIC_REMOTE_KEY_OPT", + "PAYMENT_ADDR_REQ", + "PAYMENT_ADDR_OPT", + "MPP_REQ", + "MPP_OPT" + ], + "default": "DATALOSS_PROTECT_REQ" + }, + "lnrpcHTLCAttempt": { + "type": "object", + "properties": { + "status": { + "$ref": "#/definitions/HTLCAttemptHTLCStatus", + "description": "The status of the HTLC." + }, + "route": { + "$ref": "#/definitions/lnrpcRoute", + "description": "The route taken by this HTLC." + }, + "attempt_time_ns": { + "type": "string", + "format": "int64", + "description": "The time in UNIX nanoseconds at which this HTLC was sent." + }, + "resolve_time_ns": { + "type": "string", + "format": "int64", + "description": "The time in UNIX nanoseconds at which this HTLC was settled or failed.\nThis value will not be set if the HTLC is still IN_FLIGHT." + }, + "failure": { + "$ref": "#/definitions/lnrpcFailure", + "description": "Detailed htlc failure info." + } + } + }, + "lnrpcHop": { + "type": "object", + "properties": { + "chan_id": { + "type": "string", + "format": "uint64", + "description": "The unique channel ID for the channel. The first 3 bytes are the block\nheight, the next 3 the index within the block, and the last 2 bytes are the\noutput index for the channel." + }, + "chan_capacity": { + "type": "string", + "format": "int64" + }, + "amt_to_forward": { + "type": "string", + "format": "int64" + }, + "fee": { + "type": "string", + "format": "int64" + }, + "expiry": { + "type": "integer", + "format": "int64" + }, + "amt_to_forward_msat": { + "type": "string", + "format": "int64" + }, + "fee_msat": { + "type": "string", + "format": "int64" + }, + "pub_key": { + "type": "string", + "description": "An optional public key of the hop. If the public key is given, the payment\ncan be executed without relying on a copy of the channel graph." + }, + "tlv_payload": { + "type": "boolean", + "format": "boolean", + "description": "If set to true, then this hop will be encoded using the new variable length\nTLV format. Note that if any custom tlv_records below are specified, then\nthis field MUST be set to true for them to be encoded properly." + }, + "mpp_record": { + "$ref": "#/definitions/lnrpcMPPRecord", + "description": "An optional TLV record that signals the use of an MPP payment. If present,\nthe receiver will enforce that that the same mpp_record is included in the\nfinal hop payload of all non-zero payments in the HTLC set. If empty, a\nregular single-shot payment is or was attempted." + }, + "custom_records": { + "type": "object", + "additionalProperties": { + "type": "string", + "format": "byte" + }, + "description": "An optional set of key-value TLV records. This is useful within the context\nof the SendToRoute call as it allows callers to specify arbitrary K-V pairs\nto drop off at each hop within the onion." + } + } + }, + "lnrpcHopHint": { + "type": "object", + "properties": { + "node_id": { + "type": "string", + "description": "The public key of the node at the start of the channel." + }, + "chan_id": { + "type": "string", + "format": "uint64", + "description": "The unique identifier of the channel." + }, + "fee_base_msat": { + "type": "integer", + "format": "int64", + "description": "The base fee of the channel denominated in millisatoshis." + }, + "fee_proportional_millionths": { + "type": "integer", + "format": "int64", + "description": "The fee rate of the channel for sending one satoshi across it denominated in\nmillionths of a satoshi." + }, + "cltv_expiry_delta": { + "type": "integer", + "format": "int64", + "description": "The time-lock delta of the channel." + } + } + }, + "lnrpcMPPRecord": { + "type": "object", + "properties": { + "payment_addr": { + "type": "string", + "format": "byte", + "description": "A unique, random identifier used to authenticate the sender as the intended\npayer of a multi-path payment. The payment_addr must be the same for all\nsubpayments, and match the payment_addr provided in the receiver's invoice.\nThe same payment_addr must be used on all subpayments." + }, + "total_amt_msat": { + "type": "string", + "format": "int64", + "description": "The total amount in milli-satoshis being sent as part of a larger multi-path\npayment. The caller is responsible for ensuring subpayments to the same node\nand payment_hash sum exactly to total_amt_msat. The same\ntotal_amt_msat must be used on all subpayments." + } + } + }, + "lnrpcPayment": { + "type": "object", + "properties": { + "payment_hash": { + "type": "string", + "title": "The payment hash" + }, + "value": { + "type": "string", + "format": "int64", + "description": "Deprecated, use value_sat or value_msat." + }, + "creation_date": { + "type": "string", + "format": "int64", + "title": "Deprecated, use creation_time_ns" + }, + "fee": { + "type": "string", + "format": "int64", + "description": "Deprecated, use fee_sat or fee_msat." + }, + "payment_preimage": { + "type": "string", + "title": "The payment preimage" + }, + "value_sat": { + "type": "string", + "format": "int64", + "title": "The value of the payment in satoshis" + }, + "value_msat": { + "type": "string", + "format": "int64", + "title": "The value of the payment in milli-satoshis" + }, + "payment_request": { + "type": "string", + "description": "The optional payment request being fulfilled." + }, + "status": { + "$ref": "#/definitions/lnrpcPaymentPaymentStatus", + "description": "The status of the payment." + }, + "fee_sat": { + "type": "string", + "format": "int64", + "title": "The fee paid for this payment in satoshis" + }, + "fee_msat": { + "type": "string", + "format": "int64", + "title": "The fee paid for this payment in milli-satoshis" + }, + "creation_time_ns": { + "type": "string", + "format": "int64", + "description": "The time in UNIX nanoseconds at which the payment was created." + }, + "htlcs": { + "type": "array", + "items": { + "$ref": "#/definitions/lnrpcHTLCAttempt" + }, + "description": "The HTLCs made in attempt to settle the payment." + }, + "payment_index": { + "type": "string", + "format": "uint64", + "description": "The creation index of this payment. Each payment can be uniquely identified\nby this index, which may not strictly increment by 1 for payments made in\nolder versions of lnd." + }, + "failure_reason": { + "$ref": "#/definitions/lnrpcPaymentFailureReason" + } + } + }, + "lnrpcPaymentFailureReason": { + "type": "string", + "enum": [ + "FAILURE_REASON_NONE", + "FAILURE_REASON_TIMEOUT", + "FAILURE_REASON_NO_ROUTE", + "FAILURE_REASON_ERROR", + "FAILURE_REASON_INCORRECT_PAYMENT_DETAILS", + "FAILURE_REASON_INSUFFICIENT_BALANCE" + ], + "default": "FAILURE_REASON_NONE", + "description": " - FAILURE_REASON_NONE: Payment isn't failed (yet).\n - FAILURE_REASON_TIMEOUT: There are more routes to try, but the payment timeout was exceeded.\n - FAILURE_REASON_NO_ROUTE: All possible routes were tried and failed permanently. Or were no\nroutes to the destination at all.\n - FAILURE_REASON_ERROR: A non-recoverable error has occured.\n - FAILURE_REASON_INCORRECT_PAYMENT_DETAILS: Payment details incorrect (unknown hash, invalid amt or\ninvalid final cltv delta)\n - FAILURE_REASON_INSUFFICIENT_BALANCE: Insufficient local balance." + }, + "lnrpcPaymentPaymentStatus": { + "type": "string", + "enum": [ + "UNKNOWN", + "IN_FLIGHT", + "SUCCEEDED", + "FAILED" + ], + "default": "UNKNOWN" + }, + "lnrpcRoute": { + "type": "object", + "properties": { + "total_time_lock": { + "type": "integer", + "format": "int64", + "description": "The cumulative (final) time lock across the entire route. This is the CLTV\nvalue that should be extended to the first hop in the route. All other hops\nwill decrement the time-lock as advertised, leaving enough time for all\nhops to wait for or present the payment preimage to complete the payment." + }, + "total_fees": { + "type": "string", + "format": "int64", + "description": "The sum of the fees paid at each hop within the final route. In the case\nof a one-hop payment, this value will be zero as we don't need to pay a fee\nto ourselves." + }, + "total_amt": { + "type": "string", + "format": "int64", + "description": "The total amount of funds required to complete a payment over this route.\nThis value includes the cumulative fees at each hop. As a result, the HTLC\nextended to the first-hop in the route will need to have at least this many\nsatoshis, otherwise the route will fail at an intermediate node due to an\ninsufficient amount of fees." + }, + "hops": { + "type": "array", + "items": { + "$ref": "#/definitions/lnrpcHop" + }, + "description": "Contains details concerning the specific forwarding details at each hop." + }, + "total_fees_msat": { + "type": "string", + "format": "int64", + "description": "The total fees in millisatoshis." + }, + "total_amt_msat": { + "type": "string", + "format": "int64", + "description": "The total amount in millisatoshis." + } + }, + "description": "A path through the channel graph which runs over one or more channels in\nsuccession. This struct carries all the information required to craft the\nSphinx onion packet, and send the payment along the first hop in the path. A\nroute is only selected as valid if all the channels have sufficient capacity to\ncarry the initial payment amount after fees are accounted for." + }, + "lnrpcRouteHint": { + "type": "object", + "properties": { + "hop_hints": { + "type": "array", + "items": { + "$ref": "#/definitions/lnrpcHopHint" + }, + "description": "A list of hop hints that when chained together can assist in reaching a\nspecific destination." + } + } + }, + "protobufAny": { + "type": "object", + "properties": { + "type_url": { + "type": "string" + }, + "value": { + "type": "string", + "format": "byte" + } + } + }, + "routerrpcBuildRouteResponse": { + "type": "object", + "properties": { + "route": { + "$ref": "#/definitions/lnrpcRoute", + "description": "Fully specified route that can be used to execute the payment." + } + } + }, + "routerrpcFailureDetail": { + "type": "string", + "enum": [ + "UNKNOWN", + "NO_DETAIL", + "ONION_DECODE", + "LINK_NOT_ELIGIBLE", + "ON_CHAIN_TIMEOUT", + "HTLC_EXCEEDS_MAX", + "INSUFFICIENT_BALANCE", + "INCOMPLETE_FORWARD", + "HTLC_ADD_FAILED", + "FORWARDS_DISABLED", + "INVOICE_CANCELED", + "INVOICE_UNDERPAID", + "INVOICE_EXPIRY_TOO_SOON", + "INVOICE_NOT_OPEN", + "MPP_INVOICE_TIMEOUT", + "ADDRESS_MISMATCH", + "SET_TOTAL_MISMATCH", + "SET_TOTAL_TOO_LOW", + "SET_OVERPAID", + "UNKNOWN_INVOICE", + "INVALID_KEYSEND", + "MPP_IN_PROGRESS", + "CIRCULAR_ROUTE" + ], + "default": "UNKNOWN" + }, + "routerrpcForwardEvent": { + "type": "object", + "properties": { + "info": { + "$ref": "#/definitions/routerrpcHtlcInfo", + "description": "Info contains details about the htlc that was forwarded." + } + } + }, + "routerrpcForwardFailEvent": { + "type": "object" + }, + "routerrpcHtlcEvent": { + "type": "object", + "properties": { + "incoming_channel_id": { + "type": "string", + "format": "uint64", + "description": "The short channel id that the incoming htlc arrived at our node on. This\nvalue is zero for sends." + }, + "outgoing_channel_id": { + "type": "string", + "format": "uint64", + "description": "The short channel id that the outgoing htlc left our node on. This value\nis zero for receives." + }, + "incoming_htlc_id": { + "type": "string", + "format": "uint64", + "description": "Incoming id is the index of the incoming htlc in the incoming channel.\nThis value is zero for sends." + }, + "outgoing_htlc_id": { + "type": "string", + "format": "uint64", + "description": "Outgoing id is the index of the outgoing htlc in the outgoing channel.\nThis value is zero for receives." + }, + "timestamp_ns": { + "type": "string", + "format": "uint64", + "description": "The time in unix nanoseconds that the event occurred." + }, + "event_type": { + "$ref": "#/definitions/routerrpcHtlcEventEventType", + "description": "The event type indicates whether the htlc was part of a send, receive or\nforward." + }, + "forward_event": { + "$ref": "#/definitions/routerrpcForwardEvent" + }, + "forward_fail_event": { + "$ref": "#/definitions/routerrpcForwardFailEvent" + }, + "settle_event": { + "$ref": "#/definitions/routerrpcSettleEvent" + }, + "link_fail_event": { + "$ref": "#/definitions/routerrpcLinkFailEvent" + } + }, + "title": "HtlcEvent contains the htlc event that was processed. These are served on a\nbest-effort basis; events are not persisted, delivery is not guaranteed\n(in the event of a crash in the switch, forward events may be lost) and\nsome events may be replayed upon restart. Events consumed from this package\nshould be de-duplicated by the htlc's unique combination of incoming and\noutgoing channel id and htlc id. [EXPERIMENTAL]" + }, + "routerrpcHtlcEventEventType": { + "type": "string", + "enum": [ + "UNKNOWN", + "SEND", + "RECEIVE", + "FORWARD" + ], + "default": "UNKNOWN" + }, + "routerrpcHtlcInfo": { + "type": "object", + "properties": { + "incoming_timelock": { + "type": "integer", + "format": "int64", + "description": "The timelock on the incoming htlc." + }, + "outgoing_timelock": { + "type": "integer", + "format": "int64", + "description": "The timelock on the outgoing htlc." + }, + "incoming_amt_msat": { + "type": "string", + "format": "uint64", + "description": "The amount of the incoming htlc." + }, + "outgoing_amt_msat": { + "type": "string", + "format": "uint64", + "description": "The amount of the outgoing htlc." + } + } + }, + "routerrpcLinkFailEvent": { + "type": "object", + "properties": { + "info": { + "$ref": "#/definitions/routerrpcHtlcInfo", + "description": "Info contains details about the htlc that we failed." + }, + "wire_failure": { + "$ref": "#/definitions/FailureFailureCode", + "description": "FailureCode is the BOLT error code for the failure." + }, + "failure_detail": { + "$ref": "#/definitions/routerrpcFailureDetail", + "description": "FailureDetail provides additional information about the reason for the\nfailure. This detail enriches the information provided by the wire message\nand may be 'no detail' if the wire message requires no additional metadata." + }, + "failure_string": { + "type": "string", + "description": "A string representation of the link failure." + } + } + }, + "routerrpcPairData": { + "type": "object", + "properties": { + "fail_time": { + "type": "string", + "format": "int64", + "description": "Time of last failure." + }, + "fail_amt_sat": { + "type": "string", + "format": "int64", + "description": "Lowest amount that failed to forward rounded to whole sats. This may be\nset to zero if the failure is independent of amount." + }, + "fail_amt_msat": { + "type": "string", + "format": "int64", + "description": "Lowest amount that failed to forward in millisats. This may be\nset to zero if the failure is independent of amount." + }, + "success_time": { + "type": "string", + "format": "int64", + "description": "Time of last success." + }, + "success_amt_sat": { + "type": "string", + "format": "int64", + "description": "Highest amount that we could successfully forward rounded to whole sats." + }, + "success_amt_msat": { + "type": "string", + "format": "int64", + "description": "Highest amount that we could successfully forward in millisats." + } + } + }, + "routerrpcPairHistory": { + "type": "object", + "properties": { + "node_from": { + "type": "string", + "format": "byte", + "description": "The source node pubkey of the pair." + }, + "node_to": { + "type": "string", + "format": "byte", + "description": "The destination node pubkey of the pair." + }, + "history": { + "$ref": "#/definitions/routerrpcPairData" + } + }, + "description": "PairHistory contains the mission control state for a particular node pair." + }, + "routerrpcPaymentState": { + "type": "string", + "enum": [ + "IN_FLIGHT", + "SUCCEEDED", + "FAILED_TIMEOUT", + "FAILED_NO_ROUTE", + "FAILED_ERROR", + "FAILED_INCORRECT_PAYMENT_DETAILS", + "FAILED_INSUFFICIENT_BALANCE" + ], + "default": "IN_FLIGHT", + "description": " - IN_FLIGHT: Payment is still in flight.\n - SUCCEEDED: Payment completed successfully.\n - FAILED_TIMEOUT: There are more routes to try, but the payment timeout was exceeded.\n - FAILED_NO_ROUTE: All possible routes were tried and failed permanently. Or were no\nroutes to the destination at all.\n - FAILED_ERROR: A non-recoverable error has occured.\n - FAILED_INCORRECT_PAYMENT_DETAILS: Payment details incorrect (unknown hash, invalid amt or\ninvalid final cltv delta)\n - FAILED_INSUFFICIENT_BALANCE: Insufficient local balance." + }, + "routerrpcPaymentStatus": { + "type": "object", + "properties": { + "state": { + "$ref": "#/definitions/routerrpcPaymentState", + "description": "Current state the payment is in." + }, + "preimage": { + "type": "string", + "format": "byte", + "description": "The pre-image of the payment when state is SUCCEEDED." + }, + "htlcs": { + "type": "array", + "items": { + "$ref": "#/definitions/lnrpcHTLCAttempt" + }, + "description": "The HTLCs made in attempt to settle the payment [EXPERIMENTAL]." + } + } + }, + "routerrpcQueryMissionControlResponse": { + "type": "object", + "properties": { + "pairs": { + "type": "array", + "items": { + "$ref": "#/definitions/routerrpcPairHistory" + }, + "description": "Node pair-level mission control state." + } + }, + "description": "QueryMissionControlResponse contains mission control state." + }, + "routerrpcQueryProbabilityResponse": { + "type": "object", + "properties": { + "probability": { + "type": "number", + "format": "double", + "description": "The success probability for the requested pair." + }, + "history": { + "$ref": "#/definitions/routerrpcPairData", + "description": "The historical data for the requested pair." + } + } + }, + "routerrpcResetMissionControlResponse": { + "type": "object" + }, + "routerrpcRouteFeeResponse": { + "type": "object", + "properties": { + "routing_fee_msat": { + "type": "string", + "format": "int64", + "description": "A lower bound of the estimated fee to the target destination within the\nnetwork, expressed in milli-satoshis." + }, + "time_lock_delay": { + "type": "string", + "format": "int64", + "description": "An estimate of the worst case time delay that can occur. Note that callers\nwill still need to factor in the final CLTV delta of the last hop into this\nvalue." + } + } + }, + "routerrpcSendToRouteResponse": { + "type": "object", + "properties": { + "preimage": { + "type": "string", + "format": "byte", + "description": "The preimage obtained by making the payment." + }, + "failure": { + "$ref": "#/definitions/lnrpcFailure", + "description": "The failure message in case the payment failed." + } + } + }, + "routerrpcSettleEvent": { + "type": "object" + }, + "runtimeStreamError": { + "type": "object", + "properties": { + "grpc_code": { + "type": "integer", + "format": "int32" + }, + "http_code": { + "type": "integer", + "format": "int32" + }, + "message": { + "type": "string" + }, + "http_status": { + "type": "string" + }, + "details": { + "type": "array", + "items": { + "$ref": "#/definitions/protobufAny" + } + } + } + } + }, + "x-stream-definitions": { + "lnrpcPayment": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/lnrpcPayment" + }, + "error": { + "$ref": "#/definitions/runtimeStreamError" + } + }, + "title": "Stream result of lnrpcPayment" + }, + "routerrpcHtlcEvent": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/routerrpcHtlcEvent" + }, + "error": { + "$ref": "#/definitions/runtimeStreamError" + } + }, + "title": "Stream result of routerrpcHtlcEvent" + }, + "routerrpcPaymentStatus": { + "type": "object", + "properties": { + "result": { + "$ref": "#/definitions/routerrpcPaymentStatus" + }, + "error": { + "$ref": "#/definitions/runtimeStreamError" + } + }, + "title": "Stream result of routerrpcPaymentStatus" + } + } +} diff --git a/lnrpc/signrpc/signer.swagger.json b/lnrpc/signrpc/signer.swagger.json new file mode 100644 index 00000000..00fd70f0 --- /dev/null +++ b/lnrpc/signrpc/signer.swagger.json @@ -0,0 +1,176 @@ +{ + "swagger": "2.0", + "info": { + "title": "signrpc/signer.proto", + "version": "version not set" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "signrpcInputScript": { + "type": "object", + "properties": { + "witness": { + "type": "array", + "items": { + "type": "string", + "format": "byte" + }, + "description": "The serializes witness stack for the specified input." + }, + "sig_script": { + "type": "string", + "format": "byte", + "description": "*\nThe optional sig script for the specified witness that will only be set if\nthe input specified is a nested p2sh witness program." + } + } + }, + "signrpcInputScriptResp": { + "type": "object", + "properties": { + "input_scripts": { + "type": "array", + "items": { + "$ref": "#/definitions/signrpcInputScript" + }, + "description": "The set of fully valid input scripts requested." + } + } + }, + "signrpcKeyDescriptor": { + "type": "object", + "properties": { + "raw_key_bytes": { + "type": "string", + "format": "byte", + "description": "The raw bytes of the key being identified. Either this or the KeyLocator\nmust be specified." + }, + "key_loc": { + "$ref": "#/definitions/signrpcKeyLocator", + "description": "The key locator that identifies which key to use for signing. Either this\nor the raw bytes of the target key must be specified." + } + } + }, + "signrpcKeyLocator": { + "type": "object", + "properties": { + "key_family": { + "type": "integer", + "format": "int32", + "description": "The family of key being identified." + }, + "key_index": { + "type": "integer", + "format": "int32", + "description": "The precise index of the key being identified." + } + } + }, + "signrpcSharedKeyResponse": { + "type": "object", + "properties": { + "shared_key": { + "type": "string", + "format": "byte", + "description": "The shared public key, hashed with sha256." + } + } + }, + "signrpcSignDescriptor": { + "type": "object", + "properties": { + "key_desc": { + "$ref": "#/definitions/signrpcKeyDescriptor", + "description": "A descriptor that precisely describes *which* key to use for signing. This\nmay provide the raw public key directly, or require the Signer to re-derive\nthe key according to the populated derivation path." + }, + "single_tweak": { + "type": "string", + "format": "byte", + "description": "derivedKey = privkey + sha256(perCommitmentPoint || pubKey) mod N", + "title": "A scalar value that will be added to the private key corresponding to the\nabove public key to obtain the private key to be used to sign this input.\nThis value is typically derived via the following computation:" + }, + "double_tweak": { + "type": "string", + "format": "byte", + "description": "A private key that will be used in combination with its corresponding\nprivate key to derive the private key that is to be used to sign the target\ninput. Within the Lightning protocol, this value is typically the\ncommitment secret from a previously revoked commitment transaction. This\nvalue is in combination with two hash values, and the original private key\nto derive the private key to be used when signing.\n\nk = (privKey*sha256(pubKey || tweakPub) +\ntweakPriv*sha256(tweakPub || pubKey)) mod N" + }, + "witness_script": { + "type": "string", + "format": "byte", + "description": "The full script required to properly redeem the output. This field will\nonly be populated if a p2wsh or a p2sh output is being signed." + }, + "output": { + "$ref": "#/definitions/signrpcTxOut", + "description": "A description of the output being spent. The value and script MUST be\nprovided." + }, + "sighash": { + "type": "integer", + "format": "int64", + "description": "The target sighash type that should be used when generating the final\nsighash, and signature." + }, + "input_index": { + "type": "integer", + "format": "int32", + "description": "The target input within the transaction that should be signed." + } + } + }, + "signrpcSignMessageResp": { + "type": "object", + "properties": { + "signature": { + "type": "string", + "format": "byte", + "description": "The signature for the given message in the fixed-size LN wire format." + } + } + }, + "signrpcSignResp": { + "type": "object", + "properties": { + "raw_sigs": { + "type": "array", + "items": { + "type": "string", + "format": "byte" + }, + "description": "A set of signatures realized in a fixed 64-byte format ordered in ascending\ninput order." + } + } + }, + "signrpcTxOut": { + "type": "object", + "properties": { + "value": { + "type": "string", + "format": "int64", + "description": "The value of the output being spent." + }, + "pk_script": { + "type": "string", + "format": "byte", + "description": "The script of the output being spent." + } + } + }, + "signrpcVerifyMessageResp": { + "type": "object", + "properties": { + "valid": { + "type": "boolean", + "format": "boolean", + "description": "Whether the signature was valid over the given message." + } + } + } + } +} diff --git a/lnrpc/verrpc/verrpc.swagger.json b/lnrpc/verrpc/verrpc.swagger.json new file mode 100644 index 00000000..52180e81 --- /dev/null +++ b/lnrpc/verrpc/verrpc.swagger.json @@ -0,0 +1,67 @@ +{ + "swagger": "2.0", + "info": { + "title": "verrpc/verrpc.proto", + "version": "version not set" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "verrpcVersion": { + "type": "object", + "properties": { + "commit": { + "type": "string", + "description": "A verbose description of the daemon's commit." + }, + "commit_hash": { + "type": "string", + "description": "The SHA1 commit hash that the daemon is compiled with." + }, + "version": { + "type": "string", + "description": "The semantic version." + }, + "app_major": { + "type": "integer", + "format": "int64", + "description": "The major application version." + }, + "app_minor": { + "type": "integer", + "format": "int64", + "description": "The minor application version." + }, + "app_patch": { + "type": "integer", + "format": "int64", + "description": "The application patch number." + }, + "app_pre_release": { + "type": "string", + "description": "The application pre-release modifier, possibly empty." + }, + "build_tags": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of build tags that were supplied during compilation." + }, + "go_version": { + "type": "string", + "description": "The version of go that compiled the executable." + } + } + } + } +} diff --git a/lnrpc/walletrpc/walletkit.swagger.json b/lnrpc/walletrpc/walletkit.swagger.json new file mode 100644 index 00000000..4f41135d --- /dev/null +++ b/lnrpc/walletrpc/walletkit.swagger.json @@ -0,0 +1,289 @@ +{ + "swagger": "2.0", + "info": { + "title": "walletrpc/walletkit.proto", + "version": "version not set" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "ListSweepsResponseTransactionIDs": { + "type": "object", + "properties": { + "transaction_ids": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Reversed, hex-encoded string representing the transaction ids of the\nsweeps that our node has broadcast. Note that these transactions may\nnot have confirmed yet, we record sweeps on broadcast, not confirmation." + } + } + }, + "lnrpcOutPoint": { + "type": "object", + "properties": { + "txid_bytes": { + "type": "string", + "format": "byte", + "description": "Raw bytes representing the transaction id." + }, + "txid_str": { + "type": "string", + "description": "Reversed, hex-encoded string representing the transaction id." + }, + "output_index": { + "type": "integer", + "format": "int64", + "description": "The index of the output on the transaction." + } + } + }, + "lnrpcTransaction": { + "type": "object", + "properties": { + "tx_hash": { + "type": "string", + "title": "The transaction hash" + }, + "amount": { + "type": "string", + "format": "int64", + "title": "The transaction amount, denominated in satoshis" + }, + "num_confirmations": { + "type": "integer", + "format": "int32", + "title": "The number of confirmations" + }, + "block_hash": { + "type": "string", + "title": "The hash of the block this transaction was included in" + }, + "block_height": { + "type": "integer", + "format": "int32", + "title": "The height of the block this transaction was included in" + }, + "time_stamp": { + "type": "string", + "format": "int64", + "title": "Timestamp of this transaction" + }, + "total_fees": { + "type": "string", + "format": "int64", + "title": "Fees paid for this transaction" + }, + "dest_addresses": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Addresses that received funds for this transaction" + }, + "raw_tx_hex": { + "type": "string", + "description": "The raw transaction hex." + } + } + }, + "lnrpcTransactionDetails": { + "type": "object", + "properties": { + "transactions": { + "type": "array", + "items": { + "$ref": "#/definitions/lnrpcTransaction" + }, + "description": "The list of transactions relevant to the wallet." + } + } + }, + "signrpcKeyDescriptor": { + "type": "object", + "properties": { + "raw_key_bytes": { + "type": "string", + "format": "byte", + "description": "The raw bytes of the key being identified. Either this or the KeyLocator\nmust be specified." + }, + "key_loc": { + "$ref": "#/definitions/signrpcKeyLocator", + "description": "The key locator that identifies which key to use for signing. Either this\nor the raw bytes of the target key must be specified." + } + } + }, + "signrpcKeyLocator": { + "type": "object", + "properties": { + "key_family": { + "type": "integer", + "format": "int32", + "description": "The family of key being identified." + }, + "key_index": { + "type": "integer", + "format": "int32", + "description": "The precise index of the key being identified." + } + } + }, + "signrpcTxOut": { + "type": "object", + "properties": { + "value": { + "type": "string", + "format": "int64", + "description": "The value of the output being spent." + }, + "pk_script": { + "type": "string", + "format": "byte", + "description": "The script of the output being spent." + } + } + }, + "walletrpcAddrResponse": { + "type": "object", + "properties": { + "addr": { + "type": "string", + "description": "The address encoded using a bech32 format." + } + } + }, + "walletrpcBumpFeeResponse": { + "type": "object" + }, + "walletrpcEstimateFeeResponse": { + "type": "object", + "properties": { + "sat_per_kw": { + "type": "string", + "format": "int64", + "description": "The amount of satoshis per kw that should be used in order to reach the\nconfirmation target in the request." + } + } + }, + "walletrpcListSweepsResponse": { + "type": "object", + "properties": { + "transaction_details": { + "$ref": "#/definitions/lnrpcTransactionDetails" + }, + "transaction_ids": { + "$ref": "#/definitions/ListSweepsResponseTransactionIDs" + } + } + }, + "walletrpcPendingSweep": { + "type": "object", + "properties": { + "outpoint": { + "$ref": "#/definitions/lnrpcOutPoint", + "description": "The outpoint of the output we're attempting to sweep." + }, + "witness_type": { + "$ref": "#/definitions/walletrpcWitnessType", + "description": "The witness type of the output we're attempting to sweep." + }, + "amount_sat": { + "type": "integer", + "format": "int64", + "description": "The value of the output we're attempting to sweep." + }, + "sat_per_byte": { + "type": "integer", + "format": "int64", + "description": "The fee rate we'll use to sweep the output. The fee rate is only determined\nonce a sweeping transaction for the output is created, so it's possible for\nthis to be 0 before this." + }, + "broadcast_attempts": { + "type": "integer", + "format": "int64", + "description": "The number of broadcast attempts we've made to sweep the output." + }, + "next_broadcast_height": { + "type": "integer", + "format": "int64", + "description": "The next height of the chain at which we'll attempt to broadcast the\nsweep transaction of the output." + }, + "requested_conf_target": { + "type": "integer", + "format": "int64", + "description": "The requested confirmation target for this output." + }, + "requested_sat_per_byte": { + "type": "integer", + "format": "int64", + "description": "The requested fee rate, expressed in sat/byte, for this output." + }, + "force": { + "type": "boolean", + "format": "boolean", + "description": "Whether this input must be force-swept. This means that it is swept even\nif it has a negative yield." + } + } + }, + "walletrpcPendingSweepsResponse": { + "type": "object", + "properties": { + "pending_sweeps": { + "type": "array", + "items": { + "$ref": "#/definitions/walletrpcPendingSweep" + }, + "description": "The set of outputs currently being swept by lnd's central batching engine." + } + } + }, + "walletrpcPublishResponse": { + "type": "object", + "properties": { + "publish_error": { + "type": "string", + "description": "If blank, then no error occurred and the transaction was successfully\npublished. If not the empty string, then a string representation of the\nbroadcast error.\n\nTODO(roasbeef): map to a proper enum type" + } + } + }, + "walletrpcSendOutputsResponse": { + "type": "object", + "properties": { + "raw_tx": { + "type": "string", + "format": "byte", + "description": "The serialized transaction sent out on the network." + } + } + }, + "walletrpcWitnessType": { + "type": "string", + "enum": [ + "UNKNOWN_WITNESS", + "COMMITMENT_TIME_LOCK", + "COMMITMENT_NO_DELAY", + "COMMITMENT_REVOKE", + "HTLC_OFFERED_REVOKE", + "HTLC_ACCEPTED_REVOKE", + "HTLC_OFFERED_TIMEOUT_SECOND_LEVEL", + "HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL", + "HTLC_OFFERED_REMOTE_TIMEOUT", + "HTLC_ACCEPTED_REMOTE_SUCCESS", + "HTLC_SECOND_LEVEL_REVOKE", + "WITNESS_KEY_HASH", + "NESTED_WITNESS_KEY_HASH", + "COMMITMENT_ANCHOR" + ], + "default": "UNKNOWN_WITNESS", + "description": " - COMMITMENT_TIME_LOCK: A witness that allows us to spend the output of a commitment transaction\nafter a relative lock-time lockout.\n - COMMITMENT_NO_DELAY: A witness that allows us to spend a settled no-delay output immediately on a\ncounterparty's commitment transaction.\n - COMMITMENT_REVOKE: A witness that allows us to sweep the settled output of a malicious\ncounterparty's who broadcasts a revoked commitment transaction.\n - HTLC_OFFERED_REVOKE: A witness that allows us to sweep an HTLC which we offered to the remote\nparty in the case that they broadcast a revoked commitment state.\n - HTLC_ACCEPTED_REVOKE: A witness that allows us to sweep an HTLC output sent to us in the case that\nthe remote party broadcasts a revoked commitment state.\n - HTLC_OFFERED_TIMEOUT_SECOND_LEVEL: A witness that allows us to sweep an HTLC output that we extended to a\nparty, but was never fulfilled. This HTLC output isn't directly on the\ncommitment transaction, but is the result of a confirmed second-level HTLC\ntransaction. As a result, we can only spend this after a CSV delay.\n - HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL: A witness that allows us to sweep an HTLC output that was offered to us, and\nfor which we have a payment preimage. This HTLC output isn't directly on our\ncommitment transaction, but is the result of confirmed second-level HTLC\ntransaction. As a result, we can only spend this after a CSV delay.\n - HTLC_OFFERED_REMOTE_TIMEOUT: A witness that allows us to sweep an HTLC that we offered to the remote\nparty which lies in the commitment transaction of the remote party. We can\nspend this output after the absolute CLTV timeout of the HTLC as passed.\n - HTLC_ACCEPTED_REMOTE_SUCCESS: A witness that allows us to sweep an HTLC that was offered to us by the\nremote party. We use this witness in the case that the remote party goes to\nchain, and we know the pre-image to the HTLC. We can sweep this without any\nadditional timeout.\n - HTLC_SECOND_LEVEL_REVOKE: A witness that allows us to sweep an HTLC from the remote party's commitment\ntransaction in the case that the broadcast a revoked commitment, but then\nalso immediately attempt to go to the second level to claim the HTLC.\n - WITNESS_KEY_HASH: A witness type that allows us to spend a regular p2wkh output that's sent to\nan output which is under complete control of the backing wallet.\n - NESTED_WITNESS_KEY_HASH: A witness type that allows us to sweep an output that sends to a nested P2SH\nscript that pays to a key solely under our control.\n - COMMITMENT_ANCHOR: A witness type that allows us to spend our anchor on the commitment\ntransaction." + } + } +} diff --git a/lnrpc/watchtowerrpc/watchtower.swagger.json b/lnrpc/watchtowerrpc/watchtower.swagger.json new file mode 100644 index 00000000..5fea6d9d --- /dev/null +++ b/lnrpc/watchtowerrpc/watchtower.swagger.json @@ -0,0 +1,44 @@ +{ + "swagger": "2.0", + "info": { + "title": "watchtowerrpc/watchtower.proto", + "version": "version not set" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "watchtowerrpcGetInfoResponse": { + "type": "object", + "properties": { + "pubkey": { + "type": "string", + "format": "byte", + "description": "The public key of the watchtower." + }, + "listeners": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The listening addresses of the watchtower." + }, + "uris": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The URIs of the watchtower." + } + } + } + } +} diff --git a/lnrpc/wtclientrpc/wtclient.swagger.json b/lnrpc/wtclientrpc/wtclient.swagger.json new file mode 100644 index 00000000..095510db --- /dev/null +++ b/lnrpc/wtclientrpc/wtclient.swagger.json @@ -0,0 +1,142 @@ +{ + "swagger": "2.0", + "info": { + "title": "wtclientrpc/wtclient.proto", + "version": "version not set" + }, + "schemes": [ + "http", + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "paths": {}, + "definitions": { + "wtclientrpcAddTowerResponse": { + "type": "object" + }, + "wtclientrpcListTowersResponse": { + "type": "object", + "properties": { + "towers": { + "type": "array", + "items": { + "$ref": "#/definitions/wtclientrpcTower" + }, + "description": "The list of watchtowers available for new backups." + } + } + }, + "wtclientrpcPolicyResponse": { + "type": "object", + "properties": { + "max_updates": { + "type": "integer", + "format": "int64", + "description": "The maximum number of updates each session we negotiate with watchtowers\nshould allow." + }, + "sweep_sat_per_byte": { + "type": "integer", + "format": "int64", + "description": "The fee rate, in satoshis per vbyte, that will be used by watchtowers for\njustice transactions in response to channel breaches." + } + } + }, + "wtclientrpcRemoveTowerResponse": { + "type": "object" + }, + "wtclientrpcStatsResponse": { + "type": "object", + "properties": { + "num_backups": { + "type": "integer", + "format": "int64", + "description": "The total number of backups made to all active and exhausted watchtower\nsessions." + }, + "num_pending_backups": { + "type": "integer", + "format": "int64", + "description": "The total number of backups that are pending to be acknowledged by all\nactive and exhausted watchtower sessions." + }, + "num_failed_backups": { + "type": "integer", + "format": "int64", + "description": "The total number of backups that all active and exhausted watchtower\nsessions have failed to acknowledge." + }, + "num_sessions_acquired": { + "type": "integer", + "format": "int64", + "description": "The total number of new sessions made to watchtowers." + }, + "num_sessions_exhausted": { + "type": "integer", + "format": "int64", + "description": "The total number of watchtower sessions that have been exhausted." + } + } + }, + "wtclientrpcTower": { + "type": "object", + "properties": { + "pubkey": { + "type": "string", + "format": "byte", + "description": "The identifying public key of the watchtower." + }, + "addresses": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The list of addresses the watchtower is reachable over." + }, + "active_session_candidate": { + "type": "boolean", + "format": "boolean", + "description": "Whether the watchtower is currently a candidate for new sessions." + }, + "num_sessions": { + "type": "integer", + "format": "int64", + "description": "The number of sessions that have been negotiated with the watchtower." + }, + "sessions": { + "type": "array", + "items": { + "$ref": "#/definitions/wtclientrpcTowerSession" + }, + "description": "The list of sessions that have been negotiated with the watchtower." + } + } + }, + "wtclientrpcTowerSession": { + "type": "object", + "properties": { + "num_backups": { + "type": "integer", + "format": "int64", + "description": "The total number of successful backups that have been made to the\nwatchtower session." + }, + "num_pending_backups": { + "type": "integer", + "format": "int64", + "description": "The total number of backups in the session that are currently pending to be\nacknowledged by the watchtower." + }, + "max_backups": { + "type": "integer", + "format": "int64", + "description": "The maximum number of backups allowed by the watchtower session." + }, + "sweep_sat_per_byte": { + "type": "integer", + "format": "int64", + "description": "The fee rate, in satoshis per vbyte, that will be used by the watchtower for\nthe justice transaction in the event of a channel breach." + } + } + } + } +}