/// Set the extra1 field of the NearKart data structure.
/// 
/// This is used to store a comma separated list of unlocked decals.
///
/// # Arguments
///
/// * `token_id` - The id of the token update
/// * `extra1` - CSV string of unlocked decal ids
///
Set the extra1 field of the NearKart data structure.
This is used to store a comma separated list of unlocked decals.
Set the extra1 field of the NearKart data structure . This is used to store a comma separated list of unlocked decals .
fn near_kart_set_extra1(&mut self, token_id: TokenId, extra1: &String) {
        self.assert_nft_owner(token_id.clone());
        let lookup_map = self.tokens.token_metadata_by_id.as_mut().unwrap();
        let mut metadata = lookup_map.get(&token_id.to_string()).unwrap();
        let extra = metadata.extra.unwrap_or(String::from(""));
        let mut nk = NearKart::from_data(&extra);
        nk.extra1 = extra1.clone();
        let extra = nk.serialize();
        metadata.extra = Some(extra);
        lookup_map.insert(&token_id, &metadata);
    }
fn near_kart_set_extra1 ( & mut self , token_id : TokenId , extra1 : & String ) { self . assert_nft_owner ( token_id . clone ( ) ) ; let lookup_map = self . tokens . token_metadata_by_id . as_mut ( ) . unwrap ( ) ; let mut metadata = lookup_map . get ( & token_id . to_string ( ) ) . unwrap ( ) ; let extra = metadata . extra . unwrap_or ( String :: from ( " " ) ) ; let mut nk = NearKart :: from_data ( & extra ) ; nk . extra1 = extra1 . clone ( ) ; let extra = nk . serialize ( ) ; metadata . extra = Some ( extra ) ; lookup_map . insert ( & token_id , & metadata ) ; }
Set the extra1 field of the NearKart data structure.
Set the extra1 field of the NearKart data structure .
&mut self
token_id
TokenId
extra1
&String