Skip to content

Commit

Permalink
fix: controller rpc fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MartianGreed committed Sep 4, 2024
1 parent 31ca9b9 commit 1e3c019
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 3 additions & 4 deletions apps/arkmarket/src/components/connect-wallet-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import Image from "next/image";
import type { Connector } from "@starknet-react/core";
import type { PropsWithChildren } from "react";
import { useMemo, useState } from "react";
import { useCallback, useMemo, useState } from "react";
import { argent, useConnect } from "@starknet-react/core";
import { Loader2, Mail } from "lucide-react";

Expand Down Expand Up @@ -46,15 +46,14 @@ export default function ConnectWalletModal({ children }: PropsWithChildren) {
string | undefined
>(undefined);

async function connect(connector: Connector) {
const connect = useCallback(async (connector: Connector) => {
setPendingConnectorId(connector.id);
try {
await connectAsync({ connector });
} catch (error) {

Check failure on line 53 in apps/arkmarket/src/components/connect-wallet-modal.tsx

View workflow job for this annotation

GitHub Actions / lint

'error' is defined but never used

Check failure on line 53 in apps/arkmarket/src/components/connect-wallet-modal.tsx

View workflow job for this annotation

GitHub Actions / lint

Empty block statement
console.error(error);
}
setPendingConnectorId(undefined);
}
}, [connectAsync]);

function isWalletConnecting(connectorId: string) {
return pendingConnectorId === connectorId;
Expand Down
7 changes: 4 additions & 3 deletions apps/arkmarket/src/components/connectors.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import CartridgeConnector from "@cartridge/connector";
import { Connector } from "@starknet-react/core";
import type { Connector } from "@starknet-react/core";
import { env } from "~/env";

export const getConnectors = (): { connectors: Connector[] } => {
const paymaster: any = { caller: "0x414e595f43414c4c4552" };
// const paymaster: any = { caller: "0x414e595f43414c4c4552" };
// const options: any = { theme: "paved", paymaster };
const cartridge = new CartridgeConnector({
rpc: process.env.NEXT_PUBLIC_RPC_URL,
rpc: env.NEXT_PUBLIC_RPC_URL + "?apikey=" + env.NEXT_PUBLIC_RPC_API_KEY,
}) as never as Connector;
return { connectors: [cartridge] };
};

0 comments on commit 1e3c019

Please sign in to comment.