From 71fc1b7146e10ffb98f7c9c6ea8e0aa58cba540f Mon Sep 17 00:00:00 2001 From: ben Date: Wed, 18 Jan 2023 17:51:15 +0000 Subject: [PATCH] Added images --- lnbits/extensions/market/README.md | 53 +++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/lnbits/extensions/market/README.md b/lnbits/extensions/market/README.md index 0a21d36fc..79675fd1a 100644 --- a/lnbits/extensions/market/README.md +++ b/lnbits/extensions/market/README.md @@ -35,9 +35,27 @@ The `merchant` admin software can be purely clientside, but for `convenience` an NIP-01 https://github.com/nostr-protocol/nips/blob/master/01.md uses the basic NOSTR event type. +``` +{ + "id": <32-bytes sha256 of the the serialized event data> + "pubkey": <32-bytes hex-encoded public key of the event creator>, + "created_at": , + "kind": , + "tags": [ + ["e", <32-bytes hex of the id of another event>, ], + ["p", <32-bytes hex of the key>, ], + ... // other kinds of tags may be included later + ], + "content": , + "sig": <64-bytes signature of the sha256 hash of the serialized event data, which is the same as the "id" field> +} +``` + The `merchant` event that publishes and updates product lists -ALL fields are optional apart from the `timestamp`. Data from newer events should replace data from older events. +The below json goes in `content` of NIP-01. + +Data from newer events should replace data from older events. `action` types (used to indicate changes): * `update` element has changed @@ -50,7 +68,6 @@ ALL fields are optional apart from the `timestamp`. Data from newer events shoul { "name": , "description": , - "timestamp": , "currency": , "action": , "shipping": [ @@ -86,6 +103,12 @@ ALL fields are optional apart from the `timestamp`. Data from newer events shoul "categories": , "amount": , "price": , + "images": [ + { + "name": , + "link": + } + ], "action": , }, { @@ -95,6 +118,16 @@ ALL fields are optional apart from the `timestamp`. Data from newer events shoul "categories": , "amount": , "price": , + "images": [ + { + "name": , + "link": + }, + { + "name": , + "link": + } + ], "action": , }, ] @@ -113,6 +146,12 @@ ALL fields are optional apart from the `timestamp`. Data from newer events shoul "categories": , "amount": , "price": , + "images": [ + { + "name": , + "link": + } + ], "action": , } ] @@ -126,9 +165,10 @@ ALL fields are optional apart from the `timestamp`. Data from newer events shoul NIP-04 https://github.com/nostr-protocol/nips/blob/master/04.md, all checkout events are encrypted +The below json goes in `content` of NIP-04. + ### Step 1: `customer` order (event) -ALL fields are optional apart from `timestamp`. ``` { @@ -137,7 +177,6 @@ ALL fields are optional apart from `timestamp`. "description": , "address": , "message": , - "timestamp": , "contact": [ "nostr": , "phone": , @@ -170,6 +209,8 @@ Merchant should verify the sum of product ids + timestamp. Sent back from the merchant for payment. Any payment option is valid that the merchant can check. +The below json goes in `content` of NIP-04. + `payment_options`/`type` include: * `url` URL to a payment page, stripe, paypal, btcpayserver, etc * `btc` onchain bitcoin address @@ -180,7 +221,6 @@ Sent back from the merchant for payment. Any payment option is valid that the me { "id": , "message": , - "timestamp": , "payment_options": [ { "type": , @@ -201,6 +241,9 @@ Sent back from the merchant for payment. Any payment option is valid that the me ### Step 3: `merchant` verify payment/shipped (event) Once payment has been received and processed. + +The below json goes in `content` of NIP-04. + ``` { "id": ,