|
|
@ -24,7 +24,7 @@ const getFullUrl = (dmn: string) => `http://${dmn}` |
|
|
|
interface UpsertDmnParams { |
|
|
|
interface UpsertDmnParams { |
|
|
|
available: boolean |
|
|
|
available: boolean |
|
|
|
walletAddress?: string |
|
|
|
walletAddress?: string |
|
|
|
tonBalance?: number |
|
|
|
tonBalance?: string |
|
|
|
} |
|
|
|
} |
|
|
|
const upsertDmn = async ( |
|
|
|
const upsertDmn = async ( |
|
|
|
dmn: string, |
|
|
|
dmn: string, |
|
|
@ -107,8 +107,10 @@ const fetchDomainInfo = async (url: string) => { |
|
|
|
address, |
|
|
|
address, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
console.log('There is no domain info ofr', url) |
|
|
|
return null |
|
|
|
return null |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
|
|
|
|
console.log('Failed fetch domain info for', url,e) |
|
|
|
return null |
|
|
|
return null |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -134,7 +136,7 @@ const main = async () => |
|
|
|
.then(async (dmn) => { |
|
|
|
.then(async (dmn) => { |
|
|
|
const domainInfo = await fetchDomainInfo(dmn) |
|
|
|
const domainInfo = await fetchDomainInfo(dmn) |
|
|
|
console.log("success dmn", dmn) |
|
|
|
console.log("success dmn", dmn) |
|
|
|
upsertDmn(dmn, {available: true, walletAddress:domainInfo?.address,tonBalance:domainInfo?.balance}) |
|
|
|
upsertDmn(dmn, {available: true, walletAddress:domainInfo?.address, tonBalance:domainInfo?.balance}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
.catch((dmn) => { |
|
|
|
.catch((dmn) => { |
|
|
|
upsertDmn(dmn, {available: false}) |
|
|
|
upsertDmn(dmn, {available: false}) |
|
|
|