-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
2,482 additions
and
2,119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
"use client"; | ||
import ControllerConnector from "@cartridge/connector/controller"; | ||
import { Chain, mainnet, sepolia } from "@starknet-react/chains"; | ||
import { InjectedConnector } from "@starknet-react/core"; | ||
import { constants } from "starknet"; | ||
|
||
function controllerProvider(chain: Chain) { | ||
switch (chain) { | ||
case mainnet: | ||
return { nodeUrl: "https://api.cartridge.gg/x/starknet/mainnet" }; | ||
case sepolia: | ||
return { nodeUrl: "https://api.cartridge.gg/x/starknet/sepolia" }; | ||
default: | ||
return { nodeUrl: "https://api.cartridge.gg/x/starknet/sepolia" }; | ||
} | ||
} | ||
|
||
export const controllerInstance = new ControllerConnector({ | ||
// Usamos los IDs de cadena oficiales de Starknet | ||
defaultChainId: constants.StarknetChainId.SN_SEPOLIA, // o .SN_MAIN para mainnet | ||
chains: [ | ||
{ | ||
rpcUrl: "https://api.cartridge.gg/x/starknet/sepolia", | ||
}, | ||
{ | ||
rpcUrl: "https://api.cartridge.gg/x/starknet/mainnet", | ||
}, | ||
], | ||
}) as never as InjectedConnector; |
Oops, something went wrong.