isAccountValid static method

Future<bool> isAccountValid({
  1. required Account account,
})

Implementation

static Future<bool> isAccountValid({
  required Account account,
}) async {
  final provider = WalletKit().provider;
  final accountClassHash = (await provider.getClassHashAt(
    contractAddress: s.Felt.fromHexString(account.address),
    blockId: BlockId.latest,
  ))
      .when(
    result: (result) => result,
    error: ((error) => s.Felt.zero),
  );
  return accountClassHash != s.Felt.zero;
}