lnrpc: unify proto style by moving services to top of file
This commit is contained in:
7 files changed
+315
-300
No files matched your search
@@ -7,6 +7,98 @@ package walletrpc;
|
||||
|
||||
option go_package = "github.com/lightningnetwork/lnd/lnrpc/walletrpc";
|
||||
|
||||
// WalletKit is a service that gives access to the core functionalities of the
|
||||
// daemon's wallet.
|
||||
service WalletKit {
|
||||
/**
|
||||
DeriveNextKey attempts to derive the *next* key within the key family
|
||||
(account in BIP43) specified. This method should return the next external
|
||||
child within this branch.
|
||||
*/
|
||||
rpc DeriveNextKey (KeyReq) returns (signrpc.KeyDescriptor);
|
||||
|
||||
/**
|
||||
DeriveKey attempts to derive an arbitrary key specified by the passed
|
||||
KeyLocator.
|
||||
*/
|
||||
rpc DeriveKey (signrpc.KeyLocator) returns (signrpc.KeyDescriptor);
|
||||
|
||||
/**
|
||||
NextAddr returns the next unused address within the wallet.
|
||||
*/
|
||||
rpc NextAddr (AddrRequest) returns (AddrResponse);
|
||||
|
||||
/**
|
||||
PublishTransaction attempts to publish the passed transaction to the
|
||||
network. Once this returns without an error, the wallet will continually
|
||||
attempt to re-broadcast the transaction on start up, until it enters the
|
||||
chain.
|
||||
*/
|
||||
rpc PublishTransaction (Transaction) returns (PublishResponse);
|
||||
|
||||
/**
|
||||
SendOutputs is similar to the existing sendmany call in Bitcoind, and
|
||||
allows the caller to create a transaction that sends to several outputs at
|
||||
once. This is ideal when wanting to batch create a set of transactions.
|
||||
*/
|
||||
rpc SendOutputs (SendOutputsRequest) returns (SendOutputsResponse);
|
||||
|
||||
/**
|
||||
EstimateFee attempts to query the internal fee estimator of the wallet to
|
||||
determine the fee (in sat/kw) to attach to a transaction in order to
|
||||
achieve the confirmation target.
|
||||
*/
|
||||
rpc EstimateFee (EstimateFeeRequest) returns (EstimateFeeResponse);
|
||||
|
||||
/*
|
||||
PendingSweeps returns lists of on-chain outputs that lnd is currently
|
||||
attempting to sweep within its central batching engine. Outputs with similar
|
||||
fee rates are batched together in order to sweep them within a single
|
||||
transaction.
|
||||
|
||||
NOTE: Some of the fields within PendingSweepsRequest are not guaranteed to
|
||||
remain supported. This is an advanced API that depends on the internals of
|
||||
the UtxoSweeper, so things may change.
|
||||
*/
|
||||
rpc PendingSweeps (PendingSweepsRequest) returns (PendingSweepsResponse);
|
||||
|
||||
/*
|
||||
BumpFee bumps the fee of an arbitrary input within a transaction. This RPC
|
||||
takes a different approach than bitcoind's bumpfee command. lnd has a
|
||||
central batching engine in which inputs with similar fee rates are batched
|
||||
together to save on transaction fees. Due to this, we cannot rely on
|
||||
bumping the fee on a specific transaction, since transactions can change at
|
||||
any point with the addition of new inputs. The list of inputs that
|
||||
currently exist within lnd's central batching engine can be retrieved
|
||||
through the PendingSweeps RPC.
|
||||
|
||||
When bumping the fee of an input that currently exists within lnd's central
|
||||
batching engine, a higher fee transaction will be created that replaces the
|
||||
lower fee transaction through the Replace-By-Fee (RBF) policy. If it
|
||||
|
||||
This RPC also serves useful when wanting to perform a Child-Pays-For-Parent
|
||||
(CPFP), where the child transaction pays for its parent's fee. This can be
|
||||
done by specifying an outpoint within the low fee transaction that is under
|
||||
the control of the wallet.
|
||||
|
||||
The fee preference can be expressed either as a specific fee rate or a delta
|
||||
of blocks in which the output should be swept on-chain within. If a fee
|
||||
preference is not explicitly specified, then an error is returned.
|
||||
|
||||
Note that this RPC currently doesn't perform any validation checks on the
|
||||
fee preference being provided. For now, the responsibility of ensuring that
|
||||
the new fee preference is sufficient is delegated to the user.
|
||||
*/
|
||||
rpc BumpFee (BumpFeeRequest) returns (BumpFeeResponse);
|
||||
|
||||
/**
|
||||
ListSweeps returns a list of the sweep transactions our node has produced.
|
||||
Note that these sweeps may not be confirmed yet, as we record sweeps on
|
||||
broadcast, not confirmation.
|
||||
*/
|
||||
rpc ListSweeps (ListSweepsRequest) returns (ListSweepsResponse);
|
||||
}
|
||||
|
||||
message KeyReq {
|
||||
/**
|
||||
Is the key finger print of the root pubkey that this request is targeting.
|
||||
@@ -244,7 +336,6 @@ message BumpFeeRequest {
|
||||
message BumpFeeResponse {
|
||||
}
|
||||
|
||||
|
||||
message ListSweepsRequest {
|
||||
/*
|
||||
Retrieve the full sweep transaction details. If false, only the sweep txids
|
||||
@@ -268,95 +359,3 @@ message ListSweepsResponse {
|
||||
TransactionIDs transaction_ids = 2;
|
||||
}
|
||||
}
|
||||
|
||||
service WalletKit {
|
||||
/**
|
||||
DeriveNextKey attempts to derive the *next* key within the key family
|
||||
(account in BIP43) specified. This method should return the next external
|
||||
child within this branch.
|
||||
*/
|
||||
rpc DeriveNextKey (KeyReq) returns (signrpc.KeyDescriptor);
|
||||
|
||||
/**
|
||||
DeriveKey attempts to derive an arbitrary key specified by the passed
|
||||
KeyLocator.
|
||||
*/
|
||||
rpc DeriveKey (signrpc.KeyLocator) returns (signrpc.KeyDescriptor);
|
||||
|
||||
/**
|
||||
NextAddr returns the next unused address within the wallet.
|
||||
*/
|
||||
rpc NextAddr (AddrRequest) returns (AddrResponse);
|
||||
|
||||
/**
|
||||
PublishTransaction attempts to publish the passed transaction to the
|
||||
network. Once this returns without an error, the wallet will continually
|
||||
attempt to re-broadcast the transaction on start up, until it enters the
|
||||
chain.
|
||||
*/
|
||||
rpc PublishTransaction (Transaction) returns (PublishResponse);
|
||||
|
||||
/**
|
||||
SendOutputs is similar to the existing sendmany call in Bitcoind, and
|
||||
allows the caller to create a transaction that sends to several outputs at
|
||||
once. This is ideal when wanting to batch create a set of transactions.
|
||||
*/
|
||||
rpc SendOutputs (SendOutputsRequest) returns (SendOutputsResponse);
|
||||
|
||||
/**
|
||||
EstimateFee attempts to query the internal fee estimator of the wallet to
|
||||
determine the fee (in sat/kw) to attach to a transaction in order to
|
||||
achieve the confirmation target.
|
||||
*/
|
||||
rpc EstimateFee (EstimateFeeRequest) returns (EstimateFeeResponse);
|
||||
|
||||
/*
|
||||
PendingSweeps returns lists of on-chain outputs that lnd is currently
|
||||
attempting to sweep within its central batching engine. Outputs with similar
|
||||
fee rates are batched together in order to sweep them within a single
|
||||
transaction.
|
||||
|
||||
NOTE: Some of the fields within PendingSweepsRequest are not guaranteed to
|
||||
remain supported. This is an advanced API that depends on the internals of
|
||||
the UtxoSweeper, so things may change.
|
||||
*/
|
||||
rpc PendingSweeps (PendingSweepsRequest) returns (PendingSweepsResponse);
|
||||
|
||||
/*
|
||||
BumpFee bumps the fee of an arbitrary input within a transaction. This RPC
|
||||
takes a different approach than bitcoind's bumpfee command. lnd has a
|
||||
central batching engine in which inputs with similar fee rates are batched
|
||||
together to save on transaction fees. Due to this, we cannot rely on
|
||||
bumping the fee on a specific transaction, since transactions can change at
|
||||
any point with the addition of new inputs. The list of inputs that
|
||||
currently exist within lnd's central batching engine can be retrieved
|
||||
through the PendingSweeps RPC.
|
||||
|
||||
When bumping the fee of an input that currently exists within lnd's central
|
||||
batching engine, a higher fee transaction will be created that replaces the
|
||||
lower fee transaction through the Replace-By-Fee (RBF) policy. If it
|
||||
|
||||
This RPC also serves useful when wanting to perform a Child-Pays-For-Parent
|
||||
(CPFP), where the child transaction pays for its parent's fee. This can be
|
||||
done by specifying an outpoint within the low fee transaction that is under
|
||||
the control of the wallet.
|
||||
|
||||
The fee preference can be expressed either as a specific fee rate or a delta
|
||||
of blocks in which the output should be swept on-chain within. If a fee
|
||||
preference is not explicitly specified, then an error is returned.
|
||||
|
||||
Note that this RPC currently doesn't perform any validation checks on the
|
||||
fee preference being provided. For now, the responsibility of ensuring that
|
||||
the new fee preference is sufficient is delegated to the user.
|
||||
*/
|
||||
rpc BumpFee (BumpFeeRequest) returns (BumpFeeResponse);
|
||||
|
||||
|
||||
/**
|
||||
ListSweeps returns a list of the sweep transactions our node has produced.
|
||||
Note that these sweeps may not be confirmed yet, as we record sweeps on
|
||||
broadcast, not confirmation.
|
||||
*/
|
||||
rpc ListSweeps (ListSweepsRequest) returns (ListSweepsResponse) {}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user