🌟Initializing SDK

After installing the package and getting API key its time to initialize the SDK

Setting Up the SDK

SDK Setup:

const apiKey = process.env.API_API; //if stored in env variables
const chainEx = new ChainEx(apiKey);

//returns smart contract wallet address and initializes the SDK
const smartAccount = await chainEx.initialize(provider, configParams);

Begin by setting up the ChainEx SDK using your API key. Replace provider and configParams with the specifics of your setup to ensure the correct SDK configuration.

configParams

Adjust ClientParams, the configuration interface for the SDK, as follows:

  • chainId (number): Designate the chain ID for the Ethereum network (1).

  • privateKey (string, optional): If necessary, include a private key for signing.

  • rpcUrl (string, optional): Specify the Ethereum RPC endpoint URL.

  • isSponsored (boolean, optional): Define if the transaction is sponsored.

  • paymasterUrl (string, optional): Include the URL for the paymaster service.

  • paymasterProvider (string, optional): Choose a paymaster type.

  • bundlerUrl (string, optional): Point out the URL for the bundler service.

Customize these parameters according to the needs of your application.

We will be coming up with our dedicated paymaster soon.

Last updated