@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.
@@ -1,6 +1,6 @@
1
1
  import CryptoES from 'crypto-es';
2
2
  import { hash, CallData, cairo, ec, shortString, RpcProvider, Account } from 'starknet';
3
- import { formatAmount, SKU_CONTRACTS, CARRIER_IDS, SERVICE_TYPES, API_ENDPOINTS, WALLET_RPC_ENDPOINTS, getWalletTypeFromClassHash, WALLET_CLASS_HASHES } from '@chipi-stack/shared';
3
+ import { formatAmount, SKU_CONTRACTS, CARRIER_IDS, SERVICE_TYPES, API_ENDPOINTS, withRpcFallback, WALLET_RPC_ENDPOINTS, getWalletTypeFromClassHash, WALLET_CLASS_HASHES } from '@chipi-stack/shared';
4
4
  import { Chain, STARKNET_CONTRACTS } from '@chipi-stack/types';
5
5
 
6
6
  var __defProp = Object.defineProperty;
@@ -441,8 +441,10 @@ var executePaymasterTransaction = async ({
441
441
  let walletType = wallet.walletType ?? "READY";
442
442
  if (!wallet.walletType) {
443
443
  try {
444
- const resolveProvider = new RpcProvider({ nodeUrl: WALLET_RPC_ENDPOINTS.CHIPI });
445
- const onChainClassHash = await resolveProvider.getClassHashAt(wallet.publicKey, "latest");
444
+ const onChainClassHash = await withRpcFallback(
445
+ (provider2) => provider2.getClassHashAt(wallet.publicKey, "latest"),
446
+ { fallbackUrl: WALLET_RPC_ENDPOINTS.CHIPI }
447
+ );
446
448
  walletType = getWalletTypeFromClassHash(onChainClassHash) ?? "READY";
447
449
  } catch {
448
450
  }