File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed
Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -71,9 +71,19 @@ class FVMProvider implements RpcProvider {
7171 }
7272}
7373
74+ class AnkrProvider implements RpcProvider {
75+ getUrl ( chainId : number ) : string | undefined {
76+ const urls : Record < number , string > = {
77+ 42220 : `https://rpc.ankr.com/celo` ,
78+ } ;
79+ return urls [ chainId ] ;
80+ }
81+ }
82+
7483export class EvmClientFactory {
7584 private static readonly providers : RpcProvider [ ] = [
7685 new AlchemyProvider ( ) ,
86+ new AnkrProvider ( ) ,
7787 new InfuraProvider ( ) ,
7888 new FVMProvider ( ) ,
7989 new DrpcProvider ( ) ,
Original file line number Diff line number Diff line change @@ -90,10 +90,9 @@ describe("RPC Providers", () => {
9090 expect ( url ) . toContain ( "alchemy-key" ) ;
9191 } ) ;
9292
93- it ( "should return Infura URL when Alchemy is not available" , ( ) => {
93+ it ( "should return Ankr URL when Alchemy is not available" , ( ) => {
9494 const url = EvmClientFactory . getRpcUrl ( 42220 ) ; // Celo
95- expect ( url ) . toContain ( "infura.io" ) ;
96- expect ( url ) . toContain ( "infura-key" ) ;
95+ expect ( url ) . toContain ( "ankr.com" ) ;
9796 } ) ;
9897
9998 it ( "should return ankr.com URL for Filecoin" , ( ) => {
You can’t perform that action at this time.
0 commit comments