Safe-react: Use safe-config-service to get the list of Safe Apps

Created on 11 May 2021  路  16Comments  路  Source: gnosis/safe-react

What is this feature about? (1 sentence)

Integrate with an endpoint which provides a list of Safe Apps to be shown.

Why is it needed? What is the value? For whom do we build it?

  • The main advantage of migrating to an endpoint which returns the list of safe apps currently listed is that it does not require a deployment from the react app or from a frontend package.

High-level overview of the feature

  • By calling GET /api/v1/safe-apps a list of safe apps is returned.
  • A Safe App might not have a provider associated with it (this is in line with the current payload that web consumes)
  • Endpoint is not paginated in the current state.
// collection of safe apps
[
    {
        "url": <string>,
        "name": <string>,
        "iconUrl": <string>,
        "description": <string>,
        "chainIds": [<uint>],
        "provider": { // optional
            "url": <string>,
            "name": <string>
        }
    }
]
  • A filter for a specific network is also available: eg.: GET /api/v1/safe-apps?network_id=2 returns a list of safe-apps which are available on network 2.

Error state

If the server responds with an error, show a Snackbar saying "Error fetching the Safe Apps, please refresh the page".

Feature 馃憫

Most helpful comment

Swagger for the service is now available under: https://safe-config.staging.gnosisdev.com

All 16 comments

Some notes from the grooming:

I think camel case is more in line with what we have in the other services so I'd change it on the service side. I'll sync with the Backend team regarding format.

I think camel case is more in line with what we have in the other services so I'd change it on the service side. I'll sync with the Backend team regarding format.

Created ticket to tackle this here: https://github.com/gnosis/safe-config-service/issues/64

@fmrsabino says it's deployed and you can ping him if needed.

Swagger for the service is now available under: https://safe-config.staging.gnosisdev.com

@katspaugh @juampibermani Small proposal for key change: networks would become chainIDs.

Reason is that the apps are published on a specific chain_id which might be the same as network_id. Eg.: Both Ethereum Classic and Ethereum share the same network_id (1) but have different chain_ids. In the context of where a safe-app is published, being published on Ethereum does not mean that it's published on Ethereum Classic (if we read it as network_id).

Thoughts?
A list of networks/chains is available here: https://chainid.network

Makes sense 馃憤

@katspaugh @juampibermani Change was merged: https://github.com/gnosis/safe-config-service/pull/78

And it's already deployed so you can test it on staging! 馃憤

Once you add a custom app, all the apps are saved to the localStorage.

@mikheevm why is it a bad thing per se?

Screenshot 2021-06-02 at 10 46 39

@katspaugh
The app gets duplicated if the URL changes, I've seen safes where there were 3 cards for the same app. Also, in my opinion, it doesn't make sense to store remote data on the client

@fmrsabino says we shouldn't merge this for now because the service isn't deployed to prod.

@fmrsabino says we shouldn't merge this for now because the service isn't deployed to prod.

Service is now deployed to production: https://safe-config.gnosis.io/

@francovenica please let me or @fmrsabino know if you need access to the Django admin for testing.

There is the link on the prepared test cases for the external list ( https://gno.testrail.io/index.php?/suites/view/40&group_by=cases:section_id&group_id=3488&group_order=asc&display_deleted_cases=0 - External Safe Apps list section) .
I will be really appreciated if you check it , provide feedback and answer on the opened questions
@dasanra , @katspaugh , @tschubotz , @fmrsabino and @francovenica

Open questions mainly about the safe app URL validation

The feature is reopened , as there are the issue in the linked PR

Was this page helpful?
0 / 5 - 0 ratings