-
Notifications
You must be signed in to change notification settings - Fork 28
chore(chains)!: Remove Lens network support #1367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
3a66270
378e2e7
b5ebb4f
0e689c9
7aff417
f65cc59
7428b82
8effcd6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,7 +37,6 @@ body: | |
| - POLYGON | ||
| - AVALANCHE | ||
| - BNB | ||
| - LENS | ||
| - LINEA | ||
| - PLASMA | ||
| - INK | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,6 @@ body: | |
| - POLYGON | ||
| - AVALANCHE | ||
| - BNB | ||
| - LENS | ||
| - LINEA | ||
| - PLASMA | ||
| - INK | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,7 +29,6 @@ body: | |
| - POLYGON | ||
| - AVALANCHE | ||
| - BNB | ||
| - LENS | ||
| - LINEA | ||
| - PLASMA | ||
| - INK | ||
|
|
||
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| import { readFileSync } from 'node:fs' | ||
| import { join } from 'node:path' | ||
| import { exit, cwd } from 'node:process' | ||
| import { ALL_CHAINS_IDS } from '@cowprotocol/cow-sdk' | ||
|
|
||
| const COWSWAP_JSON_PATH = join(cwd(), 'src', 'public', 'CowSwap.json') | ||
|
|
||
| interface TokenEntry { | ||
| address: string | ||
| symbol?: string | ||
| name?: string | ||
| chainId: number | ||
| } | ||
|
|
||
| interface TokenList { | ||
| tokens: TokenEntry[] | ||
| } | ||
|
|
||
| function main(): void { | ||
| const supportedChainIds = new Set(ALL_CHAINS_IDS) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep in mind that ALL_CHAINS_IDS contains also chains that are not supported, such as Optimism, Bitcoin and Solana Is that intentional? |
||
| const list: TokenList = JSON.parse(readFileSync(COWSWAP_JSON_PATH, 'utf-8')) | ||
| const invalid = list.tokens.filter((token) => !supportedChainIds.has(token.chainId)) | ||
|
|
||
| if (invalid.length === 0) { | ||
| console.log('All tokens in CowSwap.json use supported chain IDs.') | ||
| exit(0) | ||
| } | ||
|
|
||
| console.error( | ||
| `CowSwap.json contains ${invalid.length} token(s) with unsupported chainId:\n${invalid.map((t) => `- ${t.chainId}: ${t.symbol ?? '?'} (${t.address})`).join('\n')}`, | ||
| ) | ||
|
|
||
| exit(1) | ||
| } | ||
|
|
||
| main() | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also added this here.