Documentation
    Preparing search index...

    Function syncWithProvider

    • Synchronizes with the provider to establish connection with Filsnap adapter. If no provider is passed, it will attempt to get the MetaMask provider. See getProvider.

      Parameters

      • __namedParameters: { provider?: EIP1193Provider; reconnect?: boolean; version?: string } = {}

      Returns Promise<
          | undefined
          | {
              provider: EIP1193Provider;
              connect(
                  options?: { network?: Network },
              ): Promise<{ accounts: string[]; network: undefined | Network }>;
              disconnect(): Promise<void>;
              getAccounts(): Promise<string[]>;
              getChainId(): Promise<string>;
              getNetwork(): Promise<undefined | Network>;
              permissions(): Promise<{ snap: boolean; wallet: boolean }>;
              setup(): { provider: EIP1193Provider; setup(): ...; connect(options?: { network?: Network | undefined; }): Promise<{ accounts: string[]; network: Network | undefined; }>; ... 5 more ...; permissions(): Promise<...>; };
              switchChain(network?: undefined | Network): Promise<Network>;
          },
      >

      import { syncWithProvider, getProvider } from 'filsnap-adapter'

      const connector = await syncWithProvider({
      provider: await getProvider(), // optional, will attempt to get the MetaMask provider
      version: '0.1.0', // optional, defaults to '*'
      reconnect: true // optional, defaults to true
      })