@chipi-stack/backend 14.16.0 → 14.17.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/README.md +48 -0
- package/dist/index.d.mts +396 -67
- package/dist/index.d.ts +396 -67
- package/dist/index.js +632 -161
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +613 -163
- package/dist/index.mjs.map +1 -1
- package/dist/skuPurchases.js +16 -2
- package/dist/skuPurchases.js.map +1 -1
- package/dist/skuPurchases.mjs +16 -2
- package/dist/skuPurchases.mjs.map +1 -1
- package/dist/transactions.js +16 -2
- package/dist/transactions.js.map +1 -1
- package/dist/transactions.mjs +16 -2
- package/dist/transactions.mjs.map +1 -1
- package/dist/wallets.js +25 -3
- package/dist/wallets.js.map +1 -1
- package/dist/wallets.mjs +25 -3
- package/dist/wallets.mjs.map +1 -1
- package/package.json +4 -4
package/dist/skuPurchases.js
CHANGED
|
@@ -288,6 +288,7 @@ var init_ed25519 = __esm({
|
|
|
288
288
|
var execute_paymaster_raw_exports = {};
|
|
289
289
|
__export(execute_paymaster_raw_exports, {
|
|
290
290
|
executeShhhSponsoredRaw: () => executeShhhSponsoredRaw,
|
|
291
|
+
newOeNonce: () => newOeNonce,
|
|
291
292
|
resolveShhhChainId: () => resolveShhhChainId,
|
|
292
293
|
serializeExecuteFromOutsideV2Calldata: () => serializeExecuteFromOutsideV2Calldata
|
|
293
294
|
});
|
|
@@ -406,13 +407,26 @@ var init_execute_paymaster_raw = __esm({
|
|
|
406
407
|
|
|
407
408
|
// src/execute-paymaster-transaction.ts
|
|
408
409
|
init_encryption2();
|
|
410
|
+
function feltEquals(value, expected) {
|
|
411
|
+
try {
|
|
412
|
+
return BigInt(value) === expected;
|
|
413
|
+
} catch {
|
|
414
|
+
return false;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
409
417
|
function normalizeSignature(signature) {
|
|
410
418
|
if (Array.isArray(signature)) {
|
|
411
419
|
if (signature.length < 2) {
|
|
412
420
|
throw new Error(`Array signature must have at least 2 elements, got ${signature.length}`);
|
|
413
421
|
}
|
|
414
|
-
const
|
|
415
|
-
|
|
422
|
+
const isArgentSingle = signature.length === 5 && feltEquals(signature[0], 1n) && feltEquals(signature[1], 0n);
|
|
423
|
+
if (signature.length !== 2 && !isArgentSingle) {
|
|
424
|
+
throw new Error(
|
|
425
|
+
`Unsupported ${signature.length}-felt signature: expected [r, s] or Argent [1, 0, pubkey, r, s].`
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
const r = isArgentSingle ? signature[3] : signature[0];
|
|
429
|
+
const s = isArgentSingle ? signature[4] : signature[1];
|
|
416
430
|
if (r == null || s == null) {
|
|
417
431
|
throw new Error(`Signature elements must not be null/undefined. Got r=${r}, s=${s}`);
|
|
418
432
|
}
|