Skip to main content
Version: Current

Struct Traits


_10
pub struct Traits {
_10
_10
pub let traits: [Trait]
_10
}

Wrapper view to return all the traits on an NFT. This is used to return traits as individual key/value pairs along with some contextualized data about each trait.

Initializer


_10
init(_: [Trait])

Functions

addTrait()


_10
fun addTrait(_: Trait)

Adds a single Trait to the Traits view

Parameters:

  • Trait : The trait struct to be added