2024-01-15 13:35:14 -08:00
|
|
|
{
|
|
|
|
"$schema": "../rpc-schema-draft.json",
|
|
|
|
"type": "object",
|
|
|
|
"additionalProperties": false,
|
|
|
|
"rpc": "listhtlcs",
|
|
|
|
"title": "Command for querying HTLCs",
|
|
|
|
"description": [
|
|
|
|
"The **listhtlcs** RPC command gets all HTLCs (which, generally, we remember for as long as a channel is open, even if they've completed long ago)."
|
|
|
|
],
|
|
|
|
"request": {
|
|
|
|
"required": [],
|
|
|
|
"properties": {
|
|
|
|
"id": {
|
|
|
|
"type": "string",
|
|
|
|
"description": [
|
|
|
|
"A short channel id (e.g. 1x2x3) or full 64-byte hex channel id, it will only list htlcs for that channel (which must be known)."
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"response": {
|
|
|
|
"required": [
|
|
|
|
"htlcs"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"htlcs": {
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"type": "object",
|
|
|
|
"additionalProperties": false,
|
|
|
|
"required": [
|
|
|
|
"short_channel_id",
|
|
|
|
"id",
|
|
|
|
"expiry",
|
|
|
|
"direction",
|
|
|
|
"amount_msat",
|
|
|
|
"payment_hash",
|
|
|
|
"state"
|
|
|
|
],
|
|
|
|
"properties": {
|
|
|
|
"short_channel_id": {
|
|
|
|
"type": "short_channel_id",
|
|
|
|
"description": [
|
|
|
|
"The channel that contains/contained the HTLC."
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"id": {
|
|
|
|
"type": "u64",
|
|
|
|
"description": [
|
|
|
|
"The unique, incrementing HTLC id the creator gave this."
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"expiry": {
|
|
|
|
"type": "u32",
|
|
|
|
"description": [
|
|
|
|
"The block number where this HTLC expires/expired."
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"amount_msat": {
|
|
|
|
"type": "msat",
|
|
|
|
"description": [
|
|
|
|
"The value of the HTLC."
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"direction": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"out",
|
|
|
|
"in"
|
|
|
|
],
|
|
|
|
"description": [
|
|
|
|
"Out if we offered this to the peer, in if they offered it."
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"payment_hash": {
|
|
|
|
"type": "hash",
|
|
|
|
"description": [
|
|
|
|
"Payment hash sought by HTLC."
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"state": {
|
|
|
|
"type": "string",
|
|
|
|
"enum": [
|
|
|
|
"SENT_ADD_HTLC",
|
|
|
|
"SENT_ADD_COMMIT",
|
|
|
|
"RCVD_ADD_REVOCATION",
|
|
|
|
"RCVD_ADD_ACK_COMMIT",
|
|
|
|
"SENT_ADD_ACK_REVOCATION",
|
|
|
|
"RCVD_REMOVE_HTLC",
|
|
|
|
"RCVD_REMOVE_COMMIT",
|
|
|
|
"SENT_REMOVE_REVOCATION",
|
|
|
|
"SENT_REMOVE_ACK_COMMIT",
|
|
|
|
"RCVD_REMOVE_ACK_REVOCATION",
|
|
|
|
"RCVD_ADD_HTLC",
|
|
|
|
"RCVD_ADD_COMMIT",
|
|
|
|
"SENT_ADD_REVOCATION",
|
|
|
|
"SENT_ADD_ACK_COMMIT",
|
|
|
|
"RCVD_ADD_ACK_REVOCATION",
|
|
|
|
"SENT_REMOVE_HTLC",
|
|
|
|
"SENT_REMOVE_COMMIT",
|
|
|
|
"RCVD_REMOVE_REVOCATION",
|
|
|
|
"RCVD_REMOVE_ACK_COMMIT",
|
|
|
|
"SENT_REMOVE_ACK_REVOCATION"
|
|
|
|
],
|
|
|
|
"description": [
|
|
|
|
"The first 10 states are for `in`, the next 10 are for `out`."
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2024-03-27 18:45:18 -07:00
|
|
|
"json_example": [
|
2024-01-15 13:35:14 -08:00
|
|
|
{
|
2024-03-27 18:45:18 -07:00
|
|
|
"request": {
|
|
|
|
"id": "example:listhtlcs#1",
|
|
|
|
"method": "listhtlcs",
|
|
|
|
"params": "{}"
|
|
|
|
},
|
|
|
|
"response": {
|
|
|
|
"htlcs": [
|
|
|
|
{
|
|
|
|
"short_channel_id": "103x1x0",
|
|
|
|
"id": 0,
|
|
|
|
"expiry": 117,
|
|
|
|
"direction": "out",
|
|
|
|
"amount_msat": 100001001,
|
|
|
|
"payment_hash": "d2668e77c5a2220496e813de36f1fc09ba804b16af4c6bb38299d8a6eb8a5f10",
|
|
|
|
"state": "RCVD_REMOVE_ACK_REVOCATION"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"short_channel_id": "103x1x0",
|
|
|
|
"id": 1,
|
|
|
|
"expiry": 117,
|
|
|
|
"direction": "out",
|
|
|
|
"amount_msat": 100001001,
|
|
|
|
"payment_hash": "286e08ac8f575f10508d751fcfc93871b4344271967c7b9e5eacb3f3573b8307",
|
|
|
|
"state": "RCVD_REMOVE_ACK_REVOCATION"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"short_channel_id": "103x1x0",
|
|
|
|
"id": 2,
|
|
|
|
"expiry": 135,
|
|
|
|
"direction": "out",
|
|
|
|
"amount_msat": 100001001,
|
|
|
|
"payment_hash": "3e4baa750ee3dfb934578f041ccb40b87432bf37ec65c9d7bce5ff28fecbd95f",
|
|
|
|
"state": "RCVD_REMOVE_ACK_REVOCATION"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"short_channel_id": "103x1x0",
|
|
|
|
"id": 3,
|
|
|
|
"expiry": 135,
|
|
|
|
"direction": "out",
|
|
|
|
"amount_msat": 100001001,
|
|
|
|
"payment_hash": "4c3ce32565dc10ef2bd230c32802ce2fe8b007208c0a90757aa289f75c994d49",
|
|
|
|
"state": "SENT_REMOVE_REVOCATION"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2024-01-15 13:35:14 -08:00
|
|
|
},
|
|
|
|
{
|
2024-03-27 18:45:18 -07:00
|
|
|
"request": {
|
|
|
|
"id": "example:listhtlcs#2",
|
|
|
|
"method": "listhtlcs",
|
|
|
|
"params": [
|
|
|
|
"103x2x0"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"response": {
|
|
|
|
"htlcs": [
|
|
|
|
{
|
|
|
|
"short_channel_id": "103x2x0",
|
|
|
|
"id": 0,
|
|
|
|
"expiry": 117,
|
|
|
|
"direction": "out",
|
|
|
|
"amount_msat": 100001001,
|
|
|
|
"payment_hash": "12bb14b1d119e1ae0759e5ff6f1f6653e3fd8f71ea59411500d2871404a47a98",
|
|
|
|
"state": "RCVD_REMOVE_ACK_REVOCATION"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"short_channel_id": "103x2x0",
|
|
|
|
"id": 1,
|
|
|
|
"expiry": 117,
|
|
|
|
"direction": "out",
|
|
|
|
"amount_msat": 100001001,
|
|
|
|
"payment_hash": "57d950209cc0b4fcc5e3027569232f96cf83ef85314c6b139a5713848d811a66",
|
|
|
|
"state": "RCVD_REMOVE_ACK_REVOCATION"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"short_channel_id": "103x2x0",
|
|
|
|
"id": 2,
|
|
|
|
"expiry": 135,
|
|
|
|
"direction": "out",
|
|
|
|
"amount_msat": 100001001,
|
|
|
|
"payment_hash": "45ad4654715411a07a0ad6ec3f4bfaa918c90e3d1934b10b1c1c5846523ddd7f",
|
|
|
|
"state": "RCVD_REMOVE_ACK_REVOCATION"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"short_channel_id": "103x2x0",
|
|
|
|
"id": 3,
|
|
|
|
"expiry": 135,
|
|
|
|
"direction": "out",
|
|
|
|
"amount_msat": 100001001,
|
|
|
|
"payment_hash": "cc0dcd214aa71c62bfba711a0746da821f2cdba1770b11c225920bdde12c931e",
|
|
|
|
"state": "RCVD_REMOVE_ACK_REVOCATION"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2024-01-15 13:35:14 -08:00
|
|
|
},
|
|
|
|
{
|
2024-03-27 18:45:18 -07:00
|
|
|
"request": {
|
|
|
|
"id": "example:listhtlcs#3",
|
|
|
|
"method": "listhtlcs",
|
|
|
|
"params": [
|
|
|
|
"436c2658eb4f4689b42ff11b8b05f31ba09860d0df7168085e0796cdf40f85e0"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"response": {
|
|
|
|
"htlcs": [
|
|
|
|
{
|
|
|
|
"short_channel_id": "103x1x0",
|
|
|
|
"id": 0,
|
|
|
|
"expiry": 124,
|
|
|
|
"direction": "out",
|
|
|
|
"amount_msat": 1001,
|
|
|
|
"payment_hash": "2ab653668c8017ff2f36ac36678a8da04e11380bd9580a2926b170523b0c6e3b",
|
|
|
|
"state": "RCVD_REMOVE_ACK_REVOCATION"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"short_channel_id": "103x1x0",
|
|
|
|
"id": 1,
|
|
|
|
"expiry": 124,
|
|
|
|
"direction": "out",
|
|
|
|
"amount_msat": 2001,
|
|
|
|
"payment_hash": "92f889cb2e48aa28e1e577228b907cdbcc371a2c018e9c8f60fa7036e232cf1d",
|
|
|
|
"state": "RCVD_REMOVE_ACK_REVOCATION"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"short_channel_id": "103x1x0",
|
|
|
|
"id": 2,
|
|
|
|
"expiry": 128,
|
|
|
|
"direction": "out",
|
|
|
|
"amount_msat": 4001,
|
|
|
|
"payment_hash": "14ef01c9fb12d7dcac288f48ce87b19a7d5c3d5779aaed1e4adcb5c5d0e9fa45",
|
|
|
|
"state": "RCVD_REMOVE_ACK_REVOCATION"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2024-01-15 13:35:14 -08:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"author": [
|
|
|
|
"Rusty Russell <<rusty@rustcorp.com.au>> is mainly responsible."
|
|
|
|
],
|
|
|
|
"see_also": [
|
|
|
|
"lightning-listforwards(7)"
|
|
|
|
],
|
|
|
|
"resources": [
|
|
|
|
"Main web site: <https://github.com/ElementsProject/lightning>"
|
|
|
|
]
|
|
|
|
}
|