Skip to content

Commit

Permalink
feat(connect-kit/connectors): create JoyIdConnector
Browse files Browse the repository at this point in the history
  • Loading branch information
runjuu committed Feb 5, 2024
1 parent 78859df commit 251a8e3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/connect-kit/src/create-wagmi-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import { InjectedConnector } from "wagmi/connectors/injected";
import { MetaMaskConnector } from "wagmi/connectors/metaMask";
import { w3mProvider } from "@web3modal/ethereum";
import compact from "lodash.compact";
import { JoyIdConnector } from "@joyid/wagmi";

import {
CoinbaseWalletConnector,
OKXConnector,
WalletConnectConnector,
JoyIdConnector,
} from "./wallets";

export type GetDefaultClientConfigOptions = Omit<
Expand Down
1 change: 1 addition & 0 deletions packages/connect-kit/src/wallets/connectors/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from "./coinbase-wallet";
export * from "./okx-wallet";
export * from "./wallet-connect";
export * from "./joy-id";
19 changes: 19 additions & 0 deletions packages/connect-kit/src/wallets/connectors/joy-id/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { JoyIdConnector as BaseConnector } from "@joyid/wagmi";

export class JoyIdConnector extends BaseConnector {
async getProvider(config?: { chainId?: number }) {
const provider = await super.getProvider(config);

if (!("on" in provider)) {
Object.defineProperty(provider, "on", {
value: (key: string) => {
console.warn(
`JoyIdConnector: \`provider.on("${key}", callback)\` not implemented`,
);
},
});
}

return provider;
}
}

0 comments on commit 251a8e3

Please sign in to comment.