@chipi-stack/backend 14.7.0 → 14.9.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/index.d.mts +326 -2
- package/dist/index.d.ts +326 -2
- package/dist/index.js +235 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +229 -2
- package/dist/index.mjs.map +1 -1
- package/dist/skuPurchases.js +9 -1
- package/dist/skuPurchases.js.map +1 -1
- package/dist/skuPurchases.mjs +10 -2
- package/dist/skuPurchases.mjs.map +1 -1
- package/dist/transactions.js +9 -1
- package/dist/transactions.js.map +1 -1
- package/dist/transactions.mjs +10 -2
- package/dist/transactions.mjs.map +1 -1
- package/dist/wallets.js +9 -1
- package/dist/wallets.js.map +1 -1
- package/dist/wallets.mjs +10 -2
- package/dist/wallets.mjs.map +1 -1
- package/package.json +3 -3
package/dist/skuPurchases.mjs
CHANGED
|
@@ -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, WALLET_CLASS_HASHES } from '@chipi-stack/shared';
|
|
3
|
+
import { formatAmount, SKU_CONTRACTS, CARRIER_IDS, SERVICE_TYPES, API_ENDPOINTS, 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;
|
|
@@ -438,7 +438,15 @@ var executePaymasterTransaction = async ({
|
|
|
438
438
|
usePasskey ? "encryptKey is required when using passkey. The passkey authentication should have provided the encryptKey." : "encryptKey is required for transaction execution"
|
|
439
439
|
);
|
|
440
440
|
}
|
|
441
|
-
|
|
441
|
+
let walletType = wallet.walletType ?? "READY";
|
|
442
|
+
if (!wallet.walletType) {
|
|
443
|
+
try {
|
|
444
|
+
const resolveProvider = new RpcProvider({ nodeUrl: WALLET_RPC_ENDPOINTS.CHIPI });
|
|
445
|
+
const onChainClassHash = await resolveProvider.getClassHashAt(wallet.publicKey, "latest");
|
|
446
|
+
walletType = getWalletTypeFromClassHash(onChainClassHash) ?? "READY";
|
|
447
|
+
} catch {
|
|
448
|
+
}
|
|
449
|
+
}
|
|
442
450
|
if (walletType === "SHHH") {
|
|
443
451
|
const { executeShhhSponsoredRaw: executeShhhSponsoredRaw2 } = await Promise.resolve().then(() => (init_execute_paymaster_raw(), execute_paymaster_raw_exports));
|
|
444
452
|
const shhhSignerKind = (wallet.signerKind ?? "STARK") || "STARK";
|