Repository: safe-global/safe-config-service

Issue:
Add Currency Logo to the chains endpoint
The currency logo should be returned for each native currency in `GET /api/v1/chains/`

```javascript
"nativeCurrency": {
  ...
  "logoUrl" : <url-string>
}
```


Discussion:

Resolving patch:
diff --git a/src/chains/migrations/0007_chain_currency_logo_url.py b/src/chains/migrations/0007_chain_currency_logo_url.py
new file mode 100644
--- /dev/null
+++ b/src/chains/migrations/0007_chain_currency_logo_url.py
@@ -0,0 +1,21 @@
+# Generated by Django 3.2.5 on 2021-07-07 08:46
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ("chains", "0006_change_color_default_help_text"),
+    ]
+
+    operations = [
+        migrations.AddField(
+            model_name="chain",
+            name="currency_logo_url",
+            field=models.URLField(
+                default="https://cryptologos.cc/logos/ethereum-eth-logo.png"
+            ),
+            preserve_default=False,
+        ),
+    ]
diff --git a/src/chains/models.py b/src/chains/models.py
--- a/src/chains/models.py
+++ b/src/chains/models.py
@@ -20,6 +20,7 @@ class Chain(models.Model):
     currency_name = models.CharField(null=True, max_length=255)
     currency_symbol = models.CharField(max_length=255)
     currency_decimals = models.IntegerField(default=18)
+    currency_logo_url = models.URLField()
     transaction_service_url = models.URLField(null=True)
     theme_text_color = models.CharField(
         validators=[color_validator],
diff --git a/src/chains/serializers.py b/src/chains/serializers.py
--- a/src/chains/serializers.py
+++ b/src/chains/serializers.py
@@ -18,6 +18,7 @@ class CurrencySerializer(serializers.Serializer):
     name = serializers.CharField(source="currency_name")
     symbol = serializers.CharField(source="currency_symbol")
     decimals = serializers.IntegerField(source="currency_decimals")
+    logo_url = serializers.URLField(source="currency_logo_url")
 
 
 class ChainSerializer(serializers.ModelSerializer):


Test patch:
diff --git a/src/chains/tests/factories.py b/src/chains/tests/factories.py
--- a/src/chains/tests/factories.py
+++ b/src/chains/tests/factories.py
@@ -16,6 +16,7 @@ class Meta:
     currency_name = factory.Faker("cryptocurrency_name")
     currency_symbol = factory.Faker("cryptocurrency_code")
     currency_decimals = factory.Faker("pyint")
+    currency_logo_url = factory.Faker("url")
     transaction_service_url = factory.Faker("url")
     theme_text_color = factory.Faker("hex_color")
     theme_background_color = factory.Faker("hex_color")
diff --git a/src/chains/tests/test_views.py b/src/chains/tests/test_views.py
--- a/src/chains/tests/test_views.py
+++ b/src/chains/tests/test_views.py
@@ -32,6 +32,7 @@ def test_json_payload_format(self):
                         "name": chain.currency_name,
                         "symbol": chain.currency_symbol,
                         "decimals": chain.currency_decimals,
+                        "logoUrl": chain.currency_logo_url,
                     },
                     "transactionService": chain.transaction_service_url,
                     "theme": {
@@ -120,6 +121,7 @@ def test_json_payload_format(self):
                 "name": chain.currency_name,
                 "symbol": chain.currency_symbol,
                 "decimals": chain.currency_decimals,
+                "logoUrl": chain.currency_logo_url,
             },
             "transactionService": chain.transaction_service_url,
             "theme": {
@@ -157,6 +159,7 @@ def test_match(self):
                 "name": chain.currency_name,
                 "symbol": chain.currency_symbol,
                 "decimals": chain.currency_decimals,
+                "logo_url": chain.currency_logo_url,
             },
             "transaction_service": chain.transaction_service_url,
             "theme": {
@@ -186,6 +189,7 @@ def test_null_oracle_url_should_return_null_object(self):
                 "name": chain.currency_name,
                 "symbol": chain.currency_symbol,
                 "decimals": chain.currency_decimals,
+                "logo_url": chain.currency_logo_url,
             },
             "transaction_service": chain.transaction_service_url,
             "theme": {