status-desktop/ui/app/AppLayouts/Wallet/views/walletconnect/sdk
Stefan ccd8c5b65f feat(wallet) Wallet Connect integration prototype
Implement a prototype of integrating [WalletConnect Web SDK]()

- integrate WalletConnect Web SDK using Node.js and packing it using
  [webpack](https://webpack.js.org/guides/getting-started/)
  - this way, we achieve the same versioning strategy for the SDK
- add WalletConnectSDK view
  - it is used to load the web SDK via a WebView (validated working on
  Mac and Windows)
- add new app dependency of WebView QT
  - also update vendor packages `Dotherside` and `nimqml` to add
    required WebView::initialize API used to initialize the WebView
    integration at the app start
- add WalletConnectPage to Storybook for quick prototyping
  - Also add dependency for WebView Qt lib
- index.js is the wrapper used to provide a simple stateful interface
  with the WC SDK
- Entry in ui/generate-rcc.go ensures the node_modules cache is excluded
  from the resource file

Notes:

- Added `com.apple.security.cs.allow-jit` entitlement when signing the
app package. This allows Execution of JIT-compiled Code Entitlement
required by the fast-path of the JavaScriptCore framework on MacOS
platforms.
- Keep some debugging entries expected to help debugging Linux package
- Removed outdated `DerivationPathInputRegressionTests` qml test

Closes #12301
2023-10-30 09:29:33 +01:00
..
generated
src
README.md
package-lock.json
package.json
webpack.config.js

README.md

Wallet Connect Integration

WalletConnect SDK management

Install dependencies steps by executing commands in this directory:

  • update the package.json versions and run npm install
    • alternatively
      • use the command npm install <package-name>@<version/latest> --save for individual packages
      • or to update to the latest run npm update in here
    • these commands will also create or update a package-lock.json file and populate the node_modules directory
  • update the bundle.js file by running npm run build
  • add the newly generated files to index git add --update . to include in the commit

Testing

Use the web demo test client https://react-app.walletconnect.com/ for wallet pairing and https://react-auth-dapp.walletconnect.com/ for authentication

TODO

Log

Initial setup

npm init -y
npm install --save-dev webpack webpack-cli webpack-dev-server
npm install --save @walletconnect/web3wallet
npm run build

Dev - to be removed

To test SDK loading add the following to ui/app/mainui/AppMain.qml

import AppLayouts.Wallet.views.walletconnect 1.0

// ...

StatusDialog {
    id: wcHelperDialog
    visible: true

    WalletConnect {
        SplitView.preferredWidth: 400
        SplitView.preferredHeight: 600

        projectId: "<Project ID>"
        backgroundColor: wcHelperDialog.backgroundColor
    }

    clip: true
}