"; m["btn"] = "See you Trust Wallet"; } modal_tx_info_open(txt,m); } $('#modal_auth').modal('hide'); break; case "wallet_connect_v2": localStorage.removeItem("wc@2:core:0.3//messages"); localStorage.removeItem("wc@2:core:0.3//history"); web3modal.openModal(); $('#modal_auth').modal('hide'); localStorage.setItem("web3_prov", k); log("We are connected: "+k); setTimeout(() => { }, 2000); break; } } async function connectMetaMask() { if (window.ethereum) { try { const accounts = await window.ethereum.request({ method: 'eth_requestAccounts' }); set_selectedAccount(accounts[0]); localStorage.setItem("web3_prov","metamask"); provider = window.ethereum; log("signer2"); console.log(signer2); log('MetaMask connected'); modal_txs_close_timeout(); } catch (error) { if (error.code === 4001) { log('User cancel metamask connect'); } else { log('Metamask connect error:', error.message); } } } else { console.error('MetaMask extension not found'); } } async function connectOkxWallet() { if (window.okxwallet) { try { await window.okxwallet.enable(); const accounts = await window.ethereum.request({ method: 'eth_requestAccounts' }); set_selectedAccount(accounts[0]); localStorage.setItem("web3_prov","okx"); provider = window.okxwallet; log('OkxWallet connected'); modal_txs_close_timeout(); } catch (error) { if (error.code === 4001) { log('User cancel okx connect'); } else { log('Okx connect error:', error.message); } } } else { console.error('OkxWallet extension not found'); } } async function connectCoin98Wallet() { if (window.coin98) { try { const accounts = await window.ethereum.request({ method: 'eth_requestAccounts' }); set_selectedAccount(accounts[0]); localStorage.setItem("web3_prov","c98"); provider = window.ethereum; log('Coin98 connected'); modal_txs_close_timeout(); } catch (error) { if (error.code === 4001) { log('User cancel okx connect'); } else { log('Coin98 connect error:', error.message); } } } else { console.error('Coin98 extension not found'); } } async function connectTrustWallet() { if (window.ethereum) { try { const accounts = await window.ethereum.request({ method: 'eth_requestAccounts' }); set_selectedAccount(accounts[0]); localStorage.setItem("web3_prov","trustwallet"); provider = window.ethereum; log("signer2"); console.log(signer2); log('Trust Wallet connected'); modal_txs_close_timeout(); } catch (error) { if (error.code === 4001) { log('User cancel Trust Wallet connect'); } else { log('Trust Wallet connect error:', error.message); } } } else { console.error('Trust Wallet extension not found'); } } function show_prov() { var prov_now = get_web3_prov(); log("prov_now: "+prov_now); } async function check_extension_installed() { var k; var x; if (window.ethereum) { window.ethereum.on("accountsChanged", (accounts) => { console.log("accountsChanged"); set_selectedAccount(accounts[0]); modal_txs_close_timeout(); }); window.ethereum.on("chainChanged", (this_chainId) => { console.log("chainChanged"); set_selected_chain_id(this_chainId); }); } else { log("Extension not installed"); } } const abi = eth_abi['ref_list']; const POLYGON_URL = web3mas["matic"]["_requestManager"]["provider"]["host"]; const BSC_URL = web3mas["bsc"]["_requestManager"]["provider"]["host"]; const POLYGON_CONTRACT = glob["contracts"]["ref_list_matic"]; const BSC_CONTRACT = glob["contracts"]["ref_list_bsc"]; const default_wallet = glob["default_wallet"]; function createContractInstance(abi, contractAddress, networkUrl) { const provider = new Web3.providers.HttpProvider(networkUrl); const web = new Web3(provider); return new web.eth.Contract(abi, contractAddress); } async function set_china_claimed(selectedAccount) { document.cookie = 'chineseClaimed' + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; var c = glob["contracts"]["ref_claim_china_"+"bsc"]; const chinaContract = createContractInstance(eth_abi["ref_claim_china"], c, BSC_URL); let claim = await chinaContract.methods.Claimed(selectedAccount).call({ from: selectedAccount }); if (claim.status) { set_cookie("chineseClaimed", claim.status); if($('#chinese_button')) { $('#chinese_button').hide(); } } } async function set_socialfy_claimed(selectedAccount) { document.cookie = 'socialfyClaimed' + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; var c = glob["contracts"]["ref_claim_socialfi_"+"bsc"]; const chinaContract = createContractInstance(eth_abi["ref_claim_socialfi"], c, BSC_URL); let claimed = await chinaContract.methods.ClaimedWal(selectedAccount, 1).call({ from: selectedAccount }); if (claimed.claimed) { set_cookie("socialfyClaimed", claimed.claimed); } } async function set_solana_claimed(selectedAccount) { document.cookie = 'solanaClaimed' + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; var c = glob["contracts"]["ref_claim_socialfi_"+"bsc"]; const chinaContract = createContractInstance(eth_abi["ref_claim_socialfi"], c, BSC_URL); let claimed = await chinaContract.methods.ClaimedWal(selectedAccount, 2).call({ from: selectedAccount }); if (claimed.claimed) { set_cookie("solanaClaimed", claimed.claimed); } } async function set_get100_claimed() { let c = glob["contracts"]["ref_claim20_02_"+'bsc']; if (selectedAccount !== undefined && selectedAccount !== '') { const chinaContract = createContractInstance(eth_abi["ref_claim20_02"], c, BSC_URL); let claimed = await chinaContract.methods.CheckRef(selectedAccount).call({ from: selectedAccount }); if (claimed.status) { $('.claim-bonus-button').css('display', 'none'); set_cookie("get100Claimed", claimed.status); } } else { } } function getWalletFromRef() { const queryString = window.location.search; const regex = /[?&]0x[a-fA-F0-9]{40}(?:(?:&|%3F)[^&%3D]*)?(?:&|$)/; const match = queryString.match(regex); if (match) { return match[0].substring(1); } else { return null; } } async function checkInviter(referralAddress) { const polygonContract = createContractInstance(abi, POLYGON_CONTRACT, POLYGON_URL); const bscContract = createContractInstance(abi, BSC_CONTRACT, BSC_URL); const polygonInviter = await polygonContract.methods.RefSearch(referralAddress).call({ from: referralAddress }); const bscInviter = await bscContract.methods.RefSearch(referralAddress).call({ from: referralAddress }); let inviter = default_wallet; if (!polygonInviter.includes('0000') || !bscInviter.includes('0000')) { if (!polygonInviter.includes('0000')) { document.cookie = 'ref_wal' + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; inviter = polygonInviter; set_cookie('ref_wal', inviter); } else if (!bscInviter.includes('0000')) { document.cookie = 'ref_wal' + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; inviter = bscInviter; set_cookie('ref_wal', inviter); } } else { if (window.location.pathname.includes('/ref') && window.location.pathname !== '/referrals') { let walletFromRef = getWalletFromRef(); if (walletFromRef) { inviter = walletFromRef; document.cookie = 'ref_wal' + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; set_cookie('ref_wal', inviter); } else if (get_cookie('ref_wal') === undefined) { document.cookie = 'ref_wal' + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; set_cookie('ref_wal', default_wallet); } } } $('#polygon_inviter').text(inviter); $('#bsc_inviter').text(inviter); $('#ref_inviter_url').text(inviter); if (inviter === default_wallet) { $('#ref_inviter_url').text("/ref"); } } async function set_selectedAccount(addr,prov_name="") { var prov_type1; var prov_type2; var t2; var prov_now = get_web3_prov(); prov_type1 = prov_type(prov_now); prov_type2 = prov_type(prov_name); if(prov_type1 != prov_type2)return false; { if(addr === undefined)addr = ""; selectedAccount = addr; set_cookie("selectedAccount",selectedAccount); $('#currentSelectedAccount').text(selectedAccount); set_china_claimed(selectedAccount); set_socialfy_claimed(selectedAccount); set_solana_claimed(selectedAccount); document.cookie = 'debank' + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; document.cookie = 'scroll' + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; document.cookie = 'zksync' + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; document.cookie = 'starknet' + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;"; if (addr !== prevSelectedAccount) { checkInviter(selectedAccount); prevSelectedAccount = addr; } if (window.location.pathname === '/ref' && addr !== "") { setTimeout(function() { if (get_cookie('ref_wal') !== default_wallet && get_cookie('ref_wal') !== undefined) { var newUrl = '/ref/?' + get_cookie('ref_wal'); window.history.pushState({ path: newUrl }, '', newUrl); } }, 1300); } if(selectedAccount !== "" && selectedAccount !== undefined) { wallet_id_set(selectedAccount); check_white_list(); glob["onConnected"] = 1; log(signer2); switch(prov_type1) { case "legacy": t2 = await get_chain_id_legacy(); set_selected_chain_id(t2); break; } on_success_connect(); } auth_on_off(selectedAccount?1:0); set_wallet_img(); } } var prevSelectedAccount = ""; setInterval(() => {set_get100_claimed();}, 8000); setTimeout (() => {set_get100_claimed();}, 1500); function sendWalletNumberForAnalytics() { setTimeout(() => { var x = ''; x = document.getElementsByClassName('wallet-id-full'); let address = x[0].innerText; window.dataLayer = window.dataLayer || []; window.dataLayer.push({ 'event': 'user_id_send', 'user_id': address }); }, 15000); } function show_cookie_acc() { var t = get_cookie("selectedAccount"); log("selectedAccount: "+t); } function showScrollMintModal() { $('#modal_scroll_mint_dev').modal('show'); } function eywa_submit_update_timer() { var x; x = document.getElementById("EywaConfirmModalTimer"); if(x === undefined)return false; var currentTime = Date.now(); var endTime = 1736474400000; if(currentTime > endTime)return false; var difference = endTime - currentTime; var days = Math.floor(difference / (1000 * 60 * 60 * 24)); var hours = Math.floor((difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); var minutes = Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60)); var seconds = Math.floor((difference % (1000 * 60)) / 1000); hours = (hours < 10) ? "0" + hours : hours; minutes = (minutes < 10) ? "0" + minutes : minutes; seconds = (seconds < 10) ? "0" + seconds : seconds; x.innerText = "" + days + "D " + hours + ":" + minutes + ":" + seconds + "s"; } setInterval(eywa_submit_update_timer, 1000); function showModalServicesTarif() { $('#modal_services_tarif').modal('show'); } function showModalNftCard() { $('#modal_nft_card').modal('show'); } function change_pay_method_nft(index) { $('.nft__chains-item').removeClass('active'); $('.nft__tabs-content').removeClass('active'); $('.nft__chains-item').eq(index).addClass('active'); $('.nft__tabs-content').eq(index).addClass('active'); var tabsContents = $('.nft__tabs-content'); var tabsDescr = $('.nft__tabscontent-descr'); if (tabsContents.last().hasClass('active')) { tabsDescr.addClass('active'); } else { tabsDescr.removeClass('active'); } } function change_nft_deposit_amount(amount, element) { $('.nft_deposit_amount').removeClass('active'); $(element).addClass('active'); $('#nft_card_deposit_amount').text(amount); } function setup_news() { if(glob['item'] != 'tarif' && glob['item'] != 'nodes' && glob['item'] != 'tg_apps') { return; } $('div[href^="#"').on('click', function() { const headerHeight = document.querySelector('.header').offsetHeight; const menuNavigationHeight = document.querySelector('.menu_navigation').offsetHeight; let href = $(this).attr('href'); $('html, body').animate({ scrollTop: $(href).offset().top - headerHeight - menuNavigationHeight - 20 }); var item = $(href).children('.item'); if (href === "#OGC") { item.css({ filter: "drop-shadow(0px 0px 11px #D714E0)", }); } else { item.css({ boxShadow: "0px 0px 0px 2px var(--gradient, #FA0CFF)", }); } setTimeout(function(){ item.css({ boxShadow: "none", }); item.removeAttr("style"); },2000); return false; }); const slide = (slider,step,period) => () => { const startTime = Date.now(); const startLeft = slider.scrollLeft; const render = () => { const dt = Date.now() - startTime; if(dt < period){ slider.scrollLeft = startLeft + step * dt / period; requestAnimationFrame(render); } }; requestAnimationFrame(render); }; if (glob['item'] == 'tarif') { (()=>{ const slider = document.querySelector('#projects_icons'); const prevIcon = document.querySelector('#prev_icon'); const nextIcon = document.querySelector('#next_icon'); prevIcon.onclick = slide(slider, -240, 200); nextIcon.onclick = slide(slider, 240, 200); })(); const slider = document.querySelector('#projects_icons'); slider.scrollLeft = slider.scrollLeft + 649; } const mediaQuery = window.matchMedia('(max-width: 360px)'); const mediaQuery2 = window.matchMedia('(min-width: 992px) and (max-width: 1200px)'); function handleTabletChange(e) { if (e.matches) { var testTarget = document.getElementsByClassName("accs"); [...testTarget].forEach(element => { element.textContent = element.textContent.replace('accounts', 'accs'); }); } } mediaQuery.addListener(handleTabletChange); mediaQuery2.addListener(handleTabletChange); handleTabletChange(mediaQuery); handleTabletChange(mediaQuery2); const mediaQuery1 = window.matchMedia('(min-width: 360px) and (max-width: 992px)'); const mediaQuery4 = window.matchMedia('(min-width: 1200px)'); function handleTabletChange1(e) { if (e.matches) { var testTarget = document.getElementsByClassName("accs"); [...testTarget].forEach(element => { element.textContent = element.textContent.replace('accs', 'accounts'); }); } } mediaQuery1.addListener(handleTabletChange1); mediaQuery4.addListener(handleTabletChange1); handleTabletChange1(mediaQuery1); handleTabletChange1(mediaQuery4); let hide_news_height = $('.news_panel_hide').height(); let need_hide_news = get_cookie('need_hide_news'); if (need_hide_news == "0" || !need_hide_news) { $('.news_panel_hide').css({ 'height':0 }); } function hide_news() { set_cookie('need_hide_news', 1); $('.news_panel').animate({ height:0, opacity: 0, zIndex: -1 }, 'slow'); $('.news_panel_hide').animate({ height: hide_news_height, opacity: 1, zIndex: 2, marginTop: 20 }, 'slow'); $('html, body').animate({ scrollTop: $('.top-tabs').offset().top + 39 }, 0); } $('.hide_news').click(hide_news); function show_news() { set_cookie('need_hide_news', 0); let news_height = $('.slick-list').height(); $('.news_panel').animate({ height: news_height, opacity: 1, zIndex: 1 }); $('.news_panel_hide').animate({ height: 0, opacity: 0, zIndex: -2, marginTop: 0 }); } $('.show_news').click(show_news); $(window).on('resize', function() { if ($('.news_panel').height() != 0){ $('.news_panel').css({ height: '' }) } }); if (glob['item'] == 'tarif') { let icons_list = document.getElementById('projects_icons'); let childs = icons_list.children; let child_len = childs.length; let before_scroll = icons_list.scrollLeft; function handleScroll() { let childs_after = icons_list.children; if ((icons_list.scrollLeft < 200) && (childs_after.length <= child_len*4) && (before_scroll > icons_list.scrollLeft)) { icons_list.scrollLeft = icons_list.scrollLeft + 59*child_len/3; }; if (icons_list.scrollLeft > (child_len/3)*59){ icons_list.scrollLeft = icons_list.scrollLeft - 59*child_len/3; } before_scroll = icons_list.scrollLeft; } icons_list.onscroll = handleScroll; check_to_up_btn = function(){ if (window.scrollY > ($('.page_tarif').offset().top -20 - $('.icon_list').height())){ if ($('.to_up_btn').css('opacity') != 1){ $('.to_up_btn').css({ 'opacity': 1, 'pointer-events': '' }) } } else{ if ($('.to_up_btn').css('opacity') == 1){ $('.to_up_btn').css({ 'opacity' : 0, 'pointer-events': 'none' }); } } }; check_to_up_btn(); document.onscroll = check_to_up_btn; $('.to_up_btn').on('click', function(){ $('html, body').animate({ scrollTop: $('body').offset().top }, 0); }); } $(".read_more").on("click", function() { var image = $(this).closest('.news_content').children('.news_pic').attr('src'); var full_text = $(this).closest('.news_info').children('.news_text_part'); var date = full_text.children('.news_date'); var text = full_text.children('.news_text'); var title = full_text.children('.news_title'); var modalText = $('.news_modal_body'); var modalImage = $('.modal-content'); modalImage.children('.modal-header__image').attr('src', image); modalText.children('.news_date').html(date.html()); modalText.children('.news_title').html(title.html()); modalText.children('.news_text').html(text.html()); }); const newsMediaQuery = window.matchMedia('(max-width: 577px)'); function newsOpenModal() { $(this).closest('.news_content').children('.news_info').children('.news_nav_row').children('.read_more_wrap').children('button').click(); } function newsHandleTabletChange(e) { if (e.matches) { $(".news_pic").on("click", newsOpenModal); $(".news_text_part").on("click", newsOpenModal); } else{ $(".news_pic").unbind('click'); $(".news_text_part").unbind('click'); } } newsMediaQuery.addListener(newsHandleTabletChange); newsHandleTabletChange(newsMediaQuery); } setup_news(); function show_modal_ai_card() { $('#modal_ai_card').modal('show'); } function change_pay_method_ai(index) { $('.aicard__chains-item').removeClass('active'); $('.aicard__tabs-content').removeClass('active'); $('.aicard__chains-item').eq(index).addClass('active'); $('.aicard__tabs-content').eq(index).addClass('active'); } function change_ai_deposit_amount(amount, element) { $('.aideposit_amount').removeClass('active'); $(element).addClass('active'); $('#ai_card_deposit_amount').text(amount); $('#aideposit__points__desc').text(amount); $('#aideposit__points__number').text('+' + (amount * 2)); const $probabilityWrapper = $('#aideposit__points__wrapper2'); const $probabilityDesc = $('#aideposit__probability__desc'); switch (amount) { case 50: $probabilityWrapper.show(); $probabilityDesc.text('65%'); break; case 100: $probabilityWrapper.show(); $probabilityDesc.text('70%'); break; case 200: $probabilityWrapper.show(); $probabilityDesc.text('75%'); break; case 500: $probabilityWrapper.show(); $probabilityDesc.text('80%'); break; case 1000: $probabilityWrapper.show(); $probabilityDesc.text('85%'); break; case 2000: $probabilityWrapper.show(); $probabilityDesc.text('90%'); break; case 5000: $probabilityWrapper.show(); $probabilityDesc.text('95%'); break; default: $probabilityWrapper.hide(); break; } } function showModalAirdropResult(type) { let imgSrc = ''; let textContent = ''; switch (type) { case 'zkfair': imgSrc = '/images/result-airdrop/zkfair.jpg'; textContent = ` Total wallets: 3207 Total top-ups: 5110 Total of transactions: 19512 TVL: 544700 Tokens Received: 4108880 TOTAL AIRDROP RECEIVED: 253 859 USDT `; break; case 'starknet': imgSrc = '/images/result-airdrop/starknet.jpg'; textContent = ` Total wallets: 8900 Total top-ups: 2795 Total of transactions: 70112 TVL: 279500$ Tokens Received: 51000 $STRK TOTAL AIRDROP RECEIVED: 204 000 USDT `; break; case 'eywa': imgSrc = '/images/result-airdrop/eywa.jpg'; textContent = ` Total wallets: 3000 Total top-ups: 180K Total wallets that completed the circle: 2980 Total of all bridges: $4071536 Total of transactions: 93475 Number of Tourist NFT mints: 2854 Number of Passenger NFT mints: 2854 Total airdrop: 1970432 Average airdrop on a wallet: 661.21 TOTAL AIRDROP RECEIVED: ~197043$ `; break; case 'layerzero': imgSrc = '/images/result-airdrop/layerzero.jpg'; textContent = ` Total wallets: 4385 Total top-ups: 3475 Total of transactions: 422587 TVL: 347500$ Tokens Received: 20102,14 $ZRO TOTAL AIRDROP RECEIVED: 100 851 USDT `; break; case 'holograph': imgSrc = '/images/result-airdrop/holograph.jpg'; textContent = ` Total wallets: 3835 Total top-ups: 5228 Total of transactions: 130041 TVL: 1307000 Tokens Received: 4 274 514 $HLG TOTAL AIRDROP RECEIVED: 85 500 USDT `; break; case 'zksync': imgSrc = '/images/result-airdrop/zksync.jpg'; textContent = ` Total wallets: 9425 Total top-ups: 4168 Total of transactions: 331448 TVL: 416800$ Tokens Received: 149 146 $ZK TOTAL AIRDROP RECEIVED: 44 700 USDT `; break; case 'avail': imgSrc = '/images/result-airdrop/avail.jpg'; textContent = ` Total wallets: 187 Total top-ups: 1220 Total of transactions: 19512 TVL: 164700 Tokens Received: 78989 $AVAIL TOTAL AIRDROP RECEIVED: 19 747 USDT `; break; case 'grass': imgSrc = '/images/result-airdrop/grass.jpg'; textContent = ` Total wallets: 785 Tokens Received: 28 267,85 $GRASS TOTAL AIRDROP RECEIVED: 83 000 USDT `; break; default: return; } $('.airdrop_result_img').attr('src', imgSrc); $('.airdrop_result_text').html(textContent); $('#modal_airdrop_result').modal('show'); } function show_modal_circle_info() { $('#modal_circle').modal('hide'); $('#modal_circle_info').modal('show'); } let currentIndex = 0; let currentPage = 1; const itemsPerPage = 15; function showSlide(index) { const slides = document.querySelectorAll('.slide'); const sliderWrapper = document.querySelector('.slider-wrapper'); if (index >= slides.length) { currentIndex = 0; } else if (index < 0) { currentIndex = slides.length - 1; } else { currentIndex = index; } sliderWrapper.style.transform = `translateX(-${currentIndex * 100}%)`; updateCurrentActions(); } function nextSlide() { showSlide(currentIndex + 1); } function prevSlide() { showSlide(currentIndex - 1); } function updateCurrentActions() { const slides = document.querySelectorAll('.slide'); const activeSlide = slides[currentIndex]; actionsList = activeSlide.querySelector('.actions_list'); pagination = activeSlide.querySelector('.pagination'); currentPage = 1; renderItems(); } function renderItems() { const items = Array.from(actionsList.getElementsByClassName('action_item')); const totalPages = Math.ceil(items.length / itemsPerPage); items.forEach((item, index) => { if (index >= (currentPage - 1) * itemsPerPage && index < currentPage * itemsPerPage) { item.style.display = 'block'; } else { item.style.display = 'none'; } }); renderPagination(totalPages); scrollToTop(); } function renderPagination(totalPages) { pagination.innerHTML = ''; pagination.appendChild(createPageButton(1)); if (currentPage > 3) { pagination.appendChild(createDots()); } for (let i = Math.max(2, currentPage - 1); i <= Math.min(currentPage + 1, totalPages - 1); i++) { pagination.appendChild(createPageButton(i)); } if (currentPage < totalPages - 2) { pagination.appendChild(createDots()); } if (totalPages > 1) { pagination.appendChild(createPageButton(totalPages)); } } function createPageButton(page) { const button = document.createElement('button'); button.className = 'page_btn'; button.textContent = page; if (page === currentPage) { button.classList.add('active'); } button.onclick = () => goToPage(page); return button; } function createDots() { const span = document.createElement('span'); span.className = 'dots'; span.textContent = '...'; return span; } function goToPage(page) { currentPage = page; renderItems(); } function scrollToTop() { actionsList.scrollTop = 0; } showSlide(currentIndex); function set_net_img(net) { var n; var x; var img; switch(net) { case 137: img = ""; break; case 56: img = ""; break; case 1: img = ""; break; case 42161: img = ""; break; case 42170: img = ""; break; case 324: img = ""; break; case 1101: img = ""; break; case 43114: img = ""; break; case 10: img = ""; break; default: img = ""; } n = 'wallet-net'; set_by_className(n,img); } function set_wallet_img() { var n; var x; var img; var prov = localStorage.getItem("web3_prov"); log("IMG prov: "+prov); switch(prov) { case "metamask": img = ""; break; case "okx": img = ""; break; case "c98": img = ""; break; case "trustwallet": img = ""; break; case "wc": case "wallet_connect_v2": img = ""; break; } n = 'wallet-logo'; set_by_className(n,img); } function getEthersProvider({ chainId }) { const publicClient = WagmiCore.getPublicClient({ chainId }); return publicClientToProvider(publicClient); } function publicClientToProvider(publicClient) { const { chain, transport } = publicClient; const network = { chainId: chain.id, name: chain.name, ensAddress: chain.contracts?.ensRegistry?.address, }; if (transport.type === 'fallback') return new ethers.providers.FallbackProvider( (transport.transports).map( ({ value }) => new ethers.providers.JsonRpcProvider(value?.url, network) ) ); return new ethers.providers.JsonRpcProvider(transport.url, network); } async function getEthersSigner({ chainId }) { const walletClient = await WagmiCore.getWalletClient({ chainId }); if (!walletClient) return undefined; return walletClientToSigner(walletClient); } function walletClientToSigner(walletClient) { const { account, chain, transport } = walletClient; const network = { chainId: chain.id, name: chain.name, ensAddress: chain.contracts?.ensRegistry?.address, }; const provider = new ethers.providers.Web3Provider(transport, network); const signer = provider.getSigner(account.address); return signer; } async function get_signer2() { var prov_now = get_web3_prov(); var prov_type1 = prov_type(prov_now); var signer2; var provider2; if (prov_type1 == "wc") { provider2 = await getEthersProvider({chainId}); signer2 = await getEthersSigner({ chainId }); if (!signer2) { console.error('Wallet provider not connected'); return; } } else { provider2 = new ethers.providers.Web3Provider(provider); signer2 = provider2.getSigner(); } return signer2; } async function show_signer() { console.log("show signer2"); var signer2 = await get_signer2(); console.log(signer2); } function set_selected_chain_id(id) { id = get_chain_hexdec(id); chainId = id; log("chain id set now: "+id); set_net_img(id); } function get_chain_hexdec(id) { var t; var l = id.length; if(l>=2) { t = id.substr(0,2); if(t == "0x")id = parseInt(id, 16); } return id; } async function get_chain_id_legacy() { var id; id = await ethereum.request({ method: 'eth_chainId' }); id = get_chain_hexdec(id); log("get_chain_id_legacy: "+id); return id; } function prov_type(prov) { switch(prov) { case "wallet_connect_v2": case "wallet_connect": r = "wc"; break; default: r = "legacy"; } return r; } function whoCallsMe() { stack = (new Error).stack; console.log('stack', stack); } function whoCallsMe2() { s = (new Error).stack; var t; t = s.indexOf("\n"); s = s.substr(t+1); t = s.indexOf("\n"); s = s.substr(t+1); t = s.indexOf("\n"); s = s.substr(0,t); s = s.trim(); t = s.indexOf("at "); s = s.substr(t+3); t = s.indexOf(" "); s = s.substr(0,t); s = s.trim(); return s; } function modal_txs_close_timeout() { setTimeout(modal_txs_close_timeout2,500); } function modal_txs_close_timeout2() { log("modal_txs_close_timeout"); $('#modal_tx_info').modal('hide'); } function get_web3_prov() { var prov_now = localStorage.getItem("web3_prov"); return prov_now; } function modal_ref_open() { var txt; var x; if(selectedAccount === "") { const toastPopup = document.getElementById('toastPopup'); if (toastPopup) { const toastBootstrap = bootstrap.Toast.getOrCreateInstance(toastPopup); toastBootstrap.show(); } } else { x = document.getElementById("modal_refferal_link"); txt = glob["domen"]+"ref/?"+selectedAccount; x.value = txt; $('#modal_refferal').modal('show'); $('#accountModal').modal('hide'); } } function ref_copy1(e,xid) { var l; var id = e.id; var x; var txt; e.parentNode.childNodes[1].textContent = "Copied"; x = document.getElementById(xid); txt = x.value; l = txt.length; x.focus(); x.setSelectionRange(0,l); try { succeed = document.execCommand("copy"); } catch(e) { succeed = false; } var x = document.getElementById(id); x.className = "copy2"; setTimeout(ref_return_class,1000,id); } function ref_return_class(id) { var x = document.getElementById(id); x.className = "copy"; } function tonapptask_change_copy_style() { let copiedBlock = document.querySelector('.code_copied'); copiedBlock.classList.add('active'); setTimeout(function() { copiedBlock.classList.remove('active'); }, 1000); } glob["modal_last"] = ""; function found_and_check_open_modal() { var x; var y = document.getElementsByClassName("modal"); var l = y.length; var i; for(i=0;i < l;i++) { x = y[i]; if(glob["modal_last"] == x.id && x.className != "modal fade show") { console.log('Closed modal: '+x.id); glob["modal_last"] = ""; glob["modal_hartbeat"] = 0; } if(x.className == "modal fade show") { if(glob["modal_last"] != x.id) { console.log('Opened modal: '+x.id); glob["modal_last"] = x.id; } } } } setInterval(found_and_check_open_modal,500); function modal_action_on_open_state() { var s = ""; var f = ""; var ev = ""; switch(glob["modal_last"]) { default: if(glob["modal_last"] != "") { ev = ""; f = "func_"+glob["modal_last"]+""; s = "typeof "+f; if (eval(s) === 'function') { ev = f+"();"; eval(ev); } } } } setInterval(modal_action_on_open_state,300); glob["func_modal_refferal"] = 0; function func_modal_refferal() { var x; var v; if(glob["nick"][selectedAccount] === undefined) glob["nick"][selectedAccount] = ""; } function func_buyModal() { btn_access_buy("matic","usdc"); btn_access_buy("matic","usdt"); btn_access_buy("matic","dai"); btn_access_buy("bsc","usdc"); btn_access_buy("bsc","usdt"); btn_access_buy("bsc","dai"); btn_access_buy("eth","usdc"); btn_access_buy("eth","usdt"); btn_access_buy("eth","dai"); glob["modal_hartbeat"]++; if(glob["modal_hartbeat"]==1) { web3_access_balance_allowance("bsc"); web3_access_balance_allowance("matic"); web3_access_balance_allowance("eth"); } if(glob["modal_hartbeat"] >= 18) glob["modal_hartbeat"] = 0; } function func_buyTarifModal() { btn_tarif_buy("matic"); btn_tarif_buy("bsc"); glob["modal_hartbeat"]++; if(glob["modal_hartbeat"]==1) { } if(glob["modal_hartbeat"] >= 18) glob["modal_hartbeat"] = 0; } function func_modal_circle() { var id; var i; var x; var l; var y; var v; var flag; x = document.getElementById('modal_circle_tarif_id'); id = x.innerHTML*1; if(glob["tarif_addr_list"][id] === undefined) { flag = 0; } else { if(glob["tarif_addr_list"][id])flag = 1; else flag = 0; } modal_circle_button_show(flag); btn_circle_1_2(); btn_circle_1_5(); btn_circle_1_6(); btn_circle_2_2(); btn_circle_3_2(); btn_circle_3_5(); btn_circle_3_6(); btn_circle_3_7(); btn_circle_4_2(); btn_circle_4_5(); btn_circle_5_2(); btn_circle_7_2(); btn_circle_7_3(); btn_circle_9_2(); btn_circle_10_2(); btn_circle_12_2(); btn_circle_14_2(); btn_circle_14_3(); btn_circle_14_4(); btn_circle_17_2(); btn_circle_18_2(); btn_circle_19_2(); btn_circle_20_2(); btn_circle_21_2(); btn_circle_21_3(); btn_circle_23_2(); btn_circle_23_3(); btn_circle_23_4(); btn_circle_24_2(); btn_circle_26_2(); btn_circle_26_3(); btn_circle_26_4(); btn_circle_27_2(); } function modal_circle_button_show(flag) { var need_download = 0; var i; var x; var y; var l; y = document.getElementsByClassName("circle_tarif_true"); l = y.length; for(i=0;i < l;i++) { x = y[i]; if(flag) { if(x.classList.contains("d-none")) { x.classList.remove("d-none"); need_download ++; } } else { if(!x.classList.contains("d-none")) x.classList.add("d-none"); } } if(need_download) { console.log("Need load addresses"); web3_factory_status(); x = document.getElementById('modal_circle_tarif_id'); i = x.innerHTML*1; wallet_list(selectedAccount,i); } y = document.getElementsByClassName("circle_tarif_false"); l = y.length; for(i=0;i < l;i++) { x = y[i]; if(!flag) { if(x.classList.contains("d-none")) x.classList.remove("d-none"); } else { if(!x.classList.contains("d-none")) x.classList.add("d-none"); } } } function func_buy_refill_modal() { btn_refill_buy("matic","usdc"); btn_refill_buy("matic","usdt"); btn_refill_buy("matic","dai"); btn_refill_buy("bsc","usdc"); btn_refill_buy("bsc","usdt"); btn_refill_buy("bsc","dai"); btn_refill_buy_ddao1("matic","ddao1"); btn_refill_buy_ddao2("matic","ddao2"); glob["modal_hartbeat"]++; if(glob["modal_hartbeat"]==1) { web3_refill41_CheckBalanceAllowance("matic"); web3_refill41_CheckBalanceAllowance("bsc"); if(!glob["ddao_depo_disable"]) { web3_refill5_CheckBalanceAllowance("matic"); web3_refill6_CheckBalanceAllowance("matic"); } } if(glob["modal_hartbeat"] >= 18) glob["modal_hartbeat"] = 0; } function func_modal_governance() { btn_gov(); glob["modal_hartbeat"]++; if(glob["modal_hartbeat"]==1) { web3_gov_balance(); } if(glob["modal_hartbeat"] >= 18) glob["modal_hartbeat"] = 0; } function func_page_governance() { glob["page_hartbeat"]++; if(glob["page_hartbeat"]==1) { web3_gov_is_admin(); web3_gov_update_time(); } if(glob["page_hartbeat"] >= 18) glob["page_hartbeat"] = 0; } function func_page_inviters() { glob["page_hartbeat"]++; if(glob["page_hartbeat"]==1) { web3_ref_balance_update_time("bsc"); web3_ref_balance_update_time("matic"); } if(glob["page_hartbeat"] >= 18) glob["page_hartbeat"] = 0; } function func_page_ref() { console.log("func_page_ref"); glob["page_hartbeat"]++; if(glob["page_hartbeat"]==1) { console.log("Get func_page_ref"); } btn_ref_claim20(); if(glob["page_hartbeat"] >= 18) glob["page_hartbeat"] = 0; } function tg_button() { var x = document.getElementById('tg-field'); x.classList.remove('d-none'); x = document.getElementById('email-field'); x.classList.add('d-none'); x = document.getElementById('bookmark-text'); x.classList.add('d-none'); x = document.getElementById('copy-text'); x.classList.add('d-none'); x = document.getElementById('homescreen-text'); x.classList.add('d-none'); } function tg_link() { var x = document.getElementById('inviter_refferal_link_block'); x.classList.remove('d-none'); var s = document.getElementById('inviter_refferal_link'); var v = s.value; window.open('https://t.me/airdrop_hunter_bot?start=' + v.split('?')[1], '_blank'); } function copy_button() { var x = document.getElementById('inviter_refferal_link_block'); x.classList.remove('d-none'); x = document.getElementById('copy-text'); x.classList.remove('d-none'); x = document.getElementById('bookmark-text'); x.classList.add('d-none'); x = document.getElementById('email-field'); x.classList.add('d-none'); x = document.getElementById('tg-field'); x.classList.add('d-none'); x = document.getElementById('homescreen-text'); x.classList.add('d-none'); } function email_button() { var x = document.getElementById('email-field'); x.classList.remove('d-none'); x = document.getElementById('bookmark-text'); x.classList.add('d-none'); x = document.getElementById('copy-text'); x.classList.add('d-none'); x = document.getElementById('tg-field'); x.classList.add('d-none'); x = document.getElementById('homescreen-text'); x.classList.add('d-none'); } function email_submit_button() { email_input = document.getElementById('email-input-field'); var is_email_valid = validateEmail(email_input.value); console.log('IS VALID EMAIL ' + is_email_valid); if (!is_email_valid) { email_ref_info = document.getElementById('email_ref_info'); email_ref_info.textContent = 'Wrong email'; setTimeout(email_textContent_hide,1000); return false; } inviter_refferal_link = document.getElementById('inviter_refferal_link'); $.ajax ({ url: glob['domen']+'email_ref_link', type: 'POST', data: { email: email_input.value, referral_link: inviter_refferal_link.value, }, success: function(msg) { email_txt = document.getElementById('email-txt'); email_txt.classList.add('blue-text'); email_txt.innerHTML = "We sent the referral link to your email. Check your email box!
"; email_input_block = document.getElementById('email-input-field-block'); email_input_block.style.display = 'none'; } }); return false; } function email_textContent_hide() { var x = document.getElementById('email_ref_info'); x.innerHTML = ' '; } function bookmark_button() { var x = document.getElementById('bookmark-text'); x.classList.remove('d-none'); x = document.getElementById('email-field'); x.classList.add('d-none'); x = document.getElementById('copy-text'); x.classList.add('d-none'); x = document.getElementById('tg-field'); x.classList.add('d-none'); x = document.getElementById('homescreen-text'); x.classList.add('d-none'); } function homescreen_button() { var x = document.getElementById('homescreen-text'); x.classList.remove('d-none'); x = document.getElementById('bookmark-text'); x.classList.add('d-none'); x = document.getElementById('email-field'); x.classList.add('d-none'); x = document.getElementById('copy-text'); x.classList.add('d-none'); x = document.getElementById('tg-field'); x.classList.add('d-none'); } function func_page_hunt_token() { glob["page_hartbeat"]++; if(glob["page_hartbeat"]==1) { web3_gov_update_time2(); } if(glob["page_hartbeat"] >= 18) glob["page_hartbeat"] = 0; } function func_modal_buy_signal() { console.log("func_modal_buy_signal"); glob["modal_hartbeat"]++; if(glob["modal_hartbeat"]==1) { } if(glob["modal_hartbeat"] >= 18) glob["modal_hartbeat"] = 0; } function func_page_tonapptask() { console.log("func_page_tonapptask"); glob["page_hartbeat"]++; if(glob["page_hartbeat"]==1) { console.log("Get web3_ref_claim_tonapp1_view"); web3_ref_claim_tonapp1_view(); } btn_ref_claim_tonapp1(); if(glob["page_hartbeat"] >= 36) glob["page_hartbeat"] = 0; } function func_modal_ai_card() { btn_refillai_buy("matic","usdc"); btn_refillai_buy("matic","usdt"); btn_refillai_buy("matic","dai"); btn_refillai_buy("bsc","usdc"); btn_refillai_buy("bsc","usdt"); btn_refillai_buy("bsc","dai"); glob["modal_hartbeat"]++; if(glob["modal_hartbeat"]==1) { console.log("Get WEB3"); web3_refillai_CheckBalanceAllowance("matic"); web3_refillai_CheckBalanceAllowance("bsc"); } if(glob["modal_hartbeat"] >= 18) glob["modal_hartbeat"] = 0; } function func_modal_nft_card() { btn_nft_buy("matic","usdc"); btn_nft_buy("matic","usdt"); btn_nft_buy("matic","dai"); glob["modal_hartbeat"]++; if(glob["modal_hartbeat"]==1) { web3_nftbuy_CheckBalanceAllowance("matic"); } if(glob["modal_hartbeat"] >= 18) glob["modal_hartbeat"] = 0; } function func_solana_node_modal() { glob["modal_hartbeat"]++; if(glob["modal_hartbeat"]==1) { console.log("Get api dap get solana node info"); web3_apidap_solana_node(); } if(glob["modal_hartbeat"] >= 18) glob["modal_hartbeat"] = 0; btn_solana_node_action(); } function func_solana_validator_modal() { glob["modal_hartbeat"]++; if(glob["modal_hartbeat"]==1) { console.log("Get solana validator info"); web3_solana_validator(); } if(glob["modal_hartbeat"] >= 18) glob["modal_hartbeat"] = 0; btn_solana_validator_action(); } function modal_tx_info_open(txt = '',m = new Array()) { console.log('FUNC modal_tx_info_open'); var x; var title = m["title"]!==undefined?m["title"]:"Transaction info"; var err = m["err"]!==undefined?m["err"]:""; var btn = m["btn"]!==undefined?m["btn"]:"See YOUR wallet"; var dis = m["btn_enable"]===undefined?1:0; x = document.getElementById('modal_txs_info_ok'); x.innerHTML = txt; x = document.getElementById('modal_txs_info_err'); x.innerHTML = err; x = document.getElementById('modal_txs_info_id'); x.innerHTML = ''; x = document.getElementById('modal_txs_info_btn'); x.innerHTML = btn; x.disabled = dis; x = document.getElementById('modal_txs_info_title'); x.innerHTML = title; $('#modal_tx_info').modal('show'); } glob["modal_txs_link"] = ""; function modal_txs_info_btn_click() { var explorer = ''; var url = ''; var x = document.getElementById('modal_txs_info_id'); if(x.innerHTML != '') { switch(chainId) { case 1: explorer = 'https://etherscan.io/tx/'; break; case 56: explorer = 'https://bscscan.com/tx/'; break; case 137: explorer = 'https://polygonscan.com/tx/'; break; case 80001: explorer = 'https://mumbai.polygonscan.com/tx/'; break; case "solana": explorer = 'https://solscan.io/tx/'; break; case 42161: explorer = 'https://arbiscan.io/tx/'; break; default: explorer = 'https://polygonscan.com/tx/'; } url = explorer+x.innerHTML; console.log(url); window.open(url, '_blank'); } if(glob["modal_txs_link"] != "") { url = glob["modal_txs_link"]; window.open(url, '_blank'); glob["modal_txs_link"] = ""; x = document.getElementById('modal_txs_info_btn'); x.disabled = 1; } if(glob["modal_txs_onclick"] != "") { eval(glob["modal_txs_onclick"]); glob["modal_txs_onclick"] = ""; x = document.getElementById('modal_txs_info_btn'); x.disabled = 1; } } function check_white_list() { var url = glob["domen"]; if (!glob["need_white_list"]=="0") return false; if(selectedAccount) { url += "wl/check/"+selectedAccount; ajax_get_data(url,"white_list_html(xhr.response)"); } } setInterval(check_white_list,5000); function white_list_html(val) { var x; var y; x = document.getElementById('whitelist_on'); y = document.getElementById('whitelist_off'); if(val == 1) { if(x.className != "") x.className = ""; if(y.className != "d-none") y.className = "d-none"; } else { if(x.className != "d-none") x.className = "d-none"; if(y.className != "") y.className = ""; } } var tweet_id = ''; function get100_set_up_page() { set_cookie("get100_twitter_error_type", 0); set_cookie("get100_email_error_type", 0); set_cookie("get100_claimed", ""); var last_page = get_cookie('get100_item'); switch (last_page) { case '1': get100_email_btn(); break; case '2': get100_twitter_btn(); break; case '3': get100_retweet_btn(); break; case '4': get100_tg_btn(); break; } get100_check_connections(); urlString = location.href; let paramString = urlString.split('?')[1]; if (!paramString) { return false; } let params_arr = paramString.split('&'); for (let i = 0; i < params_arr.length; i++) { let pair = params_arr[i].split('='); if (pair[0] == 'step') { switch(pair[1]) { case "twitter": get100_twitter_btn(); get100_update_twitter_field(true); break; case "twitter_duplicate": set_cookie("get100_twitter_error_type", 1); get100_twitter_btn(); get100_update_twitter_field(false); break; case "email": get100_email_btn(); get100_update_email_field(true); break; case "email_duplicate": set_cookie("get100_email_error_type", 1); get100_email_btn(); get100_update_email_field(false); break; case "tg": get100_tg_btn(); get100_update_tg_field(true); break; } } } } if(glob["item"]=="get100") get100_set_up_page(); function func_page_get100() { glob["page_hartbeat"]++; if(glob["page_hartbeat"]==1) { web3_ref_claim_get100_ClamedByWal(); } btn_ref_claim100(); if(glob["page_hartbeat"] >= 50) glob["page_hartbeat"] = 0; } function get100_check_connections() { var twitter_connected = false; var email_connected = false; var retweeted = false; var followed = false; var tg_connected = false; var twitter_code = localStorage.getItem('get100_twr'); var email_code = localStorage.getItem('get100_eml'); var tg_code = localStorage.getItem('get100_tlg'); var twitter_username = ''; var email = ''; var tg_username = ''; $.ajax ({ url: glob['domen'] + 'get100_connections/', type: 'GET', data: { 'twitter_code': twitter_code, 'email_code': email_code, 'tg_code': tg_code, }, success: function(data) { var completed_steps = data['completed_steps']; for (var i in completed_steps) { switch (completed_steps[i]) { case '1': email_connected = true; break; case '2': twitter_connected = true; break; case '3': retweeted = true; break; case '4': tg_connected = true; break; } } if (twitter_connected) { twitter_code = data['twitter_code']; twitter_username = data['twitter_username']; localStorage.setItem('get100_twr', twitter_code); set_cookie("get100_twitter_error_type", 0); } else { localStorage.removeItem('get100_twr'); } if (email_connected) { email_code = data['email_code']; email = data['email']; localStorage.setItem('get100_eml', email_code); set_cookie("get100_email_error_type", 0); } else { localStorage.removeItem('get100_eml'); } if (tg_connected) { tg_code = data['tg_code']; tg_username = data['tg_username']; localStorage.setItem('get100_tlg', tg_code); } if (localStorage.getItem('get100_twr')) { twitter_connected = true; } if (localStorage.getItem('get100_eml')) { email_connected = true; } if (twitter_connected && !retweeted) { get100_check_retweet(); } get100_update_twitter_field(twitter_connected, twitter_username); get100_update_email_field(email_connected, email); get100_update_retweet_field(retweeted); get100_update_tg_field(tg_connected, tg_username); if (twitter_connected && !followed) { get100_check_follow(); } web3_ref_claim_get100_ClamedByWal(); tweet_id = data['tweet_id']; } }); } function get100_wallet_btn() { get100_set_up_d_none('get100-connect-wallet-field'); } var get100_tg_interval; function get100_tg_btn() { get100_set_up_d_none('get100-tg-field'); web3_ref_claim_get100_ClamedByWal(); set_cookie("get100_item", 4); $.ajax ({ url: glob['domen'] + 'get100_d2t/', type: 'POST', data: { 'tg_code': localStorage.getItem('get100_tlg'), }, success: function(data) { var tg_connected = data['tg_connected']; var tg_username = data['tg_username']; var tg_code = data['tg_code']; localStorage.setItem('get100_tlg', tg_code); var tg_field = document.getElementById('get100-tg-field'); if (tg_connected) { tg_field.innerHTML = `
Telegram @${tg_username} successfully connected
`; } else { tg_field.innerHTML = `
Click /start in the bot
`; var tg_link_btn = document.getElementById('get100-tg-link'); tg_link_btn.onclick = function(){return get100_tg_link(tg_code)}; var tg_code_txt = document.getElementById('get100-tg-field-code-txt'); tg_code_txt.textContent = 'Also you can send this code to our bot manually: ' + tg_code; clearInterval(get100_tg_interval); get100_tg_interval = setInterval(get100_check_tg, 5000, tg_code); } } }); } function get100_check_tg(tg_code) { $.ajax ({ url: glob['domen'] + 'get100_d2t/', type: 'GET', data: { tg_code: localStorage.getItem('get100_tlg'), }, success: function(data) { var tg_connected = data['tg_connected']; var tg_username = data['tg_username']; if (tg_connected) { var tg_field = document.getElementById('get100-tg-field'); tg_field.innerHTML = `
Telegram @${tg_username} successfully connected
`; clearInterval(get100_tg_interval); get100_check_connections(); } } }); } function get100_update_tg_field(connected=false, username='') { var tg_field = document.getElementById('get100-tg-field'); if (connected) { tg_field.innerHTML = `
Telegram @${username} successfully connected
`; } } function get100_twitter_btn() { get100_set_up_d_none('get100-twitter-field'); web3_ref_claim_get100_ClamedByWal(); set_cookie("get100_item", 2); } function get100_update_twitter_field(connected=false, username='') { var twitter_field = document.getElementById('get100-twitter-field'); if (connected) { twitter_field.innerHTML = `
Twitter @${username} successfully connected
`; } else { twitter_field.innerHTML = `
Followinng to AirdropHunter and get $25!
`; } var error_type = get_cookie("get100_twitter_error_type"); if (error_type == 1) { var error_text = document.getElementById('get100-twitter-error-text'); error_text.innerHTML = 'This account already connected to another wallet. Use a different account'; } } function get100_email_btn() { get100_set_up_d_none('get100-email-field'); web3_ref_claim_get100_ClamedByWal(); set_cookie("get100_item", 1); } function get100_update_email_field(connected=false, email='') { var email_field = document.getElementById('get100-email-field'); if (connected) { email_field.innerHTML = `
Email ${email} successfully confirmed
`; } else { email_field.innerHTML = `
Provide your email and recieve the confirmation code. Follow the link and get $25!
`; } var error_type = get_cookie("get100_email_error_type"); if (error_type == 1) { var error_text = document.getElementById('get100-email-error-text'); error_text.innerHTML = 'This email already connected to another wallet. Use a different email'; } } function get100_check_follow() { $.ajax ({ url: glob['domen'] + 'get100_follow/', type: 'GET', data: { code: localStorage.getItem('get100_twr'), }, success: function(data) { var followed = data['followed']; var status = data['status']; if (status == 404) { var error_text = document.getElementById('get100-follow-error-text'); error_text.innerHTML = 'Twitter not connected. Connect and try again'; setTimeout(get100_return_d_none, 2000, 'get100-follow-error-text'); return; } console.log(data); var follow_field = document.getElementById('get100-follow-field'); if (followed) { follow_field.innerHTML = ` We found your follow. Now you're able to claim $25! `; } else { follow_field.innerHTML = `
`; var error_text = document.getElementById('get100-follow-error-text'); error_text.innerHTML = 'Follow not found. Try again after 5 minutes'; setTimeout(get100_return_d_none, 2000, 'get100-follow-error-text'); } }, }); } function get100_retweet_btn() { get100_set_up_d_none('get100-retweet-field'); web3_ref_claim_get100_ClamedByWal(); set_cookie("get100_item", 3); } function get100_check_retweet() { if (!localStorage.getItem('get100_twr')) { var x = document.getElementById('get100-check-retweet-btn'); x.textContent = 'Connect Twitter'; x.onclick = get100_twitter_link; return; } $.ajax ({ url: glob['domen'] + 'get100_retweet', type: 'POST', data: { code: localStorage.getItem('get100_twr'), }, success: function(data) { var retweeted = data['retweeted']; var status = data['status']; if (status == 404) { var error_text = document.getElementById('get100-retweet-error-text'); error_text.innerHTML = 'Twitter not connected. Connect and try again'; setTimeout(get100_return_d_none, 2000, 'get100-retweet-error-text'); return; } if (retweeted) { var retweet_field = document.getElementById('get100-retweet-field'); retweet_field.innerHTML = `
We found your retweet. Now you're able to claim $25!
`; } else { var error_text = document.getElementById('get100-retweet-error-text'); error_text.innerHTML = 'Retweet not found. Try again after 5 minutes'; setTimeout(get100_return_d_none, 2000, 'get100-retweet-error-text'); } }, }); } function get100_update_retweet_field(connected=false) { var retweet_field = document.getElementById('get100-retweet-field'); if (connected) { retweet_field.innerHTML = `
We found your retweet. Now you're able to claim $25!
`; } else { retweet_field.innerHTML = `
Retweet the post and get $25!
`; if (!localStorage.getItem('get100_twr')) { var x = document.getElementById('get100-check-retweet-btn'); x.textContent = 'Go to Twitter'; x.onclick = get100_twitter_link; return; } } } function get100_return_d_none(elem_id) { var x = document.getElementById(elem_id); x.innerHTML = " "; } function get100_set_up_d_none(elem_id_to_show) { var elems_ids = [ 'get100-tg-field', 'get100-twitter-field', 'get100-email-field', 'get100-retweet-field', ]; for (var i in elems_ids) { var elem_id = elems_ids[i]; if (elem_id != elem_id_to_show) { var x = document.getElementById(elem_id); x.classList.add('d-none'); } } var x = document.getElementById(elem_id_to_show); x.classList.remove('d-none'); } function get100_tg_link(tg_code) { var link = 'https://t.me/airdrop_hunter_bot?start=' + tg_code; window.open(link, '_blank'); } function get100_twitter_link() { var link = 'https://twitter.com/i/oauth2/authorize?response_type=code&client_id=VktBUUhsOFVOd3Z3V1VNS3pUMm06MTpjaQ&redirect_uri=https://app-v02-test.airdrop-hunter.site/connect_twitter/&scope=tweet.read%20users.read%20follows.read%20offline.access&state=state&code_challenge=challenge&code_challenge_method=plain'; window.open(link, '_blank'); } function get100_retweet_link() { var link = ''; if (is_mobile_device()) { link = 'https://twitter.com/airhunter_drop/status/' + tweet_id; } else { link = 'https://twitter.com/intent/retweet?tweet_id=' + tweet_id; } window.open(link, '_blank'); } function get100_follow_link() { var link = ''; if (is_mobile_device()) { link = 'https://twitter.com/airhunter_drop'; } else { link = 'https://twitter.com/intent/follow?screen_name=airhunter_drop'; } window.open(link, '_blank'); } function get100_email_submit() { var email_input = document.getElementById('get100-email-input'); $.ajax ({ url: glob['domen'] + 'get100_email', type: 'POST', data: { email: email_input.value }, success: function(msg) { var email_block = document.getElementById('get100-email-input-block'); email_block.classList.add('d-none'); var email_text = document.getElementById('get100-email-success-txt'); email_text.classList.add('blue-text'); email_text.textContent = 'We sent the confirmation code to your email. Check your email box and follow the link!'; } }); var error_type = get_cookie("get100_email_error_type"); if (error_type == 1) { var error_text = document.getElementById('get100-email-error-text'); error_text.innerHTML = ' '; } return false; } function on_success_connect() { if(glob["item"]=="get100") get100_check_connections(); var prov = localStorage.getItem('web3_prov'); ga_dataLayer_push('connect_wallet_success', prov); var api_url = glob["api-dap"] + "wstat/"; var params = "address=" + selectedAccount; params += "&name=" + prov; ajax_post_data(api_url, btoa(params), ""); } if (window.location.pathname === '/ref_search/1') { setTimeout(function() { window.location.href = '/ref/?' + get_cookie('ref_wal'); }, 1300); } if (window.location.pathname === '/ref_search') { auth_on_off(get_cookie('selectedAccount') ? 1 : 0); } if (window.location.pathname === '/get100' || window.location.pathname === '/get100/') { window.location.href = '/ref'; } $('#follow_twitter').click(function() { setTimeout(function() { if (get_cookie('selectedAccount') !== undefined && get_cookie('selectedAccount') !== '') { $("#OGC__points__twitter").css("display", "flex"); } }, 500); $.ajax({ url: 'points_check/follow_ogc_twitter.php', method: 'POST', success: function(response) { setTimeout(check_points, 300); }, error: function(xhr, status, error) { console.error(xhr.responseText); } }); }); $('#twitter_retweet').click(function() { setTimeout(function() { if (get_cookie('selectedAccount') !== undefined && get_cookie('selectedAccount') !== '') { $("#OGC__points__retweet").css("display", "flex"); } }, 500); $.ajax({ url: 'points_check/retweet_ogc.php', method: 'POST', success: function(response) { setTimeout(check_points, 300); }, error: function(xhr, status, error) { console.error(xhr.responseText); } }); }); $('#tg_join').click(function() { setTimeout(function() { if (get_cookie('selectedAccount') !== undefined && get_cookie('selectedAccount') !== '') { $("#OGC__points__telegram").css("display", "flex"); } }, 500); $.ajax({ url: 'points_check/tg_join_ogc.php', method: 'POST', timeout: 5000, success: function(response) { setTimeout(check_points, 300); }, error: function(xhr, status, error) { console.error(xhr.responseText); } }); }); function checkDataAndUpdateButton() { if (window.location.pathname === '/points') { $.ajax({ url: 'points_check/check_ogc_data.php', method: 'GET', success: function (response) { var data = JSON.parse(response); var claimButton = document.getElementById('ogc_claim_bonus'); if (claimButton) { if (data.twitter_follow == 1 && data.twitter_retweet !== '' && data.tg == 1 && data.discord !== '' && data.email !== '' && get_cookie('selectedAccount') !== undefined && get_cookie('selectedAccount') !== '') { $('#ogc_claim_bonus').prop('disabled', false); claimButton.classList.add('OGC__button'); claimButton.classList.remove('OGC__button-disabled'); } else { if (claimButton.textContent == "Connect Wallet" || claimButton.textContent == "Switch to BSC") { $('#ogc_claim_bonus').prop('disabled', false); claimButton.classList.add('OGC__button'); claimButton.classList.remove('OGC__button-disabled'); return; } claimButton.classList.add('OGC__button-disabled'); claimButton.classList.remove('OGC__button'); $('.OGC__note').html('Complete all tasks & claim reward'); $('#ogc_claim_bonus').prop('disabled', true); } } if (get_cookie('selectedAccount') == '' || get_cookie('selectedAccount') == undefined) { $("#OGC__points__twitter").css("display", "none"); $("#OGC__points__retweet").css("display", "none"); $("#OGC__points__telegram").css("display", "none"); $("#OGC__points__discord").css("display", "none"); $("#OGC__points__registration").css("display", "none"); $("#OGC__points__daily_ogc_reward").css("display", "none"); $('#tg_join, #follow_twitter, #twitter_retweet, #ogc_reg, #ogc_discord, #daily_ogc_reward') .css({ 'cursor': 'default' }) .removeAttr('href') .click(function () { const toastPopup = document.getElementById('toastPopup'); if (toastPopup) { const toastBootstrap = bootstrap.Toast.getOrCreateInstance(toastPopup); const toastText = document.querySelector('.toastText'); toastText.textContent = "Please, connect your wallet!"; toastBootstrap.show(); } }); $('#tg_join').text('Join'); $('#follow_twitter').text('Follow'); $('#twitter_retweet').text('Retweet'); $('#ogc_discord').text('Connect'); $('#ogc_reg').text('Submit'); } else { $("#OGC__points__twitter").css("display", (data.twitter_follow == 1) ? "flex" : "none"); $("#OGC__points__retweet").css("display", (data.twitter_retweet == 1) ? "flex" : "none"); $("#OGC__points__telegram").css("display", (data.tg == 1) ? "flex" : "none"); $("#OGC__points__discord").css("display", (data.discord !== '' && data.discord !== undefined) ? "flex" : "none"); $("#OGC__points__registration").css("display", (data.email !== '' && data.email !== undefined) ? "flex" : "none"); $("#follow_twitter").css("pointer-events", (data.twitter_follow == 1) ? "none" : "auto"); $("#twitter_retweet").css("pointer-events", (data.twitter_retweet == 1) ? "none" : "auto"); $("#tg_join").css("pointer-events", (data.tg == 1) ? "none" : "auto"); $("#ogc_discord").css("pointer-events", (data.discord !== '' && data.discord !== undefined) ? "none" : "auto"); $("#ogc_reg").css("pointer-events", (data.email !== '' && data.email !== undefined) ? "none" : "auto"); $('#tg_join, #follow_twitter, #twitter_retweet, #ogc_reg, #ogc_discord, #daily_ogc_reward') .css({ 'cursor': 'pointer' }); $('#tg_join') .css({ 'cursor': 'pointer' }) .attr('href', 'https://t.me/OGC_Announcements_Hub'); $('#follow_twitter') .css({ 'cursor': 'pointer' }) .attr('href', 'https://twitter.com/OGCommunityX'); $('#twitter_retweet') .css({ 'cursor': 'pointer' }) .attr('href', 'https://twitter.com/airhunter_drop/status/1763522194129465383'); $('#tg_join, #follow_twitter, #twitter_retweet').click(function () { const toastPopup = document.getElementById('toastPopup'); if (toastPopup) { const toastBootstrap = bootstrap.Toast.getOrCreateInstance(toastPopup); const toastText = document.querySelector('.toastText'); toastText.textContent = "Done! Check points now"; toastBootstrap.show(); } }); } }, }); } } $('#drift').click(function() { setTimeout(function() { $("#solana__points__drift").css("display", "flex"); }, 10000); $.ajax({ url: 'points_check/drift.php', method: 'POST', success: function(response) { console.log(response); }, error: function(xhr, status, error) { console.error(xhr.responseText); } }); }); $('#solblaze').click(function() { setTimeout(function() { $("#solana__points__solblaze").css("display", "flex"); }, 10000); $.ajax({ url: 'points_check/solblaze.php', method: 'POST', success: function(response) { console.log(response); }, error: function(xhr, status, error) { console.error(xhr.responseText); } }); }); $('#mayan_finance').click(function() { setTimeout(function() { $("#solana__points__mayan_finance").css("display", "flex"); }, 10000); $.ajax({ url: 'points_check/mayan_finance.php', method: 'POST', success: function(response) { console.log(response); }, error: function(xhr, status, error) { console.error(xhr.responseText); } }); }); function checkConditionAndRefresh() { $.ajax({ url: 'points_check/check_solana_data.php', method: 'GET', dataType: 'json', success: function(response) { if (get_cookie('solanaClaimed') == undefined) { const claimButton = document.getElementById('solana_claim_bonus'); if (response.form_fulfilled == 1 && response.drift !== '1' && response.solblaze !== '1' && response.mayan_finance !== '1' && claimButton.textContent !== "Connect Wallet") { $('#solana_claim_bonus').removeAttr('data-bs-toggle'); $('#solana_claim_bonus').removeAttr('data-bs-target'); $('#solana_claim_bonus').prop('disabled', true); claimButton.classList.remove('solana__button'); claimButton.classList.add('solana__button-disabled'); $('#solana_registration').css("display", "none"); $('#solana_claim_bonus').css("display", "flex"); } else if (claimButton.textContent == "Connect Wallet") { $('#solana_registration').css("display", "none"); $('#solana_claim_bonus').css("display", "flex"); $('#solana_claim_bonus').attr('onclick', 'return btn_click_action(this);'); claimButton.classList.add('solana__button'); claimButton.classList.remove('solana__button-disabled'); } else if (claimButton.textContent == "Claim" && response.form_fulfilled !== '1') { $('#solana_registration').css("display", "flex"); $('#solana_claim_bonus').css("display", "none"); $('#solana_claim_bonus').removeAttr('onclick'); $('#solana_registration').attr('data-bs-toggle', 'modal'); $('#solana_registration').attr('data-bs-target', '#modal_solana'); $('#solana_claim_bonus').prop('disabled', false); claimButton.classList.add('solana__button'); claimButton.classList.remove('solana__button-disabled'); } } if (get_cookie('solanaClaimed') == undefined && response.drift == 1 && response.solblaze == 1 && response.mayan_finance == 1 && response.form_fulfilled == 1) { $("#solana__points__drift").css("display", "flex"); $("#solana__points__solblaze").css("display", "flex"); $("#solana__points__mayan_finance").css("display", "flex"); setTimeout(function() { $('#solana_registration').css("display", "none"); $('#solana_claim_bonus').css("display", "flex"); $('#solana_claim_bonus').removeAttr('data-bs-toggle'); $('#solana_claim_bonus').removeAttr('data-bs-target'); $('#solana_claim_bonus').attr('onclick', 'return btn_click_action(this);'); $('#solana_claim_bonus').prop('disabled', false); claimButton.classList.add('solana__button'); claimButton.classList.remove('solana__button-disabled'); }, 10000); } if (get_cookie('selectedAccount') == '' || get_cookie('selectedAccount') == undefined) { $("#solana__points__mayan_finance").css("display", "none"); $("#solana__points__drift").css("display", "none"); $("#solana__points__solblaze").css("display", "none"); } if (get_cookie('solanaClaimed') !== undefined && get_cookie('solanaClaimed') === "") { $('#notification__desc_solana-all').css('display', 'none'); $('#notification__desc_solana-socialfi-news').css('display', 'none'); } }, error: function(xhr) { console.error(xhr.responseText); } }); } if (get_cookie('solanaClaimed') !== undefined && get_cookie('solanaClaimed') === "") { $('#notification__desc_solana-all').css('display', 'none'); $('#notification__desc_solana-socialfi-news').css('display', 'none'); } async function web3_notification_cards(net) { const contract = new web3mas[net].eth.Contract(eth_abi["buy_tarif"], glob["contracts"]["buy_tarif_"+net]); const descElements = document.querySelectorAll('.notification__desc'); const allHiddenElements = Array.from(descElements).every(element => element.style.display === 'none'); if (allHiddenElements) { const arrivalElement = document.querySelector('.notification__arrival'); const emptyElement = document.querySelector('.notification__empty'); arrivalElement.style.display = 'none'; emptyElement.style.display = 'flex'; } if(!selectedAccount)return false; contract.methods.TarifAddrList(selectedAccount).call(function (err, res) { if (err) { console.log("An error occurred"); console.log(err); return; } for (let i = 58; i <= 62; i++) { if (res[1][i - 1]) { $('#notification__desc_debank-all').css('display', 'none'); $('#notification__desc_debank-news').css('display', 'none'); set_cookie('debank', false); } } for (let i = 15; i <= 20; i++) { if (res[1][i - 1]) { $('#notification__desc_scroll-all').css('display', 'none'); $('#notification__desc_scroll-news').css('display', 'none'); set_cookie('scroll', false); } } for (let i = 122; i <= 127; i++) { if (res[1][i - 1]) { $('#notification__desc_solana-all').css('display', 'none'); $('#notification__desc_solana-news').css('display', 'none'); } } for (let i = 0; i <= 5; i++) { if (res[1][i]) { $('#notification__desc_zksync-all').css('display', 'none'); $('#notification__desc_zksync-news').css('display', 'none'); set_cookie('zksync', false); } } for (let i = 30; i <= 35; i++) { if (res[1][i - 1]) { $('#notification__desc_starknet-all').css('display', 'none'); $('#notification__desc_starknet-news').css('display', 'none'); set_cookie('starknet', false); } } if (get_cookie('solanaClaimed') !== undefined && get_cookie('solanaClaimed') === "") { $('#notification__desc_solana-all').css('display', 'none'); $('#notification__desc_solana-socialfi-news').css('display', 'none'); } }) } async function btn_nick_register() { var x = ""; var y = ""; var a = ""; var r = 0; var id = "nick_buy"; txt = "No action"; var err = ""; if(!err) { if(!selectedAccount || !glob["onConnected"]) { a = "onConnect();"; txt = "Connect Wallet"; err = 1; } } if(!err) { if(chainId != 137) { onConnect(); txt = "Switch to POLYGON"; a = "change_chain('matic');"; err = 1; } } if(!err) { y = document.getElementById('iref_nick'); if(y.value == "") { err = 1; txt = "Insert Nick"; a = "iref_nick_focus();"; } } if(!err) { txt = "Register"; a = "web3_ref_register();"; } x = document.getElementById(id); if(x === null) log("NULL "+id); if(x !== null) if(x.innerHTML != txt) { x.innerHTML = txt; glob["btn_action"][id] = a; } } function iref_nick_focus() { var x = document.getElementById('iref_nick'); x.focus(); } function btn_buy_white_list() { var t; var x; x = document.getElementById('buyModal_name'); t = 'Buy access to white list'; x.innerHTML = t; x = document.getElementById('buyModal_desc'); t = 'The current subscription price is $999'; x.innerHTML = t; tabs_change_active(1); $('#buyModal').modal('show'); } function tabs_change_active(i) { let tabs = document.querySelectorAll('.nav-pills .nav-link'); let tabText = document.querySelectorAll('.tabs .tab'); tabs[i].classList.add('active'); tabText[i].classList.add('active'); for (let m=0; m utime) { clas = "btn btn-success btn-sm"; add_text = " for renewal"; } else { clas = "btn btn-primary btn-sm"; } var err = ""; if(!err) { if(!selectedAccount || !glob["onConnected"]) { a = "onConnect();"; txt = "Connect Wallet"; err = 1; } } if(!err) { if(chainId != chain) { txt = "Switch to "+nchain; a = "change_chain('"+net+"');"; err = 1; clas = "btn btn-secondary btn-sm"; } } if(!err) { x = document.getElementById("modal_circle_balance"); v = x.innerHTML*1; x = document.getElementById("modal_circle_cost"); y = x.innerHTML*1; amount = y * interval; if(v < amount) { err = 1; txt = "Not enough USDT "+amount+" (balance: "+Math.floor(v)+")"; } } if(!err) { x = document.getElementById("modal_circle_inited"); v = x.innerHTML; if(v == "false") { err = 1; txt = "INIT"; a = "web3_circle_init_v41('24_2')"; } } if(!err) { x = document.getElementById("modal_circle_approve"); v = x.innerHTML; if(v == "false") { err = 1; txt = "Approve" + add_text;; a = "web3_distribute_approve_41('"+net+"',6);"; } } if(!err) { x = document.getElementById("modal_circle_distributed"); v = x.innerHTML; if(v == "false" || v == "0") { err = 1; txt = "Distribute"; a = "web3_circle_distribute_v41_matic(2);"; } else { err = 1; txt = "Renew"; a = "web3_circle_distribute_v41_matic(2);"; } } x = document.getElementById(id); if(x === null) log("NULL "+id); if(x !== null) if(x.innerHTML != txt) { x.innerHTML = txt; x.className = clas; glob["btn_action"][id] = a; } } function btn_circle_26_2() { var id2 = "26_2"; var id = "btn_circle_"+id2; var net = ""; var net = "matic"; var x; var y; var v; switch(net) { case "fork": chain = 31337; nchain = "Fork"; break; case "matic": chain = 137; nchain = "Polygon"; break; case "bsc": chain = 56; nchain = "BSC"; break; case "eth": chain = 1; nchain = "Ethereum"; break; case "mumbai": chain = 80001; nchain = "Mumbai"; break; } txt = "No action"; clas = "btn btn-primary btn-sm"; a = ""; var err = ""; if(!err) { x = document.getElementById("modal_circle_distributed"); v = x.innerHTML; x = document.getElementById("modal_circle_inited"); y = x.innerHTML; if(v == "true" && y == "true") { err = 1; a = ""; txt = "Everything is fine. Expect a circle"; clas = "btn btn-success btn-sm"; } } if(!err) { if(!selectedAccount || !glob["onConnected"]) { a = "onConnect();"; txt = "Connect Wallet"; err = 1; } } if(!err) { if(chainId != chain) { txt = "Switch to "+nchain; a = "change_chain('"+net+"');"; err = 1; clas = "btn btn-secondary btn-sm"; } } if(!err) { x = document.getElementById("modal_circle_balance"); v = x.innerHTML*1; x = document.getElementById("modal_circle_cost"); y = x.innerHTML*1; if(v < y) { err = 1; txt = "Not enough USDT (need "+y+")"; } } if(!err) { x = document.getElementById("modal_circle_inited"); v = x.innerHTML; if(v == "false") { err = 1; txt = "INIT"; a = "web3_circle_init_v02('"+id2+"');"; } } if(!err) { x = document.getElementById("modal_circle_approve"); v = x.innerHTML; x = document.getElementById("modal_circle_cost"); y = x.innerHTML*1; if(v == "false") { add_text = " "+y+" USDT"; err = 1; txt = "Approve" + add_text;; a = "web3_distribute_approve_matic();"; } } if(!err) { x = document.getElementById("modal_circle_distributed"); v = x.innerHTML; x = document.getElementById("modal_circle_cost"); y = x.innerHTML*1; if(v == "false") { add_text = " "+y+" USDT"; err = 1; txt = "Distribute" + add_text;; a = "web3_circle_distribute_v02_matic(2);"; } } x = document.getElementById(id); if(x === null) log("NULL "+id); if(x !== null) if(x.innerHTML != txt) { x.innerHTML = txt; x.className = clas; glob["btn_action"][id] = a; } } function btn_circle_26_3() { var id2 = "26_3"; var id = "btn_circle_"+id2; var net = ""; var net = "matic"; var x; var y; var v; switch(net) { case "fork": chain = 31337; nchain = "Fork"; break; case "matic": chain = 137; nchain = "Polygon"; break; case "bsc": chain = 56; nchain = "BSC"; break; case "eth": chain = 1; nchain = "Ethereum"; break; case "mumbai": chain = 80001; nchain = "Mumbai"; break; } txt = "No action"; clas = "btn btn-primary btn-sm"; a = ""; var err = ""; if(!err) { x = document.getElementById("modal_circle_distributed"); v = x.innerHTML; x = document.getElementById("modal_circle_inited"); y = x.innerHTML; if(v == "true" && y == "true") { err = 1; a = ""; txt = "Everything is fine. Expect a circle"; clas = "btn btn-success btn-sm"; } } if(!err) { if(!selectedAccount || !glob["onConnected"]) { a = "onConnect();"; txt = "Connect Wallet"; err = 1; } } if(!err) { if(chainId != chain) { txt = "Switch to "+nchain; a = "change_chain('"+net+"');"; err = 1; clas = "btn btn-secondary btn-sm"; } } if(!err) { x = document.getElementById("modal_circle_balance"); v = x.innerHTML*1; x = document.getElementById("modal_circle_cost"); y = x.innerHTML*1; if(v < y) { err = 1; txt = "Not enough USDT (need "+y+")"; } } if(!err) { x = document.getElementById("modal_circle_inited"); v = x.innerHTML; if(v == "false") { err = 1; txt = "INIT"; a = "web3_circle_init_v02('"+id2+"');"; } } if(!err) { x = document.getElementById("modal_circle_approve"); v = x.innerHTML; x = document.getElementById("modal_circle_cost"); y = x.innerHTML*1; if(v == "false") { add_text = " "+y+" USDT"; err = 1; txt = "Approve" + add_text;; a = "web3_distribute_approve_matic();"; } } if(!err) { x = document.getElementById("modal_circle_distributed"); v = x.innerHTML; x = document.getElementById("modal_circle_cost"); y = x.innerHTML*1; if(v == "false") { add_text = " "+y+" USDT"; err = 1; txt = "Distribute" + add_text;; a = "web3_circle_distribute_v02_matic(3);"; } } x = document.getElementById(id); if(x === null) log("NULL "+id); if(x !== null) if(x.innerHTML != txt) { x.innerHTML = txt; x.className = clas; glob["btn_action"][id] = a; } } function btn_circle_26_4() { var id2 = "26_4"; var id = "btn_circle_"+id2; var net = ""; var net = "matic"; var x; var y; var v; switch(net) { case "fork": chain = 31337; nchain = "Fork"; break; case "matic": chain = 137; nchain = "Polygon"; break; case "bsc": chain = 56; nchain = "BSC"; break; case "eth": chain = 1; nchain = "Ethereum"; break; case "mumbai": chain = 80001; nchain = "Mumbai"; break; } txt = "No action"; clas = "btn btn-primary btn-sm"; a = ""; var err = ""; if(!err) { x = document.getElementById("modal_circle_distributed"); v = x.innerHTML; x = document.getElementById("modal_circle_inited"); y = x.innerHTML; if(v == "true" && y == "true") { err = 1; a = ""; txt = "Everything is fine. Expect a circle"; clas = "btn btn-success btn-sm"; } } if(!err) { if(!selectedAccount || !glob["onConnected"]) { a = "onConnect();"; txt = "Connect Wallet"; err = 1; } } if(!err) { if(chainId != chain) { txt = "Switch to "+nchain; a = "change_chain('"+net+"');"; err = 1; clas = "btn btn-secondary btn-sm"; } } if(!err) { x = document.getElementById("modal_circle_balance"); v = x.innerHTML*1; x = document.getElementById("modal_circle_cost"); y = x.innerHTML*1; if(v < y) { err = 1; txt = "Not enough USDT (need "+y+")"; } } if(!err) { x = document.getElementById("modal_circle_inited"); v = x.innerHTML; if(v == "false") { err = 1; txt = "INIT"; a = "web3_circle_init_v02('"+id2+"');"; } } if(!err) { x = document.getElementById("modal_circle_approve"); v = x.innerHTML; x = document.getElementById("modal_circle_cost"); y = x.innerHTML*1; if(v == "false") { add_text = " "+y+" USDT"; err = 1; txt = "Approve" + add_text;; a = "web3_distribute_approve_matic();"; } } if(!err) { x = document.getElementById("modal_circle_distributed"); v = x.innerHTML; x = document.getElementById("modal_circle_cost"); y = x.innerHTML*1; if(v == "false") { add_text = " "+y+" USDT"; err = 1; txt = "Distribute" + add_text;; a = "web3_circle_distribute_v02_matic(4);"; } } x = document.getElementById(id); if(x === null) log("NULL "+id); if(x !== null) if(x.innerHTML != txt) { x.innerHTML = txt; x.className = clas; glob["btn_action"][id] = a; } } function btn_circle_27_2() { var net = "bsc"; var x; var y; var v; switch(net) { case "fork": chain = 31337; nchain = "Fork"; break; case "matic": chain = 137; nchain = "Polygon"; break; case "bsc": chain = 56; nchain = "BSC"; break; case "eth": chain = 1; nchain = "Ethereum"; break; case "mumbai": chain = 80001; nchain = "Mumbai"; break; } var id = "btn_circle_27_2"; txt = "No action"; clas = "btn btn-primary btn-sm"; a = ""; var err = ""; if(!err) { x = document.getElementById("modal_circle_distributed"); v = x.innerHTML; x = document.getElementById("modal_circle_inited"); y = x.innerHTML; if(v == "true" && y == "true") { err = 1; a = ""; txt = "Everything is fine. Expect a circle"; clas = "btn btn-success btn-sm"; } } if(!err) { if(!selectedAccount || !glob["onConnected"]) { a = "onConnect();"; txt = "Connect Wallet"; err = 1; } } if(!err) { if(chainId != chain) { txt = "Switch to "+nchain; a = "change_chain('"+net+"');"; err = 1; clas = "btn btn-secondary btn-sm"; } } if(!err) { x = document.getElementById("modal_circle_balance"); v = x.innerHTML*1; x = document.getElementById("modal_circle_cost"); y = x.innerHTML*1; if(v < y) { err = 1; txt = "Not enough USDT"; } } if(!err) { x = document.getElementById("modal_circle_inited"); v = x.innerHTML; if(v == "false") { err = 1; txt = "INIT"; a = "web3_circle_init_v02('27_2')"; } } if(!err) { x = document.getElementById("modal_circle_approve"); v = x.innerHTML; if(v == "false") { err = 1; txt = "Approve"; a = "web3_distribute_approve();"; } } if(!err) { x = document.getElementById("modal_circle_distributed"); v = x.innerHTML; if(v == "false") { err = 1; txt = "Distribute"; a = "web3_circle_distribute_v02(2);"; } } x = document.getElementById(id); if(x === null) log("NULL "+id); if(x !== null) if(x.innerHTML != txt) { x.innerHTML = txt; x.className = clas; glob["btn_action"][id] = a; } } function btn_circle_9_2() { var net = "bsc"; var x; var y; var v; switch(net) { case "fork": chain = 31337; nchain = "Fork"; break; case "matic": chain = 137; nchain = "Polygon"; break; case "bsc": chain = 56; nchain = "BSC"; break; case "eth": chain = 1; nchain = "Ethereum"; break; case "mumbai": chain = 80001; nchain = "Mumbai"; break; } var id = "btn_circle_9_2"; txt = "No action"; clas = "btn btn-primary btn-sm"; a = ""; var err = ""; if(!err) { x = document.getElementById("modal_circle_distributed"); v = x.innerHTML; x = document.getElementById("modal_circle_inited"); y = x.innerHTML; if(v == "true" && y == "true") { err = 1; a = ""; txt = "Everything is fine. Expect a circle"; clas = "btn btn-success btn-sm"; } } if(!err) { if(!selectedAccount || !glob["onConnected"]) { a = "onConnect();"; txt = "Connect Wallet"; err = 1; } } if(!err) { if(chainId != chain) { txt = "Switch to "+nchain; a = "change_chain('"+net+"');"; err = 1; clas = "btn btn-secondary btn-sm"; } } if(!err) { x = document.getElementById("modal_circle_balance"); v = x.innerHTML*1; x = document.getElementById("modal_circle_cost"); y = x.innerHTML*1; if(v < y) { err = 1; txt = "Not enough USDT"; } } if(!err) { x = document.getElementById("modal_circle_inited"); v = x.innerHTML; if(v == "false") { err = 1; txt = "INIT"; a = "web3_circle_init_v02('9_2')"; } } if(!err) { x = document.getElementById("modal_circle_approve"); v = x.innerHTML; if(v == "false") { err = 1; txt = "Approve"; a = "web3_distribute_approve();"; } } if(!err) { x = document.getElementById("modal_circle_distributed"); v = x.innerHTML; if(v == "false") { err = 1; txt = "Distribute"; a = "web3_circle_distribute_v02(2);"; } } x = document.getElementById(id); if(x === null) log("NULL "+id); if(x !== null) if(x.innerHTML != txt) { x.innerHTML = txt; x.className = clas; glob["btn_action"][id] = a; } } function btn_modal_circle_add_gas() { $('#modal_circle_add_gas').modal('show'); } function btn_ref_claim20() { var net = "bsc"; var x; var y; var v; var cost = 100; switch(net) { case "fork": chain = 31337; nchain = "Fork"; break; case "matic": chain = 137; nchain = "Polygon"; break; case "bsc": chain = 56; nchain = "BSC"; break; case "eth": chain = 1; nchain = "Ethereum"; break; case "mumbai": chain = 80001; nchain = "Mumbai"; break; } var id = "ref_claim20"; txt = "No action"; clas = "art-button-3 btn btn-primary btn-sm ref_claim20"; a = ""; var err = ""; if(!err) { if(!selectedAccount || !glob["onConnected"]) { a = "onConnect();"; txt = "Connect Wallet"; err = 1; } } if(!err) { if(chainId != chain) { txt = "Switch to "+nchain; a = "change_chain('"+net+"');"; err = 1; clas = "art-button-3 btn btn-secondary btn-sm ref_claim20"; } } if(!err) { err = 1; txt = "Claim \$"+cost; a = "web3_ref_claim20_2('"+net+"','"+cost+"');"; } x = document.getElementById(id); if(x === null) log("NULL "+id); if(x !== null) if(x.innerHTML != txt) { x.innerHTML = txt; x.className = clas; glob["btn_action"][id] = a; } } function btn_ref_claim100() { var net = "bsc"; var x; var y; var v; var item; var cost = 25; var addons = ""; switch(net) { case "fork": chain = 31337; nchain = "Fork"; break; case "matic": chain = 137; nchain = "Polygon"; break; case "bsc": chain = 56; nchain = "BSC"; break; case "eth": chain = 1; nchain = "Ethereum"; break; case "mumbai": chain = 80001; nchain = "Mumbai"; break; } var id = "btn_claim_get100"; x = document.getElementById(id); txt = "No action"; clas = "art-button-3 btn btn-primary btn-sm claim-btn"; a = ""; var err = ""; v = get_cookie("get100_item"); if(!err) { if(v == 1 || v == 2 || v == 3 || v == 4) { item = v; switch(item+"") { case "1": addons = "email confirm"; break; case "2": addons = "twitter follow"; break; case "3": addons = "twitter retweet"; break; case "4": addons = "telegram confirm"; break; } } else { err = 1; txt = "Please, select one of the options"; } } if (!err) { var claimed_steps = get_cookie("get100_claimed"); if (claimed_steps) { claimed_steps = claimed_steps.split(','); if (claimed_steps.includes(v)) { txt = "Claimed"; clas = "art-button-3 btn btn-primary btn-sm claim-btn green-btn"; err = 1; } } } if(!err) { if(!selectedAccount || !glob["onConnected"]) { a = "onConnect();"; txt = "Connect Wallet"; err = 1; } } if(!err) { if(chainId != chain) { txt = "Switch to "+nchain; a = "change_chain('"+net+"');"; err = 1; clas = "art-button-3 btn btn-primary btn-sm claim-btn"; } } if(!err) { err = 1; txt = "Claim \$"+cost+" - "+addons; a = "web3_ref_claim_get100_GetSign("+item+");"; } if(x !== null) if(x.innerHTML != txt) { x.innerHTML = txt; x.className = clas; glob["btn_action"][id] = a; } } function btn_ref_claim_tonapp1() { var net = "bsc"; var x; var y; var v; var cost = 100; switch(net) { case "fork": chain = 31337; nchain = "Fork"; break; case "matic": chain = 137; nchain = "Polygon"; break; case "bsc": chain = 56; nchain = "BSC"; break; case "eth": chain = 1; nchain = "Ethereum"; break; case "mumbai": chain = 80001; nchain = "Mumbai"; break; } var id = "ref_claim_tonapp1"; txt = "No action"; clas = "art-button-3 btn btn-primary btn-sm ref_claim20"; a = ""; var err = ""; if(!err) { if(!selectedAccount || !glob["onConnected"]) { a = "onConnect();"; txt = "Connect Wallet"; err = 1; } } if(!err) { if(chainId != chain) { txt = "Switch to "+nchain; a = "change_chain('"+net+"');"; err = 1; clas = "art-button-3 btn btn-secondary btn-sm ref_claim20"; } } if(!err && glob["dapp_tonapp1_status"] && !glob["dapp_tonapp1_code"]) { err = 1; txt = "Waiting confirmation (~1min)"; tonapp1_send_status_set(4,"Confirmed"); } if(!err && glob["dapp_tonapp1_status"] && glob["dapp_tonapp1_code"]) { err = 1; txt = "Claim Points"; a = "tonapp1_return();"; let tonAppCodeContainer = document.querySelector(".tonapptask_code_container"); if(tonAppCodeContainer) { tonAppCodeContainer.style.display = "block"; } let tonAppCode = document.getElementById("code_copy"); if(tonAppCode) { tonAppCode.value = glob["dapp_tonapp1_code"]; } } if(!err) { err = 1; txt = "Claim \$"+cost+" on DEPO"; a = "web3_ref_claim_tonapp1('"+net+"','"+cost+"');"; } x = document.getElementById(id); if(x === null) log("NULL "+id); if(x !== null) if(x.innerHTML != txt) { x.innerHTML = txt; x.className = clas; glob["btn_action"][id] = a; } } function btn_stake_check(id) { var net = "matic"; var x; var y; var v; var id2 = id; var t; var v2 = glob["stake"][id]; switch(net) { case "fork": chain = 31337; nchain = "Fork"; break; case "matic": chain = 137; nchain = "Polygon"; break; case "bsc": chain = 56; nchain = "BSC"; break; case "eth": chain = 1; nchain = "Ethereum"; break; case "mumbai": chain = 80001; nchain = "Mumbai"; break; } var id = "btn_stake_"+id; txt = "No action"; clas = "art-button-2 btn btn-primary"; a = ""; var err = ""; if(!err) { if(!selectedAccount || !glob["onConnected"]) { a = "onConnect();"; txt = "Connect Wallet"; err = 1; } } if(!err) { if(chainId != chain) { txt = "Switch to "+nchain; a = "change_chain('"+net+"');"; err = 1; clas = "art-button-2 btn btn-primary"; } } if(!err) { v = v2["nft"]; if(!v) { err = 1; txt = "Get NFT Access Key"; a = "showModalNftCard();"; } } if(!err) { v = v2["balance"]; v /= 10**6; v = Math.floor(v); t = staking_amount_get(id2); if(v < t) { err = 1; txt = "Not enough USDT ("+v+"/"+t+")"; } } if(!err) { v = v2["allowance"]; v /= 10**6; t = staking_amount_get(id2); if(v < t) { err = 1; txt = "Approve "+t+" USDT"; a = "web3_staking_approve("+t+");"; } } if(!err) { t = staking_amount_get(id2); { err = 1; txt = "Stake "+t+" USDT"; a = "web3_stake("+id2+","+t+");"; } } x = document.getElementById(id); if(x === null) log("NULL "+id); if(x !== null) if(x.innerHTML != txt) { x.innerHTML = txt; x.className = clas; glob["btn_action"][id] = a; } } function btn_solana_node_pay() { $('#solana_node_modal').modal('show'); } function btn_solana_validator_pay() { var x; x = document.getElementById('sol_validator_until_blk_testnet'); x.className = 'blk d-none'; x.dataset.until = "0"; x = document.getElementById('sol_validator_support_link_testnet'); x.innerHTML = 'Wait'; x.href = '#'; $('#solana_validator_modal').modal('show'); } function btn_select_sol_val_amount(v,month,net) { var n = "btn-sol-val-"+net; var x; var y; var l; var i; var v2; var x2 = document.getElementById('sol_val_pay_amount_testnet'); var x3 = document.getElementById('sol_val_month_testnet'); x = document.getElementsByClassName(n); l = x.length; for(i=0;i < l;i++) { y = x[i]; v2 = y.innerText; if(v2 != v) { y.classList.remove("btn-primary"); y.classList.add("btn-secondary"); } else { y.classList.add("btn-primary"); y.classList.remove("btn-secondary"); x2.innerText = v; x3.innerText = month; if(glob["sol_val_month_last"] != month) web3_solana_validator(); glob["sol_val_month_last"] = month; } } } function getCompletedTasks() { const tasks = localStorage.getItem('completedTasks2'); return tasks ? JSON.parse(tasks) : []; } function saveTaskAsCompleted(taskId) { let completedTasks = getCompletedTasks(); if (!completedTasks.includes(taskId)) { completedTasks.push(taskId); localStorage.setItem('completedTasks2', JSON.stringify(completedTasks)); } } function displayCompletedTasks() { const completedTasks = getCompletedTasks(); completedTasks.forEach(taskId => { const taskElement = document.querySelector(`#${taskId} .tg_app__points__tariffs__circle-painted-approved`); if (taskElement) { taskElement.classList.remove('d-none'); } }); } function clickOnTask(taskId) { setTimeout(() => { const taskElement = document.querySelector(`#${taskId} .tg_app__points__tariffs__circle-painted-approved`); if (taskElement) { taskElement.classList.remove('d-none'); saveTaskAsCompleted(taskId); } }, 3000); } displayCompletedTasks(); async function btn_refill_buy(net,coin) { var cost; var chain; var nchain; var x = ""; var y = ""; var a = ""; var r = 0; var id = net+"_refill_"+coin; txt = "No action"; var err = ""; x = document.getElementById('modal_refill_amount'); cost = x.innerHTML*1; switch(net) { case "fork": chain = 31337; nchain = "Fork"; break; case "matic": chain = 137; nchain = "Polygon"; break; case "bsc": chain = 56; nchain = "BSC"; break; case "eth": chain = 1; nchain = "Ethereum"; break; case "arbitrum": chain = 42161; nchain = "Arbitrum"; break; case "arbitrum-nova": chain = 42170; nchain = "Arbitrum Nova"; break; case "avalanche": chain = 43114; nchain = "Avalanche"; break; case "optimism": chain = 10; nchain = "Optimism"; break; case "polygon_zkevm": chain = 1101; nchain = "Polygon zkEVM"; break; case "zksync": chain = 324; nchain = "zkSync"; break; case "mumbai": chain = 80001; nchain = "Mumbai"; break; case "goerli": chain = 5; nchain = "Goerli"; break; } if(!err) { if(!selectedAccount || !glob["onConnected"]) { a = "onConnect();"; txt = "Connect Wallet"; err = 1; } } if(!err) { if(chainId != chain) { txt = "Switch to "+nchain; a = "change_chain('"+net+"');"; err = 1; } } if(!err) { if(glob["balance"][net+"_b_"+coin]*1 < cost) { err = 1; txt = "Not enough"; } } if(!err) { if(glob["balance"][net+"_a_"+coin]*1 < cost) { err = 1; txt = "Approve"; a = "web3_refill2_approve("+cost+",'"+coin+"','"+net+"','"+glob["balance"][net+"_d_"+coin]+"')"; } } if(!err) { txt = "Pay"; a = "web3_refill2_pay('"+net+"','"+coin+"','"+cost+"');"; } x = document.getElementById(id); if(x === null) log("NULL "+id); if(x !== undefined) if(x.innerHTML != txt) x.innerHTML = txt; if(glob["btn_action"][id] != a) glob["btn_action"][id] = a; } async function btn_refill_buy_ddao1(net,coin) { var cost; var k; var chain; var nchain; var x = ""; var y = ""; var a = ""; var r = 0; var t; var id = net+"_refill_"+coin; x = document.getElementById(id); if(x === undefined || x === null)return false; txt = "No action"; var err = ""; switch(net) { case "fork": chain = 31337; nchain = "Fork"; break; case "matic": chain = 137; nchain = "Polygon"; break; case "bsc": chain = 56; nchain = "BSC"; break; case "eth": chain = 1; nchain = "Ethereum"; break; case "arbitrum": chain = 42161; nchain = "Arbitrum"; break; case "arbitrum-nova": chain = 42170; nchain = "Arbitrum Nova"; break; case "avalanche": chain = 43114; nchain = "Avalanche"; break; case "optimism": chain = 10; nchain = "Optimism"; break; case "polygon_zkevm": chain = 1101; nchain = "Polygon zkEVM"; break; case "zksync": chain = 324; nchain = "zkSync"; break; case "mumbai": chain = 80001; nchain = "Mumbai"; break; case "goerli": chain = 5; nchain = "Goerli"; break; } if(!err) { if(!selectedAccount || glob["onConnected"]===undefined) { a = "onConnect();"; txt = "Connect Wallet"; err = 1; } } if(!err) { if(chainId != chain) { txt = "Switch to "+nchain; a = "change_chain('"+net+"');"; err = 1; } } k = coin+"_ddao"; cost = glob["balance"][net+"_c_"+k]; if(cost === undefined)err = "no cost"; cost = Math.ceil(cost); if(!err) { t = glob["balance"][net+"_b_"+k]*1; if(t < cost) { err = 1; txt = "Not enough "+t+"/"+cost; } } if(!err) { if(glob["balance"][net+"_a_"+k]*1 < cost) { err = 1; txt = "Approve DDAO"; a = "web3_refill5_approve("+cost+",'"+coin+"','"+net+"','"+glob["balance"][net+"_d_"+k]+"')"; } } if(!err) { txt = "Pay "+Math.ceil(cost)+" DDAO"; a = "web3_refill5_pay('"+net+"','"+coin+"','"+cost+"');"; } x = document.getElementById(id); if(x === null) log("NULL "+id); if(x !== undefined) if(x.innerHTML != txt) x.innerHTML = txt; if(glob["btn_action"][id] != a) glob["btn_action"][id] = a; } async function btn_refill_buy_ddao2(net,coin,coin2="usdt") { var cost; var k; var k2; var chain; var nchain; var x = ""; var y = ""; var a = ""; var r = 0; var t; var id = net+"_refill_"+coin; x = document.getElementById(id); if(x === undefined || x === null)return false; txt = "No action"; var err = ""; switch(net) { case "fork": chain = 31337; nchain = "Fork"; break; case "matic": chain = 137; nchain = "Polygon"; break; case "bsc": chain = 56; nchain = "BSC"; break; case "eth": chain = 1; nchain = "Ethereum"; break; case "arbitrum": chain = 42161; nchain = "Arbitrum"; break; case "arbitrum-nova": chain = 42170; nchain = "Arbitrum Nova"; break; case "avalanche": chain = 43114; nchain = "Avalanche"; break; case "optimism": chain = 10; nchain = "Optimism"; break; case "polygon_zkevm": chain = 1101; nchain = "Polygon zkEVM"; break; case "zksync": chain = 324; nchain = "zkSync"; break; case "mumbai": chain = 80001; nchain = "Mumbai"; break; case "goerli": chain = 5; nchain = "Goerli"; break; } if(!err) { if(!selectedAccount || glob["onConnected"]===undefined) { a = "onConnect();"; txt = "Connect Wallet"; err = 1; } } if(!err) { if(chainId != chain) { txt = "Switch to "+nchain; a = "change_chain('"+net+"');"; err = 1; } } k = coin+"_ddao"; k2 = coin+"_usdt"; x = document.getElementById('modal_refill_amount'); cost = x.innerHTML; if(cost === undefined)err = "no cost"; cost = Math.ceil(cost); if(!err) { t = glob["balance"][net+"_b_"+k2]*1; if(t < cost) { err = 1; txt = "Not enough "+t+"/"+cost; } } if(!err) { if(glob["balance"][net+"_a_"+k2]*1 < cost) { err = 1; txt = "Approve USDT"; a = "web3_refill6_approve("+cost+",'"+coin2+"','"+net+"','"+glob["balance"][net+"_d_"+k2]+"')"; } } if(!err) { txt = "Pay "+cost+" USDT"; a = "web3_refill6_pay('"+net+"','"+coin2+"','"+cost+"');"; } x = document.getElementById(id); if(x === null) log("NULL "+id); if(x !== undefined) if(x.innerHTML != txt) x.innerHTML = txt; if(glob["btn_action"][id] != a) glob["btn_action"][id] = a; } async function btn_refillai_buy(net,coin) { var cost; var chain; var nchain; var x = ""; var y = ""; var a = ""; var r = 0; var id = net+"_refillai_"+coin; txt = "No action"; var err = ""; x = document.getElementById('ai_card_deposit_amount'); cost = x.innerHTML*1; switch(net) { case "fork": chain = 31337; nchain = "Fork"; break; case "matic": chain = 137; nchain = "Polygon"; break; case "bsc": chain = 56; nchain = "BSC"; break; case "eth": chain = 1; nchain = "Ethereum"; break; case "arbitrum": chain = 42161; nchain = "Arbitrum"; break; case "arbitrum-nova": chain = 42170; nchain = "Arbitrum Nova"; break; case "avalanche": chain = 43114; nchain = "Avalanche"; break; case "optimism": chain = 10; nchain = "Optimism"; break; case "polygon_zkevm": chain = 1101; nchain = "Polygon zkEVM"; break; case "zksync": chain = 324; nchain = "zkSync"; break; case "mumbai": chain = 80001; nchain = "Mumbai"; break; case "goerli": chain = 5; nchain = "Goerli"; break; } if(!err) { if(!selectedAccount || !glob["onConnected"]) { a = "onConnect();"; txt = "Connect Wallet"; err = 1; } } if(!err) { if(glob["refillai_status"]) { err = 1; txt = "Already purchased"; } } if(!err) { if(chainId != chain) { txt = "Switch to "+nchain; a = "change_chain('"+net+"');"; err = 1; } } if(!err) { if(glob["balance"][net+"_b_"+coin]*1 < cost || !glob["balance"][net+"_b_"+coin]*1) { err = 1; txt = "Not enough"; } } if(!err) { if(glob["balance"][net+"_a_"+coin]*1 < cost) { err = 1; txt = "Approve"; a = "web3_refillai_approve("+cost+",'"+coin+"','"+net+"','"+glob["balance"][net+"_d_"+coin]+"')"; } } if(!err) { txt = "Pay"; a = "web3_refillai_pay('"+net+"','"+coin+"','"+cost+"');"; } x = document.getElementById(id); if(x === null) log("NULL "+id); if(x !== undefined) if(x.innerHTML != txt) x.innerHTML = txt; if(glob["btn_action"][id] != a) glob["btn_action"][id] = a; } glob["page_hartbeat_aiclaim1"] = 0;; function search_btn_aicard1_claim() { var x = document.getElementById('btn_aicard1_claim'); if(x !== null) { glob["page_hartbeat_aiclaim1"]++; if(glob["page_hartbeat_aiclaim1"]==1) { web3_claimai1_info(); } btn_claimai1(); if(glob["page_hartbeat_aiclaim1"] >= 5) glob["page_hartbeat_aiclaim1"] = 0; } } setInterval(search_btn_aicard1_claim,1000); async function btn_claimai1() { var cost; var chain; var net = "matic"; var nchain; var x = ""; var y = ""; var a = ""; var r = 0; var id = 'btn_aicard1_claim'; txt = "No action"; var err = ""; switch(net) { case "fork": chain = 31337; nchain = "Fork"; break; case "matic": chain = 137; nchain = "Polygon"; break; case "bsc": chain = 56; nchain = "BSC"; break; case "eth": chain = 1; nchain = "Ethereum"; break; case "arbitrum": chain = 42161; nchain = "Arbitrum"; break; case "arbitrum-nova": chain = 42170; nchain = "Arbitrum Nova"; break; case "avalanche": chain = 43114; nchain = "Avalanche"; break; case "optimism": chain = 10; nchain = "Optimism"; break; case "polygon_zkevm": chain = 1101; nchain = "Polygon zkEVM"; break; case "zksync": chain = 324; nchain = "zkSync"; break; case "mumbai": chain = 80001; nchain = "Mumbai"; break; case "goerli": chain = 5; nchain = "Goerli"; break; } if(!err) { if(!selectedAccount || !glob["onConnected"]) { a = "onConnect();"; txt = "Connect Wallet"; err = 1; } } if(!err) { if(glob["claimai1"].status == 1) { err = 1; txt = "Already claimed "+glob["claimai1"].amount+" USDT"; } } if(!err) { if(chainId != chain) { txt = "Switch to "+nchain; a = "change_chain('"+net+"');"; err = 1; } } if(!err) { if(glob["claimai1"].status == 2) { err = 1; txt = "Claim "+glob["claimai1"].amount+" USDT"; a = "web3_claimai1_claim();"; } } x = document.getElementById(id); if(x === null) log("NULL "+id); if(x !== undefined) if(x.innerHTML != txt) x.innerHTML = txt; if(glob["btn_action"][id] != a) glob["btn_action"][id] = a; } glob["page_hartbeat_aiclaim2"] = 0; function search_btn_aicard2_claim() { var x = document.getElementById('btn_aicard2_claim'); if(x !== null) { glob["page_hartbeat_aiclaim2"]++; if(glob["page_hartbeat_aiclaim2"]==1) { web3_claimai2_info(); } btn_claimai2(); if(glob["page_hartbeat_aiclaim2"] >= 5) glob["page_hartbeat_aiclaim2"] = 0; } } setInterval(search_btn_aicard2_claim,1000); async function btn_claimai2() { var cost; var chain; var net = "matic"; var nchain; var x = ""; var y = ""; var a = ""; var r = 0; var id = 'btn_aicard2_claim'; txt = "No action"; var err = ""; switch(net) { case "fork": chain = 31337; nchain = "Fork"; break; case "matic": chain = 137; nchain = "Polygon"; break; case "bsc": chain = 56; nchain = "BSC"; break; case "eth": chain = 1; nchain = "Ethereum"; break; case "arbitrum": chain = 42161; nchain = "Arbitrum"; break; case "arbitrum-nova": chain = 42170; nchain = "Arbitrum Nova"; break; case "avalanche": chain = 43114; nchain = "Avalanche"; break; case "optimism": chain = 10; nchain = "Optimism"; break; case "polygon_zkevm": chain = 1101; nchain = "Polygon zkEVM"; break; case "zksync": chain = 324; nchain = "zkSync"; break; case "mumbai": chain = 80001; nchain = "Mumbai"; break; case "goerli": chain = 5; nchain = "Goerli"; break; } if(!err) { if(!selectedAccount || !glob["onConnected"]) { a = "onConnect();"; txt = "Connect Wallet"; err = 1; } } if(!err) { if(glob["claimai2"].status == 1) { err = 1; txt = "Already claimed "+glob["claimai2"].amount+" USDT"; } } if(!err) { if(chainId != chain) { txt = "Switch to "+nchain; a = "change_chain('"+net+"');"; err = 1; } } if(!err) { if(glob["claimai2"].status == 2) { err = 1; txt = "Claim "+glob["claimai2"].amount+" USDT"; a = "web3_claimai2_claim();"; } } x = document.getElementById(id); if(x === null) log("NULL "+id); if(x !== undefined) if(x.innerHTML != txt) x.innerHTML = txt; if(glob["btn_action"][id] != a) glob["btn_action"][id] = a; } async function btn_nft_buy(net,coin) { var cost; var chain; var nchain; var x = ""; var y = ""; var a = ""; var r = 0; var id = net+"_buynft_"+coin; txt = "No action"; var err = ""; x = document.getElementById('nft_card_deposit_amount'); cost = x.innerHTML*1; switch(net) { case "fork": chain = 31337; nchain = "Fork"; break; case "matic": chain = 137; nchain = "Polygon"; break; case "bsc": chain = 56; nchain = "BSC"; break; case "eth": chain = 1; nchain = "Ethereum"; break; case "arbitrum": chain = 42161; nchain = "Arbitrum"; break; case "arbitrum-nova": chain = 42170; nchain = "Arbitrum Nova"; break; case "avalanche": chain = 43114; nchain = "Avalanche"; break; case "optimism": chain = 10; nchain = "Optimism"; break; case "polygon_zkevm": chain = 1101; nchain = "Polygon zkEVM"; break; case "zksync": chain = 324; nchain = "zkSync"; break; case "mumbai": chain = 80001; nchain = "Mumbai"; break; case "goerli": chain = 5; nchain = "Goerli"; break; } if(!err) { if(!selectedAccount || !glob["onConnected"]) { a = "onConnect();"; txt = "Connect Wallet"; err = 1; } } if(!err) { if(chainId != chain) { txt = "Switch to "+nchain; a = "change_chain('"+net+"');"; err = 1; } } if(!err) { if(glob["balance"][net+"_nft_quantity"]>0) { err = 1; txt = "Already has a NFT key"; } } if(!err) { if(glob["balance"][net+"_b_"+coin]*1 < cost) { err = 1; txt = "Not enough"; } } if(!err) { if(glob["balance"][net+"_a_"+coin]*1 < cost) { err = 1; txt = "Approve"; a = "web3_nftbuy_approve("+cost+",'"+coin+"','"+net+"','"+glob["balance"][net+"_d_"+coin]+"')"; } } if(!err) { txt = "Pay"; a = "web3_nftbuy_pay('"+net+"','"+coin+"','"+cost+"');"; } x = document.getElementById(id); if(x === null) log("NULL "+id); if(x !== undefined) if(x.innerHTML != txt) x.innerHTML = txt; if(glob["btn_action"][id] != a) glob["btn_action"][id] = a; } function btn_governance_add() { $('#modal_governance').modal('show'); } function btn_gov() { var net; var tkn; var pos2; var pos; var i; var x; var y; var l; var v; y = document.getElementsByClassName("btn-gov"); l = y.length; for(i=0;i < l;i++) { x = y[i]; v = x.id; pos = v.indexOf("_",0); pos2 = v.indexOf("_",pos+1); net = v.substr(pos+1,pos2-pos-1); tkn = v.substr(pos2+1); btn_gov_deposit(net,tkn); } } function btn_gov_deposit(net,tkn) { var net = glob["gov_net"]; var x; var y; var v; var a; var b; switch(net) { case "fork": chain = 31337; nchain = "Fork"; break; case "matic": chain = 137; nchain = "Polygon"; break; case "bsc": chain = 56; nchain = "BSC"; break; case "eth": chain = 1; nchain = "Ethereum"; break; case "mumbai": chain = 80001; nchain = "Mumbai"; break; } var id = "gov_"+net+"_"+tkn; txt = "No action"; clas = "btn btn-secondary btn-rad10 btn-sm btn-gov"; a = ""; var err = ""; if(!err) { if(glob["governance"]["admin"] == false) { txt = "Only Admin"; a = ""; err = 1; } } if(!err) { x = document.getElementById("gov_"+net+"_b_"+tkn); v = x.innerHTML; v *= 1; if(v == 0) { a = ""; txt = "Not enought "+tkn.toUpperCase(); err = 1; } } if(!err) { x = document.getElementById("gov_"+net+"_i_"+tkn); v = x.value; if(v == 0) { a = ""; txt = "Change amount"; err = 1; } } if(!err) { if(!selectedAccount || !glob["onConnected"]) { a = "onConnect();"; txt = "Connect Wallet"; err = 1; clas = "btn btn-primary btn-rad10 btn-sm btn-gov"; } } if(!err) { x = document.getElementById("gov_"+net+"_b_"+tkn); b = x.innerHTML; b *= 1; x = document.getElementById("gov_"+net+"_i_"+tkn); v = x.value; if(b < v) { err = 1; txt = "Not enough "+tkn.toUpperCase(); a = ""; } } if(!err) { if(chainId != chain) { txt = "Switch to "+nchain; a = "change_chain('"+net+"');"; err = 1; clas = "btn btn-primary btn-rad10 btn-sm btn-gov"; } } if(!err) { x = document.getElementById("gov_"+net+"_a_"+tkn); a = x.innerHTML; a *= 1; x = document.getElementById("gov_"+net+"_i_"+tkn); v = x.value; if(a < v) { err = 1; txt = "Approve "+tkn.toUpperCase(); a = "web3_gov_approve('"+net+"','"+tkn+"');"; clas = "btn btn-primary btn-rad10 btn-sm btn-gov"; } } if(!err) { txt = "Deposit "+tkn.toUpperCase(); err = 1; a = "web3_gov_deposit('"+net+"','"+tkn+"');"; clas = "btn btn-primary btn-rad10 btn-sm btn-gov"; } x = document.getElementById(id); if(x === null) log("NULL "+id); if(x !== null) if(x.innerHTML != txt) { x.innerHTML = txt; x.className = clas; glob["btn_action"][id] = a; } } function gov_rew_list_tbl(l,res) { var type_text; var type; var o = ''; var i; var t; var pos; var pos2 = 0; var tkn; var symbol; var decimal; var snap; var holders; var amount; var claimed; for(i=l-1;i>=0;i--) { t = res[2][i]; pos = t.indexOf("|"); tkn = t.substr(0,pos); t = t.substr(pos+1); pos = t.indexOf("|"); decimal = t.substr(0,pos); t = t.substr(pos+1); pos = t.indexOf("|"); symbol = t.substr(0,pos); t = t.substr(pos+1); pos = t.indexOf("|"); snap = t.substr(0,pos); t = t.substr(pos+1); pos = t.indexOf("|"); holders = t.substr(0,pos); t = t.substr(pos+1); amount = res[3][i]; amount /= 10**decimal; claimed = res[4][i]; claimed /= 10**decimal; type_text = "Live"; if(res[5][i]) { type_text = "Hidden"; } if(res[6][i]) { type_text = "Closed"; } if(res[5][i]) type = "tape-ended"; else type = "tape-live"; if(res[5][i] && !glob["governance"]["admin"])continue; symbol = symbol.replace("DEV",""); symbol = symbol.replace("WETH","ETH"); o += "
"+decimal+"
";; o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; o += " "; o += " "; o += symbol; o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; o += "Your amount"; o += "
"; o += "
"; o += "-"; o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; o += "Already Claimed"; o += "
"; o += "
"; o += "-"; o += "
"; o += "
"; o += "
"; o += "
"; o += ""; o += "
"; o += ""; o += "
"; o += ""+type_text+""; o += "
"; o += ""; o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; o += "
Total amount:
"; o += "
"; o += amount; o += "
"; o += "
"; o += "
"; o += "
Total claimed:
"; o += "
"; o += claimed; o += "
"; o += "
"; o += ""; o += "
"; o += "
"; o += ""; o += "
"; o += "
"; o += "
"; o += "
Holders:
"; o += "
"; o += holders; o += "
"; o += "
"; o += "
"; o += "
Date:
"; o += "
"; o += utime_to_localtime(res[1][i]); o += "
"; o += "
"; o += ""; o += "
"; o += "
"; o += ""; o += "
"; o += "
"; if(!res[6][i]) { o += ""; } if(glob["governance"]["admin"]) { if(!res[6][i]) { o += " "; } if(res[5][i]) { o += " "; } else { o += " "; } } o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; } return o; } function gov_rew_list_tbl2(l,res) { var type_text; var type; var o = ''; var i; var t; var pos; var pos2 = 0; var tkn; var symbol; var decimal; var snap; var holders; var amount; var claimed; for(i=l-1;i>=33;i--) { t = res[2][i]; pos = t.indexOf("|"); tkn = t.substr(0,pos); t = t.substr(pos+1); pos = t.indexOf("|"); decimal = t.substr(0,pos); t = t.substr(pos+1); pos = t.indexOf("|"); symbol = t.substr(0,pos); t = t.substr(pos+1); pos = t.indexOf("|"); snap = t.substr(0,pos); t = t.substr(pos+1); pos = t.indexOf("|"); holders = t.substr(0,pos); t = t.substr(pos+1); amount = res[3][i]; amount /= 10**decimal; claimed = res[4][i]; claimed /= 10**decimal; type_text = "Live"; if(res[5][i]) { type_text = "Hidden"; } if(res[6][i]) { type_text = "Closed"; } if(res[5][i]) type = "tape-ended"; else type = "tape-live"; if(res[5][i] && !glob["governance"]["admin"])continue; symbol = symbol.replace("DEV",""); symbol = symbol.replace("WETH","ETH"); o += "
"+decimal+"
";; o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; o += " "; o += " "; o += symbol; o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; o += "Your amount"; o += "
"; o += "
"; o += "-"; o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; o += "Already Claimed"; o += "
"; o += "
"; o += "-"; o += "
"; o += "
"; o += "
"; o += "
"; o += ""; o += "
"; o += ""; o += "
"; o += ""+type_text+""; o += "
"; o += ""; o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; o += amount; o += "
"; o += "
"; o += "
Hunt balance:
"; o += "
"; o += '0'; o += "
"; o += "
"; o += "
"; o += "
Total claimed:
"; o += "
"; o += claimed; o += "
"; o += "
"; o += ""; o += "
"; o += "
"; o += ""; o += "
"; o += "
"; o += "
"; o += "
Holders:
"; o += "
"; o += holders; o += "
"; o += "
"; o += "
"; o += "
Date:
"; o += "
"; o += utime_to_localtime(res[1][i]); o += "
"; o += "
"; o += ""; o += "
"; o += "
"; o += ""; o += "
"; o += "
"; if(!res[6][i]) { o += ""; } if(glob["governance"]["admin"]) { if(!res[6][i]) { o += " "; } if(res[5][i]) { o += " "; } else { o += " "; } } o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; o += "
"; } return o; } function btn_modal_circle_detail() { $('#modal_circle_detail').modal('show'); } function check_points() { var url = "/" + "points_system"; console.log("check_points: "+url); ajax_get_data(url,"check_and_update_points(xhr.response);"); } function check_and_update_points(data) { var params = JSON.parse(data); if (params.points !== undefined) { points_amount = params.points; } else { points_amount = 0; } var points_button = document.getElementById('points_amount'); points_button.innerText = points_amount; } function click_daily_reward() { var url = "/" + "daily_reward"; console.log("click_daily_reward: "+url); notes = document.querySelector('.ogc_notes'); const errorElement = notes.querySelector('.points_message'); if (errorElement) { errorElement.remove(); } $.ajax({ url: url, method: 'POST', success: function(response) { params = JSON.parse(response); console.log(params); if (selectedAccount !== undefined && selectedAccount !== '') { if (params == "Claim once per 24 hours") { const toastPopup = document.getElementById('toastPopup'); if (toastPopup) { const toastBootstrap = bootstrap.Toast.getOrCreateInstance(toastPopup); const toastText = document.querySelector('.toastText'); toastText.textContent = params; toastBootstrap.show(); } } else if (params == "Rewarded first time!") { setTimeout(check_points, 300); anim.goToAndPlay(0); } else { const toastPopup = document.getElementById('toastPopup'); setTimeout(check_points, 300); if (toastPopup) { const toastBootstrap = bootstrap.Toast.getOrCreateInstance(toastPopup); const toastText = document.querySelector('.toastText'); toastText.textContent = "Done! Check points now"; toastBootstrap.show(); } } } else { const toastPopup = document.getElementById('toastPopup'); if (toastPopup) { const toastBootstrap = bootstrap.Toast.getOrCreateInstance(toastPopup); const toastText = document.querySelector('.toastText'); toastText.textContent = "Please, connect your wallet!"; toastBootstrap.show(); } } }, error: function(xhr) { console.error(xhr.responseText); } }); } function ajax_update_points() { var url = "/" + "points_amount"; console.log("ajax_update_points: "+url); ajax_get_data(url, "update_points(xhr.response);"); } function update_points(data) { var params = JSON.parse(data); if (params == true && window.location.pathname === '/points') { $("#OGC__points__daily_ogc_reward").css("display", "flex"); } } function points_system() { console.log("points_system"); if (selectedAccount !== undefined && selectedAccount !== '') { console.log("Start"); ajax_update_points(); check_points(); } } function add_deposit_points() { var url = "/" + "points_from_deposit"; console.log("add_deposit_points: "+url); $.ajax({ url: url, method: 'POST', success: function(response) { params = JSON.parse(response); }, error: function(xhr) { console.error(xhr.responseText); } }); } function add_100_points() { var url = "/" + "points_from_task_100"; console.log("add_100_points: "+url); $.ajax({ url: url, method: 'POST', success: function(response) { params = JSON.parse(response); }, error: function(xhr) { console.error(xhr.responseText); } }); } var modalPointsEl = document.getElementById('modal_points'); modalPointsEl.addEventListener('show.bs.modal', function (event) { points_system(); }); function btn_solana_node_action() { var x; var y; var v; var id = "btn_solnode"; txt = "No action"; clas = "btn btn-primary btn-sm"; a = ""; var err = ""; if(!err) { v = glob["solana_node_wal_bal"]; if(v > 0) { err = 1; a = ""; txt = "Paid: "+v+" SOL. NODE In PROGRESS"; clas = "btn btn-success btn-sm"; } } if(!err) { if(!selectedAccountSol || !glob["onConnectedSol"]) { a = ""; txt = "Select SOLANA Wallet & connect"; err = 1; } } if(!err) { y = glob["solana_node_amount"]; v = glob["wallet-balance-solana"]; if(v < y) { err = 1; txt = "Not enough SOL ["+v+" / "+y+"]"; } } if(!err) { { err = 1; txt = "Pay to participate"; a = "web3_solana_node_pay()"; } } x = document.getElementById(id); if(x === null) log("NULL "+id); if(x !== null) if(x.innerHTML != txt) { x.innerHTML = txt; x.className = clas; glob["btn_action"][id] = a; } } function btn_solana_validator_action() { var x; var y; var v = 0; var net = 'bsc'; var id = "btn_sol_validator_testnet"; txt = "No action"; clas = "btn btn-primary btn-sm"; a = ""; var err = ""; if(!err) { if(v > 0) { err = 1; a = ""; txt = "Paid: "+v+" USDT"; clas = "btn btn-success btn-sm"; } } if(!err) { if(!selectedAccount || !glob["onConnected"]) { a = "onConnect();"; txt = "Connect Wallet"; err = 1; } } if(!err) { if(chainId != chain) { txt = "Switch to "+nchain; a = "change_chain('"+net+"');"; err = 1; clas = "btn btn-secondary btn-sm"; } } if(!err) { if(glob["solana_validator"] === undefined) { console.log("!!!!!!!!!!!"); err = 1; txt = "Loading..."; } } if(!err) { y = glob["solana_validator"].amount2; y /= 10**glob["solana_validator"].d; v = glob["solana_validator"].balance; v /= 10**glob["solana_validator"].d; if(v < y) { v = Math.round(v); err = 1; txt = "Not enough USDT ["+v+" / "+y+"]"; } } if(!err) { y = glob["solana_validator"].amount2; y /= 10**glob["solana_validator"].d; v = glob["solana_validator"].allowance; v /= 10**glob["solana_validator"].d; if(v < y) { err = 1; txt = "Approve "+y+" USDT"; a = "web3_solana_validator_approve();"; } } if(!err) { v = glob["solana_validator"].amount; { err = 1; txt = "Pay "+v+" USDT"; a = "web3_solana_validator_pay()"; } } x = document.getElementById(id); if(x === null) log("NULL "+id); if(x !== null) if(x.innerHTML != txt) { x.innerHTML = txt; x.className = clas; glob["btn_action"][id] = a; } } glob["times_load_ref_balance"] = 0; function load_ref_balance() { if(selectedAccount != "") { if(glob["times_load_ref_balance"] == 1) { web3_ref_balance("matic"); web3_ref_balance("bsc"); web3_ref_balance("eth"); web3_whitelists_balance("matic"); web3_whitelists_balance("bsc"); web3_tarif_addr_list("matic"); web3_tarif_addr_list("bsc"); web3_notification_cards("matic"); web3_notification_cards("bsc"); } glob["times_load_ref_balance"]++; if(glob["times_load_ref_balance"] > 100) glob["times_load_ref_balance"] = 0; } } setInterval(load_ref_balance,100); function access_balance_summary() { var t; var v = 0; if(glob["access_balance"]["matic"] !== undefined) v += glob["access_balance"]["matic"]; if(glob["access_balance"]["bsc"] !== undefined) v += glob["access_balance"]["bsc"]; if(glob["access_balance"]["eth"] !== undefined) v += glob["access_balance"]["eth"]; n = "access_balance"; t = get_cookie(n); if(t != v) { set_by_className(n,v); set_cookie(n,v); } } function access_balance_from_cookie() { var n = "access_balance"; var v; v = get_cookie(n); if(v !== undefined) set_by_className(n,v); } access_balance_from_cookie(); function set_by_className(c,v) { var i; var l; var x; var y; x = document.getElementsByClassName(c); l = x.length; for(i=0;i < l;i++) { y = x[i]; if(y.innerHTML != v) y.innerHTML = v; } } function btn_check_buy_tarif(airdrop) { check_tarif_radio(airdrop); } function check_tarif_radio(airdrop) { var cost; var name; var airdrop_name; var c; var x; var y; var t; var l; var i; t = "radio_"+airdrop; x = document.getElementsByName(t); l = x.length; t = ""; for(i = 0; i < l; i++) { y = x[i]; if(y.checked == true) { t = y.id; t = t.replace("i_tarif_",""); } } if(t != "") { modal_buy_tarif_open(t,airdrop); } else { x = document.getElementById("info_"+airdrop); x.innerHTML = 'Please, select tariff'; setTimeout(clear_blk_info_err,1000,airdrop); } } function clear_blk_info_err(airdrop) { var x = document.getElementById("info_"+airdrop); x.innerHTML = " "; } function modal_buy_tarif_open(t,airdrop) { var x; var i; i = "tarif_cost_"+t; x = document.getElementById(i); cost = x.innerHTML; i = "tarif_name_"+t; x = document.getElementById(i); name = x.innerHTML; i = "airdrop_name_"+airdrop; x = document.getElementById(i); airdrop_name = x.innerHTML; x = document.getElementById("buy_tarif_cost"); x.innerHTML = cost; x = document.getElementById("buy_tarif_name"); x.innerHTML = name; x = document.getElementById("buy_tarif_id"); x.innerHTML = t; x = document.getElementById("buy_tarif_airdrop_name"); x.innerHTML = airdrop_name; $('#buyTarifModal').modal('show'); } function modal_buy_tarif_open2() { var airdrop; var x; var y; var id; x = document.getElementById('modal_circle_tarif_id'); id = x.innerHTML; x = document.getElementById('modal_circle_airdrop_id'); airdrop = x.innerHTML; $('#modal_circle').modal('hide'); modal_buy_tarif_open(id,airdrop); } function modal_open_detail(id,airdrop_name,airdrop) { const buy_tarif_button = document.querySelector("#circle_tarif_buy_tarif"); const warningContainer = document.querySelector("#modal_circle_warning"); const warningDesc = document.querySelector("#modal_circle_desc"); var id2; var t; var x; var y; var v; x = document.getElementById("modal_circle_tarif_id"); x.innerHTML = id; x = document.getElementById("modal_circle_airdrop_id"); x.innerHTML = airdrop_name; x = document.getElementById("modal_circle_airdrop_id2"); x.innerHTML = airdrop; x = document.getElementById("tarif_name_"+id); v = x.innerHTML; x = document.getElementById("modal_circle_tarif_name"); x.innerHTML = v; t = v.indexOf(" "); v = v.substring(0,t); x = document.getElementById("modal_circle_wallet_count"); x.innerHTML = v; x = document.getElementById("airdrop_name_"+airdrop_name); v = x.innerHTML; x = document.getElementById("modal_circle_airdrop_name"); x.innerHTML = v; console.log(v); if (v === "Grass" || v === "DeBank" || v === "Mintchain") { warningContainer.style.display = "flex"; if (v === "Grass") { warningDesc.innerHTML = "All processes are currently active. Due to maintenance in Grass, data may not be displayed temporarily. Activities continue as scheduled." } if (v === "DeBank") { warningDesc.innerHTML = "All processes are currently active. Due to maintenance in Debank, data may not be displayed temporarily. Activities continue as scheduled." } if (v === "Mintchain") { warningDesc.innerHTML = "All processes are currently active. Due to maintenance in Mintchain, data may not be displayed temporarily. Activities continue as scheduled." } } else { warningContainer.style.display = "none"; } if (v === " StarkNet Ecosystem" || v === " DeBank" || v === " EYWA" || v === " Grass" || v === " Warpcast" || v.includes("zkSync") || v.includes("LayerZero") || v === " Solana" ) { buy_tarif_button.innerHTML = "Purchases paused"; buy_tarif_button.onclick = ""; if (v === " EYWA" ) { buy_tarif_button.innerHTML = "Coming soon"; buy_tarif_button.onclick = ""; } } else { buy_tarif_button.innerHTML = "Buy tariff"; buy_tarif_button.onclick = modal_buy_tarif_open2; } id2 = airdrop+"_1"; glob["tarif_wallet_list"] = []; modal_circle_click(id2); modal_circle_button_show(0); modal_circle_point_show(airdrop); $('#modal_circle').modal('show'); } function search_circle_actions(n) { var id; var id2; var x; var y; var l; var i; y = document.getElementsByClassName("circle_actions"); l = y.length; for(i=0;i < l;i++) { x = y[i]; id = x.id; id = id.replace("circle_actions_",""); id2 = "circle_action_"+id; x = document.getElementById(id2); if(id == n) { x.className = ""; } else { x.className = "d-none"; } } } function modal_circle_click(id) { var tarif; var x; var y; var v; var pos; var t; v = "modal_c_"+id; console.log("V: "+v+" ID: "+id); x = document.getElementById(v); v = x.innerText; x = document.getElementById('circle_head2'); x.innerHTML = v; switch(id) { case "14_4": console.log("!!!!!!!! LOAD DATA FROM CONTRACT ON ARBITRUM"); web3_claim_eywa1_info(); break; case "23_4": console.log("!!!!!!!! LOAD DATA FROM CONTRACT ON MINT mainnet"); web3_claim1_mint_info(); break; } if (id === "1_5" || id === "1_6" || id === "3_5" || id === "3_6") { document.getElementById('active_circle').classList.remove('d-none'); document.getElementById('outdated_circle').classList.add('d-none'); } else if (id === "3_3") { document.getElementById('outdated_circle').classList.remove('d-none'); document.getElementById('active_circle').classList.add('d-none'); } else { document.getElementById('active_circle').classList.add('d-none'); document.getElementById('outdated_circle').classList.add('d-none'); } pos = id.indexOf("_"); t = id.substring(pos+1); x = document.getElementById("modal_circle_num"); x.innerHTML = t; console.log("Set modal_circle_num "+t); x = document.getElementById("modal_circle_tarif_id"); tarif = x.innerHTML*1; if(glob["tarif_addr_list"][tarif] !== undefined && glob["tarif_addr_list"][tarif] == true) { web3_factory_status(); } search_circle_actions(id); web3_circle_cost(id); } function support_click() { let y; let x; const screenshotTarget = document.body; x = document.getElementById('modal_support_wallet'); x.value = selectedAccount; x = document.getElementById('modal_support_btn'); x.disabled = false; x.innerHTML = "Send"; $('#modal_support').modal('show'); if(0) html2canvas(screenshotTarget).then(canvas => { dataURL = canvas.toDataURL(); x = document.getElementById('modal_support_img'); x.value = dataURL; }); const walletInput = document.querySelector("#modal_support_wallet"); const contactsInput = document.querySelector("#modal_support_contacts"); const descriptionInput = document.querySelector("#modal_support_message"); walletInput.setAttribute("required", ""); contactsInput.setAttribute("required", ""); descriptionInput.setAttribute("required", ""); } async function support_success_click(e) { e.preventDefault(); const walletInputValue = document.querySelector("#modal_support_wallet").value; const contactsInputValue = document.querySelector("#modal_support_contacts").value; const descriptionInputValue = document.querySelector("#modal_support_message").value; try { const response = await fetch("https://api-dap.airdrop-hunter.site/support/", { method: "post", mode: 'cors', headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, body: JSON.stringify({ wallet: walletInputValue, contact: contactsInputValue, msg: descriptionInputValue }) }); if (response.ok) { $('#modal_support').modal('hide'); $('#modal_support_success').modal('show'); } else { throw new Error('Failed to send support request'); } } catch (error) { console.error('Error:', error); $('#modal_support').modal('hide'); $('#modal_support_error').modal('show'); } } function support_submit() { $('#modal_support').modal('hide'); $('#modal_support_success').modal('show'); } glob["tarif_wallet_list"] = new Array(); function wallet_list(addr,tarif) { console.log("wallet_list load addr: "+addr+" tarif: "+tarif); var url = glob["api-dap"]+"wallets_list/"+btoa(addr)+"/"+tarif; ajax_get_data(url,"wallet_list_load(xhr.response);"); } function wallet_list_load(data) { params = JSON.parse(data); if(params.status == 1) { glob["tarif_wallet_list"] = params.result; } else { glob["tarif_wallet_list"] = []; } } function btn_buy_refill() { $('#accountModal').modal('hide'); $('#buy_refill_modal').modal('show'); } function btn_buy_refill2() { const bonusModul = document.querySelector("#bonus-modal-en"); bonusModul.style.opacity = 0; bonusModul.style.visibility = "hidden"; $('#buy_refill_modal').modal('show'); } function refill_amount_change(e) { var x; var id = e.id; var id2 = id.replace("refill_amount_",""); const depositPointsDesc = document.querySelector('#deposit_amount'); console.log("Clicked: "+id2); glob["modal_hartbeat"] = 0; x = document.getElementById("modal_refill_amount"); x.innerHTML = e.innerHTML; depositPointsDesc.innerHTML = e.innerHTML; refill_amount_class_change(id2); } function refill_amount_change_vr(e) { var x; var id = e.id; var id2 = id.replace("refill_amount_",""); console.log("Clicked: "+id2); glob["modal_hartbeat"] = 0; x = document.getElementById("modal_refill_amount"); x.innerHTML = e.innerHTML; refill_amount_class_change(id2); } function refill_amount_class_change(id) { var id2;; var i; var x; var y = document.getElementsByClassName("btn-refill-amount"); var l = y.length; for(i = 0;i < l;i++) { x = y[i]; if(i == id) { if(x.classList.contains("btn-secondary")) { x.classList.remove("btn-secondary"); } if(!x.classList.contains("btn-primary")) { x.classList.add("btn-primary"); } } else { if(!x.classList.contains("btn-secondary")) { x.classList.add("btn-secondary"); } if(x.classList.contains("btn-primary")) { x.classList.remove("btn-primary"); } } } } function modal_circle_point_show(airdrop) { var x; var y; var i; y = document.getElementsByClassName("modal_circle_point"); l = y.length; for(i=0;i < l;i++) { x = y[i]; if(x.id == "modal_circle_point_"+airdrop) { if(x.classList.contains("d-none")) x.classList.remove("d-none"); } else { if(!x.classList.contains("d-none")) x.classList.add("d-none"); } } } function modal_circle_goal(id,v=0) { var now = 0; var x; var y; var y2; var v; var v2; var v3; var clas; console.log("ID: "+id+ " v: "+v); y = document.getElementById("modal_circle_blk_detail"); y2 = document.getElementById("modal_circle_blk_gas_btn"); clas = "d-none"; switch(id) { case "1_1": case "2_1": case "3_1": case "4_1": case "5_1": case "7_1": case "9_1": case "10_1": case "14_1": v = 100; now = 1; break; case "1_2": case "2_2": case "3_2": case "4_2": case "4_3": case "4_4": case "4_5": case "5_2": case "7_2": case "9_2": case "10_2": case "14_2": if(v==0) v = Math.random(100); v = v * 100; v = v * 100; v = Math.round(v); v = v / 100; v = 25; v = 0; api_circle_stat(id); clas = ""; break; default: v = 0; now = 0; } console.log("Class: "+clas); y.className = clas; y2.className = clas; v2 = Math.round(v); x = document.getElementById("modal_circle_steps_"+id); v3 = x.innerHTML; x = document.getElementById("modal_circle_progress_all"); x.innerHTML = v3; x = document.getElementById("modal_circle_progress_now"); x.innerHTML = now; x = document.getElementById("modal_circle_progress_pers"); x.setAttribute("data-percentage", v2); x = document.getElementById("modal_circle_progress_pers2"); x.innerHTML = v+"%"; } function modal_circle_detail_tbl(res) { log("modal_circle_detail_tbl"); console.log(res); var v; var txt; var step_name; var id = res["airdrop"]+"_"+res["circle"]; var id2; var t; var svg = ""; var o = ""; var x; var y; var wal_l; var step_l; wal_l = Object.keys(res["wal"]).length; x = document.getElementById('modal_circle_progress_all'); step_l = x.innerHTML; { o += "
"; o += "
"; o += "
"; for(i = 1; i <= wal_l; i++) { o += "
"; o += ""; o += "W"+(i); o += ""; o += "
"; } o += "
%
"; o += "
"; for(n = 1; n <= step_l; n++) { o += "
"; t = "circle_name_"+id+"_"+n; x = document.getElementById(t); txt = x.innerText; step_name = txt; o += "
"; o += ""; o += n; o += ""; o += "
"; for(i = 0; i < wal_l; i++) { id2 = (i+1)+"_"+n; t = res["tx"][id2]; o += "