Git Product home page Git Product logo

Comments (1)

ohager avatar ohager commented on July 28, 2024

That's actually relatively easy, but requires Deeplink support.
We can rely here on SRC22, i.e. using the generic URL format

action: "sign"
payload: "36b2444574328410c27..." (unsigned transaction bytes)

According to SRC22 the payload needs to be encoded in base64 (although knowing that unsignedBytes is already hex and compatible with network transport).

An url would look like this:

signum://v1?action=sign&payload=MDAyMDM1MWUzYTEyM2MwMDQ5N2Q1NTlkMThkOTg5YjhlMmQ3MjllYjZmNjliNzBjMWRkYzNlNTU0Zjc1YmVmM2VkMjcxNmE0YjIxMjE5MDIwODIyZWIwN2I3Nzc1NzIxMDBlMWY1MDUwMDAwMDAwMDQwNDIwZjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMTAwMDAwMGMxMzIwYTAwMmY4YTMzZmQyOWI0N2Q5NDA0Y2ZlMTUzMWI1NDNjN2MwMTExMDAwMDgwNTM2ZjZkNjUyMDU0NjU3Mzc0MjA0ZDY1NzM3MzYxNjc2NQ==

SignumJS already supports this in Methods:

createDeeplink and parseDeeplink

https://signum-network.github.io/signumjs/modules/util.html#createdeeplink

So the flow is:

  1. Get unsigendTransactionBytes (generate Tx using the senders public key only)
  2. The dApp generates the deeplink for signing (createDeeplink)
  3. Using the deeplink would open the Mobile Wallet
  4. Mobile wallet needs to parse the incoming link -> support for two actions: pay (to be compatible with phoenix codes) and sign
  5. Mobile wallet navigates to Signing Screen (if action=sign)
  6. Gets the unsigned bytes and parses it using node function parseTransactionBytes
  7. Shows data and asks for confirmation

Bonus: the dApp can check the blockchain pending bytes for signed transaction.

from signum-mobile-wallet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.