This repository was archived by the owner on Aug 22, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -109,27 +109,23 @@ export function getFormattedAddressesByProtocol(
109109
110110 return addresses
111111 . map ( ( address ) => {
112- let evmAddress , starknetAddress ;
113-
114- try {
115- evmAddress = snapshot . utils . getFormattedAddress ( address , 'evm' ) ;
116- } catch ( e ) { }
117- try {
118- starknetAddress = snapshot . utils . getFormattedAddress (
119- address ,
120- 'starknet'
121- ) ;
122- } catch ( e ) { }
123-
124- if ( evmAddress && protocols . includes ( 'evm' ) ) {
125- return evmAddress ;
112+ if ( protocols . includes ( 'evm' ) ) {
113+ try {
114+ return snapshot . utils . getFormattedAddress ( address , 'evm' ) ;
115+ } catch ( e ) {
116+ // Continue to starknet if evm formatting fails and starknet is supported
117+ }
126118 }
127119
128- if ( ! evmAddress && starknetAddress && protocols . includes ( 'starknet' ) ) {
129- return starknetAddress ;
120+ if ( protocols . includes ( 'starknet' ) ) {
121+ try {
122+ return snapshot . utils . getFormattedAddress ( address , 'starknet' ) ;
123+ } catch ( e ) {
124+ // Address format not supported by any protocol
125+ }
130126 }
131127 } )
132- . filter ( Boolean ) ;
128+ . filter ( Boolean ) as string [ ] ;
133129}
134130
135131export const {
You can’t perform that action at this time.
0 commit comments