File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Expand file tree Collapse file tree 2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,9 @@ export const alchemyRPCs: Record<number, RPCGenerator> = {
11
11
[ viem . berachain . id ] : ( apiKey ) => `https://berachain-mainnet.g.alchemy.com/v2/${ apiKey } ` ,
12
12
[ viem . blast . id ] : ( apiKey ) => `https://blast-mainnet.g.alchemy.com/v2/${ apiKey } ` ,
13
13
[ viem . bsc . id ] : ( apiKey ) => `https://bnb-mainnet.g.alchemy.com/v2/${ apiKey } ` ,
14
- [ viem . mainnet . id ] : ( apiKey ) => `https://eth-mainnet.g.alchemy.com/v2/${ apiKey } ` ,
15
14
[ viem . gnosis . id ] : ( apiKey ) => `https://gnosis-mainnet.g.alchemy.com/v2/${ apiKey } ` ,
16
15
[ viem . linea . id ] : ( apiKey ) => `https://linea-mainnet.g.alchemy.com/v2/${ apiKey } ` ,
16
+ [ viem . mainnet . id ] : ( apiKey ) => `https://eth-mainnet.g.alchemy.com/v2/${ apiKey } ` ,
17
17
[ viem . optimism . id ] : ( apiKey ) => `https://opt-mainnet.g.alchemy.com/v2/${ apiKey } ` ,
18
18
[ viem . polygon . id ] : ( apiKey ) => `https://polygon-mainnet.g.alchemy.com/v2/${ apiKey } ` ,
19
19
[ viem . ronin . id ] : ( apiKey ) => `https://ronin-mainnet.g.alchemy.com/v2/${ apiKey } ` ,
Original file line number Diff line number Diff line change @@ -46,11 +46,11 @@ export const contractsQueries = {
46
46
} ,
47
47
/**
48
48
* Get many contracts.
49
- * - no options ⇒ all
50
- * - {protocol} ⇒ all for that protocol
51
- * - {protocol, chainId} ⇒ filtered by chain
52
- * - {release} ⇒ all deployments of that release
53
- * - {release, chainId} ⇒ that slice of deployments
49
+ * - no options ⇒ all
50
+ * - { protocol } ⇒ all for that protocol
51
+ * - { protocol, chainId } ⇒ filtered by chain
52
+ * - { release } ⇒ all deployments of that release
53
+ * - { release, chainId } ⇒ that slice of deployments
54
54
*/
55
55
getAll : ( opts ?: {
56
56
chainId ?: number ;
@@ -84,6 +84,13 @@ export const contractsQueries = {
84
84
return _ . flatMap ( deps , ( d ) => d . contracts ) ;
85
85
}
86
86
87
+ // by chain id
88
+ if ( chainId ) {
89
+ const deps = _ . flatMap ( releasesQueries . getAll ( ) , ( r ) => r . deployments ) ;
90
+ const filtered = _ . filter ( deps , { chainId } ) ;
91
+ return _ . flatMap ( filtered , ( d ) => d . contracts ) ;
92
+ }
93
+
87
94
// no filters → all
88
95
return _ . flatMap ( releasesQueries . getAll ( ) , ( r ) => r . deployments . flatMap ( ( d ) => d . contracts ) ) ;
89
96
} ,
You can’t perform that action at this time.
0 commit comments