@ -627,14 +627,15 @@ class TokensDataStore {
} else {
var jsonDictionary = json
if let tokenObject = tokens . first ( where : { $0 . contractAddress . sameContract ( as : address ) } ) {
// W e m u s t m a k e s u r e t h e v a l u e s t o r e d i s a t l e a s t a n e m p t y s t r i n g , n e v e r n i l b e c a u s e w e n e e d t o d e s e r i a l i s e / d e c o d e i t
jsonDictionary [ " tokenId " ] = JSON ( tokenId )
jsonDictionary [ " contractName " ] = JSON ( tokenObject . name )
jsonDictionary [ " symbol " ] = JSON ( tokenObject . symbol )
jsonDictionary [ " name " ] = jsonDictionary [ " name " ]
jsonDictionary [ " imageUrl " ] = jsonDictionary [ " image " ]
jsonDictionary [ " thumbnailUrl " ] = jsonDictionary [ " image " ]
// W e m a k e s u r e t h e v a l u e s t o r e d i s a t l e a s t a n e m p t y s t r i n g , n e v e r n i l b e c a u s e w e n e e d t o d e s e r i a l i s e / d e c o d e i t
jsonDictionary [ " externalLink " ] = JSON ( jsonDictionary [ " external_url " ] . stringValue )
jsonDictionary [ " name " ] = JSON ( jsonDictionary [ " name " ] . stringValue )
jsonDictionary [ " imageUrl " ] = JSON ( jsonDictionary [ " image " ] . string ? ? jsonDictionary [ " image_url " ] . string ? ? " " )
jsonDictionary [ " thumbnailUrl " ] = jsonDictionary [ " imageUrl " ]
// P O A P t o k e n s ( h t t p s : / / b l o c k s c o u t . c o m / x d a i / m a i n n e t / a d d r e s s / 0 x 2 2 C 1 f 6 0 5 0 E 5 6 d 2 8 7 6 0 0 9 9 0 3 6 0 9 a 2 c C 3 f E f 8 3 B 4 1 5 / t r a n s a c t i o n s ) , e g . h t t p s : / / a p i . p o a p . x y z / m e t a d a t a / 2 5 0 3 / 2 7 8 5 6 9 , u s e ` h o m e _ u r l ` a s t h e k e y f o r w h a t t h e y s h o u l d u s e ` e x t e r n a l _ u r l ` f o r a n d t h e y u s e ` e x t e r n a l _ u r l ` t o p o i n t b a c k t o t h e t o k e n U R I
jsonDictionary [ " externalLink " ] = JSON ( jsonDictionary [ " home_url " ] . string ? ? jsonDictionary [ " external_url " ] . string ? ? " " )
}
if let jsonString = jsonDictionary . rawString ( ) {
return ( contract : address , json : jsonString )