Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Refine installation flow #10

Closed
danfinlay opened this issue Sep 18, 2019 · 3 comments
Closed

Refine installation flow #10

danfinlay opened this issue Sep 18, 2019 · 3 comments

Comments

@danfinlay
Copy link
Collaborator

The current forceParams request to install then install flow feels a little clunky to me. This issue will be for discussing the API for installing a plugin.

I was thinking we could unify the installation of the plugin with the permission to connect to it, maybe something like this:

const result = await ethereum.send({
  method: 'wallet_requestPermissions',
  params: [
    {
      wallet_connectToPlugin_pluginA: {
        sourceUrl,
      }
    }
  ]
})

// If the user approves, and the plugin does not exist, we install it.
// If the user approves and the plugin is already installed, we merely grant permission to connect to it.
// Now this site can send messages to that plugin:

await ethereum.send({
  method: 'wallet_connectToPlugin_pluginA',
  params: [ RPC_PAYLOAD ]
})
@danfinlay
Copy link
Collaborator Author

The proposal above is distinct from current behavior because we currently are lazily installing the plugin on the first invocation, but we should just install it as soon as permission to interact with it was granted.

@danfinlay
Copy link
Collaborator Author

I implemented this. There are probably still ways to refine installation, though, so I'm keeping this open for the general cause of improving it further and having a place to discuss how.

@rekmarks
Copy link
Member

Superseded by #94

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants