mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-23 14:40:47 +01:00
Added models and simple example
This commit is contained in:
parent
5b6e05af60
commit
99d963c726
2 changed files with 267 additions and 2 deletions
|
@ -16,8 +16,8 @@ A `merchant` and `customer` both have a NOSTR key-pair that are used to sign not
|
|||
* `merchant` - seller of products with NOSTR key-pair
|
||||
* `customer` - buyer of products with NOSTR key-pair
|
||||
* `product` - item for sale by the `merchant`
|
||||
* `stall` - list of products controlled by `merchant`
|
||||
* `marketplace` - clientside software for searching `stalls` an buying `products`
|
||||
* `stall` - list of products controlled by `merchant` (a `merchant` can have multiple stalls)
|
||||
* `marketplace` - clientside software for searching `stalls` and purchasing `products`
|
||||
|
||||
## Diagon Alley Clients
|
||||
|
||||
|
@ -89,6 +89,7 @@ Data from newer events should replace data from older events.
|
|||
"price": <Int, cost per unit>,
|
||||
"images": [
|
||||
{
|
||||
"id": <String, UUID derived from product ID>,
|
||||
"name": <String, image name>,
|
||||
"link": <String, URL or BASE64>
|
||||
}
|
||||
|
@ -104,10 +105,12 @@ Data from newer events should replace data from older events.
|
|||
"price": <Int, cost per unit>,
|
||||
"images": [
|
||||
{
|
||||
"id": <String, UUID derived from product ID>,
|
||||
"name": <String, image name>,
|
||||
"link": <String, URL or BASE64>
|
||||
},
|
||||
{
|
||||
"id": <String, UUID derived from product ID>,
|
||||
"name": <String, image name>,
|
||||
"link": <String, URL or BASE64>
|
||||
}
|
||||
|
@ -132,6 +135,7 @@ Data from newer events should replace data from older events.
|
|||
"price": <Int, cost per unit>,
|
||||
"images": [
|
||||
{
|
||||
"id": <String, UUID derived from product ID>,
|
||||
"name": <String, image name>,
|
||||
"link": <String, URL or BASE64>
|
||||
}
|
||||
|
@ -145,6 +149,33 @@ Data from newer events should replace data from older events.
|
|||
|
||||
```
|
||||
|
||||
As all elements are optional, an `action` `update` to a `product` `image`, may look as simple as:
|
||||
|
||||
```
|
||||
{
|
||||
"stalls": [
|
||||
{
|
||||
"id": <UUID derived from merchant public-key>,
|
||||
"products": [
|
||||
{
|
||||
"id": <String, UUID derived from stall ID>,
|
||||
"images": [
|
||||
{
|
||||
"id": <String, UUID derived from product ID>,
|
||||
"name": <String, image name>,
|
||||
"link": <String, URL or BASE64>
|
||||
}
|
||||
],
|
||||
"action": <String, optional action>,
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
|
||||
## Checkout events
|
||||
|
||||
NIP-04 https://github.com/nostr-protocol/nips/blob/master/04.md, all checkout events are encrypted
|
||||
|
@ -241,3 +272,10 @@ The below json goes in `content` of NIP-04.
|
|||
## Customer support events
|
||||
|
||||
Customer support is handle over whatever communication method was specified. If communicationg via nostr, NIP-04 is used https://github.com/nostr-protocol/nips/blob/master/04.md.
|
||||
|
||||
## Additional
|
||||
|
||||
Standard data models can be found here <a href="models.json">here</a>
|
||||
|
||||
|
||||
|
||||
|
|
227
lnbits/extensions/market/models.json
Normal file
227
lnbits/extensions/market/models.json
Normal file
|
@ -0,0 +1,227 @@
|
|||
{
|
||||
"shipping_zones": [
|
||||
"Free (digital)",
|
||||
"Worldwide",
|
||||
"Europe",
|
||||
"Australia",
|
||||
"Austria",
|
||||
"Belgium",
|
||||
"Brazil",
|
||||
"Canada",
|
||||
"Denmark",
|
||||
"Finland",
|
||||
"France",
|
||||
"Germany",
|
||||
"Greece",
|
||||
"Hong Kong",
|
||||
"Hungary",
|
||||
"Ireland",
|
||||
"Indonesia",
|
||||
"Israel",
|
||||
"Italy",
|
||||
"Japan",
|
||||
"Kazakhstan",
|
||||
"Korea",
|
||||
"Luxembourg",
|
||||
"Malaysia",
|
||||
"Mexico",
|
||||
"Netherlands",
|
||||
"New Zealand",
|
||||
"Norway",
|
||||
"Poland",
|
||||
"Portugal",
|
||||
"Russia",
|
||||
"Saudi Arabia",
|
||||
"Singapore",
|
||||
"Spain",
|
||||
"Sweden",
|
||||
"Switzerland",
|
||||
"Thailand",
|
||||
"Turkey",
|
||||
"Ukraine",
|
||||
"United Kingdom**",
|
||||
"United States***",
|
||||
"Vietnam",
|
||||
"China"
|
||||
],
|
||||
"categories": [
|
||||
"Fashion (clothing and accessories)",
|
||||
"Health (and beauty)",
|
||||
"Toys (and baby equipment)",
|
||||
"Media (Books and CDs)",
|
||||
"Groceries (Food and Drink)",
|
||||
"Technology (Phones and Computers)",
|
||||
"Home (furniture and accessories)",
|
||||
"Gifts (flowers, cards, etc)",
|
||||
"Adult",
|
||||
"Other"
|
||||
],
|
||||
"currency": {
|
||||
"BTC": "Bitcoin",
|
||||
"SAT": "Bitcoin satoshis",
|
||||
"AED": "United Arab Emirates Dirham",
|
||||
"AFN": "Afghan Afghani",
|
||||
"ALL": "Albanian Lek",
|
||||
"AMD": "Armenian Dram",
|
||||
"ANG": "Netherlands Antillean Gulden",
|
||||
"AOA": "Angolan Kwanza",
|
||||
"ARS": "Argentine Peso",
|
||||
"AUD": "Australian Dollar",
|
||||
"AWG": "Aruban Florin",
|
||||
"AZN": "Azerbaijani Manat",
|
||||
"BAM": "Bosnia and Herzegovina Convertible Mark",
|
||||
"BBD": "Barbadian Dollar",
|
||||
"BDT": "Bangladeshi Taka",
|
||||
"BGN": "Bulgarian Lev",
|
||||
"BHD": "Bahraini Dinar",
|
||||
"BIF": "Burundian Franc",
|
||||
"BMD": "Bermudian Dollar",
|
||||
"BND": "Brunei Dollar",
|
||||
"BOB": "Bolivian Boliviano",
|
||||
"BRL": "Brazilian Real",
|
||||
"BSD": "Bahamian Dollar",
|
||||
"BTN": "Bhutanese Ngultrum",
|
||||
"BWP": "Botswana Pula",
|
||||
"BYN": "Belarusian Ruble",
|
||||
"BYR": "Belarusian Ruble",
|
||||
"BZD": "Belize Dollar",
|
||||
"CAD": "Canadian Dollar",
|
||||
"CDF": "Congolese Franc",
|
||||
"CHF": "Swiss Franc",
|
||||
"CLF": "Unidad de Fomento",
|
||||
"CLP": "Chilean Peso",
|
||||
"CNH": "Chinese Renminbi Yuan Offshore",
|
||||
"CNY": "Chinese Renminbi Yuan",
|
||||
"COP": "Colombian Peso",
|
||||
"CRC": "Costa Rican Colón",
|
||||
"CUC": "Cuban Convertible Peso",
|
||||
"CVE": "Cape Verdean Escudo",
|
||||
"CZK": "Czech Koruna",
|
||||
"DJF": "Djiboutian Franc",
|
||||
"DKK": "Danish Krone",
|
||||
"DOP": "Dominican Peso",
|
||||
"DZD": "Algerian Dinar",
|
||||
"EGP": "Egyptian Pound",
|
||||
"ERN": "Eritrean Nakfa",
|
||||
"ETB": "Ethiopian Birr",
|
||||
"EUR": "Euro",
|
||||
"FJD": "Fijian Dollar",
|
||||
"FKP": "Falkland Pound",
|
||||
"GBP": "British Pound",
|
||||
"GEL": "Georgian Lari",
|
||||
"GGP": "Guernsey Pound",
|
||||
"GHS": "Ghanaian Cedi",
|
||||
"GIP": "Gibraltar Pound",
|
||||
"GMD": "Gambian Dalasi",
|
||||
"GNF": "Guinean Franc",
|
||||
"GTQ": "Guatemalan Quetzal",
|
||||
"GYD": "Guyanese Dollar",
|
||||
"HKD": "Hong Kong Dollar",
|
||||
"HNL": "Honduran Lempira",
|
||||
"HRK": "Croatian Kuna",
|
||||
"HTG": "Haitian Gourde",
|
||||
"HUF": "Hungarian Forint",
|
||||
"IDR": "Indonesian Rupiah",
|
||||
"ILS": "Israeli New Sheqel",
|
||||
"IMP": "Isle of Man Pound",
|
||||
"INR": "Indian Rupee",
|
||||
"IQD": "Iraqi Dinar",
|
||||
"ISK": "Icelandic Króna",
|
||||
"JEP": "Jersey Pound",
|
||||
"JMD": "Jamaican Dollar",
|
||||
"JOD": "Jordanian Dinar",
|
||||
"JPY": "Japanese Yen",
|
||||
"KES": "Kenyan Shilling",
|
||||
"KGS": "Kyrgyzstani Som",
|
||||
"KHR": "Cambodian Riel",
|
||||
"KMF": "Comorian Franc",
|
||||
"KRW": "South Korean Won",
|
||||
"KWD": "Kuwaiti Dinar",
|
||||
"KYD": "Cayman Islands Dollar",
|
||||
"KZT": "Kazakhstani Tenge",
|
||||
"LAK": "Lao Kip",
|
||||
"LBP": "Lebanese Pound",
|
||||
"LKR": "Sri Lankan Rupee",
|
||||
"LRD": "Liberian Dollar",
|
||||
"LSL": "Lesotho Loti",
|
||||
"LYD": "Libyan Dinar",
|
||||
"MAD": "Moroccan Dirham",
|
||||
"MDL": "Moldovan Leu",
|
||||
"MGA": "Malagasy Ariary",
|
||||
"MKD": "Macedonian Denar",
|
||||
"MMK": "Myanmar Kyat",
|
||||
"MNT": "Mongolian Tögrög",
|
||||
"MOP": "Macanese Pataca",
|
||||
"MRO": "Mauritanian Ouguiya",
|
||||
"MUR": "Mauritian Rupee",
|
||||
"MVR": "Maldivian Rufiyaa",
|
||||
"MWK": "Malawian Kwacha",
|
||||
"MXN": "Mexican Peso",
|
||||
"MYR": "Malaysian Ringgit",
|
||||
"MZN": "Mozambican Metical",
|
||||
"NAD": "Namibian Dollar",
|
||||
"NGN": "Nigerian Naira",
|
||||
"NIO": "Nicaraguan Córdoba",
|
||||
"NOK": "Norwegian Krone",
|
||||
"NPR": "Nepalese Rupee",
|
||||
"NZD": "New Zealand Dollar",
|
||||
"OMR": "Omani Rial",
|
||||
"PAB": "Panamanian Balboa",
|
||||
"PEN": "Peruvian Sol",
|
||||
"PGK": "Papua New Guinean Kina",
|
||||
"PHP": "Philippine Peso",
|
||||
"PKR": "Pakistani Rupee",
|
||||
"PLN": "Polish Złoty",
|
||||
"PYG": "Paraguayan Guaraní",
|
||||
"QAR": "Qatari Riyal",
|
||||
"RON": "Romanian Leu",
|
||||
"RSD": "Serbian Dinar",
|
||||
"RUB": "Russian Ruble",
|
||||
"RWF": "Rwandan Franc",
|
||||
"SAR": "Saudi Riyal",
|
||||
"SBD": "Solomon Islands Dollar",
|
||||
"SCR": "Seychellois Rupee",
|
||||
"SEK": "Swedish Krona",
|
||||
"SGD": "Singapore Dollar",
|
||||
"SHP": "Saint Helenian Pound",
|
||||
"SLL": "Sierra Leonean Leone",
|
||||
"SOS": "Somali Shilling",
|
||||
"SRD": "Surinamese Dollar",
|
||||
"SSP": "South Sudanese Pound",
|
||||
"STD": "São Tomé and Príncipe Dobra",
|
||||
"SVC": "Salvadoran Colón",
|
||||
"SZL": "Swazi Lilangeni",
|
||||
"THB": "Thai Baht",
|
||||
"TJS": "Tajikistani Somoni",
|
||||
"TMT": "Turkmenistani Manat",
|
||||
"TND": "Tunisian Dinar",
|
||||
"TOP": "Tongan Paʻanga",
|
||||
"TRY": "Turkish Lira",
|
||||
"TTD": "Trinidad and Tobago Dollar",
|
||||
"TWD": "New Taiwan Dollar",
|
||||
"TZS": "Tanzanian Shilling",
|
||||
"UAH": "Ukrainian Hryvnia",
|
||||
"UGX": "Ugandan Shilling",
|
||||
"USD": "US Dollar",
|
||||
"UYU": "Uruguayan Peso",
|
||||
"UZS": "Uzbekistan Som",
|
||||
"VEF": "Venezuelan Bolívar",
|
||||
"VES": "Venezuelan Bolívar Soberano",
|
||||
"VND": "Vietnamese Đồng",
|
||||
"VUV": "Vanuatu Vatu",
|
||||
"WST": "Samoan Tala",
|
||||
"XAF": "Central African Cfa Franc",
|
||||
"XAG": "Silver (Troy Ounce)",
|
||||
"XAU": "Gold (Troy Ounce)",
|
||||
"XCD": "East Caribbean Dollar",
|
||||
"XDR": "Special Drawing Rights",
|
||||
"XOF": "West African Cfa Franc",
|
||||
"XPD": "Palladium",
|
||||
"XPF": "Cfp Franc",
|
||||
"XPT": "Platinum",
|
||||
"YER": "Yemeni Rial",
|
||||
"ZAR": "South African Rand",
|
||||
"ZMW": "Zambian Kwacha",
|
||||
"ZWL": "Zimbabwean Dollar"
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue