2024-01-15 13:35:14 -08:00
|
|
|
{
|
|
|
|
|
"$schema": "../rpc-schema-draft.json",
|
|
|
|
|
"type": "object",
|
|
|
|
|
"rpc": "listoffers",
|
|
|
|
|
"title": "Command for listing offers",
|
|
|
|
|
"description": [
|
|
|
|
|
"The **listoffers** RPC command list all offers, or with `offer_id`, only the offer with that offer_id (if it exists)."
|
|
|
|
|
],
|
2024-07-22 19:21:49 -07:00
|
|
|
"categories": [
|
|
|
|
|
"readonly"
|
|
|
|
|
],
|
2024-01-15 13:35:14 -08:00
|
|
|
"request": {
|
|
|
|
|
"required": [],
|
2024-10-30 09:38:42 +10:30
|
|
|
"additionalProperties": false,
|
2024-01-15 13:35:14 -08:00
|
|
|
"properties": {
|
|
|
|
|
"offer_id": {
|
|
|
|
|
"type": "hash",
|
|
|
|
|
"description": [
|
|
|
|
|
"Offer_id to get details for (if it exists)."
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"active_only": {
|
|
|
|
|
"type": "boolean",
|
|
|
|
|
"description": [
|
|
|
|
|
"If set and is true, only offers with `active` true are returned."
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
"response": {
|
|
|
|
|
"required": [
|
|
|
|
|
"offers"
|
|
|
|
|
],
|
2024-10-30 09:38:42 +10:30
|
|
|
"additionalProperties": false,
|
2024-01-15 13:35:14 -08:00
|
|
|
"properties": {
|
|
|
|
|
"offers": {
|
|
|
|
|
"type": "array",
|
|
|
|
|
"items": {
|
|
|
|
|
"type": "object",
|
|
|
|
|
"additionalProperties": false,
|
|
|
|
|
"required": [
|
|
|
|
|
"offer_id",
|
|
|
|
|
"active",
|
|
|
|
|
"single_use",
|
|
|
|
|
"bolt12",
|
|
|
|
|
"used"
|
|
|
|
|
],
|
|
|
|
|
"properties": {
|
|
|
|
|
"offer_id": {
|
|
|
|
|
"type": "hash",
|
|
|
|
|
"description": [
|
|
|
|
|
"The id of this offer (merkle hash of non-signature fields)."
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"active": {
|
|
|
|
|
"type": "boolean",
|
|
|
|
|
"description": [
|
|
|
|
|
"Whether this can still be used."
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"single_use": {
|
|
|
|
|
"type": "boolean",
|
|
|
|
|
"description": [
|
|
|
|
|
"Whether this expires as soon as it's paid."
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"bolt12": {
|
|
|
|
|
"type": "string",
|
|
|
|
|
"description": [
|
|
|
|
|
"The bolt12 encoding of the offer."
|
|
|
|
|
]
|
|
|
|
|
},
|
2025-12-11 15:51:30 -08:00
|
|
|
"description": {
|
|
|
|
|
"added": "v26.04",
|
|
|
|
|
"type": "string",
|
|
|
|
|
"description": [
|
|
|
|
|
"The user-specified bolt 12 description."
|
|
|
|
|
]
|
|
|
|
|
},
|
2024-01-15 13:35:14 -08:00
|
|
|
"used": {
|
|
|
|
|
"type": "boolean",
|
|
|
|
|
"description": [
|
|
|
|
|
"True if an associated invoice has been paid."
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"label": {
|
|
|
|
|
"type": "string",
|
|
|
|
|
"description": [
|
|
|
|
|
"The (optional) user-specified label."
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-06-20 14:57:02 -07:00
|
|
|
"author": [
|
2025-12-17 11:30:56 -08:00
|
|
|
"Rusty Russell [rusty@rustcorp.com.au](mailto:rusty@rustcorp.com.au) is mainly responsible."
|
2024-06-20 14:57:02 -07:00
|
|
|
],
|
|
|
|
|
"see_also": [
|
|
|
|
|
"lightning-offer(7)",
|
|
|
|
|
"lightning-listoffers(7)"
|
|
|
|
|
],
|
|
|
|
|
"resources": [
|
2025-12-17 11:30:56 -08:00
|
|
|
"Main web site: [https://github.com/ElementsProject/lightning](https://github.com/ElementsProject/lightning)"
|
2024-06-20 14:57:02 -07:00
|
|
|
],
|
|
|
|
|
"examples": [
|
2024-01-15 13:35:14 -08:00
|
|
|
{
|
2024-03-27 18:45:18 -07:00
|
|
|
"request": {
|
|
|
|
|
"id": "example:listoffers#1",
|
|
|
|
|
"method": "listoffers",
|
|
|
|
|
"params": {
|
|
|
|
|
"active_only": true
|
2024-01-15 13:35:14 -08:00
|
|
|
}
|
2024-03-27 18:45:18 -07:00
|
|
|
},
|
|
|
|
|
"response": {
|
|
|
|
|
"offers": [
|
|
|
|
|
{
|
2025-02-19 10:47:17 -08:00
|
|
|
"offer_id": "offeridl21000002100000210000021000002100000210000021000002100000",
|
2024-03-27 18:45:18 -07:00
|
|
|
"active": true,
|
|
|
|
|
"single_use": false,
|
2025-02-19 10:47:17 -08:00
|
|
|
"bolt12": "lno1qgsq000bolt210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000210002100021000",
|
2025-12-11 15:51:30 -08:00
|
|
|
"description": "Fish sale!",
|
2024-03-27 18:45:18 -07:00
|
|
|
"used": false
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-02-19 10:47:17 -08:00
|
|
|
"offer_id": "offeridl22000002200000220000022000002200000220000022000002200000",
|
2024-03-27 18:45:18 -07:00
|
|
|
"active": true,
|
|
|
|
|
"single_use": false,
|
2025-02-19 10:47:17 -08:00
|
|
|
"bolt12": "lno1qgsq000bolt220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000220002200022000",
|
2025-12-11 15:51:30 -08:00
|
|
|
"description": "Coffee",
|
2024-08-09 22:44:53 -07:00
|
|
|
"used": false
|
|
|
|
|
},
|
|
|
|
|
{
|
2025-02-19 10:47:17 -08:00
|
|
|
"offer_id": "offeridl23000002300000230000023000002300000230000023000002300000",
|
2024-08-09 22:44:53 -07:00
|
|
|
"active": true,
|
|
|
|
|
"single_use": false,
|
2025-02-19 10:47:17 -08:00
|
|
|
"bolt12": "lno1qgsq000bolt230002300023000230002300023000230002300023000230002300023000230002300023000230002300023000230002300023000230002300023000",
|
2025-12-11 15:51:30 -08:00
|
|
|
"description": "Movie ticket",
|
2024-07-18 00:28:22 -07:00
|
|
|
"used": false
|
2024-03-27 18:45:18 -07:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
2024-01-15 13:35:14 -08:00
|
|
|
},
|
|
|
|
|
{
|
2024-03-27 18:45:18 -07:00
|
|
|
"request": {
|
|
|
|
|
"id": "example:listoffers#2",
|
|
|
|
|
"method": "listoffers",
|
|
|
|
|
"params": [
|
2025-02-19 10:47:17 -08:00
|
|
|
"offeridl23000002300000230000023000002300000230000023000002300000"
|
2024-03-27 18:45:18 -07:00
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
"response": {
|
|
|
|
|
"offers": [
|
|
|
|
|
{
|
2024-08-09 22:44:53 -07:00
|
|
|
"offer_id": "offeridl23000002300000230000023000002300000230000023000002300000",
|
|
|
|
|
"active": true,
|
2024-03-27 18:45:18 -07:00
|
|
|
"single_use": false,
|
2024-08-09 22:44:53 -07:00
|
|
|
"bolt12": "lno1qgsq000bolt230002300023000230002300023000230002300023000230002300023000230002300023000230002300023000230002300023000230002300023000",
|
2024-03-27 18:45:18 -07:00
|
|
|
"used": false
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
2024-01-15 13:35:14 -08:00
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|