Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async run() {
const { args } = this.parse(GetMetadata)
const address = args.address
const accounts = await this.kit.contracts.getAccounts()
const metadataURL = await accounts.getMetadataURL(address)
if (!metadataURL) {
console.info('No metadata set for address')
return
}
try {
const metadata = await IdentityMetadataWrapper.fetchFromURL(metadataURL)
console.info('Metadata contains the following claims: \n')
displayMetadata(metadata)
} catch (error) {
console.error('Metadata could not be retrieved from ', metadataURL)
}
}
}
lst.forEach(async (a) => {
try {
const url = await accounts.getMetadataURL(a)
console.log(a, 'has url', url)
let metadata: IdentityMetadataWrapper
if (url == '') metadata = IdentityMetadataWrapper.fromEmpty(a)
else metadata = await IdentityMetadataWrapper.fetchFromURL(url)
processClaims(kit, a, metadata)
} catch (err) {
console.error('Bad address', a, err.toString())
}
})
}