title: connect to walletconnect with Dapp
body: <p>I created my own lottery smart contract and also created front ends Dapp in html and javascript. I before used metamask for connecting. and also I used infura for connecting without metamask. but now I want to connect the project to trust wallet in phone with walletconnect. But I cannot find true code for connecting dapp to trust wallet with walletconnect. Please someone help me to connect html front end to the trust wallet with Qr-code. If you need to see my project I can send all code of my project for you.</p>
  <p>I used before this code for wallet connect:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="container"&gt;
                &lt;div class="row"&gt;
                  &lt;div class="col-md-12"&gt;
                    &lt;h5&gt;Web3modal example for vanille JavaScript and HTML&lt;/h5&gt;
  
                    &lt;p&gt;No wallet connected. Connect wallet to show accounts and their ETH balances.&lt;/p&gt;
  
                    &lt;div class="alert alert-danger" id="alert-error-https" style="display: none"&gt;
                      You can run this example only over HTTPS connection.
                    &lt;/div&gt;
  
                    &lt;div id="prepare"&gt;
                      &lt;button class="btn btn-primary" id="btn-connect"&gt;
                        Connect wallet
                      &lt;/button&gt;
                    &lt;/div&gt;
  
                    &lt;div id="connected" style="display: none"&gt;
  
                      &lt;button class="btn btn-primary" id="btn-disconnect"&gt;
                        Disconnect wallet
                      &lt;/button&gt;
  
                      &lt;hr&gt;
  
                      &lt;div id="network"&gt;
                        &lt;p&gt;
                          &lt;strong&gt;Connected blockchain:&lt;/strong&gt; &lt;span id="network-name"&gt;&lt;/span&gt;
                        &lt;/p&gt;
  
                        &lt;p&gt;
                          &lt;strong&gt;Selected account:&lt;/strong&gt; &lt;span id="selected-account"&gt;&lt;/span&gt;
                        &lt;/p&gt;
  
                      &lt;/div&gt;
  
                      &lt;hr&gt;
  
                      &lt;h4&gt;All account balances&lt;/h4&gt;
  
                      &lt;table class="table table-listing"&gt;
                        &lt;thead&gt;
                          &lt;th&gt;Address&lt;/th&gt;
                          &lt;th&gt;ETH balance&lt;/th&gt;
                        &lt;/thead&gt;
  
                        &lt;tbody id="accounts"&gt;
                        &lt;/tbody&gt;
                      &lt;/table&gt;
  
                      &lt;p&gt;Please try to switch between different accounts in your wallet if your wallet supports this functionality.&lt;/p&gt;
  
                    &lt;/div&gt;
  
                    &lt;br&gt;
  
                    &lt;div class="well"&gt;
                      &lt;p class="text-muted"&gt;See also the &lt;a href="https://web3modal.com/"&gt;TypeScript and React example application&lt;/a&gt;&lt;/p&gt;
                    &lt;/div&gt;
  
                  &lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
  
              &lt;!-- We use simple &lt;template&gt; templating for the example --&gt;
              &lt;div id="templates" style="display: none"&gt;
                &lt;template id="template-balance"&gt;
                  &lt;tr&gt;
                    &lt;th class="address"&gt;&lt;/th&gt;
                    &lt;td class="balance"&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                &lt;/template&gt;
              &lt;/div&gt;
  
  
              &lt;script type="text/javascript" src="https://unpkg.com/web3@1.2.11/dist/web3.min.js"&gt;&lt;/script&gt;
              &lt;script type="text/javascript" src="https://unpkg.com/web3modal@1.9.0/dist/index.js"&gt;&lt;/script&gt;
              &lt;script type="text/javascript" src="https://unpkg.com/evm-chains@0.2.0/dist/umd/index.min.js"&gt;&lt;/script&gt;
              &lt;script type="text/javascript" src="https://unpkg.com/@walletconnect/web3-provider@1.2.1/dist/umd/index.min.js"&gt;&lt;/script&gt;
              &lt;script type="text/javascript" src="https://unpkg.com/fortmatic@2.0.6/dist/fortmatic.js"&gt;&lt;/script&gt;
  
              &lt;!-- This is our example code --&gt;
              &lt;script type="text/javascript" src="./example.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>and also this code for normal connect :</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>if (typeof window.ethereum !== 'undefined') 
              {
                  console.log('MetaMask is installed!');
                  
  web333 = new Web3(web3.currentProvider);            
                  
              const accountsH = ethereum.request({ method: 'eth_requestAccounts' });
              const accountH = accountsH[0];
              const showAccountH = document.querySelector('.showAccount');
                  
          const accounts = ethereum.request({ method: 'eth_requestAccounts' });
          const account = accounts[0];
          const showAccount = document.querySelector('.showAccount'); 
                  
              }else{
                  console.log('MetaMask not installed!');
                  alert("Please install Metamsk wallet first, then try again");
                  
                  
       web333 = new Web3(new Web3.providers.HttpProvider("https://ropsten.infura.io/v3/3c68/* my infura ID */5811f301753"));              
  }
  
  
  var addressH = "0x35C00a/*MY CONTRACT ADDRESS */8D639145";
                  var abiH =[/*my contract ABI*/];
                          contractH = new web333.eth.Contract(abiH, addressH);</code></pre>
  </div>
  </div>
  </p>
  <p>I want to connect trust wallet and metamask and can connect to the other wallet. I want the global type of code for all wallets.</p>