SIPs icon indicating copy to clipboard operation
SIPs copied to clipboard

Create SIP-22: Deep Links

Open Montoya opened this issue 1 year ago • 4 comments

I have attempted to describe a URL schema for deep links as well as a method for using them.

Montoya avatar Mar 21 '24 04:03 Montoya

I think I have a different idea about how to do this now. Will make a different proposal.

Montoya avatar Mar 22 '24 12:03 Montoya

OK I have updated this based on what I think is the right approach. The only thing that is missing is that ideally the request to open a page could also pass along some parameters. For example, let's say a Snap has multiple features in its home page, like 1) swap 2) bridge 3) stake. If a Snap wants to open its home page and navigate to one of those interfaces, it will need to be able to pass a parameter that can be processed by the homepage. The request could look like this:

await snap.request({
  method: 'snap_open',
  params: {
    url: 'npm:@consensys/starknet-snap/page/home',
    params: {...}
  },
});

Would that be a good approach?

Montoya avatar May 20 '24 22:05 Montoya

OK I have updated this based on what I think is the right approach. The only thing that is missing is that ideally the request to open a page could also pass along some parameters. For example, let's say a Snap has multiple features in its home page, like 1) swap 2) bridge 3) stake. If a Snap wants to open its home page and navigate to one of those interfaces, it will need to be able to pass a parameter that can be processed by the homepage. The request could look like this:

await snap.request({
  method: 'snap_open',
  params: {
    url: 'npm:@consensys/starknet-snap/page/home',
    params: {...}
  },
});

Would that be a good approach?

You can have the params in the url, condense the request a little.

It makes sense to have params for the urls, we might have to update the SIP that defines pages to accommodate params.

hmalik88 avatar May 22 '24 13:05 hmalik88

On second thought you can just use anchors if all you're looking for out of the params is to navigate to a certain part of a page

hmalik88 avatar May 22 '24 18:05 hmalik88

Changed the URL scheme based on some more convos and reduced the scope of the SIP to just define the scheme, in a later SIP (or MIP?) we can spec the RPC navigation method.

hmalik88 avatar Sep 13 '24 15:09 hmalik88