argentlabs / starknetkit

MIT License
23 stars 15 forks source link

feat: Introduce `MockConnector` option to enable test automation of dApps using `starknetkit` #116

Open SergeyVolynkin opened 3 months ago

SergeyVolynkin commented 3 months ago

Hi @bluecco, @vladutjs Would it be possible to add an implementation of a MockConnector to be used with starknetkit, similar to what WalletConnect/wagmi provides

For example with WalletConnect it is possible run tests against mocked ETH wallet via

const wagmiConfig = createConfig({
  autoConnect: true,
  connectors: [
    new MockConnector({
      chains: [sepolia],
      options: {
        flags: {
          isAuthorized: true,
        },
        walletClient: createWalletClient({
          account: mnemonicToAccount(testWallet.mnemonic),
          chain: sepolia,
          transport: http(),
        }),
      },
    }),
  ],
  publicClient,
});