EtherspotWallet constructor

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

Implementation

EtherspotWallet(
  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,
  );
  etherspotWalletFactory = EtherspotWalletFactory(
    address: opts?.factoryAddress ??
        EthereumAddress.fromHex(ERC4337.ETHERSPOT_WALLET_FACTORY),
    client: web3client,
  );
  initCode = '0x';
  nonceKey = opts?.nonceKey ?? BigInt.zero;
  proxy = etherspot_wallet_impl.EtherspotWallet(
    address: EthereumAddress.fromHex(Addresses.AddressZero),
    client: web3client,
  );
}