mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
Define the AccountPayments RPC endpoint and its request/response messages in lit-accounts.proto. This endpoint allows querying paginated payment history for a specific account. Also update the frontend JS/TS proto sanitization script to map the imported lnd.proto file to its flat directory path, fixing app build.
1035 lines
38 KiB
JSON
1035 lines
38 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"title": "lit-accounts.proto",
|
|
"version": "version not set"
|
|
},
|
|
"tags": [
|
|
{
|
|
"name": "Accounts"
|
|
}
|
|
],
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"paths": {
|
|
"/v1/accounts": {
|
|
"get": {
|
|
"summary": "litcli: `accounts list`\nListAccounts returns all accounts that are currently stored in the account\ndatabase.",
|
|
"operationId": "Accounts_ListAccounts",
|
|
"responses": {
|
|
"200": {
|
|
"description": "A successful response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/litrpcListAccountsResponse"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "An unexpected error response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/rpcStatus"
|
|
}
|
|
}
|
|
},
|
|
"tags": [
|
|
"Accounts"
|
|
]
|
|
},
|
|
"post": {
|
|
"summary": "litcli: `accounts create`\nCreateAccount adds an entry to the account database. This entry represents\nan amount of satoshis (account balance) that can be spent using off-chain\ntransactions (e.g. paying invoices).",
|
|
"description": "Macaroons can be created to be locked to an account. This makes sure that\nthe bearer of the macaroon can only spend at most that amount of satoshis\nthrough the daemon that has issued the macaroon.\n\nAccounts only assert a maximum amount spendable. Having a certain account\nbalance does not guarantee that the node has the channel liquidity to\nactually spend that amount.",
|
|
"operationId": "Accounts_CreateAccount",
|
|
"responses": {
|
|
"200": {
|
|
"description": "A successful response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/litrpcCreateAccountResponse"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "An unexpected error response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/rpcStatus"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/litrpcCreateAccountRequest"
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
"Accounts"
|
|
]
|
|
}
|
|
},
|
|
"/v1/accounts/credit/{account.id}": {
|
|
"post": {
|
|
"summary": "litcli: `accounts update credit`\nCreditAccount increases the balance of an existing account in the account\ndatabase.",
|
|
"operationId": "Accounts_CreditAccount",
|
|
"responses": {
|
|
"200": {
|
|
"description": "A successful response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/litrpcCreditAccountResponse"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "An unexpected error response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/rpcStatus"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "account.id",
|
|
"description": "The ID of the account.",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/AccountsCreditAccountBody"
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
"Accounts"
|
|
]
|
|
}
|
|
},
|
|
"/v1/accounts/debit/{account.id}": {
|
|
"post": {
|
|
"summary": "litcli: `accounts update debit`\nDebitAccount decreases the balance of an existing account in the account\ndatabase.",
|
|
"operationId": "Accounts_DebitAccount",
|
|
"responses": {
|
|
"200": {
|
|
"description": "A successful response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/litrpcDebitAccountResponse"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "An unexpected error response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/rpcStatus"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "account.id",
|
|
"description": "The ID of the account.",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/AccountsDebitAccountBody"
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
"Accounts"
|
|
]
|
|
}
|
|
},
|
|
"/v1/accounts/payments": {
|
|
"get": {
|
|
"summary": "litcli: `accounts payments`\nAccountPayments returns the detailed payment history for the given account.",
|
|
"operationId": "Accounts_AccountPayments",
|
|
"responses": {
|
|
"200": {
|
|
"description": "A successful response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/litrpcAccountPaymentsResponse"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "An unexpected error response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/rpcStatus"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "account.id",
|
|
"description": "The ID of the account.",
|
|
"in": "query",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "account.label",
|
|
"description": "The label of the account.",
|
|
"in": "query",
|
|
"required": false,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "max_payments",
|
|
"description": "The maximum number of payments to return. If set to 0, it will default\nto 20. Capped at 50.",
|
|
"in": "query",
|
|
"required": false,
|
|
"type": "string",
|
|
"format": "uint64"
|
|
},
|
|
{
|
|
"name": "index_offset",
|
|
"description": "The row offset into the list of payments that will be used as the start of\nthe query. The payments are returned in ascending lexicographical order of\ntheir payment hash.",
|
|
"in": "query",
|
|
"required": false,
|
|
"type": "string",
|
|
"format": "uint64"
|
|
},
|
|
{
|
|
"name": "count_total_payments",
|
|
"description": "If set, the total number of payments matching the query will be returned\nin the response.",
|
|
"in": "query",
|
|
"required": false,
|
|
"type": "boolean"
|
|
}
|
|
],
|
|
"tags": [
|
|
"Accounts"
|
|
]
|
|
}
|
|
},
|
|
"/v1/accounts/{id}": {
|
|
"delete": {
|
|
"summary": "litcli: `accounts remove`\nRemoveAccount removes the given account from the account database.",
|
|
"operationId": "Accounts_RemoveAccount",
|
|
"responses": {
|
|
"200": {
|
|
"description": "A successful response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/litrpcRemoveAccountResponse"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "An unexpected error response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/rpcStatus"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"description": "The hexadecimal ID of the account to remove. Either the ID or the label must\nbe set.",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "label",
|
|
"description": "The label of the account to remove. If an account has no label, then the ID\nmust be used instead.",
|
|
"in": "query",
|
|
"required": false,
|
|
"type": "string"
|
|
}
|
|
],
|
|
"tags": [
|
|
"Accounts"
|
|
]
|
|
},
|
|
"post": {
|
|
"summary": "litcli: `accounts update`\nUpdateAccount updates an existing account in the account database.",
|
|
"operationId": "Accounts_UpdateAccount",
|
|
"responses": {
|
|
"200": {
|
|
"description": "A successful response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/litrpcAccount"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "An unexpected error response.",
|
|
"schema": {
|
|
"$ref": "#/definitions/rpcStatus"
|
|
}
|
|
}
|
|
},
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"description": "The ID of the account to update. Either the ID or the label must be set.",
|
|
"in": "path",
|
|
"required": true,
|
|
"type": "string"
|
|
},
|
|
{
|
|
"name": "body",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/AccountsUpdateAccountBody"
|
|
}
|
|
}
|
|
],
|
|
"tags": [
|
|
"Accounts"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"AccountsCreditAccountBody": {
|
|
"type": "object",
|
|
"properties": {
|
|
"account": {
|
|
"type": "object",
|
|
"properties": {
|
|
"label": {
|
|
"type": "string",
|
|
"description": "The label of the account."
|
|
}
|
|
},
|
|
"description": "The identifier of the account to credit.",
|
|
"title": "The identifier of the account to credit."
|
|
},
|
|
"amount": {
|
|
"type": "string",
|
|
"format": "uint64",
|
|
"description": "The amount by which the account's balance should be credited."
|
|
}
|
|
}
|
|
},
|
|
"AccountsDebitAccountBody": {
|
|
"type": "object",
|
|
"properties": {
|
|
"account": {
|
|
"type": "object",
|
|
"properties": {
|
|
"label": {
|
|
"type": "string",
|
|
"description": "The label of the account."
|
|
}
|
|
},
|
|
"description": "The identifier of the account to debit.",
|
|
"title": "The identifier of the account to debit."
|
|
},
|
|
"amount": {
|
|
"type": "string",
|
|
"format": "uint64",
|
|
"description": "The amount by which the account's balance should be debited."
|
|
}
|
|
}
|
|
},
|
|
"AccountsUpdateAccountBody": {
|
|
"type": "object",
|
|
"properties": {
|
|
"account_balance": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"description": "Deprecated, use the `litcli update credit` or `litcli update debit`\ncommands instead. The new account balance to set. Set to -1 to not\nupdate the balance."
|
|
},
|
|
"expiration_date": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"description": "The new account expiry to set. Set to -1 to not update the expiry. Set to 0\nto never expire."
|
|
},
|
|
"label": {
|
|
"type": "string",
|
|
"description": "The label of the account to update. If an account has no label, then the ID\nmust be used instead. This field is only used to identify the account."
|
|
},
|
|
"new_label": {
|
|
"type": "string",
|
|
"description": "The new label to set for the account."
|
|
}
|
|
}
|
|
},
|
|
"FailureFailureCode": {
|
|
"type": "string",
|
|
"enum": [
|
|
"RESERVED",
|
|
"INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS",
|
|
"INCORRECT_PAYMENT_AMOUNT",
|
|
"FINAL_INCORRECT_CLTV_EXPIRY",
|
|
"FINAL_INCORRECT_HTLC_AMOUNT",
|
|
"FINAL_EXPIRY_TOO_SOON",
|
|
"INVALID_REALM",
|
|
"EXPIRY_TOO_SOON",
|
|
"INVALID_ONION_VERSION",
|
|
"INVALID_ONION_HMAC",
|
|
"INVALID_ONION_KEY",
|
|
"AMOUNT_BELOW_MINIMUM",
|
|
"FEE_INSUFFICIENT",
|
|
"INCORRECT_CLTV_EXPIRY",
|
|
"CHANNEL_DISABLED",
|
|
"TEMPORARY_CHANNEL_FAILURE",
|
|
"REQUIRED_NODE_FEATURE_MISSING",
|
|
"REQUIRED_CHANNEL_FEATURE_MISSING",
|
|
"UNKNOWN_NEXT_PEER",
|
|
"TEMPORARY_NODE_FAILURE",
|
|
"PERMANENT_NODE_FAILURE",
|
|
"PERMANENT_CHANNEL_FAILURE",
|
|
"EXPIRY_TOO_FAR",
|
|
"MPP_TIMEOUT",
|
|
"INVALID_ONION_PAYLOAD",
|
|
"INVALID_ONION_BLINDING",
|
|
"INTERNAL_FAILURE",
|
|
"UNKNOWN_FAILURE",
|
|
"UNREADABLE_FAILURE"
|
|
],
|
|
"default": "RESERVED",
|
|
"description": " - RESERVED: The numbers assigned in this enumeration match the failure codes as\ndefined in BOLT #4. Because protobuf 3 requires enums to start with 0,\na RESERVED value is added.\n - INTERNAL_FAILURE: An internal error occurred.\n - UNKNOWN_FAILURE: The error source is known, but the failure itself couldn't be decoded.\n - UNREADABLE_FAILURE: An unreadable failure result is returned if the received failure message\ncannot be decrypted. In that case the error source is unknown."
|
|
},
|
|
"HTLCAttemptHTLCStatus": {
|
|
"type": "string",
|
|
"enum": [
|
|
"IN_FLIGHT",
|
|
"SUCCEEDED",
|
|
"FAILED"
|
|
],
|
|
"default": "IN_FLIGHT"
|
|
},
|
|
"PaymentPaymentStatus": {
|
|
"type": "string",
|
|
"enum": [
|
|
"UNKNOWN",
|
|
"IN_FLIGHT",
|
|
"SUCCEEDED",
|
|
"FAILED",
|
|
"INITIATED"
|
|
],
|
|
"default": "UNKNOWN",
|
|
"description": " - UNKNOWN: Deprecated. This status will never be returned.\n - IN_FLIGHT: Payment has inflight HTLCs.\n - SUCCEEDED: Payment is settled.\n - FAILED: Payment is failed.\n - INITIATED: Payment is created and has not attempted any HTLCs."
|
|
},
|
|
"litrpcAccount": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"description": "The ID of the account."
|
|
},
|
|
"initial_balance": {
|
|
"type": "string",
|
|
"format": "uint64",
|
|
"description": "The initial balance in satoshis that was set when the account was created."
|
|
},
|
|
"current_balance": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"description": "The current balance in satoshis."
|
|
},
|
|
"last_update": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"description": "Timestamp of the last time the account was updated."
|
|
},
|
|
"expiration_date": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"description": "Timestamp of the account's expiration date. Zero means it does not expire."
|
|
},
|
|
"invoices": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"$ref": "#/definitions/litrpcAccountInvoice"
|
|
},
|
|
"description": "The list of invoices created by the account. An invoice created by an\naccount will credit the account balance if it is settled."
|
|
},
|
|
"payments": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"$ref": "#/definitions/litrpcAccountPayment"
|
|
},
|
|
"description": "The list of payments made by the account. A payment made by an account will\ndebit the account balance if it is settled."
|
|
},
|
|
"label": {
|
|
"type": "string",
|
|
"description": "An optional label to identify the account. If this is not empty, then it is\nguaranteed to be unique."
|
|
}
|
|
}
|
|
},
|
|
"litrpcAccountIdentifier": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"description": "The ID of the account."
|
|
},
|
|
"label": {
|
|
"type": "string",
|
|
"description": "The label of the account."
|
|
}
|
|
}
|
|
},
|
|
"litrpcAccountInvoice": {
|
|
"type": "object",
|
|
"properties": {
|
|
"hash": {
|
|
"type": "string",
|
|
"format": "byte",
|
|
"description": "The payment hash of the invoice."
|
|
}
|
|
}
|
|
},
|
|
"litrpcAccountPayment": {
|
|
"type": "object",
|
|
"properties": {
|
|
"hash": {
|
|
"type": "string",
|
|
"format": "byte",
|
|
"description": "The payment hash."
|
|
},
|
|
"state": {
|
|
"type": "string",
|
|
"description": "The state of the payment as reported by lnd."
|
|
},
|
|
"full_amount": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"description": "The full amount in satoshis reserved for this payment. This includes the\nrouting fee estimated by the fee limit of the payment request. The actual\ndebited amount will likely be lower if the fee is below the limit."
|
|
}
|
|
}
|
|
},
|
|
"litrpcAccountPaymentsResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"payments": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"$ref": "#/definitions/lnrpcPayment"
|
|
},
|
|
"description": "The detailed payments associated with the account, sorted in ascending\nlexicographical order of their payment hash."
|
|
},
|
|
"first_index_offset": {
|
|
"type": "string",
|
|
"format": "uint64",
|
|
"description": "The row offset of the first payment returned."
|
|
},
|
|
"last_index_offset": {
|
|
"type": "string",
|
|
"format": "uint64",
|
|
"description": "The row offset of the last payment returned. This can be used as the\nindex_offset in a subsequent query to paginate forwards."
|
|
},
|
|
"total_num_payments": {
|
|
"type": "string",
|
|
"format": "uint64",
|
|
"description": "The total number of payments matching the query (only set if\ncount_total_payments was true in the request)."
|
|
}
|
|
}
|
|
},
|
|
"litrpcCreateAccountRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"account_balance": {
|
|
"type": "string",
|
|
"format": "uint64",
|
|
"description": "The initial account balance in satoshis representing the maximum amount that\ncan be spent."
|
|
},
|
|
"expiration_date": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"description": "The expiration date of the account as a timestamp. Set to 0 to never expire."
|
|
},
|
|
"label": {
|
|
"type": "string",
|
|
"description": "An optional label to identify the account. If the label is not empty, then\nit must be unique, otherwise it couldn't be used to query a single account."
|
|
}
|
|
}
|
|
},
|
|
"litrpcCreateAccountResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"account": {
|
|
"$ref": "#/definitions/litrpcAccount",
|
|
"description": "The new account that was created."
|
|
},
|
|
"macaroon": {
|
|
"type": "string",
|
|
"format": "byte",
|
|
"description": "The macaroon with all permissions required to access the account."
|
|
}
|
|
}
|
|
},
|
|
"litrpcCreditAccountResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"account": {
|
|
"$ref": "#/definitions/litrpcAccount",
|
|
"description": "The credited account."
|
|
}
|
|
}
|
|
},
|
|
"litrpcDebitAccountResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"account": {
|
|
"$ref": "#/definitions/litrpcAccount",
|
|
"description": "The debited account."
|
|
}
|
|
}
|
|
},
|
|
"litrpcListAccountsResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"accounts": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"$ref": "#/definitions/litrpcAccount"
|
|
},
|
|
"description": "All accounts in the account database."
|
|
}
|
|
}
|
|
},
|
|
"litrpcRemoveAccountResponse": {
|
|
"type": "object"
|
|
},
|
|
"lnrpcAMPRecord": {
|
|
"type": "object",
|
|
"properties": {
|
|
"root_share": {
|
|
"type": "string",
|
|
"format": "byte"
|
|
},
|
|
"set_id": {
|
|
"type": "string",
|
|
"format": "byte"
|
|
},
|
|
"child_index": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
}
|
|
}
|
|
},
|
|
"lnrpcChannelUpdate": {
|
|
"type": "object",
|
|
"properties": {
|
|
"signature": {
|
|
"type": "string",
|
|
"format": "byte",
|
|
"description": "The signature that validates the announced data and proves the ownership\nof node id."
|
|
},
|
|
"chain_hash": {
|
|
"type": "string",
|
|
"format": "byte",
|
|
"description": "The target chain that this channel was opened within. This value\nshould be the genesis hash of the target chain. Along with the short\nchannel ID, this uniquely identifies the channel globally in a\nblockchain."
|
|
},
|
|
"chan_id": {
|
|
"type": "string",
|
|
"format": "uint64",
|
|
"description": "The unique description of the funding transaction."
|
|
},
|
|
"timestamp": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"description": "A timestamp that allows ordering in the case of multiple announcements.\nWe should ignore the message if timestamp is not greater than the\nlast-received."
|
|
},
|
|
"message_flags": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"description": "The bitfield that describes whether optional fields are present in this\nupdate. Currently, the least-significant bit must be set to 1 if the\noptional field MaxHtlc is present."
|
|
},
|
|
"channel_flags": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"description": "The bitfield that describes additional meta-data concerning how the\nupdate is to be interpreted. Currently, the least-significant bit must be\nset to 0 if the creating node corresponds to the first node in the\npreviously sent channel announcement and 1 otherwise. If the second bit\nis set, then the channel is set to be disabled."
|
|
},
|
|
"time_lock_delta": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"description": "The minimum number of blocks this node requires to be added to the expiry\nof HTLCs. This is a security parameter determined by the node operator.\nThis value represents the required gap between the time locks of the\nincoming and outgoing HTLC's set to this node."
|
|
},
|
|
"htlc_minimum_msat": {
|
|
"type": "string",
|
|
"format": "uint64",
|
|
"description": "The minimum HTLC value which will be accepted."
|
|
},
|
|
"base_fee": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"description": "The base fee that must be used for incoming HTLC's to this particular\nchannel. This value will be tacked onto the required for a payment\nindependent of the size of the payment."
|
|
},
|
|
"fee_rate": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"description": "The fee rate that will be charged per millionth of a satoshi."
|
|
},
|
|
"htlc_maximum_msat": {
|
|
"type": "string",
|
|
"format": "uint64",
|
|
"description": "The maximum HTLC value which will be accepted."
|
|
},
|
|
"extra_opaque_data": {
|
|
"type": "string",
|
|
"format": "byte",
|
|
"description": "The set of data that was appended to this message, some of which we may\nnot actually know how to iterate or parse. By holding onto this data, we\nensure that we're able to properly validate the set of signatures that\ncover these new fields, and ensure we're able to make upgrades to the\nnetwork in a forwards compatible manner."
|
|
}
|
|
}
|
|
},
|
|
"lnrpcFailure": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"$ref": "#/definitions/FailureFailureCode",
|
|
"title": "Failure code as defined in the Lightning spec"
|
|
},
|
|
"channel_update": {
|
|
"$ref": "#/definitions/lnrpcChannelUpdate",
|
|
"description": "An optional channel update message."
|
|
},
|
|
"htlc_msat": {
|
|
"type": "string",
|
|
"format": "uint64",
|
|
"description": "A failure type-dependent htlc value."
|
|
},
|
|
"onion_sha_256": {
|
|
"type": "string",
|
|
"format": "byte",
|
|
"description": "The sha256 sum of the onion payload."
|
|
},
|
|
"cltv_expiry": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"description": "A failure type-dependent cltv expiry value."
|
|
},
|
|
"flags": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"description": "A failure type-dependent flags value."
|
|
},
|
|
"failure_source_index": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"description": "The position in the path of the intermediate or final node that generated\nthe failure message. Position zero is the sender node."
|
|
},
|
|
"height": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"description": "A failure type-dependent block height."
|
|
}
|
|
}
|
|
},
|
|
"lnrpcHTLCAttempt": {
|
|
"type": "object",
|
|
"properties": {
|
|
"attempt_id": {
|
|
"type": "string",
|
|
"format": "uint64",
|
|
"description": "The unique ID that is used for this attempt."
|
|
},
|
|
"status": {
|
|
"$ref": "#/definitions/HTLCAttemptHTLCStatus",
|
|
"description": "The status of the HTLC."
|
|
},
|
|
"route": {
|
|
"$ref": "#/definitions/lnrpcRoute",
|
|
"description": "The route taken by this HTLC."
|
|
},
|
|
"attempt_time_ns": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"description": "The time in UNIX nanoseconds at which this HTLC was sent."
|
|
},
|
|
"resolve_time_ns": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"description": "The time in UNIX nanoseconds at which this HTLC was settled or failed.\nThis value will not be set if the HTLC is still IN_FLIGHT."
|
|
},
|
|
"failure": {
|
|
"$ref": "#/definitions/lnrpcFailure",
|
|
"description": "Detailed htlc failure info."
|
|
},
|
|
"preimage": {
|
|
"type": "string",
|
|
"format": "byte",
|
|
"description": "The preimage that was used to settle the HTLC."
|
|
}
|
|
}
|
|
},
|
|
"lnrpcHop": {
|
|
"type": "object",
|
|
"properties": {
|
|
"chan_id": {
|
|
"type": "string",
|
|
"format": "uint64",
|
|
"description": "The unique channel ID for the channel. The first 3 bytes are the block\nheight, the next 3 the index within the block, and the last 2 bytes are the\noutput index for the channel."
|
|
},
|
|
"chan_capacity": {
|
|
"type": "string",
|
|
"format": "int64"
|
|
},
|
|
"amt_to_forward": {
|
|
"type": "string",
|
|
"format": "int64"
|
|
},
|
|
"fee": {
|
|
"type": "string",
|
|
"format": "int64"
|
|
},
|
|
"expiry": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"amt_to_forward_msat": {
|
|
"type": "string",
|
|
"format": "int64"
|
|
},
|
|
"fee_msat": {
|
|
"type": "string",
|
|
"format": "int64"
|
|
},
|
|
"pub_key": {
|
|
"type": "string",
|
|
"description": "An optional public key of the hop. If the public key is given, the payment\ncan be executed without relying on a copy of the channel graph."
|
|
},
|
|
"tlv_payload": {
|
|
"type": "boolean",
|
|
"description": "If set to true, then this hop will be encoded using the new variable length\nTLV format. Note that if any custom tlv_records below are specified, then\nthis field MUST be set to true for them to be encoded properly."
|
|
},
|
|
"mpp_record": {
|
|
"$ref": "#/definitions/lnrpcMPPRecord",
|
|
"description": "An optional TLV record that signals the use of an MPP payment. If present,\nthe receiver will enforce that the same mpp_record is included in the final\nhop payload of all non-zero payments in the HTLC set. If empty, a regular\nsingle-shot payment is or was attempted."
|
|
},
|
|
"amp_record": {
|
|
"$ref": "#/definitions/lnrpcAMPRecord",
|
|
"description": "An optional TLV record that signals the use of an AMP payment. If present,\nthe receiver will treat all received payments including the same\n(payment_addr, set_id) pair as being part of one logical payment. The\npayment will be settled by XORing the root_share's together and deriving the\nchild hashes and preimages according to BOLT XX. Must be used in conjunction\nwith mpp_record."
|
|
},
|
|
"custom_records": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string",
|
|
"format": "byte"
|
|
},
|
|
"description": "An optional set of key-value TLV records. This is useful within the context\nof the SendToRoute call as it allows callers to specify arbitrary K-V pairs\nto drop off at each hop within the onion."
|
|
},
|
|
"metadata": {
|
|
"type": "string",
|
|
"format": "byte",
|
|
"description": "The payment metadata to send along with the payment to the payee."
|
|
},
|
|
"blinding_point": {
|
|
"type": "string",
|
|
"format": "byte",
|
|
"description": "Blinding point is an optional blinding point included for introduction\nnodes in blinded paths. This field is mandatory for hops that represents\nthe introduction point in a blinded path."
|
|
},
|
|
"encrypted_data": {
|
|
"type": "string",
|
|
"format": "byte",
|
|
"description": "Encrypted data is a receiver-produced blob of data that provides hops\nin a blinded route with forwarding data. As this data is encrypted by\nthe recipient, we will not be able to parse it - it is essentially an\narbitrary blob of data from our node's perspective. This field is\nmandatory for all hops in a blinded path, including the introduction\nnode."
|
|
},
|
|
"total_amt_msat": {
|
|
"type": "string",
|
|
"format": "uint64",
|
|
"description": "The total amount that is sent to the recipient (possibly across multiple\nHTLCs), as specified by the sender when making a payment to a blinded path.\nThis value is only set in the final hop payload of a blinded payment. This\nvalue is analogous to the MPPRecord that is used for regular (non-blinded)\nMPP payments."
|
|
}
|
|
}
|
|
},
|
|
"lnrpcMPPRecord": {
|
|
"type": "object",
|
|
"properties": {
|
|
"payment_addr": {
|
|
"type": "string",
|
|
"format": "byte",
|
|
"description": "A unique, random identifier used to authenticate the sender as the intended\npayer of a multi-path payment. The payment_addr must be the same for all\nsubpayments, and match the payment_addr provided in the receiver's invoice.\nThe same payment_addr must be used on all subpayments. This is also called\npayment secret in specifications (e.g. BOLT 11)."
|
|
},
|
|
"total_amt_msat": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"description": "The total amount in milli-satoshis being sent as part of a larger multi-path\npayment. The caller is responsible for ensuring subpayments to the same node\nand payment_hash sum exactly to total_amt_msat. The same\ntotal_amt_msat must be used on all subpayments."
|
|
}
|
|
}
|
|
},
|
|
"lnrpcPayment": {
|
|
"type": "object",
|
|
"properties": {
|
|
"payment_hash": {
|
|
"type": "string",
|
|
"title": "The payment hash"
|
|
},
|
|
"value": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"description": "Deprecated, use value_sat or value_msat."
|
|
},
|
|
"creation_date": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"title": "Deprecated, use creation_time_ns"
|
|
},
|
|
"fee": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"description": "Deprecated, use fee_sat or fee_msat."
|
|
},
|
|
"payment_preimage": {
|
|
"type": "string",
|
|
"title": "The payment preimage"
|
|
},
|
|
"value_sat": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"title": "The value of the payment in satoshis"
|
|
},
|
|
"value_msat": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"title": "The value of the payment in milli-satoshis"
|
|
},
|
|
"payment_request": {
|
|
"type": "string",
|
|
"description": "The optional payment request being fulfilled."
|
|
},
|
|
"status": {
|
|
"$ref": "#/definitions/PaymentPaymentStatus",
|
|
"description": "The status of the payment."
|
|
},
|
|
"fee_sat": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"title": "The fee paid for this payment in satoshis"
|
|
},
|
|
"fee_msat": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"title": "The fee paid for this payment in milli-satoshis"
|
|
},
|
|
"creation_time_ns": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"description": "The time in UNIX nanoseconds at which the payment was created."
|
|
},
|
|
"htlcs": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"$ref": "#/definitions/lnrpcHTLCAttempt"
|
|
},
|
|
"description": "The HTLCs made in attempt to settle the payment."
|
|
},
|
|
"payment_index": {
|
|
"type": "string",
|
|
"format": "uint64",
|
|
"description": "The creation index of this payment. Each payment can be uniquely identified\nby this index, which may not strictly increment by 1 for payments made in\nolder versions of lnd."
|
|
},
|
|
"failure_reason": {
|
|
"$ref": "#/definitions/lnrpcPaymentFailureReason"
|
|
},
|
|
"first_hop_custom_records": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string",
|
|
"format": "byte"
|
|
},
|
|
"description": "The custom TLV records that were sent to the first hop as part of the HTLC\nwire message for this payment."
|
|
}
|
|
}
|
|
},
|
|
"lnrpcPaymentFailureReason": {
|
|
"type": "string",
|
|
"enum": [
|
|
"FAILURE_REASON_NONE",
|
|
"FAILURE_REASON_TIMEOUT",
|
|
"FAILURE_REASON_NO_ROUTE",
|
|
"FAILURE_REASON_ERROR",
|
|
"FAILURE_REASON_INCORRECT_PAYMENT_DETAILS",
|
|
"FAILURE_REASON_INSUFFICIENT_BALANCE",
|
|
"FAILURE_REASON_CANCELED"
|
|
],
|
|
"default": "FAILURE_REASON_NONE",
|
|
"description": " - FAILURE_REASON_NONE: Payment isn't failed (yet).\n - FAILURE_REASON_TIMEOUT: There are more routes to try, but the payment timeout was exceeded.\n - FAILURE_REASON_NO_ROUTE: All possible routes were tried and failed permanently. Or were no\nroutes to the destination at all.\n - FAILURE_REASON_ERROR: A non-recoverable error has occured.\n - FAILURE_REASON_INCORRECT_PAYMENT_DETAILS: Payment details incorrect (unknown hash, invalid amt or\ninvalid final cltv delta)\n - FAILURE_REASON_INSUFFICIENT_BALANCE: Insufficient local balance.\n - FAILURE_REASON_CANCELED: The payment was canceled."
|
|
},
|
|
"lnrpcRoute": {
|
|
"type": "object",
|
|
"properties": {
|
|
"total_time_lock": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"description": "The cumulative (final) time lock across the entire route. This is the CLTV\nvalue that should be extended to the first hop in the route. All other hops\nwill decrement the time-lock as advertised, leaving enough time for all\nhops to wait for or present the payment preimage to complete the payment."
|
|
},
|
|
"total_fees": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"description": "The sum of the fees paid at each hop within the final route. In the case\nof a one-hop payment, this value will be zero as we don't need to pay a fee\nto ourselves."
|
|
},
|
|
"total_amt": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"description": "The total amount of funds required to complete a payment over this route.\nThis value includes the cumulative fees at each hop. As a result, the HTLC\nextended to the first-hop in the route will need to have at least this many\nsatoshis, otherwise the route will fail at an intermediate node due to an\ninsufficient amount of fees."
|
|
},
|
|
"hops": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"$ref": "#/definitions/lnrpcHop"
|
|
},
|
|
"description": "Contains details concerning the specific forwarding details at each hop."
|
|
},
|
|
"total_fees_msat": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"description": "The total fees in millisatoshis."
|
|
},
|
|
"total_amt_msat": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"description": "The total amount in millisatoshis."
|
|
},
|
|
"first_hop_amount_msat": {
|
|
"type": "string",
|
|
"format": "int64",
|
|
"description": "The actual on-chain amount that was sent out to the first hop. This value is\nonly different from the total_amt_msat field if this is a custom channel\npayment and the value transported in the HTLC is different from the BTC\namount in the HTLC. If this value is zero, then this is an old payment that\ndidn't have this value yet and can be ignored."
|
|
},
|
|
"custom_channel_data": {
|
|
"type": "string",
|
|
"format": "byte",
|
|
"description": "Custom channel data that might be populated in custom channels."
|
|
}
|
|
},
|
|
"description": "A path through the channel graph which runs over one or more channels in\nsuccession. This struct carries all the information required to craft the\nSphinx onion packet, and send the payment along the first hop in the path. A\nroute is only selected as valid if all the channels have sufficient capacity to\ncarry the initial payment amount after fees are accounted for."
|
|
},
|
|
"protobufAny": {
|
|
"type": "object",
|
|
"properties": {
|
|
"@type": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"additionalProperties": {}
|
|
},
|
|
"rpcStatus": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer",
|
|
"format": "int32"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"details": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"$ref": "#/definitions/protobufAny"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|