@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.
@@ -282,6 +282,7 @@ var init_ed25519 = __esm({
282
282
  var execute_paymaster_raw_exports = {};
283
283
  __export(execute_paymaster_raw_exports, {
284
284
  executeShhhSponsoredRaw: () => executeShhhSponsoredRaw,
285
+ newOeNonce: () => newOeNonce,
285
286
  resolveShhhChainId: () => resolveShhhChainId,
286
287
  serializeExecuteFromOutsideV2Calldata: () => serializeExecuteFromOutsideV2Calldata
287
288
  });
@@ -400,13 +401,26 @@ var init_execute_paymaster_raw = __esm({
400
401
 
401
402
  // src/execute-paymaster-transaction.ts
402
403
  init_encryption2();
404
+ function feltEquals(value, expected) {
405
+ try {
406
+ return BigInt(value) === expected;
407
+ } catch {
408
+ return false;
409
+ }
410
+ }
403
411
  function normalizeSignature(signature) {
404
412
  if (Array.isArray(signature)) {
405
413
  if (signature.length < 2) {
406
414
  throw new Error(`Array signature must have at least 2 elements, got ${signature.length}`);
407
415
  }
408
- const r = signature[0];
409
- const s = signature[1];
416
+ const isArgentSingle = signature.length === 5 && feltEquals(signature[0], 1n) && feltEquals(signature[1], 0n);
417
+ if (signature.length !== 2 && !isArgentSingle) {
418
+ throw new Error(
419
+ `Unsupported ${signature.length}-felt signature: expected [r, s] or Argent [1, 0, pubkey, r, s].`
420
+ );
421
+ }
422
+ const r = isArgentSingle ? signature[3] : signature[0];
423
+ const s = isArgentSingle ? signature[4] : signature[1];
410
424
  if (r == null || s == null) {
411
425
  throw new Error(`Signature elements must not be null/undefined. Got r=${r}, s=${s}`);
412
426
  }