Concordium / concordium-dapp-libraries

A coherent set of building blocks for making it as easy as possible for developers to build web-based dApps.
Apache License 2.0
7 stars 5 forks source link

wallet-connectors: Fix schema object serialization for WalletConnect #41

Closed bisgardo closed 1 year ago

bisgardo commented 1 year ago

Purpose

Ensure that schema objects are sent in the format expected by the Mobile Wallets.

Changes

Translate the Schema object into one that JSON encodes as expected by the Mobile Wallet Crypto library.

Currently the schema objects are sent directly which means that the type field has unexpected values and the value is converted to a Buffer (format {type: "Buffer", data: [<bytes>]}) instead of a base64 encoded string.

The Android wallet accepts the current payload but silently fails to decode the parameters and just prints "No parameters". I've verified that it prints the correct payload after this change. The iOS wallet's WalletConnect implementation is going to accept both formats.

bisgardo commented 1 year ago

ping @orhoj