Skip to content
This repository was archived by the owner on Oct 20, 2024. It is now read-only.

v0.3.0

Compare
Choose a tag to compare
@hazim-j hazim-j released this 07 Jun 14:18
· 23 commits to main since this release
148b5ab

Release notes

TL;DR:

  • Simplify interface for Preset builders and client.
  • Add Preset for ZeroDev Kernel.
  • Add BundlerJsonRpcProvider module.
  • Add Constants module.

Breaking changes

v0.3.0 requires minor updates to how we initialise presets and clients

Presets

If you're using the SimpleAccount preset, you'll need to make the following changes. Common entities such as entryPoint and simpleAccountFactory addresses have been moved to a Constants module.

const simpleAccount = await Presets.Builder.SimpleAccount.init(
  signer,
  config.rpcUrl,
--  config.entryPoint,
--  config.simpleAccountFactory
);

Presets now also have an optional opts argument for the init method. This lets you still use non-canonical values and define a paymaster middleware.

interface IPresetBuilderOpts {
  entryPoint?: string;
  factory?: string;
  paymasterMiddleware?: UserOperationMiddlewareFn;
  overrideBundlerRpc?: string;
}

For example, if you want to include a paymaster middleware:

const simpleAccount = await Presets.Builder.SimpleAccount.init(
  signer,
  config.rpcUrl,
  { paymasterMiddleware }
);

Client

Similarly with clients, the entryPoint is not required when calling init. It defaults to the canonical entryPoint address and can be overridden in an optional opts argument.

const client = await Client.init(
  config.rpcUrl,
--  config.entryPoint
);

An optional opts argument can also be passed:

interface IClientOpts {
  entryPoint?: string;
  overrideBundlerRpc?: string;
}

For example, to override the bundler RPC:

const client = await Client.init(
  config.rpcUrl,
  { overrideBundlerRpc }
);

Running into issues?

Check out the resources below:


What's Changed

New Contributors

Full Changelog: v0.2.0...v0.3.0