Git Product home page Git Product logo

safe-config-service's People

Contributors

abhinavmsra avatar dependabot[bot] avatar fmrsabino avatar gmonty030 avatar hectorgomezv avatar iamacook avatar inomurko avatar jpalvarezl avatar mmv08 avatar moisses89 avatar rmeissner avatar schmanu avatar servroxsolutions avatar uxio0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

safe-config-service's Issues

Restrict chain theme colours to RRGGBB

For improved compatibility between the data stored in the config service and the clients that will consume the theme payload (web, iOS, Android), we should remove the Alpha channel support from the color formats of theme.

Format JSON keys in camel case

Endpoints consumed by the clients should have the JSON keys in camel case. By having them camel case, it follows the formatting that we have in other services.

Add public Transaction Service URL

In addition to the current chain information, in order for the client gateway and the clients to use the services provided by the Safe Transaction Service, the transaction service url should also be returned:

{
   "chainId": <stringified-int>,
   ...
   "transactionService" : <url-string> // optional 
}

Add theme information to the chain endpoint

Frontend clients have a theming option for each L2 chain. This information should be stored and retrieved with /api/v1/chains so that clients can render the respective theme for each chain.

The following should be added to the /api/v1/chains endpoint.

Initial proposal:

{
  ...
  "theme": {
       "light": {
           "textColor": <hex-color-string>,
           "backgroundColor": <hex-color-string>
       },
       "dark": {
           "textColor": <hex-color-string>,
           "backgroundColor": <hex-color-string>
       }
   }
}

Update on the payload: #86 (comment)

Add ENS Registry to each chain

In case the ENS registry is present on the Chain, then its address should be returned:

GET /api/v1/chains/

{
  ...
  "ensRegistryAddress": "<checksummed-address>" // optional
}

@gnosis/safe-android @gnosis/safe-ios @gnosis/safe-web

Use a generated unique id to represent a safe-app instead of a URL

Using the URL as a unique identifier for the safe-app is error prone as the same app can be represented in multiple forms (eg.: https://example.com, https://example.com/, https://example.com/?, https://example.com/# etc...

We should then generate a unique identifier to represent each app instead of relying on the uniqueness of the url.

GET /api/v1/safe-apps/

[
  {
    "id": <int>,
    ...
  }
]

Add Safe App Provider information

The service should (optionally) include information about the provider of the application.

The provider information should have at least the following fields:

{
  "name" : <string>,
  "url": <string>
}

Support for fixed gas price without oracle

For some chains a fixed gas price can be used (instead of relying on a gas price oracle).

On the safe-react, the GasPrice can be either given with gasPrice | gasPriceOracle? or gasPrice? | gasPriceOracle:
https://github.com/gnosis/safe-react/blob/ae206843c86aa1663ca6db66d3662c1882d36991/src/config/networks/network.d.ts#L80-L89

Given this, if gasPrice is given then gasPriceOracle should be null and if gasPriceOracle is given then gasPrice should be null.

Open Questions

  1. Is the gasPrice considered to be in gwei
  2. Is it correct to assume that only one can be provided and not both?

cc/ @gnosis/safe-web

`ChainInfo` to include minimum recommended `MasterCopy` version

In order to provide information for the clients whether a safe is "Up to date" we need to know which is the version of the master copy that, as a minimum, is recommended.

This information can change from chain to chain, therefore we would like to have a field that specifies the version in the ChainInfo object.

ChainInfo {
  "minMasterCopyVersion" : "<semver-str>"
}

Change networks key to chainIDs

networks currently represents chainId so it can be a source of confusion where networks can have a value of 1 (network_id of Ethereum and Ethereum Classic) but the application is only available in one of the chains (that share the same network_id)

Provider field is required in Django admin

The Provider field of a SafeApp is currently required for validation even though its contents can be null in the database. This field should be optional on the validation phase.

Missing CORS headers

Since CORS headers are missing, resources from this application cannot be accessed by other domains

Add core chain information endpoint

Add chain information to the model and admin. The endpoint will be available under /api/v1/chains.
Each chain should have the following data:

{
   "chainId": <stringified-int>, // stringified-int due to int size constraints
   "chainName": <string>, // optional
   "nativeCurrency": {
       "name": <string>, // optional
       "symbol": <string>,
       "decimals": <uint>,
   },
   "rpcUrl": <url-string>,
   "blockExplorerUrl": <url-string>
}

Optional fields are marked with // optional

⚠️ Note: this does not include parameters regarding client theme and gnosis/safe-client-gateway. The data represented here is only related with "core" chain data.

Invalidate cache on SafeApp model update

The cache should be invalidated on model updates (create, update, delete). This can be accomplished by storing the cache entry in a separate cache (due to the complexity of retrieving the correct cache key) and clearing that cache.

Use different namespace and endpoint name for `/safe-apps`

The endpoint /api/v1/safe-apps is currently under the v1 namespace and safe-apps endpoint name.

To align it better with the future endpoints the following should be changed:

  • the namespace changes from v1 to safe-apps
  • the endpoint name changes from safe-apps to list

This results in a reverse url resolution with safe-apps:list instead of v1:safe-apps

Cache GET /safe-apps/ endpoint

The endpoint GET /safe-apps returns a list of safe-apps that can be cached (eg.: 1h) due to the nature of the endpoint (frequency of updating the app list is low). Updating the list should invalidate the cache.

Add /check endpoint

This endpoint should be used to check if the server is alive and ready to receive requests

Improve versioning namespace

Currently requests don't have a version set. This can be done for example with URLPathVersioning or NamespaceVersioning.

NamespaceVersioning seems to integrate quite well with drf-yasg

Add option to hide a safe-app without deleting its entry

We should be able to hide a safe-app from the admin interface easily without having to delete its entry. This would provide more flexibility in case there's any concern regarding a specific entry or to add the possibility of adding a new entry without revealing it right away in the endpoint.

Add Gas Price Oracle for each chain

Client should be able to use a gas price oracle that is associated with a specific chain. Given that, the oracle information and parameters should be retrieved with each chain.

{
  ...
  "gasPriceOracle": { // optional
       "url": <url-string>,
       "gasParameter": <string> // eg.: safeLow | average | fast
   }
}

Open Questions:

  1. Do we require that added chains have a Gas Price Oracle?

Chains

  • BSC: api.bscscan.com
  • Arbitrum: uses the eth_gasPrice RPC method

Add internal transaction service url to /chains

In addition to the public transaction url returned for each chain, an internal one should be returned and should be only used by the client gateway.

GET /api/v1/chains/

[
  {
    ...
    "transactionService": <url>,
    "transactionServiceCluster": <url> // this should only be used by the client gateway and not exposed to the clients
  }
]

@gnosis/safe-services

Add Unstoppable Domains Registry to each chain

In case the Unstoppable Domains registry is present on the Chain, then its address should be returned:

GET /api/v1/chains/

{
  ...
  "unstoppableDomainsRegistryAddress": "<checksummed-address>" // optional
}

Update 1 (payload changes): #125 (comment)

Update 2 (no changes required): #125 (comment)

@gnosis/safe-android @gnosis/safe-ios @gnosis/safe-web

Serve static files with Nginx

When running the application with Nginx as reverse-proxy, static files (such as Admin CSS) are not correctly collected and served

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.