Created
October 13, 2017 13:35
-
-
Save lukehedger/2a94c65b50b40b154a54daf9b51f8cc5 to your computer and use it in GitHub Desktop.
Download and process META-ID metadata signature from Swarm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web3.bzz.download(metadataAddress.slice(2)) | |
.then(rawMetadata => | |
Object.keys(rawMetadata).map(path => ({ | |
[`${path}`]: JSON.parse(rawMetadata[path].data.toString()) | |
})) | |
.reduce((o, v) => Object.assign({}, o, v), {}) | |
) | |
.then(metadata => console.log(metadata)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment