@chipi-stack/backend 14.15.1 → 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.
@@ -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 r = signature[0];
415
- const s = signature[1];
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
  }