@@ -28,6 +28,8 @@ const chains: { [key in ChainId]: Chain } = {
2828 safeConfirmations : 1 ,
2929 // 0,1 blocks per minute * 180 minutes (3 hours) -> 18 blocks wait period
3030 txFailureTimeout : 10800000 , // 3 hours in ms
31+ evmCompatible : false ,
32+ hasTokens : false ,
3133 // TODO: include network types in validation
3234 isValidAddress : ( address ) => ! ! validateBitcoinAddress ( address ) ,
3335 formatAddress : ( address ) => address ,
@@ -44,6 +46,8 @@ const chains: { [key in ChainId]: Chain } = {
4446 safeConfirmations : 1 ,
4547 // ~0,1 blocks per minute * 180 minutes (3 hours) -> 18 blocks wait period
4648 txFailureTimeout : 10800000 , // 3 hours in ms
49+ evmCompatible : false ,
50+ hasTokens : false ,
4751 // TODO: include network types in validation
4852 isValidAddress : ( address ) => isValidBitcoinCashAddress ( address ) ,
4953 formatAddress : ( address ) => formatBitcoinCashAddress ( address ) ,
@@ -60,6 +64,8 @@ const chains: { [key in ChainId]: Chain } = {
6064 safeConfirmations : 3 ,
6165 // ~4 blocks per minute * 30 minutes -> 120 blocks wait period
6266 txFailureTimeout : 1800000 , // in ms
67+ evmCompatible : true ,
68+ hasTokens : true ,
6369 isValidAddress : ( hexAddress : string ) => isValidAddress ( with0x ( hexAddress ) ) ,
6470 formatAddress : ( hexAddress : string ) => toChecksumAddress ( with0x ( hexAddress ) ) ,
6571 isValidTransactionHash : ( hash : string ) => isValidHex ( hash ) ,
@@ -75,6 +81,8 @@ const chains: { [key in ChainId]: Chain } = {
7581 safeConfirmations : 5 ,
7682 // ~3 blocks per minute * 30 minutes -> 90 blocks wait period
7783 txFailureTimeout : 1800000 , // in ms
84+ evmCompatible : true ,
85+ hasTokens : true ,
7886 isValidAddress : ( hexAddress : string ) => isValidAddress ( with0x ( hexAddress ) ) ,
7987 formatAddress : ( hexAddress : string , network ?: string ) =>
8088 toChecksumAddress ( with0x ( hexAddress ) , getRSKChainID ( network ) ) ,
@@ -91,6 +99,8 @@ const chains: { [key in ChainId]: Chain } = {
9199 safeConfirmations : 5 ,
92100 // ~20 blocks per minute * 10 minutes -> 200 blocks wait period
93101 txFailureTimeout : 600000 , // in ms
102+ evmCompatible : true ,
103+ hasTokens : true ,
94104 isValidAddress : ( hexAddress : string ) => isValidAddress ( with0x ( hexAddress ) ) ,
95105 formatAddress : ( hexAddress : string ) => toChecksumAddress ( with0x ( hexAddress ) ) ,
96106 isValidTransactionHash : ( hash : string ) => isValidHex ( hash ) ,
@@ -106,6 +116,8 @@ const chains: { [key in ChainId]: Chain } = {
106116 safeConfirmations : 10 ,
107117 // ~50 blocks per minute * 5 minutes -> 250 blocks wait period
108118 txFailureTimeout : 300000 , // in ms
119+ evmCompatible : false ,
120+ hasTokens : false ,
109121 isValidAddress : ( address ) => isValidNearAddress ( address ) ,
110122 formatAddress : ( address ) => address ,
111123 isValidTransactionHash : ( hash : string ) => isValidNearTx ( hash ) ,
@@ -121,6 +133,8 @@ const chains: { [key in ChainId]: Chain } = {
121133 safeConfirmations : 31 ,
122134 // ~120 blocks per minute * 5 minutes -> 600 blocks wait period
123135 txFailureTimeout : 300000 , // in ms
136+ evmCompatible : false ,
137+ hasTokens : false ,
124138 isValidAddress : ( address ) => isValidSolanaAddress ( address ) ,
125139 formatAddress : ( address ) => address ,
126140 isValidTransactionHash : ( hash : string ) => isValidSolanaTx ( hash ) ,
@@ -136,6 +150,8 @@ const chains: { [key in ChainId]: Chain } = {
136150 safeConfirmations : 1 ,
137151 // ~10 blocks per minute * 15 minutes -> 150 blocks wait period
138152 txFailureTimeout : 900000 , // in ms
153+ evmCompatible : false ,
154+ hasTokens : true ,
139155 isValidAddress : ( address ) => isValidTerraAddress ( address ) ,
140156 formatAddress : ( address ) => address ,
141157 isValidTransactionHash : ( hash : string ) => isValidTerraTx ( hash ) ,
@@ -151,6 +167,8 @@ const chains: { [key in ChainId]: Chain } = {
151167 safeConfirmations : 5 ,
152168 // ~30 blocks per minute * 10 minutes -> 300 blocks wait period
153169 txFailureTimeout : 600000 , // in ms
170+ evmCompatible : true ,
171+ hasTokens : true ,
154172 isValidAddress : ( hexAddress : string ) => isValidAddress ( with0x ( hexAddress ) ) ,
155173 formatAddress : ( hexAddress : string ) => toChecksumAddress ( with0x ( hexAddress ) ) ,
156174 isValidTransactionHash : ( hash : string ) => isValidHex ( hash ) ,
@@ -166,6 +184,8 @@ const chains: { [key in ChainId]: Chain } = {
166184 safeConfirmations : 5 ,
167185 // ~15 blocks per minute * 10 minutes -> 150 blocks wait period
168186 txFailureTimeout : 600000 , // in ms
187+ evmCompatible : true ,
188+ hasTokens : true ,
169189 isValidAddress : ( hexAddress : string ) => isValidAddress ( with0x ( hexAddress ) ) ,
170190 formatAddress : ( hexAddress : string ) => toChecksumAddress ( with0x ( hexAddress ) ) ,
171191 isValidTransactionHash : ( hash : string ) => isValidHex ( hash ) ,
@@ -181,6 +201,8 @@ const chains: { [key in ChainId]: Chain } = {
181201 safeConfirmations : 5 ,
182202 // ~12 blocks per minute * 15 minutes -> 180 blocks wait period
183203 txFailureTimeout : 900000 , // in ms
204+ evmCompatible : true ,
205+ hasTokens : true ,
184206 isValidAddress : ( hexAddress : string ) => isValidAddress ( with0x ( hexAddress ) ) ,
185207 formatAddress : ( hexAddress : string ) => toChecksumAddress ( with0x ( hexAddress ) ) ,
186208 isValidTransactionHash : ( hash : string ) => isValidHex ( hash ) ,
@@ -196,6 +218,8 @@ const chains: { [key in ChainId]: Chain } = {
196218 safeConfirmations : 5 ,
197219 // ~15 blocks per minute * 10 minutes -> 150 blocks wait period
198220 txFailureTimeout : 600000 , // in ms
221+ evmCompatible : true ,
222+ hasTokens : true ,
199223 isValidAddress : ( hexAddress : string ) => isValidAddress ( with0x ( hexAddress ) ) ,
200224 formatAddress : ( hexAddress : string ) => toChecksumAddress ( with0x ( hexAddress ) ) ,
201225 isValidTransactionHash : ( hash : string ) => isValidHex ( hash ) ,
@@ -204,15 +228,11 @@ const chains: { [key in ChainId]: Chain } = {
204228}
205229
206230function isEthereumChain ( chain : ChainId ) {
207- return [
208- ChainId . BinanceSmartChain ,
209- ChainId . Ethereum ,
210- ChainId . Rootstock ,
211- ChainId . Polygon ,
212- ChainId . Avalanche ,
213- ChainId . Arbitrum ,
214- ChainId . Fuse
215- ] . includes ( chain )
231+ return chains [ chain ] . evmCompatible
216232}
217233
218- export { chains , isEthereumChain }
234+ function hasTokens ( chain : ChainId ) {
235+ return chains [ chain ] . hasTokens
236+ }
237+
238+ export { chains , isEthereumChain , hasTokens }
0 commit comments