-
Notifications
You must be signed in to change notification settings - Fork 912
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
offer: allow re-enabling a previously disabled offer
Sometimes, for various reasons, a user disables an offer and then wants to re-enable it. This should be allowed because, from the CLN point of view, it is just an internal state. If a user has constraints on the description of the invoice because they are using services that link some sort of user ID to an offer, it is important for the user to be able to re-enable the offer, not create a new one. Creating a new offer would require a different description. Link: #7360 Co-Developed-by: Rusty Russell <[email protected]> Signed-off-by: Vincenzo Palazzo <[email protected]>
- Loading branch information
1 parent
47e7127
commit 1e1edfd
Showing
7 changed files
with
312 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10757,6 +10757,7 @@ | |
"Rusty Russell <<[email protected]>> is mainly responsible." | ||
], | ||
"see_also": [ | ||
"lightning-enableoffer(7)", | ||
"lightning-offer(7)", | ||
"lightning-listoffers(7)" | ||
], | ||
|
@@ -10921,6 +10922,112 @@ | |
} | ||
] | ||
}, | ||
"lightning-enableoffer.json": { | ||
"$schema": "../rpc-schema-draft.json", | ||
"type": "object", | ||
"additionalProperties": false, | ||
"rpc": "disableoffer", | ||
"title": "Command for re-enabling an offer", | ||
"warning": "experimental-offers only", | ||
"description": [ | ||
"The **enableoffer** RPC command enables an offer, after it has been disabled." | ||
], | ||
"request": { | ||
"required": [ | ||
"offer_id" | ||
], | ||
"properties": { | ||
"offer_id": { | ||
"type": "hash", | ||
"description": [ | ||
"The id we use to identify this offer." | ||
] | ||
} | ||
} | ||
}, | ||
"response": { | ||
"required": [ | ||
"offer_id", | ||
"active", | ||
"single_use", | ||
"bolt12", | ||
"used" | ||
], | ||
"properties": { | ||
"offer_id": { | ||
"type": "hash", | ||
"description": [ | ||
"The merkle hash of the offer." | ||
] | ||
}, | ||
"active": { | ||
"type": "boolean", | ||
"enum": [ | ||
true | ||
], | ||
"description": [ | ||
"Whether the offer can produce invoices/payments." | ||
] | ||
}, | ||
"single_use": { | ||
"type": "boolean", | ||
"description": [ | ||
"Whether the offer is disabled after first successful use." | ||
] | ||
}, | ||
"bolt12": { | ||
"type": "string", | ||
"description": [ | ||
"The bolt12 string representing this offer." | ||
] | ||
}, | ||
"used": { | ||
"type": "boolean", | ||
"description": [ | ||
"Whether the offer has had an invoice paid / payment made." | ||
] | ||
}, | ||
"label": { | ||
"type": "string", | ||
"description": [ | ||
"The label provided when offer was created." | ||
] | ||
} | ||
}, | ||
"pre_return_value_notes": [ | ||
"Note: the returned object is the same format as **listoffers**." | ||
] | ||
}, | ||
"author": [ | ||
"Rusty Russell <<[email protected]>> is mainly responsible." | ||
], | ||
"see_also": [ | ||
"lightning-offer(7)", | ||
"lightning-disableoffer(7)", | ||
"lightning-listoffers(7)" | ||
], | ||
"resources": [ | ||
"Main web site: <https://github.com/ElementsProject/lightning>" | ||
], | ||
"examples": [ | ||
{ | ||
"request": { | ||
"id": "example:enableoffer#1", | ||
"method": "enableoffer", | ||
"params": { | ||
"offer_id": "713a16ccd4eb10438bdcfbc2c8276be301020dd9d489c530773ba64f3b33307d" | ||
} | ||
}, | ||
"response": { | ||
"offer_id": "053a5c566fbea2681a5ff9c05a913da23e45b95d09ef5bd25d7d408f23da7084", | ||
"active": true, | ||
"single_use": false, | ||
"bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqvqcdgq2z9pk7enxv4jjqen0wgs8yatnw3ujz83qkc6rvp4j28rt3dtrn32zkvdy7efhnlrpr5rp5geqxs783wtlj550qs8czzku4nk3pqp6m593qxgunzuqcwkmgqkmp6ty0wyvjcqdguv3pnpukedwn6cr87m89t74h3auyaeg89xkvgzpac70z3m9rn5xzu28c", | ||
"used": false | ||
} | ||
} | ||
] | ||
}, | ||
"lightning-feerates.json": { | ||
"$schema": "../rpc-schema-draft.json", | ||
"type": "object", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,7 @@ | |
"Rusty Russell <<[email protected]>> is mainly responsible." | ||
], | ||
"see_also": [ | ||
"lightning-enableoffer(7)", | ||
"lightning-offer(7)", | ||
"lightning-listoffers(7)" | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
{ | ||
"$schema": "../rpc-schema-draft.json", | ||
"type": "object", | ||
"additionalProperties": false, | ||
"rpc": "disableoffer", | ||
"title": "Command for re-enabling an offer", | ||
"warning": "experimental-offers only", | ||
"description": [ | ||
"The **enableoffer** RPC command enables an offer, after it has been disabled." | ||
], | ||
"request": { | ||
"required": [ | ||
"offer_id" | ||
], | ||
"properties": { | ||
"offer_id": { | ||
"type": "hash", | ||
"description": [ | ||
"The id we use to identify this offer." | ||
] | ||
} | ||
} | ||
}, | ||
"response": { | ||
"required": [ | ||
"offer_id", | ||
"active", | ||
"single_use", | ||
"bolt12", | ||
"used" | ||
], | ||
"properties": { | ||
"offer_id": { | ||
"type": "hash", | ||
"description": [ | ||
"The merkle hash of the offer." | ||
] | ||
}, | ||
"active": { | ||
"type": "boolean", | ||
"enum": [ | ||
true | ||
], | ||
"description": [ | ||
"Whether the offer can produce invoices/payments." | ||
] | ||
}, | ||
"single_use": { | ||
"type": "boolean", | ||
"description": [ | ||
"Whether the offer is disabled after first successful use." | ||
] | ||
}, | ||
"bolt12": { | ||
"type": "string", | ||
"description": [ | ||
"The bolt12 string representing this offer." | ||
] | ||
}, | ||
"used": { | ||
"type": "boolean", | ||
"description": [ | ||
"Whether the offer has had an invoice paid / payment made." | ||
] | ||
}, | ||
"label": { | ||
"type": "string", | ||
"description": [ | ||
"The label provided when offer was created." | ||
] | ||
} | ||
}, | ||
"pre_return_value_notes": [ | ||
"Note: the returned object is the same format as **listoffers**." | ||
] | ||
}, | ||
"author": [ | ||
"Rusty Russell <<[email protected]>> is mainly responsible." | ||
], | ||
"see_also": [ | ||
"lightning-offer(7)", | ||
"lightning-disableoffer(7)", | ||
"lightning-listoffers(7)" | ||
], | ||
"resources": [ | ||
"Main web site: <https://github.com/ElementsProject/lightning>" | ||
], | ||
"examples": [ | ||
{ | ||
"request": { | ||
"id": "example:enableoffer#1", | ||
"method": "enableoffer", | ||
"params": { | ||
"offer_id": "713a16ccd4eb10438bdcfbc2c8276be301020dd9d489c530773ba64f3b33307d" | ||
} | ||
}, | ||
"response": { | ||
"offer_id": "053a5c566fbea2681a5ff9c05a913da23e45b95d09ef5bd25d7d408f23da7084", | ||
"active": true, | ||
"single_use": false, | ||
"bolt12": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrcgqvqcdgq2z9pk7enxv4jjqen0wgs8yatnw3ujz83qkc6rvp4j28rt3dtrn32zkvdy7efhnlrpr5rp5geqxs783wtlj550qs8czzku4nk3pqp6m593qxgunzuqcwkmgqkmp6ty0wyvjcqdguv3pnpukedwn6cr87m89t74h3auyaeg89xkvgzpac70z3m9rn5xzu28c", | ||
"used": false | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters