Skip to content

Commit 4b55d5b

Browse files
authored
feat(new-networks): add lens and bnb permit and aux lists support (#1033)
* feat: bump cow-sdk version to 6.1.0-lens-bsc.2 * feat: map all supported chains to use CowSwap.json token list except sepolia * feat: add permit related scripts for lens and bnb * feat: add lens and bnb coingecko mappings * feat: add Coingecko for lens and bnb and uniswap for bnb * feat: add bnb and lens to permit info gh action * refactor: sort permit info chain ids * chore: update readme * chore: bump to latest cow-sdk
1 parent bd181d1 commit 4b55d5b

File tree

12 files changed

+5355
-19
lines changed

12 files changed

+5355
-19
lines changed

.github/workflows/updatePermitInfo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
fail-fast: false # continue parallel jobs even if individual parts fail
1818
matrix:
19-
chainId: [1, 100, 8453, 42161, 137, 43114] # all supported chains
19+
chainId: [ 1, 56, 100, 137, 232, 8453, 42161, 43114 ] # all supported chains
2020

2121
steps:
2222
- name: Checkout code

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,6 @@ The script generates token list files in `src/public/` for the following network
103103
- Base (CoinGecko.8453.json, Uniswap.8453.json)
104104
- Gnosis Chain (CoinGecko.100.json, Uniswap.100.json)
105105
- Polygon (CoinGecko.137.json, Uniswap.137.json)
106+
- Avalanche (CoinGecko.43114.json, Uniswap.43114.json)
107+
- Lens (CoinGecko.232.json)
108+
- BNB (CoinGecko.56.json, Uniswap.56.json)

package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
"fetchPermitInfo:sepolia": "yarn run fetchPermitInfo -- 11155111",
2929
"fetchPermitInfo:avalanche": "yarn run fetchPermitInfo -- 43114",
3030
"fetchPermitInfo:polygon": "yarn run fetchPermitInfo -- 137",
31+
"fetchPermitInfo:bnb": "yarn run fetchPermitInfo -- 56",
32+
"fetchPermitInfo:lens": "yarn run fetchPermitInfo -- 232",
3133
"recheckPermitInfo:mainnet": "yarn run fetchPermitInfo -- 1 '' '' true",
3234
"recheckPermitInfo:arb1": "yarn run fetchPermitInfo -- 42161 '' '' true",
3335
"recheckPermitInfo:base": "yarn run fetchPermitInfo -- 8453 '' '' true",
@@ -36,11 +38,13 @@
3638
"recheckPermitInfo:avalanche": "yarn run fetchPermitInfo -- 43114 '' '' true",
3739
"recheckPermitInfo:polygon": "yarn run fetchPermitInfo -- 137 '' '' true",
3840
"run-script": "node --loader ts-node/esm --experimental-json-modules --experimental-specifier-resolution=node",
41+
"recheckPermitInfo:bnb": "yarn run fetchPermitInfo -- 56 '' '' true",
42+
"recheckPermitInfo:lens": "yarn run fetchPermitInfo -- 232 '' '' true",
3943
"test": "node --test"
4044
},
4145
"license": "(MIT OR Apache-2.0)",
4246
"dependencies": {
43-
"@cowprotocol/cow-sdk": "6.0.0-RC.63",
47+
"@cowprotocol/cow-sdk": "6.2.0-lens-bsc.0",
4448
"@cowprotocol/permit-utils": "^0.7.0-RC.1",
4549
"@uniswap/token-lists": "^1.0.0-beta.33",
4650
"ajv": "^8.17.1",
@@ -61,4 +65,4 @@
6165
"prettier": "^3.0.3",
6266
"typescript": "^5.2.2"
6367
}
64-
}
68+
}

src/permitInfo/const.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ export const DEFAULT_RPC_URLS: Record<SupportedChainId, string> = {
1313
[SupportedChainId.SEPOLIA]: 'https://ethereum-sepolia.publicnode.com',
1414
[SupportedChainId.AVALANCHE]: 'https://api.avax.network/ext/bc/C/rpc',
1515
[SupportedChainId.POLYGON]: 'https://polygon-rpc.com',
16+
[SupportedChainId.BNB]: 'https://bsc-dataseed.binance.org',
17+
[SupportedChainId.LENS]: 'https://rpc.lens.xyz',
1618
}
1719

1820
export const BASE_PATH = join('..', 'public')

src/permitInfo/utils/getTokensFromTokenList.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
import { SupportedChainId } from '@cowprotocol/cow-sdk'
1+
import { SupportedChainId, mapSupportedNetworks } from '@cowprotocol/cow-sdk'
22
import { readFileSync } from 'node:fs'
33
import { join } from 'node:path'
44
import { BASE_PATH } from '../const'
55
import { Token } from '../types'
66

77
const tokenListsByNetwork: Record<SupportedChainId, string> = {
8-
[SupportedChainId.MAINNET]: 'CowSwap.json',
9-
[SupportedChainId.ARBITRUM_ONE]: 'CowSwap.json',
10-
[SupportedChainId.BASE]: 'CowSwap.json',
11-
[SupportedChainId.GNOSIS_CHAIN]: 'CowSwap.json',
8+
...mapSupportedNetworks('CowSwap.json'),
129
[SupportedChainId.SEPOLIA]: 'CowSwapSepolia.json',
13-
[SupportedChainId.POLYGON]: 'CowSwap.json',
14-
[SupportedChainId.AVALANCHE]: 'CowSwap.json',
1510
}
1611

1712
export async function getTokensFromTokenList(

src/public/CoinGecko.232.json

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"keywords": [
3+
"defi"
4+
],
5+
"version": {
6+
"major": 0,
7+
"minor": 1,
8+
"patch": 0
9+
},
10+
"tokens": [
11+
{
12+
"chainId": 232,
13+
"address": "0x88f08e304ec4f90d644cec3fb69b8ad414acf884",
14+
"name": "Lens Bridged USDC Lens ",
15+
"symbol": "USDC",
16+
"decimals": 6,
17+
"logoURI": "https://assets.coingecko.com/coins/images/55549/large/usdc1.png?1746723205"
18+
},
19+
{
20+
"chainId": 232,
21+
"address": "0x6bdc36e20d267ff0dd6097799f82e78907105e2f",
22+
"name": "Wrapped GHO Lens ",
23+
"symbol": "WGHO",
24+
"decimals": 18,
25+
"logoURI": "https://assets.coingecko.com/coins/images/55536/large/gho.png?1746569568"
26+
},
27+
{
28+
"chainId": 232,
29+
"address": "0xe5ecd226b3032910ceaa43ba92ee8232f8237553",
30+
"name": "Lens Bridged WETH Lens ",
31+
"symbol": "WETH",
32+
"decimals": 18,
33+
"logoURI": "https://assets.coingecko.com/coins/images/55548/large/eth1.png?1746723194"
34+
},
35+
{
36+
"chainId": 232,
37+
"address": "0xb0588f9a9cade7cd5f194a5fe77acd6a58250f82",
38+
"name": "Bonsai Token",
39+
"symbol": "BONSAI",
40+
"decimals": 18,
41+
"logoURI": "https://assets.coingecko.com/coins/images/35884/large/bonsaiToken.png?1744187538"
42+
}
43+
],
44+
"name": "CoinGecko on Lens",
45+
"logoURI": "https://support.coingecko.com/hc/article_attachments/4499575478169/CoinGecko_logo.png",
46+
"timestamp": "2025-07-21T10:15:28.338Z"
47+
}

0 commit comments

Comments
 (0)