Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deeplinks #2679

Closed
nikita-fuchs opened this issue Jan 31, 2024 · 3 comments · Fixed by #3167
Closed

Deeplinks #2679

nikita-fuchs opened this issue Jan 31, 2024 · 3 comments · Fixed by #3167

Comments

@nikita-fuchs
Copy link

Hello everybody, I know, easier said than properly done, but as multiple approaches exist how we could pull this off with the way SH wallet works, we can find the most ideal one and go for it.

Is your feature request related to a problem? Please describe.

The motivations for this are as follows:

  1. in order to simplify the implementation of the Superhero Wallet for partners and other developers the necessity of deeplinks became more and more apparent.
  2. We should combine this with the long-discussed mobile scenario, where deep-links would bounce you into the SH app, and later allow calling some callback URL in the browser with details/parameters the user permitted to share with the mobile website (will will get at this at some point ;) )

Describe the solution you'd like

  1. create the generic foundations to introduce deep links for certain actions
  2. introduce deep-linking into certain / very standardised / TBD features like doing transfers, signing messages.

Describe alternatives you've considered
Going down the SDK-route is not practical for parnters which support 14 different wallets, adding the whole SDK just to perform a simple sign message and/or transfer really bloats the dependencies.

Additional context
Integration of aeternity on bigger platforms would heavily benefit from that, as we are learning in specific, not-yet-announced cases right now.

@kenodressel
Copy link
Collaborator

To use deeplinks, do as follow opening the links in a new window (either window.open or target="_blank")

connect your wallet

URL: https://wallet.superhero.com/address&x-success=<success-url>&x-cancel=<cancel-url>

to connect your wallet it should be noted that the success callback url should contain ?address={address}&networkId={networkId} which is then updated by the wallet to become ?address=ak_....&networkId=ae_uat or similar.

so http://localhost:3000/wallet-connect-success?address={address}&networkId={networkId}
gets called from the wallet as http://localhost:3000/wallet-connect-success?address=ak_fe(...)23&networkId=ae_uat. This can then be used by the application to determine the account holder.

sign a tx

looking at your issue that does not fully fulfill all requests, as a prepared TX is still required (and therefore most likely an SDK) in order to be signed. But thats what exists already:

const rawTx = await aeSdk.buildTx(transaction);
const query = new URLSearchParams({
    transaction: rawTx,
    networkId: 'ae_uat', // or your network id
    broadcast: "true",
  });
const url = `https://wallet.superhero.com/sign-transaction?${query.toString()}&x-success=<success-url>&x-cancel=<cancel-url>`;

sign a message

URL: https://wallet.superhero.com/sign-message?message=<message>&x-success=<success-url>&x-cancel=<cancel-url>

@AndreasGassmann
Copy link

Hijacking this thread because it's relevant: This is indeed a really important feature and it was quite easy to integrate. The "sign a message" deeplink was almost exactly what we needed, with one missing feature about the encoding of the message: #2688

@davidyuk
Copy link
Member

davidyuk commented Feb 6, 2024

There were also a deeplink to make a spend transaction (including custom payload), also to claim an invite

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

Successfully merging a pull request may close this issue.

4 participants