diff --git a/internal/parsers/tzip/tokens/metadata.go b/internal/parsers/tzip/tokens/metadata.go index 115ec0621..33259151f 100644 --- a/internal/parsers/tzip/tokens/metadata.go +++ b/internal/parsers/tzip/tokens/metadata.go @@ -225,8 +225,14 @@ func (m *TokenMetadata) Merge(second *TokenMetadata) { func getStringArrayKey(data map[string]interface{}, keyName string) []string { if val, ok := data[keyName]; ok { delete(data, keyName) - if s, ok := val.([]string); ok { - return s + if s, ok := val.([]interface{}); ok { + arr := make([]string, 0) + for i := range s { + if data, ok := s[i].(string); ok { + arr = append(arr, data) + } + } + return arr } } return nil diff --git a/internal/parsers/tzip/tokens/metadata_test.go b/internal/parsers/tzip/tokens/metadata_test.go index e2505b884..970d7ec95 100644 --- a/internal/parsers/tzip/tokens/metadata_test.go +++ b/internal/parsers/tzip/tokens/metadata_test.go @@ -215,6 +215,7 @@ func TestTokenMetadata_UnmarshalJSON(t *testing.T) { Decimals: int64Ptr(0), Description: "A most mysterious map has been discovered. Where it leads is uncertain, but an adventure lies ahead.", DisplayURI: "https://gateway.pinata.cloud/ipfs/QmPkJBaRnb2JwqA1S2sUQayTV9xT3x8MBnsmq7ForBWKuU", + Creators: []string{"test", "author"}, Extras: map[string]interface{}{ "nonTransferable": false, "symbolPreference": false, @@ -233,7 +234,8 @@ func TestTokenMetadata_UnmarshalJSON(t *testing.T) { "booleanAmount": false, "displayUri": "https://gateway.pinata.cloud/ipfs/QmPkJBaRnb2JwqA1S2sUQayTV9xT3x8MBnsmq7ForBWKuU", "defaultPresentation": "large", - "actionLabel": "Send" + "actionLabel": "Send", + "creators": ["test", "author"] }`), }, { name: "test ipfs 2",