From 4a0025c1b7cfd217616711e973784366b144b769 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Tue, 27 Jul 2021 12:59:52 +0200 Subject: [PATCH] lnrpc: split REST annotations into service files As a preparation for the migration to the grpc-gateway/v2 library we declare each service's REST annotations in its own file. This is optional in the v1 library but mandatory in v2. --- lnrpc/autopilotrpc/autopilot.yaml | 15 ++ lnrpc/chainrpc/chainnotifier.yaml | 14 ++ lnrpc/gen_protos.sh | 5 +- lnrpc/invoicesrpc/invoices.yaml | 16 ++ lnrpc/lnclipb/lncli.yaml | 5 + lnrpc/rest-annotations.yaml | 341 ---------------------------- lnrpc/routerrpc/router.yaml | 48 ++++ lnrpc/rpc.yaml | 147 ++++++++++++ lnrpc/signrpc/signer.yaml | 20 ++ lnrpc/stateservice.yaml | 9 + lnrpc/verrpc/verrpc.yaml | 7 + lnrpc/walletrpc/walletkit.yaml | 56 +++++ lnrpc/walletunlocker.yaml | 16 ++ lnrpc/watchtowerrpc/watchtower.yaml | 7 + lnrpc/wtclientrpc/wtclient.yaml | 18 ++ 15 files changed, 381 insertions(+), 343 deletions(-) create mode 100644 lnrpc/autopilotrpc/autopilot.yaml create mode 100644 lnrpc/chainrpc/chainnotifier.yaml create mode 100644 lnrpc/invoicesrpc/invoices.yaml create mode 100644 lnrpc/lnclipb/lncli.yaml delete mode 100644 lnrpc/rest-annotations.yaml create mode 100644 lnrpc/routerrpc/router.yaml create mode 100644 lnrpc/rpc.yaml create mode 100644 lnrpc/signrpc/signer.yaml create mode 100644 lnrpc/stateservice.yaml create mode 100644 lnrpc/verrpc/verrpc.yaml create mode 100644 lnrpc/walletrpc/walletkit.yaml create mode 100644 lnrpc/walletunlocker.yaml create mode 100644 lnrpc/watchtowerrpc/watchtower.yaml create mode 100644 lnrpc/wtclientrpc/wtclient.yaml diff --git a/lnrpc/autopilotrpc/autopilot.yaml b/lnrpc/autopilotrpc/autopilot.yaml new file mode 100644 index 000000000..2725f17d7 --- /dev/null +++ b/lnrpc/autopilotrpc/autopilot.yaml @@ -0,0 +1,15 @@ +type: google.api.Service +config_version: 3 + +http: + rules: + - selector: autopilotrpc.Autopilot.Status + get: "/v2/autopilot/status" + - selector: autopilotrpc.Autopilot.ModifyStatus + post: "/v2/autopilot/modify" + body: "*" + - selector: autopilotrpc.Autopilot.QueryScores + get: "/v2/autopilot/scores" + - selector: autopilotrpc.Autopilot.SetScores + post: "/v2/autopilot/scores" + body: "*" diff --git a/lnrpc/chainrpc/chainnotifier.yaml b/lnrpc/chainrpc/chainnotifier.yaml new file mode 100644 index 000000000..8f67806e6 --- /dev/null +++ b/lnrpc/chainrpc/chainnotifier.yaml @@ -0,0 +1,14 @@ +type: google.api.Service +config_version: 3 + +http: + rules: + - selector: chainrpc.ChainNotifier.RegisterConfirmationsNtfn + post: "/v2/chainnotifier/register/confirmations" + body: "*" + - selector: chainrpc.ChainNotifier.RegisterSpendNtfn + post: "/v2/chainnotifier/register/spends" + body: "*" + - selector: chainrpc.ChainNotifier.RegisterBlockEpochNtfn + post: "/v2/chainnotifier/register/blocks" + body: "*" diff --git a/lnrpc/gen_protos.sh b/lnrpc/gen_protos.sh index 17c86edf5..f7df43e70 100755 --- a/lnrpc/gen_protos.sh +++ b/lnrpc/gen_protos.sh @@ -20,14 +20,15 @@ function generate() { "${file}" # Generate the REST reverse proxy. + annotationsFile=${file//proto/yaml} protoc -I/usr/local/include -I. \ - --grpc-gateway_out=logtostderr=true,paths=source_relative,grpc_api_configuration=rest-annotations.yaml:. \ + --grpc-gateway_out=logtostderr=true,paths=source_relative,grpc_api_configuration=${annotationsFile}:. \ "${file}" # Finally, generate the swagger file which describes the REST API in detail. protoc -I/usr/local/include -I. \ - --swagger_out=logtostderr=true,grpc_api_configuration=rest-annotations.yaml:. \ + --swagger_out=logtostderr=true,grpc_api_configuration=${annotationsFile}:. \ "${file}" done } diff --git a/lnrpc/invoicesrpc/invoices.yaml b/lnrpc/invoicesrpc/invoices.yaml new file mode 100644 index 000000000..9b5129d0d --- /dev/null +++ b/lnrpc/invoicesrpc/invoices.yaml @@ -0,0 +1,16 @@ +type: google.api.Service +config_version: 3 + +http: + rules: + - selector: invoicesrpc.Invoices.SubscribeSingleInvoice + get: "/v2/invoices/subscribe/{r_hash}" + - selector: invoicesrpc.Invoices.CancelInvoice + post: "/v2/invoices/cancel" + body: "*" + - selector: invoicesrpc.Invoices.AddHoldInvoice + post: "/v2/invoices/hodl" + body: "*" + - selector: invoicesrpc.Invoices.SettleInvoice + post: "/v2/invoices/settle" + body: "*" diff --git a/lnrpc/lnclipb/lncli.yaml b/lnrpc/lnclipb/lncli.yaml new file mode 100644 index 000000000..609dad27f --- /dev/null +++ b/lnrpc/lnclipb/lncli.yaml @@ -0,0 +1,5 @@ +type: google.api.Service +config_version: 3 + +http: + rules: diff --git a/lnrpc/rest-annotations.yaml b/lnrpc/rest-annotations.yaml deleted file mode 100644 index 73c2ffc0b..000000000 --- a/lnrpc/rest-annotations.yaml +++ /dev/null @@ -1,341 +0,0 @@ -type: google.api.Service -config_version: 3 - -# Mapping for the grpc-gateway REST proxy. -# Please make sure to also update the `metadata.go` file when editing this file -# and adding a new client-streaming RPC! - -http: - rules: - # rpc.proto - - selector: lnrpc.Lightning.WalletBalance - get: "/v1/balance/blockchain" - - selector: lnrpc.Lightning.ChannelBalance - get: "/v1/balance/channels" - - selector: lnrpc.Lightning.GetTransactions - get: "/v1/transactions" - - selector: lnrpc.Lightning.EstimateFee - get: "/v1/transactions/fee" - - selector: lnrpc.Lightning.SendCoins - post: "/v1/transactions" - body: "*" - - selector: lnrpc.Lightning.ListUnspent - get: "/v1/utxos" - - selector: lnrpc.Lightning.SubscribeTransactions - get: "/v1/transactions/subscribe" - - selector: lnrpc.Lightning.SendMany - post: "/v1/transactions/many" - body: "*" - - selector: lnrpc.Lightning.NewAddress - get: "/v1/newaddress" - - selector: lnrpc.Lightning.SignMessage - post: "/v1/signmessage" - body: "*" - - selector: lnrpc.Lightning.VerifyMessage - post: "/v1/verifymessage" - body: "*" - - selector: lnrpc.Lightning.ConnectPeer - post: "/v1/peers" - body: "*" - - selector: lnrpc.Lightning.DisconnectPeer - delete: "/v1/peers/{pub_key}" - - selector: lnrpc.Lightning.ListPeers - get: "/v1/peers" - - selector: lnrpc.Lightning.SubscribePeerEvents - get: "/v1/peers/subscribe" - - selector: lnrpc.Lightning.GetInfo - get: "/v1/getinfo" - - selector: lnrpc.Lightning.GetRecoveryInfo - get: "/v1/getrecoveryinfo" - - selector: lnrpc.Lightning.PendingChannels - get: "/v1/channels/pending" - - selector: lnrpc.Lightning.ListChannels - get: "/v1/channels" - - selector: lnrpc.Lightning.SubscribeChannelEvents - get: "/v1/channels/subscribe" - - selector: lnrpc.Lightning.ClosedChannels - get: "/v1/channels/closed" - - selector: lnrpc.Lightning.OpenChannelSync - post: "/v1/channels" - body: "*" - - selector: lnrpc.Lightning.OpenChannel - post: "/v1/channels/stream" - body: "*" - - selector: lnrpc.Lightning.FundingStateStep - post: "/v1/funding/step" - body: "*" - - selector: lnrpc.Lightning.ChannelAcceptor - post: "/v1/channels/acceptor" - body: "*" - - selector: lnrpc.Lightning.CloseChannel - delete: "/v1/channels/{channel_point.funding_txid_str}/{channel_point.output_index}" - - selector: lnrpc.Lightning.AbandonChannel - delete: "/v1/channels/abandon/{channel_point.funding_txid_str}/{channel_point.output_index}" - - selector: lnrpc.Lightning.SendPayment - post: "/v1/channels/transaction-stream" - body: "*" - - selector: lnrpc.Lightning.SendPaymentSync - post: "/v1/channels/transactions" - body: "*" - - selector: lnrpc.Lightning.SendToRoute - # deprecated, no REST endpoint - - selector: lnrpc.Lightning.SendToRouteSync - post: "/v1/channels/transactions/route" - body: "*" - - selector: lnrpc.Lightning.AddInvoice - post: "/v1/invoices" - body: "*" - - selector: lnrpc.Lightning.ListInvoices - get: "/v1/invoices" - - selector: lnrpc.Lightning.LookupInvoice - get: "/v1/invoice/{r_hash_str}" - - selector: lnrpc.Lightning.SubscribeInvoices - get: "/v1/invoices/subscribe" - - selector: lnrpc.Lightning.DecodePayReq - get: "/v1/payreq/{pay_req}" - - selector: lnrpc.Lightning.ListPayments - get: "/v1/payments" - - selector: lnrpc.Lightning.DeleteAllPayments - delete: "/v1/payments" - - selector: lnrpc.Lightning.DescribeGraph - get: "/v1/graph" - - selector: lnrpc.Lightning.GetNodeMetrics - get: "/v1/graph/nodemetrics" - - selector: lnrpc.Lightning.GetChanInfo - get: "/v1/graph/edge/{chan_id}" - - selector: lnrpc.Lightning.GetNodeInfo - get: "/v1/graph/node/{pub_key}" - - selector: lnrpc.Lightning.QueryRoutes - get: "/v1/graph/routes/{pub_key}/{amt}" - - selector: lnrpc.Lightning.GetNetworkInfo - get: "/v1/graph/info" - - selector: lnrpc.Lightning.StopDaemon - post: "/v1/stop" - body: "*" - - selector: lnrpc.Lightning.SubscribeChannelGraph - get: "/v1/graph/subscribe" - - selector: lnrpc.Lightning.DebugLevel - post: "/v1/debuglevel" - body: "*" - - selector: lnrpc.Lightning.FeeReport - get: "/v1/fees" - - selector: lnrpc.Lightning.UpdateChannelPolicy - post: "/v1/chanpolicy" - body: "*" - - selector: lnrpc.Lightning.ForwardingHistory - post: "/v1/switch" - body: "*" - - selector: lnrpc.Lightning.ExportChannelBackup - get: "/v1/channels/backup/{chan_point.funding_txid_str}/{chan_point.output_index}" - - selector: lnrpc.Lightning.ExportAllChannelBackups - get: "/v1/channels/backup" - - selector: lnrpc.Lightning.VerifyChanBackup - post: "/v1/channels/backup/verify" - body: "*" - - selector: lnrpc.Lightning.RestoreChannelBackups - post: "/v1/channels/backup/restore" - body: "*" - - selector: lnrpc.Lightning.SubscribeChannelBackups - get: "/v1/channels/backup/subscribe" - - selector: lnrpc.Lightning.BakeMacaroon - post: "/v1/macaroon" - body: "*" - - selector: lnrpc.Lightning.ListMacaroonIDs - get: "/v1/macaroon/ids" - - selector: lnrpc.Lightning.DeleteMacaroonID - delete: "/v1/macaroon/{root_key_id}" - - selector: lnrpc.Lightning.ListPermissions - get: "/v1/macaroon/permissions" - - # walletunlocker.proto - - selector: lnrpc.WalletUnlocker.GenSeed - get: "/v1/genseed" - - selector: lnrpc.WalletUnlocker.InitWallet - post: "/v1/initwallet" - body: "*" - - selector: lnrpc.WalletUnlocker.UnlockWallet - post: "/v1/unlockwallet" - body: "*" - - selector: lnrpc.WalletUnlocker.ChangePassword - post: "/v1/changepassword" - body: "*" - - # autopilotrpc/autopilot.proto - - selector: autopilotrpc.Autopilot.Status - get: "/v2/autopilot/status" - - selector: autopilotrpc.Autopilot.ModifyStatus - post: "/v2/autopilot/modify" - body: "*" - - selector: autopilotrpc.Autopilot.QueryScores - get: "/v2/autopilot/scores" - - selector: autopilotrpc.Autopilot.SetScores - post: "/v2/autopilot/scores" - body: "*" - - # chainrpc/chainnotifier.proto - - selector: chainrpc.ChainNotifier.RegisterConfirmationsNtfn - post: "/v2/chainnotifier/register/confirmations" - body: "*" - - selector: chainrpc.ChainNotifier.RegisterSpendNtfn - post: "/v2/chainnotifier/register/spends" - body: "*" - - selector: chainrpc.ChainNotifier.RegisterBlockEpochNtfn - post: "/v2/chainnotifier/register/blocks" - body: "*" - - # invoicesrpc/invoices.proto - - selector: invoicesrpc.Invoices.SubscribeSingleInvoice - get: "/v2/invoices/subscribe/{r_hash}" - - selector: invoicesrpc.Invoices.CancelInvoice - post: "/v2/invoices/cancel" - body: "*" - - selector: invoicesrpc.Invoices.AddHoldInvoice - post: "/v2/invoices/hodl" - body: "*" - - selector: invoicesrpc.Invoices.SettleInvoice - post: "/v2/invoices/settle" - body: "*" - - # routerrpc/router.proto - - selector: routerrpc.Router.SendPaymentV2 - post: "/v2/router/send" - body: "*" - - selector: routerrpc.Router.TrackPaymentV2 - get: "/v2/router/track/{payment_hash}" - - selector: routerrpc.Router.EstimateRouteFee - post: "/v2/router/route/estimatefee" - body: "*" - - selector: routerrpc.Router.SendToRoute - # deprecated, no REST endpoint - - selector: routerrpc.Router.SendToRouteV2 - post: "/v2/router/route/send" - body: "*" - - selector: routerrpc.Router.ResetMissionControl - post: "/v2/router/mc/reset" - body: "*" - - selector: routerrpc.Router.QueryMissionControl - get: "/v2/router/mc" - - selector: routerrpc.Router.GetMissionControlConfig - get: "/v2/router/mccfg" - - selector: routerrpc.Router.SetMissionControlConfig - post: "/v2/router/mccfg" - body: "*" - - selector: routerrpc.Router.QueryProbability - get: "/v2/router/mc/probability/{from_node}/{to_node}/{amt_msat}" - - selector: routerrpc.Router.XImportMissionControl - post: "/v2/router/x/importhistory" - body: "*" - - selector: routerrpc.Router.BuildRoute - post: "/v2/router/route" - body: "*" - - selector: routerrpc.Router.SubscribeHtlcEvents - get: "/v2/router/htlcevents" - - selector: routerrpc.Router.SendPayment - # deprecated, no REST endpoint - - selector: routerrpc.Router.TrackPayment - # deprecated, no REST endpoint - - selector: routerrpc.Router.HtlcInterceptor - post: "/v2/router/htlcinterceptor" - body: "*" - - selector: routerrpc.Router.UpdateChanStatus - post: "/v2/router/updatechanstatus" - body: "*" - - # signrpc/signer.proto - - selector: signrpc.Signer.SignOutputRaw - post: "/v2/signer/signraw" - body: "*" - - selector: signrpc.Signer.ComputeInputScript - post: "/v2/signer/inputscript" - body: "*" - - selector: signrpc.Signer.SignMessage - post: "/v2/signer/signmessage" - body: "*" - - selector: signrpc.Signer.VerifyMessage - post: "/v2/signer/verifymessage" - body: "*" - - selector: signrpc.Signer.DeriveSharedKey - post: "/v2/signer/sharedkey" - body: "*" - - # stateservice.proto - - selector: lnrpc.State.SubscribeState - get: "/v1/state/subscribe" - - selector: lnrpc.State.GetState - get: "/v1/state" - - # verrpc/verrpc.proto - - selector: verrpc.Versioner.GetVersion - get: "/v2/versioner/version" - - # walletrpc/walletkit.proto - - selector: walletrpc.WalletKit.ListUnspent - post: "/v2/wallet/utxos" - - selector: walletrpc.WalletKit.LeaseOutput - post: "/v2/wallet/utxos/lease" - body: "*" - - selector: walletrpc.WalletKit.ReleaseOutput - post: "/v2/wallet/utxos/release" - body: "*" - - selector: walletrpc.WalletKit.ListLeases - post: "/v2/wallet/utxos/leases" - - selector: walletrpc.WalletKit.DeriveNextKey - post: "/v2/wallet/key/next" - body: "*" - - selector: walletrpc.WalletKit.DeriveKey - post: "/v2/wallet/key" - body: "*" - - selector: walletrpc.WalletKit.ImportPublicKey - post: "/v2/wallet/key/import" - body: "*" - - selector: walletrpc.WalletKit.NextAddr - post: "/v2/wallet/address/next" - body: "*" - - selector: walletrpc.WalletKit.PublishTransaction - post: "/v2/wallet/tx" - body: "*" - - selector: walletrpc.WalletKit.SendOutputs - post: "/v2/wallet/send" - body: "*" - - selector: walletrpc.WalletKit.EstimateFee - get: "/v2/wallet/estimatefee/{conf_target}" - - selector: walletrpc.WalletKit.PendingSweeps - get: "/v2/wallet/sweeps/pending" - - selector: walletrpc.WalletKit.BumpFee - post: "/v2/wallet/bumpfee" - body: "*" - - selector: walletrpc.WalletKit.ListSweeps - get: "/v2/wallet/sweeps" - - selector: walletrpc.WalletKit.LabelTransaction - post: "/v2/wallet/tx/label" - body: "*" - - selector: walletrpc.WalletKit.FundPsbt - post: "/v2/wallet/psbt/fund" - body: "*" - - selector: walletrpc.WalletKit.FinalizePsbt - post: "/v2/wallet/psbt/finalize" - body: "*" - - selector: walletrpc.WalletKit.ListAccounts - get: "/v2/wallet/accounts" - - selector: walletrpc.WalletKit.ImportAccount - post: "/v2/wallet/accounts/import" - body: "*" - - # watchtowerrpc/watchtower.proto - - selector: watchtowerrpc.Watchtower.GetInfo - get: "/v2/watchtower/server" - - # wtclientrpc/wtclient.proto - - selector: wtclientrpc.WatchtowerClient.AddTower - post: "/v2/watchtower/client" - body: "*" - - selector: wtclientrpc.WatchtowerClient.RemoveTower - delete: "/v2/watchtower/client/{pubkey}" - - selector: wtclientrpc.WatchtowerClient.ListTowers - get: "/v2/watchtower/client" - - selector: wtclientrpc.WatchtowerClient.GetTowerInfo - get: "/v2/watchtower/client/info/{pubkey}" - - selector: wtclientrpc.WatchtowerClient.Stats - get: "/v2/watchtower/client/stats" - - selector: wtclientrpc.WatchtowerClient.Policy - get: "/v2/watchtower/client/policy" diff --git a/lnrpc/routerrpc/router.yaml b/lnrpc/routerrpc/router.yaml new file mode 100644 index 000000000..a3683db16 --- /dev/null +++ b/lnrpc/routerrpc/router.yaml @@ -0,0 +1,48 @@ +type: google.api.Service +config_version: 3 + +http: + rules: + - selector: routerrpc.Router.SendPaymentV2 + post: "/v2/router/send" + body: "*" + - selector: routerrpc.Router.TrackPaymentV2 + get: "/v2/router/track/{payment_hash}" + - selector: routerrpc.Router.EstimateRouteFee + post: "/v2/router/route/estimatefee" + body: "*" + - selector: routerrpc.Router.SendToRoute + # deprecated, no REST endpoint + - selector: routerrpc.Router.SendToRouteV2 + post: "/v2/router/route/send" + body: "*" + - selector: routerrpc.Router.ResetMissionControl + post: "/v2/router/mc/reset" + body: "*" + - selector: routerrpc.Router.QueryMissionControl + get: "/v2/router/mc" + - selector: routerrpc.Router.GetMissionControlConfig + get: "/v2/router/mccfg" + - selector: routerrpc.Router.SetMissionControlConfig + post: "/v2/router/mccfg" + body: "*" + - selector: routerrpc.Router.QueryProbability + get: "/v2/router/mc/probability/{from_node}/{to_node}/{amt_msat}" + - selector: routerrpc.Router.XImportMissionControl + post: "/v2/router/x/importhistory" + body: "*" + - selector: routerrpc.Router.BuildRoute + post: "/v2/router/route" + body: "*" + - selector: routerrpc.Router.SubscribeHtlcEvents + get: "/v2/router/htlcevents" + - selector: routerrpc.Router.SendPayment + # deprecated, no REST endpoint + - selector: routerrpc.Router.TrackPayment + # deprecated, no REST endpoint + - selector: routerrpc.Router.HtlcInterceptor + post: "/v2/router/htlcinterceptor" + body: "*" + - selector: routerrpc.Router.UpdateChanStatus + post: "/v2/router/updatechanstatus" + body: "*" diff --git a/lnrpc/rpc.yaml b/lnrpc/rpc.yaml new file mode 100644 index 000000000..3e8f42e11 --- /dev/null +++ b/lnrpc/rpc.yaml @@ -0,0 +1,147 @@ +type: google.api.Service +config_version: 3 + +# Mapping for the grpc-gateway REST proxy. +# Please make sure to also update the `metadata.go` file when editing this file +# and adding a new client-streaming RPC! + +http: + rules: + - selector: lnrpc.Lightning.WalletBalance + get: "/v1/balance/blockchain" + - selector: lnrpc.Lightning.ChannelBalance + get: "/v1/balance/channels" + - selector: lnrpc.Lightning.GetTransactions + get: "/v1/transactions" + - selector: lnrpc.Lightning.EstimateFee + get: "/v1/transactions/fee" + - selector: lnrpc.Lightning.SendCoins + post: "/v1/transactions" + body: "*" + - selector: lnrpc.Lightning.ListUnspent + get: "/v1/utxos" + - selector: lnrpc.Lightning.SubscribeTransactions + get: "/v1/transactions/subscribe" + - selector: lnrpc.Lightning.SendMany + post: "/v1/transactions/many" + body: "*" + - selector: lnrpc.Lightning.NewAddress + get: "/v1/newaddress" + - selector: lnrpc.Lightning.SignMessage + post: "/v1/signmessage" + body: "*" + - selector: lnrpc.Lightning.VerifyMessage + post: "/v1/verifymessage" + body: "*" + - selector: lnrpc.Lightning.ConnectPeer + post: "/v1/peers" + body: "*" + - selector: lnrpc.Lightning.DisconnectPeer + delete: "/v1/peers/{pub_key}" + - selector: lnrpc.Lightning.ListPeers + get: "/v1/peers" + - selector: lnrpc.Lightning.SubscribePeerEvents + get: "/v1/peers/subscribe" + - selector: lnrpc.Lightning.GetInfo + get: "/v1/getinfo" + - selector: lnrpc.Lightning.GetRecoveryInfo + get: "/v1/getrecoveryinfo" + - selector: lnrpc.Lightning.PendingChannels + get: "/v1/channels/pending" + - selector: lnrpc.Lightning.ListChannels + get: "/v1/channels" + - selector: lnrpc.Lightning.SubscribeChannelEvents + get: "/v1/channels/subscribe" + - selector: lnrpc.Lightning.ClosedChannels + get: "/v1/channels/closed" + - selector: lnrpc.Lightning.OpenChannelSync + post: "/v1/channels" + body: "*" + - selector: lnrpc.Lightning.OpenChannel + post: "/v1/channels/stream" + body: "*" + - selector: lnrpc.Lightning.FundingStateStep + post: "/v1/funding/step" + body: "*" + - selector: lnrpc.Lightning.ChannelAcceptor + post: "/v1/channels/acceptor" + body: "*" + - selector: lnrpc.Lightning.CloseChannel + delete: "/v1/channels/{channel_point.funding_txid_str}/{channel_point.output_index}" + - selector: lnrpc.Lightning.AbandonChannel + delete: "/v1/channels/abandon/{channel_point.funding_txid_str}/{channel_point.output_index}" + - selector: lnrpc.Lightning.SendPayment + post: "/v1/channels/transaction-stream" + body: "*" + - selector: lnrpc.Lightning.SendPaymentSync + post: "/v1/channels/transactions" + body: "*" + - selector: lnrpc.Lightning.SendToRoute + # deprecated, no REST endpoint + - selector: lnrpc.Lightning.SendToRouteSync + post: "/v1/channels/transactions/route" + body: "*" + - selector: lnrpc.Lightning.AddInvoice + post: "/v1/invoices" + body: "*" + - selector: lnrpc.Lightning.ListInvoices + get: "/v1/invoices" + - selector: lnrpc.Lightning.LookupInvoice + get: "/v1/invoice/{r_hash_str}" + - selector: lnrpc.Lightning.SubscribeInvoices + get: "/v1/invoices/subscribe" + - selector: lnrpc.Lightning.DecodePayReq + get: "/v1/payreq/{pay_req}" + - selector: lnrpc.Lightning.ListPayments + get: "/v1/payments" + - selector: lnrpc.Lightning.DeleteAllPayments + delete: "/v1/payments" + - selector: lnrpc.Lightning.DescribeGraph + get: "/v1/graph" + - selector: lnrpc.Lightning.GetNodeMetrics + get: "/v1/graph/nodemetrics" + - selector: lnrpc.Lightning.GetChanInfo + get: "/v1/graph/edge/{chan_id}" + - selector: lnrpc.Lightning.GetNodeInfo + get: "/v1/graph/node/{pub_key}" + - selector: lnrpc.Lightning.QueryRoutes + get: "/v1/graph/routes/{pub_key}/{amt}" + - selector: lnrpc.Lightning.GetNetworkInfo + get: "/v1/graph/info" + - selector: lnrpc.Lightning.StopDaemon + post: "/v1/stop" + body: "*" + - selector: lnrpc.Lightning.SubscribeChannelGraph + get: "/v1/graph/subscribe" + - selector: lnrpc.Lightning.DebugLevel + post: "/v1/debuglevel" + body: "*" + - selector: lnrpc.Lightning.FeeReport + get: "/v1/fees" + - selector: lnrpc.Lightning.UpdateChannelPolicy + post: "/v1/chanpolicy" + body: "*" + - selector: lnrpc.Lightning.ForwardingHistory + post: "/v1/switch" + body: "*" + - selector: lnrpc.Lightning.ExportChannelBackup + get: "/v1/channels/backup/{chan_point.funding_txid_str}/{chan_point.output_index}" + - selector: lnrpc.Lightning.ExportAllChannelBackups + get: "/v1/channels/backup" + - selector: lnrpc.Lightning.VerifyChanBackup + post: "/v1/channels/backup/verify" + body: "*" + - selector: lnrpc.Lightning.RestoreChannelBackups + post: "/v1/channels/backup/restore" + body: "*" + - selector: lnrpc.Lightning.SubscribeChannelBackups + get: "/v1/channels/backup/subscribe" + - selector: lnrpc.Lightning.BakeMacaroon + post: "/v1/macaroon" + body: "*" + - selector: lnrpc.Lightning.ListMacaroonIDs + get: "/v1/macaroon/ids" + - selector: lnrpc.Lightning.DeleteMacaroonID + delete: "/v1/macaroon/{root_key_id}" + - selector: lnrpc.Lightning.ListPermissions + get: "/v1/macaroon/permissions" diff --git a/lnrpc/signrpc/signer.yaml b/lnrpc/signrpc/signer.yaml new file mode 100644 index 000000000..295f8b160 --- /dev/null +++ b/lnrpc/signrpc/signer.yaml @@ -0,0 +1,20 @@ +type: google.api.Service +config_version: 3 + +http: + rules: + - selector: signrpc.Signer.SignOutputRaw + post: "/v2/signer/signraw" + body: "*" + - selector: signrpc.Signer.ComputeInputScript + post: "/v2/signer/inputscript" + body: "*" + - selector: signrpc.Signer.SignMessage + post: "/v2/signer/signmessage" + body: "*" + - selector: signrpc.Signer.VerifyMessage + post: "/v2/signer/verifymessage" + body: "*" + - selector: signrpc.Signer.DeriveSharedKey + post: "/v2/signer/sharedkey" + body: "*" diff --git a/lnrpc/stateservice.yaml b/lnrpc/stateservice.yaml new file mode 100644 index 000000000..0375a81ed --- /dev/null +++ b/lnrpc/stateservice.yaml @@ -0,0 +1,9 @@ +type: google.api.Service +config_version: 3 + +http: + rules: + - selector: lnrpc.State.SubscribeState + get: "/v1/state/subscribe" + - selector: lnrpc.State.GetState + get: "/v1/state" diff --git a/lnrpc/verrpc/verrpc.yaml b/lnrpc/verrpc/verrpc.yaml new file mode 100644 index 000000000..149d349f4 --- /dev/null +++ b/lnrpc/verrpc/verrpc.yaml @@ -0,0 +1,7 @@ +type: google.api.Service +config_version: 3 + +http: + rules: + - selector: verrpc.Versioner.GetVersion + get: "/v2/versioner/version" diff --git a/lnrpc/walletrpc/walletkit.yaml b/lnrpc/walletrpc/walletkit.yaml new file mode 100644 index 000000000..291b8508d --- /dev/null +++ b/lnrpc/walletrpc/walletkit.yaml @@ -0,0 +1,56 @@ +type: google.api.Service +config_version: 3 + +http: + rules: + - selector: walletrpc.WalletKit.ListUnspent + post: "/v2/wallet/utxos" + - selector: walletrpc.WalletKit.LeaseOutput + post: "/v2/wallet/utxos/lease" + body: "*" + - selector: walletrpc.WalletKit.ReleaseOutput + post: "/v2/wallet/utxos/release" + body: "*" + - selector: walletrpc.WalletKit.ListLeases + post: "/v2/wallet/utxos/leases" + - selector: walletrpc.WalletKit.DeriveNextKey + post: "/v2/wallet/key/next" + body: "*" + - selector: walletrpc.WalletKit.DeriveKey + post: "/v2/wallet/key" + body: "*" + - selector: walletrpc.WalletKit.ImportPublicKey + post: "/v2/wallet/key/import" + body: "*" + - selector: walletrpc.WalletKit.NextAddr + post: "/v2/wallet/address/next" + body: "*" + - selector: walletrpc.WalletKit.PublishTransaction + post: "/v2/wallet/tx" + body: "*" + - selector: walletrpc.WalletKit.SendOutputs + post: "/v2/wallet/send" + body: "*" + - selector: walletrpc.WalletKit.EstimateFee + get: "/v2/wallet/estimatefee/{conf_target}" + - selector: walletrpc.WalletKit.PendingSweeps + get: "/v2/wallet/sweeps/pending" + - selector: walletrpc.WalletKit.BumpFee + post: "/v2/wallet/bumpfee" + body: "*" + - selector: walletrpc.WalletKit.ListSweeps + get: "/v2/wallet/sweeps" + - selector: walletrpc.WalletKit.LabelTransaction + post: "/v2/wallet/tx/label" + body: "*" + - selector: walletrpc.WalletKit.FundPsbt + post: "/v2/wallet/psbt/fund" + body: "*" + - selector: walletrpc.WalletKit.FinalizePsbt + post: "/v2/wallet/psbt/finalize" + body: "*" + - selector: walletrpc.WalletKit.ListAccounts + get: "/v2/wallet/accounts" + - selector: walletrpc.WalletKit.ImportAccount + post: "/v2/wallet/accounts/import" + body: "*" diff --git a/lnrpc/walletunlocker.yaml b/lnrpc/walletunlocker.yaml new file mode 100644 index 000000000..1bb08649d --- /dev/null +++ b/lnrpc/walletunlocker.yaml @@ -0,0 +1,16 @@ +type: google.api.Service +config_version: 3 + +http: + rules: + - selector: lnrpc.WalletUnlocker.GenSeed + get: "/v1/genseed" + - selector: lnrpc.WalletUnlocker.InitWallet + post: "/v1/initwallet" + body: "*" + - selector: lnrpc.WalletUnlocker.UnlockWallet + post: "/v1/unlockwallet" + body: "*" + - selector: lnrpc.WalletUnlocker.ChangePassword + post: "/v1/changepassword" + body: "*" diff --git a/lnrpc/watchtowerrpc/watchtower.yaml b/lnrpc/watchtowerrpc/watchtower.yaml new file mode 100644 index 000000000..63d8f8d58 --- /dev/null +++ b/lnrpc/watchtowerrpc/watchtower.yaml @@ -0,0 +1,7 @@ +type: google.api.Service +config_version: 3 + +http: + rules: + - selector: watchtowerrpc.Watchtower.GetInfo + get: "/v2/watchtower/server" diff --git a/lnrpc/wtclientrpc/wtclient.yaml b/lnrpc/wtclientrpc/wtclient.yaml new file mode 100644 index 000000000..011a43ba1 --- /dev/null +++ b/lnrpc/wtclientrpc/wtclient.yaml @@ -0,0 +1,18 @@ +type: google.api.Service +config_version: 3 + +http: + rules: + - selector: wtclientrpc.WatchtowerClient.AddTower + post: "/v2/watchtower/client" + body: "*" + - selector: wtclientrpc.WatchtowerClient.RemoveTower + delete: "/v2/watchtower/client/{pubkey}" + - selector: wtclientrpc.WatchtowerClient.ListTowers + get: "/v2/watchtower/client" + - selector: wtclientrpc.WatchtowerClient.GetTowerInfo + get: "/v2/watchtower/client/info/{pubkey}" + - selector: wtclientrpc.WatchtowerClient.Stats + get: "/v2/watchtower/client/stats" + - selector: wtclientrpc.WatchtowerClient.Policy + get: "/v2/watchtower/client/policy"