"summary":"ListAccounts retrieves all accounts belonging to the wallet by default. A\nname and key scope filter can be provided to filter through all of the\nwallet accounts and return only those matching.",
"description":"An optional filter to only return accounts matching this name.",
"in":"query",
"required":false,
"type":"string"
},
{
"name":"address_type",
"description":"An optional filter to only return accounts matching this address type.",
"in":"query",
"required":false,
"type":"string",
"enum":[
"UNKNOWN",
"WITNESS_PUBKEY_HASH",
"NESTED_WITNESS_PUBKEY_HASH",
"HYBRID_NESTED_WITNESS_PUBKEY_HASH"
],
"default":"UNKNOWN"
}
],
"tags":[
"WalletKit"
]
}
},
"/v2/wallet/accounts/import":{
"post":{
"summary":"ImportAccount imports an account backed by an account extended public key.\nThe master key fingerprint denotes the fingerprint of the root key\ncorresponding to the account public key (also known as the key with\nderivation path m/). This may be required by some hardware wallets for\nproper identification and signing.",
"description":"The address type can usually be inferred from the key's version, but may be\nrequired for certain keys to map them into the proper scope.\n\nFor BIP-0044 keys, an address type must be specified as we intend to not\nsupport importing BIP-0044 keys into the wallet using the legacy\npay-to-pubkey-hash (P2PKH) scheme. A nested witness address type will force\nthe standard BIP-0049 derivation scheme, while a witness address type will\nforce the standard BIP-0084 derivation scheme.\n\nFor BIP-0049 keys, an address type must also be specified to make a\ndistinction between the standard BIP-0049 address schema (nested witness\npubkeys everywhere) and our own BIP-0049Plus address schema (nested pubkeys\nexternally, witness pubkeys internally).\n\nNOTE: Events (deposits/spends) for keys derived from an account will only be\ndetected by lnd if they happen after the import. Rescans to detect past\nevents will be supported later on.",
"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.",
"summary":"ImportPublicKey imports a public key as watch-only into the wallet.",
"description":"NOTE: Events (deposits/spends) for a key will only be detected by lnd if\nthey happen after the import. Rescans to detect past events will be\nsupported later on.",
"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.",
"summary":"FinalizePsbt expects a partial transaction with all inputs and outputs fully\ndeclared and tries to sign all inputs that belong to the wallet. Lnd must be\nthe last signer of the transaction. That means, if there are any unsigned\nnon-witness inputs or inputs without UTXO information attached or inputs\nwithout witness data that do not belong to lnd's wallet, this method will\nfail. If no error is returned, the PSBT is ready to be extracted and the\nfinal TX within to be broadcast.",
"description":"NOTE: This method does NOT publish the transaction once finalized. It is the\ncaller's responsibility to either publish the transaction on success or\nunlock/release any locked UTXOs in case of an error in this method.",
"summary":"FundPsbt creates a fully populated PSBT that contains enough inputs to fund\nthe outputs specified in the template. There are two ways of specifying a\ntemplate: Either by passing in a PSBT with at least one output declared or\nby passing in a raw TxTemplate message.",
"description":"If there are no inputs specified in the template, coin selection is\nperformed automatically. If the template does contain any inputs, it is\nassumed that full coin selection happened externally and no additional\ninputs are added. If the specified inputs aren't enough to fund the outputs\nwith the given fee rate, an error is returned.\n\nAfter either selecting or verifying the inputs, all input UTXOs are locked\nwith an internal app ID.\n\nNOTE: If this method returns without an error, it is the caller's\nresponsibility to either spend the locked UTXOs (by finalizing and then\npublishing the transaction) or to unlock/release the locked UTXOs in case of\nan error on the caller's side.",
"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.",
"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.",
"description":"Retrieve the full sweep transaction details. If false, only the sweep txids\nwill be returned. Note that some sweeps that LND publishes will have been\nreplaced-by-fee, so will not be included in this output.",
"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.",
"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.",
"summary":"ListUnspent returns a list of all utxos spendable by the wallet with a\nnumber of confirmations between the specified minimum and maximum.",
"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`.",
"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.",
"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."
"description":"The name used to identify the account."
},
"address_type":{
"$ref":"#/definitions/walletrpcAddressType",
"title":"The type of addresses the account supports.\nAddressType | External Branch | Internal Branch\n---------------------------------------------------------------------\nWITNESS_PUBKEY_HASH | P2WPKH | P2WPKH\nNESTED_WITNESS_PUBKEY_HASH | NP2WPKH | NP2WPKH\nHYBRID_NESTED_WITNESS_PUBKEY_HASH | NP2WPKH | P2WPKH"
},
"extended_public_key":{
"type":"string",
"description":"The public key backing the account that all keys are derived from\nrepresented as an extended key. This will always be empty for the default\nimported account in which single public keys are imported into."
"description":"The fingerprint of the root key from which the account public key was\nderived from. This will always be zero for the default imported account in\nwhich single public keys are imported into. The bytes are in big-endian\norder."
"description":"The derivation path corresponding to the account public key. This will\nalways be empty for the default imported account in which single public keys\nare imported into."
},
"external_key_count":{
"type":"integer",
"format":"int64",
"description":"The number of keys derived from the external branch of the account public\nkey. This will always be zero for the default imported account in which\nsingle public keys are imported into."
},
"internal_key_count":{
"type":"integer",
"format":"int64",
"description":"The number of keys derived from the internal branch of the account public\nkey. This will always be zero for the default imported account in which\nsingle public keys are imported into."
},
"watch_only":{
"type":"boolean",
"format":"boolean",
"description":"Whether the wallet stores private keys for the account."
"description":"A PSBT that should be signed and finalized. The PSBT must contain all\nrequired inputs, outputs, UTXO data and partial signatures of all other\nsigners."
"description":"The fully signed and finalized transaction in PSBT format."
},
"raw_final_tx":{
"type":"string",
"format":"byte",
"description":"The fully signed and finalized transaction in the raw wire format."
}
}
},
"walletrpcFundPsbtRequest":{
"type":"object",
"properties":{
"psbt":{
"type":"string",
"format":"byte",
"description":"Use an existing PSBT packet as the template for the funded PSBT.\n\nThe packet must contain at least one non-dust output. If one or more\ninputs are specified, no coin selection is performed. In that case every\ninput must be an UTXO known to the wallet that has not been locked\nbefore. The sum of all inputs must be sufficiently greater than the sum\nof all outputs to pay a miner fee with the specified fee rate. A change\noutput is added to the PSBT if necessary."
},
"raw":{
"$ref":"#/definitions/walletrpcTxTemplate",
"description":"Use the outputs and optional inputs from this raw template."
},
"target_conf":{
"type":"integer",
"format":"int64",
"description":"The target number of blocks that the transaction should be confirmed in."
"description":"A name to identify the account with."
},
"extended_public_key":{
"type":"string",
"description":"A public key that corresponds to a wallet account represented as an extended\nkey. It must conform to a derivation path of the form\nm/purpose'/coin_type'/account'."
"description":"The fingerprint of the root key (also known as the key with derivation path\nm/) from which the account public key was derived from. This may be required\nby some hardware wallets for proper identification and signing. The bytes\nmust be in big-endian order."
"description":"An address type is only required when the extended account public key has a\nlegacy version (xpub, tpub, etc.), such that the wallet cannot detect what\naddress scheme it belongs to."
"description":"Whether a dry run should be attempted when importing the account. This\nserves as a way to confirm whether the account is being imported correctly\nby returning the first N addresses for the external and internal branches of\nthe account. If these addresses match as expected, then it should be safe to\nimport the account as is."
"description":"The details of the imported account."
},
"dry_run_external_addrs":{
"type":"array",
"items":{
"type":"string"
},
"description":"The first N addresses that belong to the external branch of the account.\nThe external branch is typically used for external non-change addresses.\nThese are only returned if a dry run was specified within the request."
},
"dry_run_internal_addrs":{
"type":"array",
"items":{
"type":"string"
},
"description":"The first N addresses that belong to the internal branch of the account.\nThe internal branch is typically used for change addresses. These are only\nreturned if a dry run was specified within the request."
"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."
"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."
"description":"Deprecated, use sat_per_vbyte.\nThe fee rate we'll use to sweep the output, expressed in sat/vbyte. The fee\nrate is only determined once a sweeping transaction for the output is\ncreated, so it's possible for this to be 0 before this."
"description":"Deprecated, use requested_sat_per_vbyte.\nThe requested fee rate, expressed in sat/vbyte, for this output."
},
"sat_per_vbyte":{
"type":"string",
"format":"uint64",
"description":"The fee rate we'll use to sweep the output, expressed in sat/vbyte. The fee\nrate is only determined once a sweeping transaction for the output is\ncreated, so it's possible for this to be 0 before this."
"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"
"description":"An optional list of inputs to use. Every input must be an UTXO known to the\nwallet that has not been locked before. The sum of all inputs must be\nsufficiently greater than the sum of all outputs to pay a miner fee with the\nfee rate specified in the parent message.\n\nIf no inputs are specified, coin selection will be performed instead and\ninputs of sufficient value will be added to the resulting PSBT."
},
"outputs":{
"type":"object",
"additionalProperties":{
"type":"string",
"format":"uint64"
},
"description":"A map of all addresses and the amounts to send to in the funded PSBT."
}
}
},
"walletrpcUtxoLease":{
"type":"object",
"properties":{
"id":{
"type":"string",
"format":"byte",
"description":"A 32 byte random ID that identifies the lease."
},
"outpoint":{
"$ref":"#/definitions/lnrpcOutPoint",
"description":"The identifying outpoint of the output being leased."
},
"expiration":{
"type":"string",
"format":"uint64",
"description":"The absolute expiration of the output lease represented as a unix timestamp."
"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."