@@ -381,10 +381,7 @@ export const getChainAddresses = (chainId: number): ChainAddresses => {
381
381
* Assumptions:
382
382
* - unwrapped token has same number of decimals than wrapped tokens.
383
383
*/
384
- export const unwrappedTokensMapping : Record <
385
- ChainId ,
386
- Record < Address , Address >
387
- > = {
384
+ const _unwrappedTokensMapping : Record < ChainId , Record < Address , Address > > = {
388
385
[ ChainId . EthMainnet ] : {
389
386
[ _addressesRegistry [ ChainId . EthMainnet ] . wbIB01 ] :
390
387
_addressesRegistry [ ChainId . EthMainnet ] . bIB01 ,
@@ -507,11 +504,15 @@ export const convexWrapperTokens: Record<number, Set<Address>> = {
507
504
508
505
export let addressesRegistry = Object . freeze ( _addressesRegistry ) ;
509
506
export let addresses = addressesRegistry as Record < number , ChainAddresses > ;
507
+ export let unwrappedTokensMapping = Object . freeze ( _unwrappedTokensMapping ) ;
510
508
511
509
export function registerCustomAddresses (
512
510
customAddresses :
513
511
| Record < keyof typeof _addressesRegistry , DeepPartial < ChainAddresses > >
514
- | Record < number , ChainAddresses > ,
512
+ | Record < number , ChainAddresses > = { } ,
513
+ {
514
+ unwrappedTokens,
515
+ } : { unwrappedTokens ?: Record < number , Record < Address , Address > > } = { } ,
515
516
) {
516
517
// biome-ignore lint/suspicious/noExplicitAny: type is not trivial and not important here
517
518
const customizer = ( objValue : any , _srcValue : any , key : string ) => {
@@ -522,4 +523,9 @@ export function registerCustomAddresses(
522
523
addresses = addressesRegistry = Object . freeze (
523
524
mergeWith ( { } , _addressesRegistry , customAddresses , customizer ) ,
524
525
) ;
526
+
527
+ if ( unwrappedTokens )
528
+ unwrappedTokensMapping = Object . freeze (
529
+ mergeWith ( { } , _unwrappedTokensMapping , unwrappedTokens , customizer ) ,
530
+ ) ;
525
531
}
0 commit comments