SimpleAccount constructor

SimpleAccount(
  1. EthPrivateKey credentials,
  2. String rpcUrl, {
  3. IPresetBuilderOpts? opts,
})

Implementation

SimpleAccount(
  this.credentials,
  String rpcUrl, {
  IPresetBuilderOpts? opts,
}) : super() {
  final web3client = Web3Client.custom(BundlerJsonRpcProvider(
    rpcUrl,
    http.Client(),
  ).setBundlerRpc(
    opts?.overrideBundlerRpc,
  ));
  entryPoint = EntryPoint(
    address: opts?.entryPoint ?? EthereumAddress.fromHex(ERC4337.ENTRY_POINT),
    client: web3client,
  );
  simpleAccountFactory = SimpleAccountFactory(
    address: opts?.factoryAddress ??
        EthereumAddress.fromHex(ERC4337.SIMPLE_ACCOUNT_FACTORY),
    client: web3client,
  );
  initCode = '0x';
  nonceKey = opts?.nonceKey ?? BigInt.zero;
  proxy = simple_account_impl.SimpleAccount(
    address: EthereumAddress.fromHex(Addresses.AddressZero),
    client: web3client,
  );
}