File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ export default class ControllerProvider extends BaseProvider {
4949
5050 // Merge user chains with default chains
5151 // User chains take precedence if they specify the same network
52- const chains = [ ...( options . chains || [ ] ) , ... cartridgeChains ] ;
52+ const chains = [ ...cartridgeChains , ... ( options . chains || [ ] ) ] ;
5353 const defaultChainId =
5454 options . defaultChainId || constants . StarknetChainId . SN_MAIN ;
5555
@@ -438,8 +438,10 @@ export default class ControllerProvider extends BaseProvider {
438438 const isMainnet = chainId === constants . StarknetChainId . SN_MAIN ;
439439 const isSepolia = chainId === constants . StarknetChainId . SN_SEPOLIA ;
440440 const isCartridgeRpc = url . hostname === "api.cartridge.gg" ;
441+ const isLocalhost =
442+ url . hostname === "localhost" || url . hostname === "127.0.0.1" ;
441443
442- if ( ( isMainnet || isSepolia ) && ! isCartridgeRpc ) {
444+ if ( ( isMainnet || isSepolia ) && ! ( isCartridgeRpc || isLocalhost ) ) {
443445 throw new Error (
444446 `Only Cartridge RPC providers are allowed for ${ isMainnet ? "mainnet" : "sepolia" } . ` +
445447 `Please use: https://api.cartridge.gg/x/starknet/${ isMainnet ? "mainnet" : "sepolia" } ` ,
You can’t perform that action at this time.
0 commit comments