From 1cda46770181d6986d0b8c73b499559009513be4 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Wed, 3 Jun 2020 17:35:19 +0200 Subject: [PATCH] lnrpc: explain how to use map types in REST --- lnrpc/rpc.pb.go | 20 ++++++++++++++++++++ lnrpc/rpc.proto | 10 ++++++++++ lnrpc/rpc.swagger.json | 2 ++ 3 files changed, 32 insertions(+) diff --git a/lnrpc/rpc.pb.go b/lnrpc/rpc.pb.go index f6cc76fcd..3d81001b1 100644 --- a/lnrpc/rpc.pb.go +++ b/lnrpc/rpc.pb.go @@ -12367,6 +12367,11 @@ type LightningClient interface { // lncli: `estimatefee` //EstimateFee asks the chain backend to estimate the fee rate and total fees //for a transaction that pays to multiple specified outputs. + // + //When using REST, the `AddrToAmount` map type can be set by appending + //`&AddrToAmount[
]=` to the URL. Unfortunately this + //map type doesn't appear in the REST API documentation because of a bug in + //the grpc-gateway library. EstimateFee(ctx context.Context, in *EstimateFeeRequest, opts ...grpc.CallOption) (*EstimateFeeResponse, error) // lncli: `sendcoins` //SendCoins executes a request to send coins to a particular address. Unlike @@ -12590,6 +12595,11 @@ type LightningClient interface { //satoshis. The returned route contains the full details required to craft and //send an HTLC, also including the necessary information that should be //present within the Sphinx packet encapsulated within the HTLC. + // + //When using REST, the `dest_custom_records` map type can be set by appending + //`&dest_custom_records[]=` + //to the URL. Unfortunately this map type doesn't appear in the REST API + //documentation because of a bug in the grpc-gateway library. QueryRoutes(ctx context.Context, in *QueryRoutesRequest, opts ...grpc.CallOption) (*QueryRoutesResponse, error) // lncli: `getnetworkinfo` //GetNetworkInfo returns some basic stats about the known channel graph from @@ -13448,6 +13458,11 @@ type LightningServer interface { // lncli: `estimatefee` //EstimateFee asks the chain backend to estimate the fee rate and total fees //for a transaction that pays to multiple specified outputs. + // + //When using REST, the `AddrToAmount` map type can be set by appending + //`&AddrToAmount[
]=` to the URL. Unfortunately this + //map type doesn't appear in the REST API documentation because of a bug in + //the grpc-gateway library. EstimateFee(context.Context, *EstimateFeeRequest) (*EstimateFeeResponse, error) // lncli: `sendcoins` //SendCoins executes a request to send coins to a particular address. Unlike @@ -13671,6 +13686,11 @@ type LightningServer interface { //satoshis. The returned route contains the full details required to craft and //send an HTLC, also including the necessary information that should be //present within the Sphinx packet encapsulated within the HTLC. + // + //When using REST, the `dest_custom_records` map type can be set by appending + //`&dest_custom_records[]=` + //to the URL. Unfortunately this map type doesn't appear in the REST API + //documentation because of a bug in the grpc-gateway library. QueryRoutes(context.Context, *QueryRoutesRequest) (*QueryRoutesResponse, error) // lncli: `getnetworkinfo` //GetNetworkInfo returns some basic stats about the known channel graph from diff --git a/lnrpc/rpc.proto b/lnrpc/rpc.proto index bd6811423..f69b768f2 100644 --- a/lnrpc/rpc.proto +++ b/lnrpc/rpc.proto @@ -46,6 +46,11 @@ service Lightning { /* lncli: `estimatefee` EstimateFee asks the chain backend to estimate the fee rate and total fees for a transaction that pays to multiple specified outputs. + + When using REST, the `AddrToAmount` map type can be set by appending + `&AddrToAmount[
]=` to the URL. Unfortunately this + map type doesn't appear in the REST API documentation because of a bug in + the grpc-gateway library. */ rpc EstimateFee (EstimateFeeRequest) returns (EstimateFeeResponse); @@ -355,6 +360,11 @@ service Lightning { satoshis. The returned route contains the full details required to craft and send an HTLC, also including the necessary information that should be present within the Sphinx packet encapsulated within the HTLC. + + When using REST, the `dest_custom_records` map type can be set by appending + `&dest_custom_records[]=` + to the URL. Unfortunately this map type doesn't appear in the REST API + documentation because of a bug in the grpc-gateway library. */ rpc QueryRoutes (QueryRoutesRequest) returns (QueryRoutesResponse); diff --git a/lnrpc/rpc.swagger.json b/lnrpc/rpc.swagger.json index 584e5c56e..cd36a8700 100644 --- a/lnrpc/rpc.swagger.json +++ b/lnrpc/rpc.swagger.json @@ -1001,6 +1001,7 @@ "/v1/graph/routes/{pub_key}/{amt}": { "get": { "summary": "lncli: `queryroutes`\nQueryRoutes attempts to query the daemon's Channel Router for a possible\nroute to a target destination capable of carrying a specific amount of\nsatoshis. The returned route contains the full details required to craft and\nsend an HTLC, also including the necessary information that should be\npresent within the Sphinx packet encapsulated within the HTLC.", + "description": "When using REST, the `dest_custom_records` map type can be set by appending\n`\u0026dest_custom_records[\u003crecord_number\u003e]=\u003crecord_data_base64_url_encoded\u003e`\nto the URL. Unfortunately this map type doesn't appear in the REST API\ndocumentation because of a bug in the grpc-gateway library.", "operationId": "QueryRoutes", "responses": { "200": { @@ -1854,6 +1855,7 @@ "/v1/transactions/fee": { "get": { "summary": "lncli: `estimatefee`\nEstimateFee asks the chain backend to estimate the fee rate and total fees\nfor a transaction that pays to multiple specified outputs.", + "description": "When using REST, the `AddrToAmount` map type can be set by appending\n`\u0026AddrToAmount[\u003caddress\u003e]=\u003camount_to_send\u003e` to the URL. Unfortunately this\nmap type doesn't appear in the REST API documentation because of a bug in\nthe grpc-gateway library.", "operationId": "EstimateFee", "responses": { "200": {