add verification

This commit is contained in:
liangping 2023-12-15 16:13:56 +08:00
parent 64460a686c
commit 10d95e9d0b
3 changed files with 15 additions and 10 deletions

View File

@ -23,9 +23,9 @@ console.log("contract:", props.contract)
onMounted(() => {
console.log("mounted", `${baseurl}/deploy-histories/neutron-1?contract=${props.contract}`, chainId.value)
get(`${baseurl}/deploy-histories/${chainId.value}?contract=${props.contract}`).then((x) => {
console.log("x:", x)
// console.log("mounted", `${baseurl}/deploy-histories/neutron?contract=${props.contract}`, chainId.value)
get(`${baseurl}/deploy-histories/neutron?contract=${props.contract}`).then((x) => {
console.log("verification:", x)
verification.value = x
}).catch(e => {
console.error(e)
@ -36,17 +36,22 @@ function verify() {
const base = useBaseStore()
const id = base.latest?.block?.header?.chain_id || "unknown"
const data = {"contractAddress": props.contract, "chainId": "neutron"}
console.log(data)
const data = {"contractAddress": props.contract, "chainId": id}
post(`${baseurl}/verification/neutron`, data).then((x)=> {
console.log("x", x)
verification.value = x.result
})
}
</script>
<template>
<div class="bg-base-100 px-4 pt-3 pb-4 rounded mb-4 shadow">
<h2 class="card-title truncate w-full mt-4">Verification {{ chainId }}</h2>
<h2 class="card-title truncate w-full mt-4">Verification</h2>
<div><DynamicComponent :value="verification"/></div>
<button class="btn btn-primary" @click="verify">verify</button>
<div class="text-center">
<div v-if="Object.keys(verification).length == 0" >
<Icon icon="mdi:emoticon-sad-outline"></Icon>Haven't found verification
</div>
<button class="btn btn-primary mt-5" @click="verify">verify</button>
</div>
</div>
</template>

View File

@ -40,7 +40,7 @@ export async function post(url: string, data: any) {
// credentials: 'same-origin', // redirect: 'follow', // manual, *follow, error
// referrerPolicy: 'origin', // no-referrer, *no-referrer-when-downgrade, origin, origin-when-cross-origin, same-origin, strict-origin, strict-origin-when-cross-origin, unsafe-url
headers: {
'Content-Type': 'text/plain',
'Content-Type': 'application/json',
Accept: '*/*',
'Accept-Encoding': 'gzip, deflate, br',
},

View File

@ -202,7 +202,7 @@ const result = ref({});
<PaginationBar :limit="page.limit" :total="txs.pagination?.total" :callback="pageload" />
</div>
<WasmVerification v-if="contractAddress=='1'" :contract="contractAddress" class="hide"/>
<WasmVerification :contract="contractAddress"/>
<div>
<input type="checkbox" id="modal-contract-funds" class="modal-toggle" />