wharfkit / wallet-plugin-wombat

WalletPlugin for the Wharf Session Kit. Allow users to login and sign transactions with Wombat wallet.
https://wharfkit.com
Other
1 stars 1 forks source link

Error: Invalid response from Anchor, must contain link_ch, link_key, link_name and cid flags. #6

Closed DenisCarriere closed 10 months ago

DenisCarriere commented 1 year ago
  1. When using Anchor login, cannot login using Wombat
  2. When using Wombat forces to use Scatter protocol without an option to Scan QR code to login.

Using: Desktop UI + Mobile (to sign in)

@aaroncox thoughts?

Code

import { Chains } from "@wharfkit/common"
import { SessionKit } from "@wharfkit/session"
import { WebRenderer } from "@wharfkit/web-renderer"
import { WalletPluginAnchor } from "@wharfkit/wallet-plugin-anchor"
import { WalletPluginWombat } from "@wharfkit/wallet-plugin-wombat"

export const session = new SessionKit({
    appName: "work.pomelo",
    chains: [Chains.EOS],
    ui: new WebRenderer(),
    walletPlugins: [
        new WalletPluginAnchor(),
        new WalletPluginWombat(),
    ]
})

Login 1 (with Wombat)

image

Login 2 (with Anchor)

image image
aaroncox commented 1 year ago

The error messages are accurate, it doesn't look like Wombat has fully implemented the link messaging protocol like Anchor does - and instead just uses plain ESR payloads.

So some answers, of which I'm not sure what our stance is at this point:

  1. When using the Anchor wallet plugin to login and scanning with Wombat, to get this to work we would need to modify the @wharfkit/wallet-plugin-anchor to utilize the fallback method of rendering a QR code when a link session doesn't exist. I don't think we have this on our roadmap in the short term, since we'd expect anyone using this multi-device setup to use link sessions so they don't have to continually scan new QR codes. Since Wombat doesn't implement these, it's just not going to work until they implement link sessions.
  2. For the @wharfkit/wallet-plugin-wombat, we went the route of using the Scatter protocol (instead of ESR) since it was most complete on their end. It works with the browser extension, the mobile app, and their new desktop app - but only in same-device setups (e.g. no browser + mobile multi-device). This means we don't present a QR code, since Scatter's protocol doesn't support that. It's expecting you to use the in-app browser to load things, or be on the same device.

If we were to swap the Wombat plugin to use ESR+link, we'd need Wombat to also support link sessions in order to provide the best experience. As it stands though they don't, so the best experience for them is still using Scatter's protocol.

I am not sure we have anything actionable at the moment for this. What I think we may need is for Wombats team to either commit fully to implementing ESR, or just embrace that they are using Scatter's protocol - I'm not sure we can do both cleanly while maintaining a Wombat-specific plugin (which I think is important for their branding).

DenisCarriere commented 1 year ago

Ah ok! I'll ping Wombat to see if they can update their wallet to add that support link sessions 👍