Upload Reference Material To Arweave and Mint
Last updated
Was this helpful?
Last updated
Was this helpful?
Uploading reference material to permanent storage through the is easy. This makes including minting functionality on your app a breeze by abstracting away the permanent metadata storage! This guide will walk you through it.
...To be added For now, this functionality is temporarily not restricted by an API key
or
This example accepts a file via input and then creates a metadata object in which it is contained. It then calls the storage method uploadReference,
receiving a JSON argument resulting in an upload of the reference to arweave.
The neat trick here is that within this JSON object, you can have certain fields containing files (media, document, animation_url) and these will also get permanently uploaded! If you want to learn more about how permanent storage and metadata work check out the
When a result is returned the payload will contain an id field. When this is appended to the https://arweave.net/ base URI we will have a link to a permanently stored JSON containing our also permanently stored media!
In this snippet, we are getting an instance of the connected wallet and constructing a Mint method call object, and supplying them both to the execute command.
The Arweave URL that we previously generated should be passed into the reference field. More in-depth information relating to the fields can be found in the documentation.
With all this done you should now be able to mint tokens from the uploaded reference material!
Now that we have a link to the permanently stored file we can proceed to make the contract call. If you haven't deployed a contract yet check out our guide on or reference the .
For more information on how to mint through a call to your very own token contract check out and the .