@chipi-stack/backend 14.8.0 → 14.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -444,7 +444,15 @@ var executePaymasterTransaction = async ({
444
444
  usePasskey ? "encryptKey is required when using passkey. The passkey authentication should have provided the encryptKey." : "encryptKey is required for transaction execution"
445
445
  );
446
446
  }
447
- const walletType = wallet.walletType ?? "READY";
447
+ let walletType = wallet.walletType ?? "READY";
448
+ if (!wallet.walletType) {
449
+ try {
450
+ const resolveProvider = new starknet.RpcProvider({ nodeUrl: shared.WALLET_RPC_ENDPOINTS.CHIPI });
451
+ const onChainClassHash = await resolveProvider.getClassHashAt(wallet.publicKey, "latest");
452
+ walletType = shared.getWalletTypeFromClassHash(onChainClassHash) ?? "READY";
453
+ } catch {
454
+ }
455
+ }
448
456
  if (walletType === "SHHH") {
449
457
  const { executeShhhSponsoredRaw: executeShhhSponsoredRaw2 } = await Promise.resolve().then(() => (init_execute_paymaster_raw(), execute_paymaster_raw_exports));
450
458
  const shhhSignerKind = (wallet.signerKind ?? "STARK") || "STARK";