lnrpc: extract or add REST annotations to yaml

This commit is contained in:
Oliver Gugger committed 2020-06-04 08:50:00 +02:00
1 parent 3ef41dd198
commit fe16be5bb8
39 files changed
+11341 -1410

No files matched your search

+46
View File
@@ -10,6 +10,8 @@ import (
lnrpc "github.com/lightningnetwork/lnd/lnrpc"
signrpc "github.com/lightningnetwork/lnd/lnrpc/signrpc"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
@@ -1799,6 +1801,50 @@ type WalletKitServer interface {
LabelTransaction(context.Context, *LabelTransactionRequest) (*LabelTransactionResponse, error)
}
// UnimplementedWalletKitServer can be embedded to have forward compatible implementations.
type UnimplementedWalletKitServer struct {
}
func (*UnimplementedWalletKitServer) ListUnspent(ctx context.Context, req *ListUnspentRequest) (*ListUnspentResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListUnspent not implemented")
}
func (*UnimplementedWalletKitServer) LeaseOutput(ctx context.Context, req *LeaseOutputRequest) (*LeaseOutputResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method LeaseOutput not implemented")
}
func (*UnimplementedWalletKitServer) ReleaseOutput(ctx context.Context, req *ReleaseOutputRequest) (*ReleaseOutputResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ReleaseOutput not implemented")
}
func (*UnimplementedWalletKitServer) DeriveNextKey(ctx context.Context, req *KeyReq) (*signrpc.KeyDescriptor, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeriveNextKey not implemented")
}
func (*UnimplementedWalletKitServer) DeriveKey(ctx context.Context, req *signrpc.KeyLocator) (*signrpc.KeyDescriptor, error) {
return nil, status.Errorf(codes.Unimplemented, "method DeriveKey not implemented")
}
func (*UnimplementedWalletKitServer) NextAddr(ctx context.Context, req *AddrRequest) (*AddrResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method NextAddr not implemented")
}
func (*UnimplementedWalletKitServer) PublishTransaction(ctx context.Context, req *Transaction) (*PublishResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method PublishTransaction not implemented")
}
func (*UnimplementedWalletKitServer) SendOutputs(ctx context.Context, req *SendOutputsRequest) (*SendOutputsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SendOutputs not implemented")
}
func (*UnimplementedWalletKitServer) EstimateFee(ctx context.Context, req *EstimateFeeRequest) (*EstimateFeeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method EstimateFee not implemented")
}
func (*UnimplementedWalletKitServer) PendingSweeps(ctx context.Context, req *PendingSweepsRequest) (*PendingSweepsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method PendingSweeps not implemented")
}
func (*UnimplementedWalletKitServer) BumpFee(ctx context.Context, req *BumpFeeRequest) (*BumpFeeResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BumpFee not implemented")
}
func (*UnimplementedWalletKitServer) ListSweeps(ctx context.Context, req *ListSweepsRequest) (*ListSweepsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListSweeps not implemented")
}
func (*UnimplementedWalletKitServer) LabelTransaction(ctx context.Context, req *LabelTransactionRequest) (*LabelTransactionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method LabelTransaction not implemented")
}
func RegisterWalletKitServer(s *grpc.Server, srv WalletKitServer) {
s.RegisterService(&_WalletKit_serviceDesc, srv)
}
File diff suppressed because it is too large. Load diff
+570 -5
View File
@@ -4,17 +4,425 @@
"title": "walletrpc/walletkit.proto",
"version": "version not set"
},
"schemes": [
"http",
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {},
"paths": {
"/v2/wallet/address/next": {
"post": {
"summary": "NextAddr returns the next unused address within the wallet.",
"operationId": "NextAddr",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/walletrpcAddrResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/walletrpcAddrRequest"
}
}
],
"tags": [
"WalletKit"
]
}
},
"/v2/wallet/bumpfee": {
"post": {
"summary": "BumpFee bumps the fee of an arbitrary input within a transaction. This RPC\ntakes a different approach than bitcoind's bumpfee command. lnd has a\ncentral batching engine in which inputs with similar fee rates are batched\ntogether to save on transaction fees. Due to this, we cannot rely on\nbumping the fee on a specific transaction, since transactions can change at\nany point with the addition of new inputs. The list of inputs that\ncurrently exist within lnd's central batching engine can be retrieved\nthrough the PendingSweeps RPC.",
"description": "When bumping the fee of an input that currently exists within lnd's central\nbatching engine, a higher fee transaction will be created that replaces the\nlower fee transaction through the Replace-By-Fee (RBF) policy. If it\n\nThis RPC also serves useful when wanting to perform a Child-Pays-For-Parent\n(CPFP), where the child transaction pays for its parent's fee. This can be\ndone by specifying an outpoint within the low fee transaction that is under\nthe control of the wallet.\n\nThe fee preference can be expressed either as a specific fee rate or a delta\nof blocks in which the output should be swept on-chain within. If a fee\npreference is not explicitly specified, then an error is returned.\n\nNote that this RPC currently doesn't perform any validation checks on the\nfee preference being provided. For now, the responsibility of ensuring that\nthe new fee preference is sufficient is delegated to the user.",
"operationId": "BumpFee",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/walletrpcBumpFeeResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/walletrpcBumpFeeRequest"
}
}
],
"tags": [
"WalletKit"
]
}
},
"/v2/wallet/estimatefee/{conf_target}": {
"get": {
"summary": "EstimateFee attempts to query the internal fee estimator of the wallet to\ndetermine the fee (in sat/kw) to attach to a transaction in order to\nachieve the confirmation target.",
"operationId": "EstimateFee",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/walletrpcEstimateFeeResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
{
"name": "conf_target",
"description": "The number of confirmations to shoot for when estimating the fee.",
"in": "path",
"required": true,
"type": "integer",
"format": "int32"
}
],
"tags": [
"WalletKit"
]
}
},
"/v2/wallet/key": {
"post": {
"summary": "DeriveKey attempts to derive an arbitrary key specified by the passed\nKeyLocator.",
"operationId": "DeriveKey",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/signrpcKeyDescriptor"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/signrpcKeyLocator"
}
}
],
"tags": [
"WalletKit"
]
}
},
"/v2/wallet/key/next": {
"post": {
"summary": "DeriveNextKey attempts to derive the *next* key within the key family\n(account in BIP43) specified. This method should return the next external\nchild within this branch.",
"operationId": "DeriveNextKey",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/signrpcKeyDescriptor"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/walletrpcKeyReq"
}
}
],
"tags": [
"WalletKit"
]
}
},
"/v2/wallet/send": {
"post": {
"summary": "SendOutputs is similar to the existing sendmany call in Bitcoind, and\nallows the caller to create a transaction that sends to several outputs at\nonce. This is ideal when wanting to batch create a set of transactions.",
"operationId": "SendOutputs",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/walletrpcSendOutputsResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/walletrpcSendOutputsRequest"
}
}
],
"tags": [
"WalletKit"
]
}
},
"/v2/wallet/sweeps": {
"get": {
"summary": "ListSweeps returns a list of the sweep transactions our node has produced.\nNote that these sweeps may not be confirmed yet, as we record sweeps on\nbroadcast, not confirmation.",
"operationId": "ListSweeps",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/walletrpcListSweepsResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
{
"name": "verbose",
"description": "Retrieve the full sweep transaction details. If false, only the sweep txids\nwill be returned.",
"in": "query",
"required": false,
"type": "boolean",
"format": "boolean"
}
],
"tags": [
"WalletKit"
]
}
},
"/v2/wallet/sweeps/pending": {
"get": {
"summary": "PendingSweeps returns lists of on-chain outputs that lnd is currently\nattempting to sweep within its central batching engine. Outputs with similar\nfee rates are batched together in order to sweep them within a single\ntransaction.",
"description": "NOTE: Some of the fields within PendingSweepsRequest are not guaranteed to\nremain supported. This is an advanced API that depends on the internals of\nthe UtxoSweeper, so things may change.",
"operationId": "PendingSweeps",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/walletrpcPendingSweepsResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"tags": [
"WalletKit"
]
}
},
"/v2/wallet/tx": {
"post": {
"summary": "PublishTransaction attempts to publish the passed transaction to the\nnetwork. Once this returns without an error, the wallet will continually\nattempt to re-broadcast the transaction on start up, until it enters the\nchain.",
"operationId": "PublishTransaction",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/walletrpcPublishResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/walletrpcTransaction"
}
}
],
"tags": [
"WalletKit"
]
}
},
"/v2/wallet/tx/label": {
"post": {
"summary": "LabelTransaction adds a label to a transaction. If the transaction already\nhas a label the call will fail unless the overwrite bool is set. This will\noverwrite the exiting transaction label. Labels must not be empty, and\ncannot exceed 500 characters.",
"operationId": "LabelTransaction",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/walletrpcLabelTransactionResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/walletrpcLabelTransactionRequest"
}
}
],
"tags": [
"WalletKit"
]
}
},
"/v2/wallet/utxos": {
"post": {
"summary": "ListUnspent returns a list of all utxos spendable by the wallet with a\nnumber of confirmations between the specified minimum and maximum.",
"operationId": "ListUnspent",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/walletrpcListUnspentResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"tags": [
"WalletKit"
]
}
},
"/v2/wallet/utxos/lease": {
"post": {
"summary": "LeaseOutput locks an output to the given ID, preventing it from being\navailable for any future coin selection attempts. The absolute time of the\nlock's expiration is returned. The expiration of the lock can be extended by\nsuccessive invocations of this RPC. Outputs can be unlocked before their\nexpiration through `ReleaseOutput`.",
"operationId": "LeaseOutput",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/walletrpcLeaseOutputResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/walletrpcLeaseOutputRequest"
}
}
],
"tags": [
"WalletKit"
]
}
},
"/v2/wallet/utxos/release": {
"post": {
"summary": "ReleaseOutput unlocks an output, allowing it to be available for coin\nselection if it remains unspent. The ID should match the one used to\noriginally lock the output.",
"operationId": "ReleaseOutput",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/walletrpcReleaseOutputResponse"
}
},
"default": {
"description": "An unexpected error response",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/walletrpcReleaseOutputRequest"
}
}
],
"tags": [
"WalletKit"
]
}
}
},
"definitions": {
"ListSweepsResponseTransactionIDs": {
"type": "object",
@@ -155,6 +563,39 @@
}
}
},
"protobufAny": {
"type": "object",
"properties": {
"type_url": {
"type": "string"
},
"value": {
"type": "string",
"format": "byte"
}
}
},
"runtimeError": {
"type": "object",
"properties": {
"error": {
"type": "string"
},
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"$ref": "#/definitions/protobufAny"
}
}
}
},
"signrpcKeyDescriptor": {
"type": "object",
"properties": {
@@ -199,6 +640,9 @@
}
}
},
"walletrpcAddrRequest": {
"type": "object"
},
"walletrpcAddrResponse": {
"type": "object",
"properties": {
@@ -208,6 +652,30 @@
}
}
},
"walletrpcBumpFeeRequest": {
"type": "object",
"properties": {
"outpoint": {
"$ref": "#/definitions/lnrpcOutPoint",
"description": "The input we're attempting to bump the fee of."
},
"target_conf": {
"type": "integer",
"format": "int64",
"description": "The target number of blocks that the input should be spent within."
},
"sat_per_byte": {
"type": "integer",
"format": "int64",
"description": "The fee rate, expressed in sat/byte, that should be used to spend the input\nwith."
},
"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."
}
}
},
"walletrpcBumpFeeResponse": {
"type": "object"
},
@@ -221,9 +689,57 @@
}
}
},
"walletrpcKeyReq": {
"type": "object",
"properties": {
"key_finger_print": {
"type": "integer",
"format": "int32",
"description": "Is the key finger print of the root pubkey that this request is targeting.\nThis allows the WalletKit to possibly serve out keys for multiple HD chains\nvia public derivation."
},
"key_family": {
"type": "integer",
"format": "int32",
"description": "The target key family to derive a key from. In other contexts, this is\nknown as the \"account\"."
}
}
},
"walletrpcLabelTransactionRequest": {
"type": "object",
"properties": {
"txid": {
"type": "string",
"format": "byte",
"description": "The txid of the transaction to label."
},
"label": {
"type": "string",
"description": "The label to add to the transaction, limited to 500 characters."
},
"overwrite": {
"type": "boolean",
"format": "boolean",
"description": "Whether to overwrite the existing label, if it is present."
}
}
},
"walletrpcLabelTransactionResponse": {
"type": "object"
},
"walletrpcLeaseOutputRequest": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "byte",
"description": "An ID of 32 random bytes that must be unique for each distinct application\nusing this RPC which will be used to bound the output lease to."
},
"outpoint": {
"$ref": "#/definitions/lnrpcOutPoint",
"description": "The identifying outpoint of the output being leased."
}
}
},
"walletrpcLeaseOutputResponse": {
"type": "object",
"properties": {
@@ -326,9 +842,44 @@
}
}
},
"walletrpcReleaseOutputRequest": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "byte",
"description": "The unique ID that was used to lock the output."
},
"outpoint": {
"$ref": "#/definitions/lnrpcOutPoint",
"description": "The identifying outpoint of the output being released."
}
}
},
"walletrpcReleaseOutputResponse": {
"type": "object"
},
"walletrpcSendOutputsRequest": {
"type": "object",
"properties": {
"sat_per_kw": {
"type": "string",
"format": "int64",
"description": "The number of satoshis per kilo weight that should be used when crafting\nthis transaction."
},
"outputs": {
"type": "array",
"items": {
"$ref": "#/definitions/signrpcTxOut"
},
"description": "A slice of the outputs that should be created in the transaction produced."
},
"label": {
"type": "string",
"description": "An optional label for the transaction, limited to 500 characters."
}
}
},
"walletrpcSendOutputsResponse": {
"type": "object",
"properties": {
@@ -339,6 +890,20 @@
}
}
},
"walletrpcTransaction": {
"type": "object",
"properties": {
"tx_hex": {
"type": "string",
"format": "byte",
"description": "The raw serialized transaction."
},
"label": {
"type": "string",
"description": "An optional label to save with the transaction. Limited to 500 characters."
}
}
},
"walletrpcWitnessType": {
"type": "string",
"enum": [