status-desktop/ui/app/AppLayouts/Wallet/views/walletconnect/sdk
Sale Djenic 48c9e372dc chore(@desktop/walletconnect): communication between qt desktop app and loaded wallet connect sdk is made via web channel 2023-11-17 13:55:20 +01:00
..
generated chore(@desktop/walletconnect): communication between qt desktop app and loaded wallet connect sdk is made via web channel 2023-11-17 13:55:20 +01:00
src chore(@desktop/walletconnect): communication between qt desktop app and loaded wallet connect sdk is made via web channel 2023-11-17 13:55:20 +01:00
README.md feat(wallet) integrate Wallet Connect sign APIs 2023-11-15 17:21:27 +01:00
package-lock.json feat(wallet) Wallet Connect integration prototype 2023-10-30 09:29:33 +01:00
package.json feat(wallet) integrate Wallet Connect sign APIs 2023-11-15 17:21:27 +01:00
webpack.config.js feat(wallet) Wallet Connect integration prototype 2023-10-30 09:29:33 +01:00

README.md

Wallet Connect Integration

TODO

Design questions

  • Do we report all chains and all accounts combination or let user select?
    • Wallet Connect require to report all chainIDs that were requested
      • Show error to user workflow.
  • Can't respond to sign messages if the wallet-connect dialog/view is closed (app is minimized)
    • Only apps that use deep links are expected to work seamlessly
  • Do we report disabled chains? Update session in case of enabled/disabled chains?
  • Allow user to disconnect session? Manage sessions?
  • Support update session if one account is added/removed?
  • User awareness of session expiration?
    • Support extend session?
  • User error workflow: retry?
  • Check the Auth request for verifyContext https://docs.walletconnect.com/web3wallet/verify
  • What description and icons to use for the app? See metadata parameter in Web3Wallet.init call

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

Log

Initial setup

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

Dev - to be removed

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

import AppLayouts.Wallet.stores 1.0 as WalletStores
import AppLayouts.Wallet.views.walletconnect 1.0

// ...

StatusDialog {
    id: wcHelperDialog
    visible: true

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

        backgroundColor: wcHelperDialog.backgroundColor

        controller: WalletStores.RootStore.walletConnectController
    }

    clip: true
}