diff --git a/69.md b/69.md index a47dfe05..4676e831 100644 --- a/69.md +++ b/69.md @@ -226,19 +226,6 @@ To ensure consistent error handling across implementations, this NIP defines the 4. **Unsupported Feature**: When the receiver doesn't support a feature requested by the payer. 5. **Invalid Amount**: When the amount specified is too big or too small, providing the acceptable range. -Error responses should be sent as kind 21001 events with the following structure in the encrypted content: - -```json -{ - "error": "", - "code": "", - "range": { //sats - "min": 10, - "max": 10000000 - } -} -``` - Error codes: - 1: Invalid Offer @@ -249,6 +236,44 @@ Error codes: Clients MUST handle these error responses gracefully and display appropriate messages to users. +### Error Response Payloads + +Error responses should be sent as kind 21001 events with the following structure in the encrypted content: + +```json +{ + "error": "", + "code": "" + // Additional fields optionally included depending on the error type +} +``` +### Expected Payloads + +3. **Expired Offer** +- **Code**: 3 +- **Payload**: +```json +{ + "error": "Expired Offer", + "code": 3, + "latest": "" +} +``` + +5. **Invalid Amount** +- **Code**: 5 +- **Payload**: +```json +{ + "error": "Invalid Amount", + "code": 5, + "range": { //sats + "min": 10, + "max": 10000000 + } +} +``` + ## Transition from LNURL LNURL services wishing to signal the upgrade should add `nip69: ` to the inital GET response described in [LUD-06](https://github.com/lnurl/luds/blob/luds/06.md). Clients seeing this new value on a LNURL server should automatically upgrade the payment flow that was instantiated by the user for that address. @@ -264,5 +289,5 @@ Future versions of this NIP may consider standardizing additional features such ## Reference Implementations -[Lightning.Pub](https://github.com/shocknet/Lightning.Pub/pull/727) / [ShockWallet](https://github.com/shocknet/wallet2/pull/268) -[demo.nip69.dev](https://demo.nip69.dev) \ No newline at end of file +- [Lightning.Pub](https://github.com/shocknet/Lightning.Pub/pull/727) / [ShockWallet](https://github.com/shocknet/wallet2/pull/268) +- [demo.nip69.dev](https://demo.nip69.dev) \ No newline at end of file