Contract FungibleTokenMetadataViews
This contract implements the metadata standard proposed in FLIP-1087.
Ref: https://github.com/onflow/flips/blob/main/application/20220811-fungible-tokens-metadata.md
Structs and resources can implement one or more metadata types, called views. Each view type represents a different kind of metadata.
Structs & Resources
struct FTView
FTView wraps FTDisplay and FTVaultData, and is used to give a complete picture of a Fungible Token. Most Fungible Token contracts should implement this view.
struct FTDisplay
View to expose the information needed to showcase this FT. This can be used by applications to give an overview and graphics of the FT.
struct FTVaultData
View to expose the information needed store and interact with a FT vault. This can be used by applications to setup a FT vault with proper storage and public capabilities.
Functions
fun getFTView()
Helper to get a FT view.
Parameters:
- viewResolver : A reference to the resolver resource
Returns: A FTView struct
fun getFTDisplay()
Helper to get FTDisplay in a way that will return a typed optional.
Parameters:
- viewResolver : A reference to the resolver resource
Returns: An optional FTDisplay struct
fun getFTVaultData()
Helper to get FTVaultData in a way that will return a typed Optional.
Parameters:
- viewResolver : A reference to the resolver resource
Returns: A optional FTVaultData struct