Configure the SDK providers

Connect your app wallet client to the SDK

The ZKsync Easy On-Ramp SDK uses the LI.FI SDK to handle any token swaps during an on-ramp process. These token swaps require a wallet client, wallet adapter or a similar wallet interface to handle transaction execution as well as a number of other wallet related tasks. To learn more about the LI.FI SDK's handling of providers, learn more on their Configure SDK providers. Since this SDK provides on-ramping to ZKsync, we provide only the EVM Provider for configuration.

Setup the EVM provider

Use the EVM provider from the ZKsync Easy On-Ramp SDK and pass that to the provider key in the config initialization.

// Example from the Demo App
createOnRampConfig({
  integrator: "ZKsync Easy OnRamp Demo",
  provider: EVM({
    getWalletClient: async () => getWalletClient(wagmiAdapter.wagmiConfig,),
    switchChain: async (chainId,) => {
      const chain = await switchChain(wagmiAdapter.wagmiConfig, { chainId, },);
      return await getWalletClient(wagmiAdapter.wagmiConfig, { chainId: chain.id, },);
    },
  },),
  dev: true,
},);

To learn more about configuring the EVM provider, read Setup EVM Provider on the LI.FI Documentation.


Made with ❤️ by the ZKsync Community