Added status check in .toml file handling

This commit is contained in:
AlexanderBuzz
2023-07-30 19:53:30 +02:00
parent 90b3feb943
commit 8bbccb9486

View File

@@ -57,6 +57,14 @@ async function verifyAccountDomain(accountData) {
const domain = convertHexToString(domainHex)
const tomlUrl = `https://${domain}/.well-known/xrp-ledger.toml`
const tomlResponse = await fetch(tomlUrl)
if (!tomlResponse.ok) {
return {
domain: domain,
verified: false
}
}
const tomlData = await tomlResponse.text()
const parsedToml = toml.parse(tomlData)
const tomlAccounts = parsedToml["ACCOUNTS"]