clams-tech / Remote

Remote control your Core Lightning node
https://remote.clams.tech
GNU General Public License v3.0
39 stars 7 forks source link

Feature Request: Add Prism Tile #247

Open farscapian opened 2 months ago

farscapian commented 2 months ago

The BOLT12 Prism plugin has undergone additional development and is reaching a stable state. Assuming the prism plugin is installed, Clams Remote should allow a node owner to create and manage prisms by surfacing a "Prism" tile. The UI should also enable the node operator to attach a prism to a BOLT12 offer and enable prism payment via prism-pay. @evansmj

evansmj commented 2 months ago

The idea is to check if plugin list returns /bolt12-prism. If it does, we display a new Tile like this:

Screenshot 2024-04-28 at 12 58 46 PM

Then we will display a screen where the user can configure a Prism. And then bind it to an Offer. All of this UI will be in the Prisms page. If a user does not have Prisms installed, no prism ui will be seen.

evansmj commented 2 months ago

fyi I am workin on this feature

johngribbin commented 2 months ago

@evansmj Hey Michael

how is your progress coming along? Would be happy to review when you think its ready

evansmj commented 2 months ago

hey @johngribbin, we got a quick demo for our hackathon. I need to clean up some alignments and make the prism detail part look more like rest of the app. we did get a prism icon from a designer (need to size it better). here are some preliminary screenshots. if you have design feedback that would be great and i could match whatever you like.

A prism tile will be shown only if the plugins list rpc command says the prisms plugin is installed. it renders before Settings so that settings remains the last tile.

Screenshot 2024-05-04 at 3 18 52 PM

The prism portal will show a list of prisms, and a list of offers. A user will be able to Bind a prism to an existing offer here. I show the list of offers here so that all prism related code remains in the prism portal. I haven't figured out the ux for setting a Binding yet.

Screenshot 2024-05-04 at 3 19 01 PM

Now if you click on a prism it will show the prism details. This layout is up in the air and I think i should match offers/channels.

Screenshot 2024-05-04 at 3 19 08 PM

The prism detail reflects this json

[
  {
    "id": "prism1",
    "timestamp": 1714796059,
    "outlay_factor": 0.8,
    "prism_members": [
      {
        "member_id": "f892a60f-83c0-4df9-9b62-674ada641d4b",
        "label": "Carol",
        "destination": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrc2qajx2enpw4k8g93pq0hqest8tsj7m2k4k7s7q5ukeq0rtlrv6kpprhe3hxjs0rx6cg6hz",
        "split": 1,
        "fees_incurred_by": "remote",
        "payout_threshold": "0msat"
      },
      {
        "member_id": "deba7e02-baef-4ed5-9c1d-809f3fe023bf",
        "label": "Dave",
        "destination": "03cb5a8d446d7e6e5c86df9999ffa77bc2a4be24b30a3f374976057671531dd24f",
        "split": 1,
        "fees_incurred_by": "remote",
        "payout_threshold": "0msat"
      },
      {
        "member_id": "25a745a5-eb6c-4d6c-b5c4-f9e90aa2a81e",
        "label": "Erin",
        "destination": "lno1qgsqvgnwgcg35z6ee2h3yczraddm72xrfua9uve2rlrm9deu7xyfzrc2qajx2enpw4k8g93pqtyguvz38rkv44hgxhhnjdsgf04vj35ualp3pv9tqqamwwjeacc9s",
        "split": 1,
        "fees_incurred_by": "remote",
        "payout_threshold": "0msat"
      }
    ]
  }
]

prism bindings will reflect this data.

{
   "bolt12_prism_bindings": [
      {
         "offer_id": "ecbb23dd33aeea4ca3c9198bdf459b004b455f13bbe72554be15a5aab4100ce6",
         "prism_id": "prism1",
         "timestamp": 1714760131,
         "member_outlays": {
            "2503e139-760c-48fc-90f0-66e88780ece4": "0msat",
            "03d6c054-2593-462d-9f68-4fd81bc0aa28": "0msat",
            "091a8fe9-a8bc-48ae-8fba-7ac33ebd961b": "0msat"
         }
      }
   ]
}

Somewhere i need to figure out a place to show existing Bindings. Maybe this should be separate from the offers list. Any design ideas would be great else I'll keep working with Farscapian to create it.

Oh and i still need to make the Create a prism page and a Delete/Disable prism mechanism somewhere.

farscapian commented 1 month ago

Just going to throw this out there after chatting about this topic with a few folks. It would be preferable to make the prism-binding stuff be centered around BOLT12 Offers in the UI. That is, the place you go to bind a prism and to view binding outlays would be Top Menu -> Offers. @evansmj I know this contradicts what I told you during the hackathon, but in speaking with @johngribbin , it may make sense to keep that stuff under Offers (the prism-related stuff under Offers would still be contingent on plugin-list). Keep in mind binding stuff is keyed on offer_id in the Prism API/db.

So in term of UI, on on the Menu -> Prism, replace the "Offers" Section (on the lower half) with a button or link that states "Manage Bindings" that links you to Menu -> Offers. When a user clicks an offer, they will see the prism_id if any prism bound to the offer. When creating a binding, the UI will display a list of Prism_ids, of which one (and only one) prism can be selected.

farscapian commented 1 month ago

Also, prism-bindinglist has been updated to the following format, per feedback from this integration. binding_id is for UI purposes only, but wondering if I can remove it now assuming we put this stuff under Menu->Offers.

{
   "bolt12_prism_bindings": [
      {
         "binding_id": "c4a16493a362a111f8491251b74dfceb4fb511970ddf3147fe9d51fb29d2dd7c",
         "offer_id": "8ca1b3674a2f39f00fd7f1b01e148b37bbc3146f1fe872e84ed615647a850ee2",
         "prism_id": "prism1",
         "timestamp": 1716209712,
         "member_outlays": [
            {
               "member_id": "073a5853-8744-464e-a353-cc5018a01cfc",
               "outlay_msat": "0"
            },
            {
               "member_id": "403d8edb-5c66-4af2-b8bd-28831f315d18",
               "outlay_msat": "0"
            },
            {
               "member_id": "7f01e3fd-6a80-466d-84a6-bda144a9283e",
               "outlay_msat": "0"
            }
         ]
      }
   ]
}
evansmj commented 1 month ago

Sounds good on moving the bindings to the offers. for binding_id i think yes you could remove it since i will latch these bindings onto existing offer_ids