Skip to content

Commit

Permalink
fix: use recommended injected connectors (#44)
Browse files Browse the repository at this point in the history
Co-authored-by: Jonatan Chaverri <[email protected]>
  • Loading branch information
Jonatan-Chaverri and Jonatan Chaverri authored Nov 5, 2024
1 parent 03ed761 commit bd707c8
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 bd707c8

Please sign in to comment.