@vaporfi/core-wagmi-connector
is a connector for the popular wagmi library to support Core wallet extension from Avalabs
You can use this connector as any other wagmi connector, import it and use it in your client setup
import { configureChains, createConfig } from 'wagmi';
import { avalanche, avalancheFuji } from '@wagmi/core/chains';
import { InjectedConnector } from 'wagmi/connectors/injected';
import { publicProvider } from 'wagmi/providers/public';
import { CoreWalletConnector } from '@vaporfi/core-wagmi-connector';
const { chains, publicClient } = configureChains(
[avalanche, avalancheFuji],
[publicProvider()]
);
const wagmiConfig = createConfig({
autoConnect: true,
connectors: [new CoreWalletConnector({ chains, options: {} })],
publicClient,
});
// wrap your app with WagmiConfig
import { WagmiConfig } from 'wagmi';
const MyApp = ({ children, ...props }) => {
return <WagmiConfig config={wagmiConfig}>{children}</WagmiConfig>;
};
Have a look at the wagmi repo and the wagmi doc to learn more on connectors and wagmi.