Skip to content

Conversation

@iamacook
Copy link
Contributor

The chain config has been updated to include our requested additions of disabledWallets, features and blockExplorerUriTemplate.api. As such, I've recreated ChainInfo struct type.

@iamacook iamacook self-assigned this Nov 12, 2021
@github-actions
Copy link

github-actions bot commented Nov 12, 2021

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link

@fmrsabino fmrsabino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👏 Some questions regarding the introduction of Feature, Wallet and src/types/networks.ts

Copy link

@fmrsabino fmrsabino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! 🚀


export type ChainConfig = {
chainId: string
// Remain agnostic as possible and reference what is returned in the CGW, i.e.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@iamacook
Copy link
Contributor Author

iamacook commented Nov 12, 2021

For future reference @gnosis/safe-web: I've removed the enums and, although it will feel under-typed in the project, we'll trust whatever comes from the CGW as the single source of truth. Any validations need to reference what is returned from /chains, i.e.

const isValidShortName = (value: string): boolean => (chains.results: ChainInfo[]).some(({ shortName }) => shortName === value)

I'm working on migrating safe-react to the /chains endpoint and will create a readily available cache for reference.

@iamacook iamacook merged commit 13f272e into main Nov 12, 2021
@iamacook iamacook deleted the update-chain-config-types branch November 12, 2021 13:47
@fmrsabino
Copy link

For future reference @gnosis/safe-web: I've removed the enums and, although it will feel under-typed in the project, we'll trust whatever comes from the CGW as the single source of truth. Any validations need to reference what is returned from /chains, i.e.

const isValidShortName = (value: string): boolean => (chains.results: ChainInfo[]).some(({ shortName }) => shortName === value)

I'm working on migrating safe-react to the /chains endpoint and will create a readily available cache for reference.

Additionally, it is possible to get a chain by its shortName using the following endpoint: GET https://safe-client.staging.gnosisdev.com/v1/chains/<short_name> (eg.: https://safe-client.staging.gnosisdev.com/v1/chains/eth).

A 200 is returned if a chain with that short name is found. 404 otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants