File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ export type Chain = {
1717export type ControllerOptions = {
1818 // Chain configuration
1919 chains? : Chain []; // Custom RPC endpoints for slot katana instances
20- chainId ? : string ; // hex encoded
20+ defaultChainId ? : string ; // Default chain to use ( hex encoded). If using Starknet React, this gets overridden by the same param in StarknetConfig
2121
2222 // Session options
2323 policies? : SessionPolicies ; // Session policies for pre-approved transactions
Original file line number Diff line number Diff line change @@ -79,7 +79,11 @@ const policies: SessionPolicies = {
7979// Initialize the connector
8080const connector = new ControllerConnector ({
8181 policies ,
82- rpc: ' https://api.cartridge.gg/x/starknet/sepolia' ,
82+ // With the defaults, you can omit chains if you want to use:
83+ // - chains: [
84+ // { rpcUrl: "https://api.cartridge.gg/x/starknet/sepolia" },
85+ // { rpcUrl: "https://api.cartridge.gg/x/starknet/mainnet" },
86+ // ]
8387})
8488
8589// Configure RPC provider
@@ -99,6 +103,7 @@ export function StarknetProvider({ children }: { children: React.ReactNode }) {
99103 return (
100104 < StarknetConfig
101105 autoConnect
106+ defaultChainId = {mainnet.id }
102107 chains = {[mainnet , sepolia ]}
103108 provider={provider}
104109 connectors={[connector ]}
Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ const provider = jsonRpcProvider({
128128export function StarknetProvider({ children }: { children: React .ReactNode }) {
129129 return (
130130 <StarknetConfig
131+ defaultChainId = { sepolia .id }
131132 chains = { [mainnet , sepolia ]}
132133 provider = { provider }
133134 connectors = { [connector ]}
You can’t perform that action at this time.
0 commit comments