WalletConnect - Wallet Technology

WalletConnect is the part of backend wallets service.

Create WalletConnect project

Before use, you must create an appropriate project in the WalletConnect dashboard Reown Cloud | Sign In

Explorer settings for project:

  • type: dapp

  • category: exchanges

  • support Sign v.2: switch on

  • chains: on production it can be Binance Smart Chain Mainnet and Ethereum Mainnet.

  • logo: use project logo

  • testing instruction:

1. Open homepage 2. Register new account 3. Go to <ETH or BNB> Wallet 4. Push Deposit button 5. Select WalletConnect 6. Input sum 0.01 and push Next 7. Scan QR-code from your wallet application 8. In wallet application approve connect then sign message.

There are different project for stage and for production.

Setup wallets service

Add in section wallets in templates/compose/backend.yaml.t 3 environment variables:

  • EXTERNAL_WALLET_MESSAGE - system show this message when user are connecting

  • WALLET_CONNECT_PROJECT_ID - project_id from WalletConnect dashboard for current project

  • BASE_URL - marionette project homepage address

wallets: ... environment: ... EXTERNAL_WALLET_MESSAGE: "Please, verify marionette connection" WALLET_CONNECT_PROJECT_ID: e851e32304159aebb9054f65c43c47e9 BASE_URL: {{base_url}}

Use case

  • User selects currency and clicks deposit button

UI sends request:

query { currencyChains(currencyId:"ETH") { id title subtitle currencyPaymentInterfaces { id minDirectDepositAmount directDepositFee minDirectDepositFee maxDirectDepositFee } } }
  • if response has one or more results user can see “WalletConnect” choice

  • After select “WalletConnect” user sees the array of the buttons (for button title is used field chain.title from response)

  • For chosen chain user can select one of currencyPaymentInterface - with different restrictions and deposit fee parameters

User must be input deposit amount and push “Next” button.

UI sends request ans shows QRcode. QR is created for response string.

UI must be subscribe to:

When UI receive subscription with correct chainId it must send two consecutive requests:

It sends the message in wallet application with EXTERNAL_WALLET_MESSAGE for signing

It sends the transaction for signing: