Using moralis as auth / provider

Hi there !
I’m working on project which require me to use useSignMessage hook from wagmi click here to see more about this hook I don’t know if moralis have this function / end point to request and sign messages !

The problem I’m facing is since the hook uses the connected account. to sign message when i try to connect wallet using Authenticate Hook and use User.address as address to sign message i get this errror ConnectorNotFoundError Connector not found
at signMessage
But I think this happens bicouse I omitted the connector in configuration

when using Rainbow kit as authentication method we use this object in configuration

const { connectors } = getDefaultWallets({
  appName: 'application  name  here ',
  chains,
})

But i don’t know how i can replace this from using rainbow kit to use moralis as connector

Full wagmi configuration when using rainbow kit :point_down:

import { getDefaultWallets, RainbowKitProvider } from '@rainbow-me/rainbowkit';
import { chain, configureChains, createClient, WagmiConfig } from 'wagmi';
import { jsonRpcProvider } from 'wagmi/providers/jsonRpc';
import { publicProvider } from 'wagmi/providers/public';
const { chains, provider } = configureChains(
  [chain.polygon], // you can add more chains here like chain.mainnet, chain.optimism etc.
  [
    jsonRpcProvider({
      rpc: () => {
        return {
          http: 'https://rpc.ankr.com/polygon', // go to https://www.ankr.com/protocol/ to get a free RPC for your network if you're not using Polygon
        };
      },
    }),
    publicProvider(),
  ]
);

const { connectors } = getDefaultWallets({
  appName: 'Next.js Chakra Rainbowkit Wagmi Starter',
  chains,
});

const wagmiClient = createClient({
  autoConnect: false,
  connectors,
  provider,
});

The reason I want to Use moralis as authentication / connect method is I want all
connected users to be available in my DB

when i try to connect wallet using Authenticate

Do you mean authenticate from Moralis? It will just using the provider you use, what is your authentication code?

With using useSignMessage, are you saying you want to integrate this with Moralis?

I’m just using connect button from Web3 Ui kit connect button

    <ConnectButton  signingMessage='sign-in to Pax'  />

Yes that is what I’m looking for

Hey @alex I noticed that moralis also use ether.js as provider and i tried to use ethers as provider Worked :nerd_face:

1 Like