Merge branch 'cec-claim' of http://git.kingsome.cn/huangjinming/CounterFireGames into staking
This commit is contained in:
commit
a5a07f5cf3
3
.env.dev
3
.env.dev
@ -24,4 +24,5 @@ VUE_APP_LOGIN_API='https://login-test.kingsome.cn'
|
||||
VUE_APP_NET_ID_MAIN='11155111'
|
||||
VUE_APP_LOCKER_ADDRESS_MAIN='0x7F2b4DB626d878778e178B4F0C7bA3a2870C6dd0'
|
||||
|
||||
VUE_APP_STAKING_CHAIN='97'
|
||||
VUE_APP_STAKING_CHAIN='97'
|
||||
VUE_APP_NET_ID_CLAIM='97'
|
||||
|
@ -24,4 +24,5 @@ VUE_APP_LOGIN_API='https://login-test.kingsome.cn'
|
||||
VUE_APP_NET_ID_MAIN='11155111'
|
||||
VUE_APP_LOCKER_ADDRESS_MAIN='0x7F2b4DB626d878778e178B4F0C7bA3a2870C6dd0'
|
||||
|
||||
VUE_APP_STAKING_CHAIN='97'
|
||||
VUE_APP_STAKING_CHAIN='97'
|
||||
VUE_APP_NET_ID_CLAIM='97'
|
||||
|
@ -24,4 +24,5 @@ VUE_APP_LOGIN_API='https://login-test.cebggame.com'
|
||||
VUE_APP_NET_ID_MAIN='1'
|
||||
VUE_APP_LOCKER_ADDRESS_MAIN='0x5c16AC8322E5cac8ad235F7e0Dc5d23bffe3ed50'
|
||||
|
||||
VUE_APP_STAKING_CHAIN='56'
|
||||
VUE_APP_STAKING_CHAIN='56'
|
||||
VUE_APP_NET_ID_CLAIM='56'
|
||||
|
@ -25,4 +25,5 @@ VUE_APP_LOGIN_API='https://login-test.cebggame.com'
|
||||
VUE_APP_NET_ID_MAIN='1'
|
||||
VUE_APP_LOCKER_ADDRESS_MAIN='0x5c16AC8322E5cac8ad235F7e0Dc5d23bffe3ed50'
|
||||
|
||||
VUE_APP_STAKING_CHAIN='56'
|
||||
VUE_APP_STAKING_CHAIN='56'
|
||||
VUE_APP_NET_ID_CLAIM='56'
|
||||
|
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 4.3 KiB |
BIN
src/assets/img/home/investor_Foresight.png
Normal file
BIN
src/assets/img/home/investor_Foresight.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.9 KiB |
@ -97,7 +97,7 @@ const logos = ref([
|
||||
.href,
|
||||
},
|
||||
{
|
||||
imgeSrc: new URL("@/assets/img/home/investor_DWFlabs.png", import.meta.url)
|
||||
imgeSrc: new URL("@/assets/img/home/investor_Foresight.png", import.meta.url)
|
||||
.href,
|
||||
}
|
||||
]);
|
||||
|
@ -6,12 +6,14 @@ import { FireWallet } from '@/components/chain/wallet/FireWallet';
|
||||
import { walletStore } from "@/store/wallet";
|
||||
import WalletSelectModel from "@/components/chain/WalletSelectModel.vue";
|
||||
import ClaimSelectModel from "@/components/chain/ClaimSelectModel.vue";
|
||||
import ClaimAddressModel from "@/components/chain/ClaimAddressModel.vue"
|
||||
import {createModal} from "@/utils/model.util";
|
||||
import {isTokenExpired, genRefreshToken, cfgChainId, switchEthereumChain} from "@/components/chain/utils"
|
||||
import {ImtblMarket} from "@/components/chain/Market";
|
||||
import { ALL_PROVIDERS } from "@/configs/configchain";
|
||||
import {Locker} from "@/components/chain/contract/Locker";
|
||||
import {GameItemMall} from "@/components/chain/contract/GameItemMall";
|
||||
import { CecClaim } from "@/components/chain/contract/cecClaim"
|
||||
import ConfirmDialog from "@/components/Dialogs/confirmDialog.vue";
|
||||
import { Widgets } from "./Widgets";
|
||||
import { Vester } from "./contract/Vester";
|
||||
@ -40,6 +42,7 @@ export class BlockChain {
|
||||
this.vester = new Vester(this)
|
||||
this.staking = new Staking(this)
|
||||
this.erc20 = new ERC20(this)
|
||||
this.claim = new CecClaim(this)
|
||||
this.widgets = new Widgets(this)
|
||||
BlockChain.instance = this;
|
||||
|
||||
@ -346,9 +349,11 @@ export class BlockChain {
|
||||
}
|
||||
|
||||
async claimAddress({title, subTitle, targetChainId}) {
|
||||
// console.log(targetChainId)
|
||||
// return
|
||||
const initData = {}
|
||||
initData[this.store.walletType] = this.store.address
|
||||
const rewardModal = createModal(WalletSelectModel, {
|
||||
const rewardModal = createModal(ClaimAddressModel, {
|
||||
title: title || 'Select Address',
|
||||
message: subTitle || 'Please select the address you want to use',
|
||||
subTitle: subTitle,
|
||||
@ -360,7 +365,7 @@ export class BlockChain {
|
||||
console.log(`select address result : ${errmsg}`);
|
||||
throw new Error(errmsg);
|
||||
}
|
||||
targetChainId = targetChainId || cfgChainId;
|
||||
targetChainId = targetChainId;
|
||||
let chainId = await walletInstance.getChainId();
|
||||
if (chainId !== targetChainId) {
|
||||
console.log(`current chain: ${chainId}, want: ${targetChainId}`)
|
||||
@ -369,9 +374,41 @@ export class BlockChain {
|
||||
return { provider, address: accounts[0] };
|
||||
}
|
||||
|
||||
/**
|
||||
* CEC 选择钱包地址
|
||||
*/
|
||||
async ClaimSelectAddress({title, subTitle, disabled, targetChainId}) {
|
||||
// console.log(targetChainId)
|
||||
// return
|
||||
const initData = {}
|
||||
initData[this.store.walletType] = this.store.address
|
||||
const rewardModal = createModal(ClaimAddressModel, {
|
||||
title: title || 'Connect your reciveing wallet',
|
||||
message: subTitle || 'Use this wallet to reciveing $CEC and pay gas',
|
||||
subTitle: subTitle,
|
||||
initData: { 1: 'MetaMask', 2: 'OKX Wallet', 3: 'Passport' },
|
||||
disabled: disabled || [5,3]
|
||||
});
|
||||
const { errcode, errmsg, walletInstance, provider, accounts } = await rewardModal.show();
|
||||
if (errcode) {
|
||||
console.log(`select address result : ${errmsg}`);
|
||||
throw new Error(errmsg);
|
||||
}
|
||||
targetChainId = targetChainId;
|
||||
let chainId = await walletInstance.getChainId();
|
||||
if (chainId !== targetChainId) {
|
||||
console.log(`current chain: ${chainId}, want: ${targetChainId}`)
|
||||
chainId = await switchEthereumChain(provider.provider, targetChainId);
|
||||
location.reload()
|
||||
}
|
||||
return { provider, address: accounts[0] };
|
||||
}
|
||||
|
||||
/**
|
||||
* CEC Claim登录
|
||||
*/
|
||||
async ClaimLogin() {}
|
||||
async ClaimChangLogout() {
|
||||
await this.wallet.logout()
|
||||
}
|
||||
|
||||
}
|
||||
|
342
src/components/chain/ClaimAddressModel.vue
Normal file
342
src/components/chain/ClaimAddressModel.vue
Normal file
@ -0,0 +1,342 @@
|
||||
<template>
|
||||
<div class="chain-modal" v-if="props.visible" :class="{ mobile: 'mobile' }">
|
||||
<div class="modal-bg" @click="cancelSelect"></div>
|
||||
<div class="modal-content" :class="{ mobile: 'mobile' }">
|
||||
<div class="modal-title">
|
||||
<div>{{title||'Please connect your wallet'}}</div>
|
||||
<img
|
||||
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAgCAYAAAB3j6rJAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyNpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIDIxLjAgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjlGMDJCNzI5NkMzMDExRUZBQzE4QkZFNTMxOUI4MzVEIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjlGMDJCNzJBNkMzMDExRUZBQzE4QkZFNTMxOUI4MzVEIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6OUYwMkI3Mjc2QzMwMTFFRkFDMThCRkU1MzE5QjgzNUQiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6OUYwMkI3Mjg2QzMwMTFFRkFDMThCRkU1MzE5QjgzNUQiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5VaK1+AAACSklEQVR42syYTWgTQRTHV62KUm9SCoFCoNKgl9CDWEpPPfRioQXJIYLNZQsSpCgUD3rxpJSKl0DtKfhxqAd7sIeAerD0GgQvpQelKIgitlUkIcaP+H/wFtJh3uzO7iz44Ach++bNb142k9l43n8QnU7HO8ivz4DX4Bd4DvpTmvMkWAG7YB0MqQl1EutiC2QcS/SBN8o89aAjQXxXEoi3YMCRBHV4UzPHD1XkoSaJ2AbZhBIZ7rCu/gNV5Dh4ISS/B4MxJaij74S6dI/0qiIUx0BNGPQR5CwlstxRXb2XvHhPJ0JxBKwJgz+B0xElToEPQp0aL9oziQQyT4UiX0A+RCLHHdSNp0Ue1e0jUvSAJ0Kxr2BYGEcd+yyMW+VFejYiFIfAI6HoHjir5Oe5Y7p8WtRh084aFiRTFYp/A6OcRx3aEfIecx0viQjFAXBfmIQ2pCvcId31apiEjUggUxEmk1jmcZ5LkUBmMaJEJapEHJEg7oRI3LWRUI8BNvEK/BGu/QUbLJRqnAetkI60wQXbjtjENPgZ8R75DYppiBR4pbpJn/FHopOZcSlykYuqE9HkVzmnLMjQveS7ECkZJMpKri/I0HuXk4jMGgr7McTn4oiUDZ97KaSLRUGGmLcRuWaQKDq4uW9EEblu2BsKlnuO6et+yyRyUxhExaZS2ABv60QmheQWF0sSE6Ap1L+kiixpkppcxEWMg4ZwfNwn4isJDR7sMsb4INU9z4IqQqeoe/wIQA/jIyn9aJ7j5982P4yfSHIeSeVviX8CDABowbjzQScruQAAAABJRU5ErkJggg=="
|
||||
alt="close"
|
||||
class="close"
|
||||
@click="cancelSelect"/>
|
||||
</div>
|
||||
<div class="modal-sub-title">
|
||||
{{subTitle || 'Connect your wallet to start your Counter Fire journey'}}
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div
|
||||
class="chain-modal-card"
|
||||
v-for="data in currentDatas"
|
||||
:key="data.name"
|
||||
@click="cardClicked(data.id)"
|
||||
>
|
||||
<div class="icon">
|
||||
<img :src="data.logo" :alt="data.name" />
|
||||
</div>
|
||||
<div class="name">{{ data.name }} <span v-if="data.id == 4">Rec</span> </div>
|
||||
<div class="tip">{{ data.tip }}</div>
|
||||
<div class="fire-wallet" v-if="data.id == 5 && isFireWallet">
|
||||
<div class="fire-wallet-item" @click="googleLogin">
|
||||
<div class="icon">
|
||||
<img :src="icon_google" alt="">
|
||||
</div>
|
||||
<div class="name">Google</div>
|
||||
</div>
|
||||
<div class="fire-wallet-item" @click="appleLogin">
|
||||
<div class="icon">
|
||||
<img :src="icon_apple" alt="">
|
||||
</div>
|
||||
<div class="name">Apple</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed, ref } from "vue";
|
||||
import { ALL_PROVIDERS, icon_google, icon_apple } from "@/configs/configchain";
|
||||
import { allProviders } from "@/components/chain/BlockChain"
|
||||
import { getlogin } from "@/api/User";
|
||||
|
||||
import {apiCecInfo} from "@/utils/marketplace"
|
||||
import { useMarketplaceStore } from "@/store/marketplace"
|
||||
import {} from "@/store/wallet"
|
||||
const marketplaceStore = useMarketplaceStore()
|
||||
|
||||
const props = defineProps({
|
||||
visible: ref(Boolean),
|
||||
close: Function,
|
||||
title: ref(String),
|
||||
subTitle: ref(String),
|
||||
initData: Object,
|
||||
disabled: Array
|
||||
});
|
||||
|
||||
const currentDatas = computed(() => {
|
||||
let list = ALL_PROVIDERS.map((item) => {
|
||||
const Provider = allProviders[item.id];
|
||||
// console.log(Provider)
|
||||
const installed = new Provider().installed;
|
||||
// console.log(installed)
|
||||
const initData = props.initData;
|
||||
let current = null;
|
||||
if (initData) {
|
||||
current = initData[item.id];
|
||||
}
|
||||
const tip = installed ? current?.tip || item.tip || '' : "Install";
|
||||
return {
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
logo: item.logo,
|
||||
installed,
|
||||
downloadUrl: item.downloadUrl,
|
||||
tip,
|
||||
};
|
||||
});
|
||||
const disabled = props.disabled || [];
|
||||
list = list.filter((item) => !disabled.includes(item.id));
|
||||
return list;
|
||||
});
|
||||
|
||||
async function selectWallet(id) {
|
||||
const Provider = allProviders[id];
|
||||
const walletInstance = new Provider()
|
||||
const { provider, accounts } = await walletInstance.web3Provider();
|
||||
hideModal({errcode: 0, provider, wallet: id, walletInstance, accounts});
|
||||
}
|
||||
|
||||
const isFireWallet = ref(false)
|
||||
async function cardClicked(id) {
|
||||
if(id == 5) {
|
||||
isFireWallet.value = !isFireWallet.value
|
||||
} else {
|
||||
const data = currentDatas.value.find((item) => item.id === id);
|
||||
if (!data.installed) {
|
||||
// return
|
||||
// // open download page
|
||||
if (!data.downloadUrl) {
|
||||
return;
|
||||
}
|
||||
window.open(data.downloadUrl, '_blank');
|
||||
} else {
|
||||
await selectWallet(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const walletTake = import.meta.env.VUE_APP_WALLET_TAKE
|
||||
const googleLogin = async () => {
|
||||
let res = await callMethod("walletLogin", "0", walletTake);
|
||||
res = JSON.parse(res);
|
||||
marketplaceStore.fireAddress = res.data.address
|
||||
marketplaceStore.fireToken = res.data.token + '.cf'
|
||||
hideModal({errcode: 0})
|
||||
|
||||
// let token = 'eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY1YjBjMmM4ZDY3MTBhYmQ1YjFhN2RhMyIsInVpZCI6IiIsImdpZCI6IiIsIm9wZW5pZCI6IjEwODc4Nzc3NTE0NTY3NzY2NzkwMCIsInZlcnNpb24iOjAsInBsYXQiOjAsImlhdCI6MTcyNDMyODg1NSwiZXhwIjoxNzI0NDE1MjU1fQ.1Qg06-q7t9YBgteWL4DtXphaHb9qlWbNJfIObdftqdO6uR2Qw5XTaZZoqdBJM8htjXpeKiYWD44ddTuMEVTHCA'
|
||||
// try{
|
||||
// let data = await apiCecInfo('0x50f82c3e944f92cbbc1d8bfc601fc3fc5f7ab155', res.data.token+'.cf')
|
||||
// console.log(data)
|
||||
// } catch (e) {
|
||||
// console.log(e)
|
||||
// }
|
||||
}
|
||||
const appleLogin = async () => {
|
||||
let res = await callMethod("walletLogin", "1", walletTake);
|
||||
res = JSON.parse(res);
|
||||
marketplaceStore.fireAddress = res.data.address
|
||||
marketplaceStore.fireToken = res.data.token + '.cf'
|
||||
hideModal({errcode: 0})
|
||||
}
|
||||
|
||||
function cancelSelect() {
|
||||
hideModal({errcode: 1, errmsg: "user cancel select wallet"});
|
||||
}
|
||||
|
||||
function hideModal(result = null) {
|
||||
props.close(result);
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.chain-modal {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow: auto;
|
||||
margin: 0;
|
||||
z-index: 10001;
|
||||
.modal-bg {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
overflow: auto;
|
||||
margin: 0;
|
||||
background-color: #000000a3;
|
||||
}
|
||||
.modal-content {
|
||||
width: 481px;
|
||||
background-color: #2d2738;
|
||||
border-radius: 40px;
|
||||
color: white;
|
||||
margin: auto;
|
||||
display: flex;
|
||||
position: relative;
|
||||
// right: -100%;
|
||||
// transform: translateX(-481px);
|
||||
margin-top: 15vh;
|
||||
// margin-top: 84px;
|
||||
flex-direction: column;
|
||||
border: 1px solid #ad76eb;
|
||||
.mobile {
|
||||
width: 100vw;
|
||||
}
|
||||
.modal-title {
|
||||
border-radius: 40px 40px 0 0;
|
||||
padding: .78125vw 1.5625vw;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 3.125vw;
|
||||
font-family: 'Anton';
|
||||
font-weight: 400;
|
||||
font-size: 26px;
|
||||
color: #000;
|
||||
background-color: #bb7fff;
|
||||
.close{
|
||||
width: 32px;
|
||||
height: 31px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
.modal-sub-title {
|
||||
margin: 16px 29px 16px 31px;
|
||||
margin-left: 16px 31px;
|
||||
font-family: 'Poppins-Regular';
|
||||
font-size: 15px;
|
||||
font-weight: 400;
|
||||
}
|
||||
.modal-body {
|
||||
padding: 0 1.5625vw 1.04167vw;
|
||||
.chain-modal-card {
|
||||
transition: background-color 0.2s ease-in-out 0s;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
margin: 9px 0;
|
||||
position: relative;
|
||||
width: 421px;
|
||||
height: 52px;
|
||||
background: url('@/assets/img/login/btn_frame1.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
.icon {
|
||||
width: 40px !important;
|
||||
height: 40px !important;
|
||||
margin-left: 24px;
|
||||
overflow: visible;
|
||||
box-shadow: none;
|
||||
-webkit-box-pack: center;
|
||||
justify-content: center;
|
||||
-webkit-box-align: center;
|
||||
align-items: center;
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.icon-svg {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
fill: currentColor;
|
||||
color: unset;
|
||||
stroke: none;
|
||||
}
|
||||
}
|
||||
.name {
|
||||
width: 65%;
|
||||
font-family: 'Poppins-Regular';
|
||||
font-weight: 400;
|
||||
font-size: 18px;
|
||||
color: #FFFFFF;
|
||||
text-align: left;
|
||||
margin-left: 15px;
|
||||
span {
|
||||
display: inline-block;
|
||||
padding: 0px 8px;
|
||||
font-size: 12px;
|
||||
font-family: 'Poppins-Regular';
|
||||
background: #31fff3;
|
||||
color: #000;
|
||||
border-radius: 10px;
|
||||
}
|
||||
}
|
||||
.tip {
|
||||
text-align: right;
|
||||
color: #a39caa;
|
||||
}
|
||||
.tip a{
|
||||
color: #a39caa;
|
||||
}
|
||||
.fire-wallet {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -260px;
|
||||
width: 256px;
|
||||
// height: 100%;
|
||||
// border-radius: .41667vw;
|
||||
z-index: 9;
|
||||
.fire-wallet-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 256px;
|
||||
height: 40px;
|
||||
background: #2D2738;
|
||||
border-radius: 10px;
|
||||
border: 2px solid #625A6B;
|
||||
margin-bottom: 5px;
|
||||
.icon {
|
||||
width: 30px !important;
|
||||
height: 30px !important;
|
||||
margin-left: 30px !important;
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
.name {
|
||||
margin-left: 18px;
|
||||
font-family: 'Poppins-Regular';
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
color: #fff;
|
||||
}
|
||||
&:last-child {
|
||||
// border: 0px;
|
||||
}
|
||||
&:hover {
|
||||
background: #D5BEFA;
|
||||
border: 0px;
|
||||
.name {
|
||||
font-family: 'Poppins-Regular';
|
||||
font-weight: 400;
|
||||
font-size: 16px;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.chain-modal-card:hover {
|
||||
background: url('@/assets/img/login/btn_frame2 .png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
color: #0A090A;
|
||||
.name {
|
||||
color: #0A090A;
|
||||
}
|
||||
.tip {
|
||||
color: #845c91;
|
||||
a {
|
||||
color: #845c91;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
@ -76,7 +76,7 @@ const currentDatas = computed(() => {
|
||||
if (initData) {
|
||||
current = initData[item.id];
|
||||
}
|
||||
const tip = installed ? current?.tip || item.tip || '' : "Click to Install";
|
||||
const tip = installed ? current?.tip || item.tip || '' : "Install";
|
||||
return {
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
@ -247,7 +247,7 @@ function hideModal(result = null) {
|
||||
}
|
||||
}
|
||||
.name {
|
||||
width: 55%;
|
||||
width: 65%;
|
||||
font-family: 'Poppins-Regular';
|
||||
font-weight: 400;
|
||||
font-size: 18px;
|
||||
@ -257,10 +257,10 @@ function hideModal(result = null) {
|
||||
}
|
||||
.tip {
|
||||
text-align: right;
|
||||
color: red;
|
||||
color: #a39caa;
|
||||
}
|
||||
.tip a{
|
||||
color: red;
|
||||
color: #a39caa;
|
||||
}
|
||||
.fire-wallet {
|
||||
position: absolute;
|
||||
@ -318,6 +318,12 @@ function hideModal(result = null) {
|
||||
.name {
|
||||
color: #0A090A;
|
||||
}
|
||||
.tip {
|
||||
color: #845c91;
|
||||
a {
|
||||
color: #845c91;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -71,7 +71,7 @@ const currentDatas = computed(() => {
|
||||
if (initData) {
|
||||
current = initData[item.id];
|
||||
}
|
||||
const tip = installed ? current?.tip || item.tip || '' : "Click to Install";
|
||||
const tip = installed ? current?.tip || item.tip || '' : "Install";
|
||||
return {
|
||||
id: item.id,
|
||||
name: item.name,
|
||||
@ -90,7 +90,7 @@ async function selectWallet(id) {
|
||||
const Provider = allProviders[id];
|
||||
const walletInstance = new Provider()
|
||||
const { provider, accounts } = await walletInstance.web3Provider();
|
||||
console.log(accounts)
|
||||
// console.log(accounts)
|
||||
hideModal({errcode: 0, provider, wallet: id, walletInstance, accounts});
|
||||
}
|
||||
|
||||
@ -220,7 +220,7 @@ function hideModal(result = null) {
|
||||
}
|
||||
}
|
||||
.name {
|
||||
width: 55%;
|
||||
width: 65%;
|
||||
font-family: 'Poppins-Regular';
|
||||
font-weight: 400;
|
||||
font-size: 18px;
|
||||
@ -230,10 +230,10 @@ function hideModal(result = null) {
|
||||
}
|
||||
.tip {
|
||||
text-align: right;
|
||||
color: red;
|
||||
color: #a39caa;
|
||||
}
|
||||
.tip a{
|
||||
color: red;
|
||||
color: #a39caa;
|
||||
}
|
||||
.fire-wallet {
|
||||
position: absolute;
|
||||
@ -267,6 +267,12 @@ function hideModal(result = null) {
|
||||
.name {
|
||||
color: #0A090A;
|
||||
}
|
||||
.tip {
|
||||
color: #845c91;
|
||||
a {
|
||||
color: #845c91;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
74
src/components/chain/contract/cecClaim.js
Normal file
74
src/components/chain/contract/cecClaim.js
Normal file
@ -0,0 +1,74 @@
|
||||
import { apiCecClaim } from '@/utils/marketplace'
|
||||
|
||||
export class CecClaim {
|
||||
constructor(_chainInstance) {
|
||||
this.bc = _chainInstance
|
||||
}
|
||||
|
||||
async sendTransaction(provider, {from, to, data}) {
|
||||
const txHash = await provider.provider.request({
|
||||
method: 'eth_sendTransaction',
|
||||
params: [{
|
||||
from,
|
||||
to,
|
||||
data
|
||||
}]
|
||||
})
|
||||
const res = await provider.waitForTransaction(txHash)
|
||||
if (res.status == 0) {
|
||||
throw new Error('transaction failed')
|
||||
}
|
||||
return txHash
|
||||
}
|
||||
|
||||
async cecClaim(provider,address,token) {
|
||||
// console.log(provider)
|
||||
const chainId = parseInt(import.meta.env.VUE_APP_NET_ID_CLAIM);
|
||||
const subTitle = 'Use this wallet to reciveing $CEC and pay gas.'
|
||||
// const { provider, address } = await this.bc.ClaimSelectAddress({subTitle: subTitle,targetChainId: chainId})
|
||||
// const preDatas = {
|
||||
// address: address,
|
||||
// }
|
||||
const { errocode, errmsg, calls } = await apiCecClaim(address,token)
|
||||
if (errocode) {
|
||||
throw new Error(errmsg)
|
||||
}
|
||||
if (!calls || calls.length == 0) {
|
||||
throw new Error('no calls')
|
||||
}
|
||||
|
||||
let resutls = []
|
||||
for (let i = 0; i < calls.length; i++) {
|
||||
const { to, data } = calls[i].trans_req
|
||||
let hash = await this.sendTransaction(provider, {from: address, to, data})
|
||||
resutls.push(hash)
|
||||
}
|
||||
return resutls
|
||||
}
|
||||
|
||||
async eaoCecClaim(token,disabled) {
|
||||
// console.log(provider)
|
||||
const chainId = parseInt(import.meta.env.VUE_APP_NET_ID_CLAIM);
|
||||
const subTitle = 'Use this wallet to reciveing $CEC and pay gas.'
|
||||
const { provider, address } = await this.bc.ClaimSelectAddress({subTitle: subTitle,targetChainId: chainId, disabled: disabled})
|
||||
// const preDatas = {
|
||||
// address: address,
|
||||
// }
|
||||
const { errocode, errmsg, calls } = await apiCecClaim(address,token)
|
||||
if (errocode) {
|
||||
throw new Error(errmsg)
|
||||
}
|
||||
if (!calls || calls.length == 0) {
|
||||
throw new Error('no calls')
|
||||
}
|
||||
|
||||
let resutls = []
|
||||
for (let i = 0; i < calls.length; i++) {
|
||||
const { to, data } = calls[i].trans_req
|
||||
let hash = await this.sendTransaction(provider, {from: address, to, data})
|
||||
resutls.push(hash)
|
||||
}
|
||||
return resutls
|
||||
}
|
||||
|
||||
}
|
@ -82,7 +82,7 @@ const logos = ref([
|
||||
.href,
|
||||
},
|
||||
{
|
||||
imgeSrc: new URL("@/assets/img/home/investor_DWFlabs.png", import.meta.url)
|
||||
imgeSrc: new URL("@/assets/img/home/investor_Foresight.png", import.meta.url)
|
||||
.href,
|
||||
}
|
||||
]);
|
||||
|
@ -141,7 +141,7 @@ const logos = ref([
|
||||
.href,
|
||||
},
|
||||
{
|
||||
imgeSrc: new URL("@/assets/img/home/investor_DWFlabs.png", import.meta.url)
|
||||
imgeSrc: new URL("@/assets/img/home/investor_Foresight.png", import.meta.url)
|
||||
.href,
|
||||
}
|
||||
]);
|
||||
|
@ -80,6 +80,15 @@ export const AllChains = [
|
||||
symbol: 'BNB',
|
||||
explorerurl: 'https://bscscan.com'
|
||||
},
|
||||
{
|
||||
name: 'Binance Smart Chain Testnet RPC',
|
||||
type: 'Testnet',
|
||||
rpc: 'https://data-seed-prebsc-1-s1.binance.org:8545/',
|
||||
id: 97,
|
||||
logo: 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNTAwIiBoZWlnaHQ9IjI1MDAiIHZpZXdCb3g9IjAgMCAyMDAwIDIwMDAiPjxnIGZpbGw9IiNmM2JhMmYiPjxwYXRoIGQ9Ik02MTEuNTkgODQwLjQybDM4OC40LTM4OC4zOSAzODguNiAzODguNTkgMjI2LTIyNkw5OTkuOTkgMCAzODUuNiA2MTQuNDJsMjI1Ljk5IDIyNk0uMDA2IDk5OS45NjlsMjI2LjAwNy0yMjYuMDA3IDIyNS45OTIgMjI1Ljk5M0wyMjYgMTIyNS45NnpNNjExLjU5IDExNTkuNThsMzg4LjQgMzg4LjM5IDM4OC41OS0zODguNTggMjI2LjEyIDIyNS44OC0uMTEuMTJMOTk5Ljk5IDIwMDBsLTYxNC40MS02MTQuNC0uMzItLjMyIDIyNi4zMy0yMjUuN00xNTQ4LjAxMyAxMDAwLjA5M2wyMjYuMDA3LTIyNi4wMDYgMjI1Ljk5MiAyMjUuOTkyLTIyNi4wMDYgMjI2LjAwN3oiLz48cGF0aCBkPSJNMTIyOS4yMiA5OTkuODhoLjFMOTk5Ljk5IDc3MC41NSA4MzAuNTEgOTQwLjAzaC0uMDFsLTE5LjQ3IDE5LjQ4LTQwLjE2IDQwLjE3LS4zMi4zMS4zMi4zMyAyMjkuMTIgMjI5LjEzIDIyOS4zMy0yMjkuMzMuMTEtLjEzLS4yMS0uMTEiLz48L2c+PC9zdmc+',
|
||||
symbol: 'BNB',
|
||||
explorerurl: 'https://testnet.bscscan.com'
|
||||
},
|
||||
{
|
||||
name: 'OKExChain Mainnet RPC',
|
||||
type: 'Mainnet',
|
||||
|
@ -1,4 +1,4 @@
|
||||
a<template>
|
||||
<template>
|
||||
<div class="claim">
|
||||
<div class="claim-content">
|
||||
<div class="claim-content-title">
|
||||
@ -173,6 +173,7 @@ a<template>
|
||||
<span>Claim to your wallet</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<!-- <div class="right claim-btn" @click="cecClaim"> -->
|
||||
<span>Coming soon</span>
|
||||
</div>
|
||||
</li>
|
||||
@ -209,11 +210,21 @@ a<template>
|
||||
<div class="content-body-box">
|
||||
<!-- 3 -->
|
||||
<div v-if="cecUserStatus == 3">
|
||||
<div class="body-box-title">
|
||||
<div class="body-box-title padding-top">
|
||||
<h3><span>{{Number(cecInfo.available) == 0 ? 0 : priceCalculated(cecInfo.available,18).toString().match(/^\d+(?:\.\d{0,2})?/)[0]}}</span> $CEC deposit to Bitget in progress</h3>
|
||||
</div>
|
||||
<div class="body-box-con">
|
||||
<p>You'll receive your $CEC airdrop in Bitget spot account before the listing time</p>
|
||||
<div class="body-box-con margin-top-20">
|
||||
<p>Well done! You're all set!</p>
|
||||
</div>
|
||||
<div class="body-box-con margin-20">
|
||||
<p>You'll receive your $CEC airdrop in Bitget spot account before the listing time.</p>
|
||||
</div>
|
||||
|
||||
<!-- <div class="body-box-btn margin-top-20">
|
||||
<p class="center"></p>
|
||||
</div> -->
|
||||
<div class="body-box-btn margin-top">
|
||||
<p class="center">Jump to<a href="https://www.bitget.com/support/articles/12560603814979?utmSource=Twitter_CEC" target="_blank"> Bitget Launchpool</a> and grab your share of 11M $CEC now!</p>
|
||||
</div>
|
||||
<div class="body-box-btn">
|
||||
<p><a @click="cecUserStatus = 4">Cancel the Pre-Deposit to Bitget</a></p>
|
||||
@ -262,7 +273,7 @@ a<template>
|
||||
<span>{{ cecInfo.bindAddress }}</span>
|
||||
</li>
|
||||
<li>
|
||||
<div>You may lose your tokens if this UID Wallet Address are incorrect blocked or doesn't exist </div>
|
||||
<div class="font-size-14">You may not receive your airdrop in Bitget if your UID, deposit address is not correct or doesn't exist</div>
|
||||
</li>
|
||||
<li>
|
||||
<h6>KYC passed only</h6>
|
||||
@ -340,7 +351,7 @@ import { priceCalculated } from "@/configs/priceCalculate"
|
||||
import {walletStore} from "@/store/wallet";
|
||||
import { useMarketplaceStore } from "@/store/marketplace"
|
||||
import { BlockChain } from "@/components/chain/BlockChain"
|
||||
import { apiCecInfoAll, apiBindAccount } from "@/utils/marketplace"
|
||||
import { apiCecInfoAll, apiBindAccount, apiCecClaim } from "@/utils/marketplace"
|
||||
|
||||
|
||||
const localWalletStore = walletStore()
|
||||
@ -377,8 +388,9 @@ const getCecTotal = async () => {
|
||||
}
|
||||
|
||||
const isBindAccount = () => {
|
||||
console.log(cecInfo.value.bindUid)
|
||||
if(cecInfo.value.bindUid) {
|
||||
cecUserStatus.value = 2
|
||||
cecUserStatus.value = 3
|
||||
} else {
|
||||
cecUserStatus.value = 0
|
||||
}
|
||||
@ -460,6 +472,16 @@ const reqGetInfo = async () => {
|
||||
getCecTotal()
|
||||
}
|
||||
|
||||
// 领取
|
||||
const cecClaim = async () => {
|
||||
let res = await new BlockChain().claimAddress({})
|
||||
console.log(res.address)
|
||||
let walletToken = await new BlockChain().token()
|
||||
let token = marketplaceStore.fireToken || walletToken
|
||||
let res1 = await apiCecClaim(res.address, token)
|
||||
console.log(res1)
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
address.value = marketplaceStore.fireAddress || localWalletStore.address
|
||||
getCecTotal()
|
||||
@ -933,6 +955,15 @@ onMounted(() => {
|
||||
width: 283px;
|
||||
text-align: left;
|
||||
}
|
||||
.claim-btn {
|
||||
span {
|
||||
color: #fff;
|
||||
padding: 10px;
|
||||
border: 1px solid #31FFF3;
|
||||
border-radius: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1070,6 +1101,11 @@ onMounted(() => {
|
||||
margin: 0 40px;
|
||||
}
|
||||
}
|
||||
.padding-top {
|
||||
h3 {
|
||||
padding-top: 10px;
|
||||
}
|
||||
}
|
||||
.body-box-con {
|
||||
p {
|
||||
width: 747px;
|
||||
@ -1170,6 +1206,9 @@ onMounted(() => {
|
||||
margin-left: 40px;
|
||||
}
|
||||
}
|
||||
.font-size-14 {
|
||||
font-size: 15px;
|
||||
}
|
||||
&:nth-child(3) {
|
||||
// margin-top: 10px;
|
||||
}
|
||||
@ -1244,6 +1283,31 @@ onMounted(() => {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.center {
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
a {
|
||||
margin-top: 20px !important;
|
||||
color: #00f0ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
.margin-top-20 {
|
||||
margin-top: 20px;
|
||||
p {
|
||||
margin: -0px auto !important;
|
||||
}
|
||||
}
|
||||
.margin-20 {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 30px;
|
||||
p {
|
||||
margin: -0px auto !important;
|
||||
}
|
||||
}
|
||||
.margin-top {
|
||||
margin-top: 10px !important;
|
||||
}
|
||||
.body-box-find {
|
||||
p {
|
||||
|
@ -47,12 +47,25 @@
|
||||
</div>
|
||||
<div class="content-tips-link">
|
||||
<div>
|
||||
<file-text-outlined />
|
||||
<a :href="instructionLink" target="_blank">Instruction</a>
|
||||
<!-- <file-text-outlined />
|
||||
<a :href="instructionLink" target="_blank">Instruction</a> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-times">
|
||||
<div class="content-time-top" @click="connectLogin">
|
||||
<li>
|
||||
<div class="left">
|
||||
<div>
|
||||
<img src="@/assets/img/cec_claim/CEC_ICON.png" alt="">
|
||||
</div>
|
||||
<span>Claim to your wallet</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<span>Starts Sep 9 at 00:00 UTC</span>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
<div class="content-time-btm">
|
||||
<li>
|
||||
<div class="left left-hover">
|
||||
<div>
|
||||
@ -62,7 +75,7 @@
|
||||
<span>0 gas</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<span>Aug 30, 06:00 - Sep 5, 06:00 UTC </span>
|
||||
<span>Closed</span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
@ -71,18 +84,6 @@
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
<!-- <div class="content-time-line"></div> -->
|
||||
<div class="content-time-btm">
|
||||
<li>
|
||||
<div class="left">
|
||||
<div></div>
|
||||
<span>Claim to your wallet</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<span>Coming soon</span>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" v-else-if="address && cecUserStatus == -2">
|
||||
@ -94,14 +95,27 @@
|
||||
</div>
|
||||
<div class="content-tips-link">
|
||||
<div class="padding-right-15">
|
||||
<file-text-outlined />
|
||||
<a :href="instructionLink" target="_blank">Instruction</a>
|
||||
<!-- <file-text-outlined />
|
||||
<a :href="instructionLink" target="_blank">Instruction</a> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-time">
|
||||
<div class="content-times">
|
||||
<div class="content-time-top">
|
||||
<li>
|
||||
<div class="left">
|
||||
<div>
|
||||
<img src="@/assets/img/cec_claim/CEC_ICON.png" alt="">
|
||||
</div>
|
||||
<span>Claim to your wallet</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<span>Starts Sep 9 at 00:00 UTC</span>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
<div class="content-time-btm">
|
||||
<li>
|
||||
<div class="left left-hover">
|
||||
<div>
|
||||
<img src="@/assets/img/cec_claim/Bitgetlogo.png" alt="">
|
||||
</div>
|
||||
@ -109,7 +123,7 @@
|
||||
<span>0 gas</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<span>Aug 30, 06:00 - Sep 5, 06:00 UTC </span>
|
||||
<span>Closed</span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
@ -118,35 +132,39 @@
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
<div class="content-time-line"></div>
|
||||
<div class="content-time-btm">
|
||||
<li>
|
||||
<div class="left">
|
||||
<div></div>
|
||||
<span>Claim to your wallet</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<span>Coming soon</span>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" v-else-if="cecUserStatus == -1">
|
||||
<div class="content-tips content-tips-login">
|
||||
<span>Address:</span> {{address}}
|
||||
</div>
|
||||
<div class="content-tips content-tips-login">
|
||||
<span>You can currently pre-deposit to Bitget</span>
|
||||
</div>
|
||||
<!-- <div class="content-tips content-tips-login" v-if="cecInfo.bindUid">
|
||||
<span>You'll receive your $CEC airdrop in Bitget spot account before the listing time.</span>
|
||||
</div> -->
|
||||
<div class="content-tips-link">
|
||||
<div>
|
||||
<file-text-outlined />
|
||||
<a :href="instructionLink" target="_blank">Instruction</a>
|
||||
<!-- <file-text-outlined />
|
||||
<a :href="instructionLink" target="_blank">Instruction</a> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-times">
|
||||
<div class="content-time-top " @click="isBindAccount">
|
||||
<div class="content-time-top" @click="isEoaWallet">
|
||||
<li>
|
||||
<div class="left">
|
||||
<div>
|
||||
<img src="@/assets/img/cec_claim/CEC_ICON.png" alt="">
|
||||
</div>
|
||||
<span>Claim to your wallet</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<!-- <div class="right claim-btn" @click="cecClaim">Claim</div> -->
|
||||
<span>Starts Sep 9 at 00:00 UTC</span>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</div>
|
||||
<!-- <div class="content-time-line"></div> -->
|
||||
<div class="content-time-btm">
|
||||
<li>
|
||||
<div class="left">
|
||||
<div>
|
||||
@ -156,7 +174,7 @@
|
||||
<span>0 gas</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<span>Aug 30, 06:00 - Sep 5, 06:00 UTC </span>
|
||||
<span>Closed</span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
@ -165,35 +183,22 @@
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
<!-- <div class="content-time-line"></div> -->
|
||||
<div class="content-time-btm">
|
||||
<li>
|
||||
<div class="left">
|
||||
<div></div>
|
||||
<span>Claim to your wallet</span>
|
||||
</div>
|
||||
<div class="right">
|
||||
<!-- <div class="right claim-btn" @click="cecClaim"> -->
|
||||
<span>Coming soon</span>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" v-else>
|
||||
<div class="content-title">
|
||||
<div class="content-title-left">
|
||||
<!-- <div class="content-title-left">
|
||||
<div class="content-title-logo">
|
||||
<img src="@/assets/img/cec_claim/Bitgetlogo.png" alt="">
|
||||
</div>
|
||||
<p>Deposit to Bitget</p>
|
||||
<div class="free">0 gas</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="content-title-right">
|
||||
<div class="content-tips-link">
|
||||
<div>
|
||||
<file-text-outlined />
|
||||
<a :href="instructionLink" target="_blank">Instruction</a>
|
||||
<!-- <file-text-outlined />
|
||||
<a :href="instructionLink" target="_blank">Instruction</a> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -201,33 +206,37 @@
|
||||
<div class="content-body">
|
||||
<div class="content-body-header">
|
||||
<div class="content-body-header-left">
|
||||
<span v-if="cecUserStatus == 0">Grab a share of 1,000,000 $CEC</span>
|
||||
<!-- <span v-if="cecUserStatus == 0">Grab a share of 1,000,000 $CEC</span> -->
|
||||
</div>
|
||||
<div class="content-body-header-right">
|
||||
Aug 30, 06:00 - Sep 5, 06:00 UTC
|
||||
Starts Sep 9 at 00:00 UTC
|
||||
</div>
|
||||
</div>
|
||||
<div class="content-body-box">
|
||||
<!-- 3 -->
|
||||
<!-- 3 claim 等待 -->
|
||||
<div v-if="cecUserStatus == 3">
|
||||
<div class="body-box-title padding-top">
|
||||
<h3><span>{{Number(cecInfo.available) == 0 ? 0 : priceCalculated(cecInfo.available,18).toString().match(/^\d+(?:\.\d{0,2})?/)[0]}}</span> $CEC deposit to Bitget in progress</h3>
|
||||
<h3><span>{{Number(cecInfo.available) == 0 ? 0 : priceCalculated(cecInfo.available,18).toString().match(/^\d+(?:\.\d{0,2})?/)[0]}}</span> $CEC claimed to your address in progress</h3>
|
||||
</div>
|
||||
<div class="body-box-con margin-top-20">
|
||||
<p>Well done! You're all set!</p>
|
||||
<p>Well done! check the progress on Bscscan</p>
|
||||
</div>
|
||||
<div class="body-box-con margin-20">
|
||||
<p>You'll receive your $CEC airdrop in Bitget spot account before the listing time.</p>
|
||||
<!-- <p>check the progress on Bscscan</p> -->
|
||||
</div>
|
||||
|
||||
<!-- <div class="body-box-btn margin-top-20">
|
||||
<p class="center"></p>
|
||||
</div> -->
|
||||
<div class="body-box-btn margin-top">
|
||||
<p class="center">Jump to<a href="https://www.bitget.com/support/articles/12560603814979?utmSource=Twitter_CEC" target="_blank"> Bitget Launchpool</a> and grab your share of 11M $CEC now!</p>
|
||||
<p class="center">· Stake at<a href="https://www.bitget.com/events/poolx/1215863452934230016" target="_blank"> Bitget Pool X</a> to grab your share of 900k $CEC.</p>
|
||||
</div>
|
||||
<div class="body-box-btn margin-top">
|
||||
<p class="center">
|
||||
· Subscribe to CEC on <a href="" target="_blank"><span>Bing X</span></a>, Earn Up to 500% APR.
|
||||
</p>
|
||||
</div>
|
||||
<div class="body-box-btn">
|
||||
<p><a @click="cecUserStatus = 4">Cancel the Pre-Deposit to Bitget</a></p>
|
||||
<!-- <p><a @click="cecUserStatus = 4">Cancel the Pre-Deposit to Bitget</a></p> -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- 4 是否取消绑定交易所 -->
|
||||
@ -244,47 +253,46 @@
|
||||
<div class="no" @click="cecUserStatus = 3">No</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 5 取消绑定成功 -->
|
||||
<!-- 5 claim 成功 -->
|
||||
<div v-if="cecUserStatus == 5">
|
||||
<div class="body-box-title">
|
||||
<!-- <h3><span>{{ Number(cecInfo.available) == 0 ? 0 : priceCalculated(cecInfo.available,18).toString().match(/^\d+(?:\.\d{0,2})?/)[0] }}</span> $CEC deposit to Bitget in progress</h3> -->
|
||||
<!-- <span>Cancellation successful</span> -->
|
||||
<div class="body-box-title padding-top">
|
||||
<h3><span>{{Number(cecInfo.available) == 0 ? 0 : priceCalculated(cecInfo.available,18).toString().match(/^\d+(?:\.\d{0,2})?/)[0]}}</span> $CEC successfully claimed</h3>
|
||||
</div>
|
||||
<div class="body-box-con">
|
||||
<h5>Cancellation successful</h5>
|
||||
<div class="body-box-content">
|
||||
<li>
|
||||
<h5>Receiving Address :</h5>
|
||||
</li>
|
||||
<p>{{ claimMyAddress || address }}</p>
|
||||
<p class="center">· Stake at<a href="https://www.bitget.com/events/poolx/1215863452934230016" target="_blank"> <a> Bitget Pool X</a></a> to grab your share of 900k $CEC.</p>
|
||||
<p class="center">
|
||||
· Subscribe to CEC on <a href="" target="_blank"><span>Bing X</span></a>, Earn Up to 500% APR.
|
||||
</p>
|
||||
</div>
|
||||
<div class="body-box-btn">
|
||||
<div @click="reqGetInfo">OK</div>
|
||||
<!-- <p><a @click="cecUserStatus = 4">Cancel the Pre-Deposit to Bitget</a></p> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 2 回显交易所绑定信息 -->
|
||||
<div v-if="cecUserStatus == 2">
|
||||
<div class="body-box-title">
|
||||
<h4>Confirm withdrawal of <span>{{Number(cecInfo.available) == 0 ? 0 : priceCalculated(cecInfo.available,18).toString().match(/^\d+(?:\.\d{0,2})?/)[0]}}</span> $CEC</h4>
|
||||
<h4>Confirm claim of <span>{{Number(cecInfo.available) == 0 ? 0 : priceCalculated(cecInfo.available,18).toString().match(/^\d+(?:\.\d{0,2})?/)[0]}}</span> $CEC</h4>
|
||||
</div>
|
||||
<div class="body-box-con">
|
||||
<li>
|
||||
<!-- <li>
|
||||
<h5>Bitget UID :</h5>
|
||||
<span>{{ cecInfo.bindUid }}</span>
|
||||
</li> -->
|
||||
<li>
|
||||
<h5>Receiving Address :</h5>
|
||||
<span>{{ claimMyAddress || address }}</span>
|
||||
</li>
|
||||
<li>
|
||||
<h5>Deposit Address :</h5>
|
||||
<span>{{ cecInfo.bindAddress }}</span>
|
||||
</li>
|
||||
<li>
|
||||
<div class="font-size-14">You may not receive your airdrop in Bitget if your UID, deposit address is not correct or doesn't exist</div>
|
||||
</li>
|
||||
<li>
|
||||
<h6>KYC passed only</h6>
|
||||
</li>
|
||||
<li>
|
||||
<div>It's required to comlete the identity verification to become eligible to deposit to Bitget</div>
|
||||
<div class="font-size-14">You will use this address to receive $CEC and to pay for gas</div>
|
||||
</li>
|
||||
</div>
|
||||
<div class="body-box-btn">
|
||||
<div @click="cecUserStatus = 3">Confirm</div>
|
||||
<span @click="cecUserStatus = 1">Back</span>
|
||||
<div @click="cecClaim">Claim</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div>
|
||||
@ -292,13 +300,13 @@
|
||||
<!-- 0 是否绑定交易所 -->
|
||||
<div v-if="cecUserStatus == 0">
|
||||
<div class="body-box-title">
|
||||
<h3>Do you have a Bitget exchange account?</h3>
|
||||
<h3>Connect the receiving wallet and use it to pay for gas</h3>
|
||||
</div>
|
||||
<div class="body-box-con">
|
||||
<p class="toBitget"><a href="https://bitget.onelink.me/XqvW?af_xp=custom&pid=Counterfire" target="_blank">No, click to create</a></p>
|
||||
<!-- <p class="toBitget"><a href="https://bitget.onelink.me/XqvW?af_xp=custom&pid=Counterfire" target="_blank">No, click to create</a></p> -->
|
||||
</div>
|
||||
<div class="body-box-btn">
|
||||
<div @click="cecUserStatus = 1">Yes, i have it</div>
|
||||
<div @click="connectWallet">Connect</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 1 绑定交易所 -->
|
||||
@ -329,16 +337,20 @@
|
||||
</div>
|
||||
<!-- ------------------------------------------------------------------------ -->
|
||||
</div>
|
||||
|
||||
<div ref="claimLogModal">
|
||||
<a-modal :class="'claimLogModal'" :getContainer="() => $refs.claimLogModal" v-model:open="claimLogDialogVisible" :closable="false" :footer="null" :maskClosable="false">
|
||||
<div class="log-title">Cec claim</div>
|
||||
<!-- <div class="log-title">Cec claim</div> -->
|
||||
<div class="closable" @click="claimLogDialogVisible = false">
|
||||
<img src="@/assets/img/marketplace/Close_counter.png" alt="">
|
||||
</div>
|
||||
<div class="log-content"></div>
|
||||
<div class="log-content">
|
||||
<h1>Under maintenance</h1>
|
||||
</div>
|
||||
</a-modal>
|
||||
</div>
|
||||
<!-- <div ref="maintainModal">
|
||||
|
||||
</div> -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -346,13 +358,16 @@
|
||||
import { ref, toRefs, toRaw, onMounted, computed, watch, inject} from "vue"
|
||||
const message = inject('$message')
|
||||
import { FileTextOutlined } from '@ant-design/icons-vue';
|
||||
import LoadingDialog from "@/components/Dialogs/loadingDialog.vue";
|
||||
|
||||
import { priceCalculated } from "@/configs/priceCalculate"
|
||||
import {switchEthereumChain} from "@/components/chain/utils"
|
||||
import {walletStore} from "@/store/wallet";
|
||||
import { useMarketplaceStore } from "@/store/marketplace"
|
||||
import { BlockChain } from "@/components/chain/BlockChain"
|
||||
import { apiCecInfoAll, apiBindAccount, apiCecClaim } from "@/utils/marketplace"
|
||||
|
||||
import ConfirmDialog from "@/components/Dialogs/confirmDialog.vue";
|
||||
import {createModal} from "@/utils/model.util";
|
||||
|
||||
const localWalletStore = walletStore()
|
||||
const marketplaceStore = useMarketplaceStore()
|
||||
@ -361,7 +376,7 @@ const claimLogDialogVisible = ref(false)
|
||||
const address = ref()
|
||||
const tradeId = ref()
|
||||
const tradeAddress = ref()
|
||||
const cecUserStatus = ref(0) // -2 没有cec -1 登陆后 0 是否绑定交易所 1 绑定账号 2 账号回显 3 绑定成功提示 4 是否取消绑定 5 取消绑定成功
|
||||
const cecUserStatus = ref(-1) // -2 没有cec -1 登陆后 0 获取claim地址 2 账号回显 3 绑定成功提示 4 是否取消绑定 5 取消绑定成功
|
||||
const cecInfo = ref({
|
||||
available: 0,
|
||||
bindAddress: '',
|
||||
@ -378,22 +393,27 @@ const getCecTotal = async () => {
|
||||
let token = marketplaceStore.fireToken || localWalletStore.token
|
||||
let data = await apiCecInfoAll(address.value, token)
|
||||
cecInfo.value = data.data
|
||||
if(data.data.available == 0 || data.data.available == '0') {
|
||||
cecUserStatus.value = -2
|
||||
if(data.data.bindUid) {
|
||||
if(data.data.available == 0 || data.data.available == '0') {
|
||||
cecUserStatus.value = -2
|
||||
} else {
|
||||
cecUserStatus.value = -1
|
||||
}
|
||||
} else {
|
||||
cecUserStatus.value = -1
|
||||
if(data.data.available == 0 || data.data.available == '0') {
|
||||
cecUserStatus.value = -2
|
||||
} else {
|
||||
cecUserStatus.value = -1
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const isBindAccount = () => {
|
||||
console.log(cecInfo.value.bindUid)
|
||||
if(cecInfo.value.bindUid) {
|
||||
cecUserStatus.value = 3
|
||||
} else {
|
||||
cecUserStatus.value = 0
|
||||
}
|
||||
const getCecInfo = async () => {
|
||||
let token = marketplaceStore.fireToken || localWalletStore.token
|
||||
let data = await apiCecInfoAll(address.value, token)
|
||||
cecInfo.value = data.data
|
||||
}
|
||||
|
||||
|
||||
@ -472,14 +492,95 @@ const reqGetInfo = async () => {
|
||||
getCecTotal()
|
||||
}
|
||||
|
||||
const claimMyAddress = ref()
|
||||
const claimMyProvider = ref()
|
||||
// 获取钱包地址
|
||||
const connectWallet = async () => {
|
||||
const disabledArr = [3, 5, localWalletStore.walletType]
|
||||
const chainId = parseInt(import.meta.env.VUE_APP_NET_ID_CLAIM);
|
||||
const subTitle = 'Use this wallet to reciveing $CEC and pay gas.'
|
||||
const { provider, address } = await new BlockChain().ClaimSelectAddress({subTitle: subTitle,targetChainId: chainId, disabled: disabledArr})
|
||||
if(address) {
|
||||
claimMyProvider.value = provider
|
||||
claimMyAddress.value = address
|
||||
cecUserStatus.value = 2
|
||||
}
|
||||
}
|
||||
|
||||
const isEoaWallet = () => {
|
||||
if(localWalletStore.walletType == 1 || localWalletStore.walletType == 2 || localWalletStore.walletType == 4) {
|
||||
cecUserStatus.value = 2
|
||||
} else {
|
||||
cecUserStatus.value = 0
|
||||
}
|
||||
}
|
||||
|
||||
// 领取
|
||||
const cecClaim = async () => {
|
||||
let res = await new BlockChain().claimAddress({})
|
||||
console.log(res.address)
|
||||
if(localWalletStore.walletType == 1 || localWalletStore.walletType == 2 || localWalletStore.walletType ==4) {
|
||||
walletClaim()
|
||||
} else {
|
||||
let walletToken = await new BlockChain().token()
|
||||
let token = marketplaceStore.fireToken || walletToken
|
||||
let address = claimMyAddress.value
|
||||
let provider = toRaw(claimMyProvider.value)
|
||||
try {
|
||||
cecUserStatus.value = 3
|
||||
let res = await new BlockChain().claim.cecClaim(provider,address, token)
|
||||
if(res) {
|
||||
getCecInfo()
|
||||
cecUserStatus.value = 5
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e.message)
|
||||
cecUserStatus.value = 2
|
||||
if(e.message.indexOf("User denied transaction signature") > -1) {
|
||||
message.error("User rejected the request");
|
||||
} else if(e.message.indexOf("reject") > -1){
|
||||
message.error("User rejected the request");
|
||||
} else if(e.message.indexOf("User denied request signature") > -1){
|
||||
message.error("User rejected the request");
|
||||
} else {
|
||||
message.error("Claim fail.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// let walletToken = await new BlockChain().token()
|
||||
// let token = marketplaceStore.fireToken || walletToken
|
||||
// let res1 = await apiCecClaim(res.address, token)
|
||||
}
|
||||
|
||||
// wallet eaoCecClaim
|
||||
const walletClaim = async () => {
|
||||
let walletToken = await new BlockChain().token()
|
||||
let token = marketplaceStore.fireToken || walletToken
|
||||
let res1 = await apiCecClaim(res.address, token)
|
||||
console.log(res1)
|
||||
let address = claimMyAddress.value || localWalletStore.address
|
||||
let provider = toRaw(claimMyProvider.value) || new BlockChain().eoaProvider
|
||||
let disabledArr = [1,2,3,4,5]
|
||||
const filteredArray = disabledArr.filter(item => item !== localWalletStore.walletType)
|
||||
try {
|
||||
cecUserStatus.value = 3
|
||||
let res = await new BlockChain().claim.eaoCecClaim(token,filteredArray)
|
||||
if(res) {
|
||||
getCecInfo()
|
||||
cecUserStatus.value = 5
|
||||
}
|
||||
} catch(e) {
|
||||
console.log(e.message)
|
||||
cecUserStatus.value = 2
|
||||
if(e.message.indexOf("User denied transaction signature") > -1) {
|
||||
message.error("User rejected the request");
|
||||
} else if(e.message.indexOf("reject") > -1){
|
||||
message.error("User rejected the request");
|
||||
} else if(e.message.indexOf("User denied request signature") > -1){
|
||||
message.error("User rejected the request");
|
||||
} else {
|
||||
message.error("Claim fail.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
@ -842,18 +943,85 @@ onMounted(() => {
|
||||
box-sizing: border-box;
|
||||
color: #fff;
|
||||
.content-time-top {
|
||||
background: url('@/assets/img/cec_claim/Counterfire_mbg02.png') no-repeat;
|
||||
background: url('@/assets/img/cec_claim/Counterfire_mbg01.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
height: 100px;
|
||||
padding: 10px 20px 0 20px;
|
||||
cursor: pointer;
|
||||
li {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 20px;
|
||||
font-size: 18px;
|
||||
font-family: 'Poppins';
|
||||
// color: #8d8598;
|
||||
.left {
|
||||
// margin-left: 60px;
|
||||
width: 390px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: 20px;
|
||||
font-family: "Poppins";
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
div {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
margin-right: 10px;
|
||||
overflow: hidden;
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
.right {
|
||||
width: 283px;
|
||||
text-align: right;
|
||||
span {
|
||||
padding-right: 40px;
|
||||
}
|
||||
.claim-btn {
|
||||
padding: 5px 20px;
|
||||
border-radius: 20px;
|
||||
color: #000;
|
||||
background: #fec25d;
|
||||
margin-right: 40px;
|
||||
}
|
||||
}
|
||||
.claim-btn {
|
||||
span {
|
||||
color: #fff;
|
||||
padding: 10px;
|
||||
border: 1px solid #31FFF3;
|
||||
border-radius: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
&:hover {
|
||||
background: url('@/assets/img/cec_claim/Counterfire_mbg01.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
}
|
||||
.content-time-line {
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
background: #44375c;
|
||||
}
|
||||
.content-time-btm {
|
||||
padding-top: 10px;
|
||||
li {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
color: #8e8497;
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 380px;
|
||||
padding-left: 40px;
|
||||
div {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
@ -873,7 +1041,7 @@ onMounted(() => {
|
||||
span {
|
||||
display: inline-block;
|
||||
color: #000;
|
||||
background: #31FFF3;
|
||||
background: #8e8497;
|
||||
font-size: 12px;
|
||||
font-family: "Poppins";
|
||||
padding: 0 5px;
|
||||
@ -892,6 +1060,7 @@ onMounted(() => {
|
||||
span {
|
||||
font-weight: 700;
|
||||
font-size: 16px;
|
||||
padding-right: 60px;
|
||||
}
|
||||
.tips {
|
||||
position: relative;
|
||||
@ -929,42 +1098,7 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
}
|
||||
&:hover {
|
||||
background: url('@/assets/img/cec_claim/Counterfire_mbg01.png') no-repeat;
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
}
|
||||
.content-time-line {
|
||||
width: 100%;
|
||||
height: 2px;
|
||||
background: #44375c;
|
||||
}
|
||||
.content-time-btm {
|
||||
li {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 20px;
|
||||
font-size: 18px;
|
||||
font-family: 'Poppins';
|
||||
color: #8d8598;
|
||||
.left {
|
||||
margin-left: 60px;
|
||||
width: 390px;
|
||||
}
|
||||
.right {
|
||||
width: 283px;
|
||||
text-align: left;
|
||||
}
|
||||
.claim-btn {
|
||||
span {
|
||||
color: #fff;
|
||||
padding: 10px;
|
||||
border: 1px solid #31FFF3;
|
||||
border-radius: 20px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
.content-title {
|
||||
@ -1258,9 +1392,11 @@ onMounted(() => {
|
||||
}
|
||||
span {
|
||||
display: inline-block;
|
||||
width: 118px;
|
||||
// width: 118px;
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
padding: 0px 10px;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
background: rgba(30,27,38,0);
|
||||
border-radius: 21px;
|
||||
@ -1293,6 +1429,32 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
}
|
||||
.body-box-content {
|
||||
width: 450px;
|
||||
margin: 0 auto;
|
||||
padding-left: 40px;
|
||||
font-size: 14px;
|
||||
font-family: 'Poppins';
|
||||
li {
|
||||
margin-top: 20px;
|
||||
}
|
||||
p {
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
.center {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 0;
|
||||
span {
|
||||
font-size: 14px;
|
||||
color: #47bcff;
|
||||
text-decoration-line: underline;
|
||||
}
|
||||
a {
|
||||
color: #7EFDFF;
|
||||
text-decoration-line: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
.margin-top-20 {
|
||||
margin-top: 20px;
|
||||
p {
|
||||
@ -1306,8 +1468,41 @@ onMounted(() => {
|
||||
margin: -0px auto !important;
|
||||
}
|
||||
}
|
||||
.text-center {
|
||||
text-align: left;
|
||||
.center {
|
||||
text-align: left !important;
|
||||
a {
|
||||
font-size: 14px;
|
||||
color: #7EFDFF;
|
||||
span {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0px;
|
||||
color: #47bcff;
|
||||
text-decoration-line: underline;
|
||||
}
|
||||
a {
|
||||
color: #7EFDFF;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.margin-top {
|
||||
margin-top: 10px !important;
|
||||
.center {
|
||||
text-align: left !important;
|
||||
a {
|
||||
span {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 14px;
|
||||
border: 0px;
|
||||
color: #47bcff;
|
||||
text-decoration-line: underline;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.body-box-find {
|
||||
p {
|
||||
@ -1434,7 +1629,7 @@ onMounted(() => {
|
||||
}
|
||||
:deep(.claimLogModal) {
|
||||
width: 1052px !important;
|
||||
height: 714px;
|
||||
height: 314px;
|
||||
background: #1A1821;
|
||||
box-shadow: 0px 15px 28px 3px rgba(22,22,22,0.13);
|
||||
border-radius: 100px;
|
||||
@ -1466,7 +1661,14 @@ onMounted(() => {
|
||||
}
|
||||
}
|
||||
.log-content {
|
||||
min-height: 510px;
|
||||
min-height: 310px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-family: 'Anton';
|
||||
font-weight: 400;
|
||||
font-size: 48px;
|
||||
color: #FFFFFF;
|
||||
.log-header {
|
||||
display: flex;
|
||||
li {
|
||||
|
Loading…
x
Reference in New Issue
Block a user