@chipi-stack/backend 14.10.1 → 14.12.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.
package/dist/wallets.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { shortString, hash, RpcProvider, ec, Account, num, CairoCustomEnum, CairoOption, CairoOptionVariant, CallData } from 'starknet';
2
- import { WALLET_RPC_ENDPOINTS, SHHH_VERIFIER_CLASS_HASHES, WALLET_CLASS_HASHES, API_ENDPOINTS, ChipiTransactionError, ChipiApiError, getWalletTypeFromClassHash } from '@chipi-stack/shared';
2
+ import { WALLET_RPC_ENDPOINTS, SHHH_VERIFIER_CLASS_HASHES, WALLET_CLASS_HASHES, API_ENDPOINTS, ChipiTransactionError, ChipiApiError, withRpcFallback, getWalletTypeFromClassHash } from '@chipi-stack/shared';
3
3
  import CryptoES from 'crypto-es';
4
4
  import { randomBytes } from 'crypto';
5
5
 
@@ -513,8 +513,10 @@ var executePaymasterTransaction = async ({
513
513
  let walletType = wallet.walletType ?? "READY";
514
514
  if (!wallet.walletType) {
515
515
  try {
516
- const resolveProvider = new RpcProvider({ nodeUrl: WALLET_RPC_ENDPOINTS.CHIPI });
517
- const onChainClassHash = await resolveProvider.getClassHashAt(wallet.publicKey, "latest");
516
+ const onChainClassHash = await withRpcFallback(
517
+ (provider2) => provider2.getClassHashAt(wallet.publicKey, "latest"),
518
+ { fallbackUrl: WALLET_RPC_ENDPOINTS.CHIPI }
519
+ );
518
520
  walletType = getWalletTypeFromClassHash(onChainClassHash) ?? "READY";
519
521
  } catch {
520
522
  }