Skip to content

Commit

Permalink
fix: use recommended injected connectors
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonatan Chaverri committed Nov 5, 2024
1 parent 03ed761 commit 2eb87fd
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions apps/web/src/providers/starknet.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
import { sepolia } from "@starknet-react/chains";
import { StarknetConfig, publicProvider } from "@starknet-react/core";
import {
StarknetConfig,
publicProvider,
useInjectedConnectors,
} from "@starknet-react/core";
import type { Connector } from "@starknet-react/core";
import { InjectedConnector } from "starknetkit/injected";
import { argent, braavos } from "@starknet-react/core";

export default function StarknetProvider({
children,
}: {
children: React.ReactNode;
}) {
const connectors = [
// TODO: add ArgentX
new InjectedConnector({
options: { id: "argentX" },
}),
new InjectedConnector({
options: { id: "braavos" },
}),
];
const { connectors } = useInjectedConnectors({
// Show these connectors if the user has no connector installed.
recommended: [argent(), braavos()],
// Hide recommended connectors if the user has any connector installed.
includeRecommended: "onlyIfNoConnectors",
// Randomize the order of the connectors.
order: "random",
});

return (
<StarknetConfig
Expand Down

0 comments on commit 2eb87fd

Please sign in to comment.