Skip to content

Commit

Permalink
feat(entrykit): clean up (#3434)
Browse files Browse the repository at this point in the history
  • Loading branch information
holic authored Jan 9, 2025
1 parent 7409095 commit e65787f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
6 changes: 1 addition & 5 deletions packages/entrykit/src/EntryKitConfigProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import { RainbowKitProvider, lightTheme, midnightTheme } from "@rainbow-me/rainb
import { EntryKitConfig } from "./config/output";
import { Chain } from "viem";
import { useChains } from "wagmi";
import { Paymaster, getPaymaster } from "./getPaymaster";

type ContextValue = EntryKitConfig & {
chain: Chain;
paymaster: Paymaster | undefined;
};

/** @internal */
Expand All @@ -29,8 +27,6 @@ export function EntryKitConfigProvider({ config, children }: Props) {
const chain = chains.find(({ id }) => id === config.chainId);
if (!chain) throw new Error(`Could not find configured chain for chain ID ${config.chainId}.`);

const paymaster = getPaymaster(chain);

return (
<RainbowKitProvider
// Prevent RainbowKit/Wagmi trying to switch chains after connection
Expand All @@ -52,7 +48,7 @@ export function EntryKitConfigProvider({ config, children }: Props) {
}
}
>
<Context.Provider value={{ ...config, chain, paymaster }}>{children}</Context.Provider>
<Context.Provider value={{ ...config, chain }}>{children}</Context.Provider>
</RainbowKitProvider>
);
}
Expand Down
9 changes: 2 additions & 7 deletions packages/entrykit/src/createWagmiConfig.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Chain, Transport } from "viem";
import { WalletList, connectorsForWallets, getDefaultWallets } from "@rainbow-me/rainbowkit";
import { connectorsForWallets } from "@rainbow-me/rainbowkit";
import { Config, CreateConfigParameters, createConfig } from "wagmi";

export type CreateWagmiConfigOptions<
Expand All @@ -21,12 +21,7 @@ export function createWagmiConfig<
const chains extends readonly [Chain, ...Chain[]],
transports extends Record<chains[number]["id"], Transport>,
>(config: CreateWagmiConfigOptions<chains, transports>): Config<chains, transports> {
const { wallets: defaultWallets } = getDefaultWallets();
const wallets: WalletList = [
// TODO: passkey wallet
...defaultWallets,
];

const wallets = getWallets();
const connectors = connectorsForWallets(wallets, {
appName: config.appName,
projectId: config.walletConnectProjectId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export async function signCall<chain extends Chain = Chain>({
nonce: initialNonce,
client,
}: SignCallOptions<chain>) {
console.log("getting nonce", worldAddress);
const nonce =
initialNonce ??
(client
Expand All @@ -37,7 +36,6 @@ export async function signCall<chain extends Chain = Chain>({
})
).nonce
: 0n);
console.log("got nonce", nonce);

const { namespace: systemNamespace, name: systemName } = hexToResource(systemId);

Expand Down

0 comments on commit e65787f

Please sign in to comment.