@chipi-stack/backend 14.8.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 +199 -13
- package/dist/index.d.ts +199 -13
- package/dist/index.js +160 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +155 -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/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 } from '@chipi-stack/shared';
|
|
2
|
+
import { WALLET_RPC_ENDPOINTS, SHHH_VERIFIER_CLASS_HASHES, WALLET_CLASS_HASHES, API_ENDPOINTS, ChipiTransactionError, ChipiApiError, getWalletTypeFromClassHash } from '@chipi-stack/shared';
|
|
3
3
|
import CryptoES from 'crypto-es';
|
|
4
4
|
import { randomBytes } from 'crypto';
|
|
5
5
|
|
|
@@ -510,7 +510,15 @@ var executePaymasterTransaction = async ({
|
|
|
510
510
|
usePasskey ? "encryptKey is required when using passkey. The passkey authentication should have provided the encryptKey." : "encryptKey is required for transaction execution"
|
|
511
511
|
);
|
|
512
512
|
}
|
|
513
|
-
|
|
513
|
+
let walletType = wallet.walletType ?? "READY";
|
|
514
|
+
if (!wallet.walletType) {
|
|
515
|
+
try {
|
|
516
|
+
const resolveProvider = new RpcProvider({ nodeUrl: WALLET_RPC_ENDPOINTS.CHIPI });
|
|
517
|
+
const onChainClassHash = await resolveProvider.getClassHashAt(wallet.publicKey, "latest");
|
|
518
|
+
walletType = getWalletTypeFromClassHash(onChainClassHash) ?? "READY";
|
|
519
|
+
} catch {
|
|
520
|
+
}
|
|
521
|
+
}
|
|
514
522
|
if (walletType === "SHHH") {
|
|
515
523
|
const { executeShhhSponsoredRaw: executeShhhSponsoredRaw2 } = await Promise.resolve().then(() => (init_execute_paymaster_raw(), execute_paymaster_raw_exports));
|
|
516
524
|
const shhhSignerKind = (wallet.signerKind ?? "STARK") || "STARK";
|