@uniswap/token-list-bridge-utils 2.8.0 → 2.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/chainId.d.ts +2 -1
- package/dist/providers/SoneiumMappingProvider.d.ts +5 -0
- package/dist/token-list-bridge-utils.cjs.development.js +57 -2
- package/dist/token-list-bridge-utils.cjs.development.js.map +1 -1
- package/dist/token-list-bridge-utils.cjs.production.min.js +1 -1
- package/dist/token-list-bridge-utils.cjs.production.min.js.map +1 -1
- package/dist/token-list-bridge-utils.esm.js +57 -2
- package/dist/token-list-bridge-utils.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/constants/chainId.ts +2 -0
- package/src/index.ts +1 -0
- package/src/local_mappings/soneium.json +14 -0
- package/src/providers/SoneiumMappingProvider.ts +11 -0
- package/src/providers/index.ts +4 -0
- package/src/utils.ts +2 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MappingProvider } from './MappingProvider'
|
|
2
|
+
import { MappedTokenData } from '../constants/types'
|
|
3
|
+
import soneiumMappings from '../local_mappings/soneium.json'
|
|
4
|
+
|
|
5
|
+
// we use a local source of mappings for soneium
|
|
6
|
+
export class SoneiumMappingProvider implements MappingProvider {
|
|
7
|
+
async provide(): Promise<MappedTokenData> {
|
|
8
|
+
const tokens = soneiumMappings as MappedTokenData
|
|
9
|
+
return tokens
|
|
10
|
+
}
|
|
11
|
+
}
|
package/src/providers/index.ts
CHANGED
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
import { AvalancheMappingProvider } from './AvalancheMappingProvider'
|
|
25
25
|
import { BaseMappingProvider } from './BaseMappingProvider'
|
|
26
26
|
import { CeloMappingProvider } from './CeloMappingProvider'
|
|
27
|
+
import { SoneiumMappingProvider } from './SoneiumMappingProvider'
|
|
27
28
|
|
|
28
29
|
const web3 = new Web3()
|
|
29
30
|
|
|
@@ -37,6 +38,7 @@ const CHAINS_WITH_MAPPING_PROVIDERS = [
|
|
|
37
38
|
ChainId.CELO,
|
|
38
39
|
ChainId.BASE,
|
|
39
40
|
ChainId.UNICHAIN,
|
|
41
|
+
ChainId.SONEIUM,
|
|
40
42
|
]
|
|
41
43
|
|
|
42
44
|
export async function buildList(
|
|
@@ -162,6 +164,8 @@ function getMappingProvider(chainId: ChainId, l1TokenList: TokenList) {
|
|
|
162
164
|
return new BaseMappingProvider()
|
|
163
165
|
case ChainId.UNICHAIN:
|
|
164
166
|
return new UnichainMappingProvider()
|
|
167
|
+
case ChainId.SONEIUM:
|
|
168
|
+
return new SoneiumMappingProvider()
|
|
165
169
|
default:
|
|
166
170
|
throw new Error(`Chain ${chainId} not supported for fetching mappings.`)
|
|
167
171
|
}
|
package/src/utils.ts
CHANGED
|
@@ -118,6 +118,8 @@ export function getRpcUrl(chainId: ChainId): string {
|
|
|
118
118
|
return 'https://alfajores-forno.celo-testnet.org/'
|
|
119
119
|
case ChainId.BASE:
|
|
120
120
|
return 'https://mainnet.base.org'
|
|
121
|
+
case ChainId.SONEIUM:
|
|
122
|
+
return 'https://soneium.drpc.org'
|
|
121
123
|
default:
|
|
122
124
|
}
|
|
123
125
|
throw new Error('Unsupported ChainId')
|