@pafi-dev/issuer 0.7.4 → 0.7.6

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.cts CHANGED
@@ -1294,6 +1294,24 @@ interface SponsorshipRequest {
1294
1294
  scenario: string;
1295
1295
  userOp: SponsorshipUserOp;
1296
1296
  target: SponsorshipTarget;
1297
+ /**
1298
+ * EIP-7702 authorization tuple — REQUIRED for the `delegate`
1299
+ * scenario so Pimlico's `pm_sponsorUserOperation` can simulate the
1300
+ * UserOp with the EOA already delegated. Without it, simulator
1301
+ * reverts `AA20 account not deployed` (chicken-and-egg: the same
1302
+ * UserOp anchors the delegation).
1303
+ *
1304
+ * Optional for non-delegate scenarios where the sender already
1305
+ * has bytecode (i.e. delegated previously). v0.7.5 added.
1306
+ */
1307
+ eip7702Auth?: {
1308
+ chainId: string;
1309
+ address: string;
1310
+ nonce: string;
1311
+ r: string;
1312
+ s: string;
1313
+ yParity: string;
1314
+ };
1297
1315
  }
1298
1316
  interface SponsorshipResponse {
1299
1317
  paymaster: Address;
@@ -2643,6 +2661,22 @@ interface RequestPaymasterParams {
2643
2661
  * scenario name).
2644
2662
  */
2645
2663
  functionName?: string;
2664
+ /**
2665
+ * EIP-7702 authorization tuple — REQUIRED for the `delegate`
2666
+ * scenario. Forwarded to sponsor-relayer's `/paymaster/sponsor`
2667
+ * which embeds it into the UserOp before `pm_sponsorUserOperation`,
2668
+ * letting Pimlico simulate the delegation atomically with the
2669
+ * sponsored UserOp. Without this, simulator throws
2670
+ * `AA20 account not deployed`. v0.7.5 added.
2671
+ */
2672
+ eip7702Auth?: {
2673
+ chainId: string;
2674
+ address: string;
2675
+ nonce: string;
2676
+ r: string;
2677
+ s: string;
2678
+ yParity: string;
2679
+ };
2646
2680
  /** Optional logger for the "sponsorship declined" warning. */
2647
2681
  onWarning?: (msg: string) => void;
2648
2682
  }
package/dist/index.d.ts CHANGED
@@ -1294,6 +1294,24 @@ interface SponsorshipRequest {
1294
1294
  scenario: string;
1295
1295
  userOp: SponsorshipUserOp;
1296
1296
  target: SponsorshipTarget;
1297
+ /**
1298
+ * EIP-7702 authorization tuple — REQUIRED for the `delegate`
1299
+ * scenario so Pimlico's `pm_sponsorUserOperation` can simulate the
1300
+ * UserOp with the EOA already delegated. Without it, simulator
1301
+ * reverts `AA20 account not deployed` (chicken-and-egg: the same
1302
+ * UserOp anchors the delegation).
1303
+ *
1304
+ * Optional for non-delegate scenarios where the sender already
1305
+ * has bytecode (i.e. delegated previously). v0.7.5 added.
1306
+ */
1307
+ eip7702Auth?: {
1308
+ chainId: string;
1309
+ address: string;
1310
+ nonce: string;
1311
+ r: string;
1312
+ s: string;
1313
+ yParity: string;
1314
+ };
1297
1315
  }
1298
1316
  interface SponsorshipResponse {
1299
1317
  paymaster: Address;
@@ -2643,6 +2661,22 @@ interface RequestPaymasterParams {
2643
2661
  * scenario name).
2644
2662
  */
2645
2663
  functionName?: string;
2664
+ /**
2665
+ * EIP-7702 authorization tuple — REQUIRED for the `delegate`
2666
+ * scenario. Forwarded to sponsor-relayer's `/paymaster/sponsor`
2667
+ * which embeds it into the UserOp before `pm_sponsorUserOperation`,
2668
+ * letting Pimlico simulate the delegation atomically with the
2669
+ * sponsored UserOp. Without this, simulator throws
2670
+ * `AA20 account not deployed`. v0.7.5 added.
2671
+ */
2672
+ eip7702Auth?: {
2673
+ chainId: string;
2674
+ address: string;
2675
+ nonce: string;
2676
+ r: string;
2677
+ s: string;
2678
+ yParity: string;
2679
+ };
2646
2680
  /** Optional logger for the "sponsorship declined" warning. */
2647
2681
  onWarning?: (msg: string) => void;
2648
2682
  }
package/dist/index.js CHANGED
@@ -1862,7 +1862,8 @@ async function requestPaymaster(params) {
1862
1862
  contract: params.pointTokenAddress,
1863
1863
  function: fn,
1864
1864
  pointToken: params.pointTokenAddress
1865
- }
1865
+ },
1866
+ ...params.eip7702Auth ? { eip7702Auth: params.eip7702Auth } : {}
1866
1867
  });
1867
1868
  } catch (err) {
1868
1869
  const msg = err instanceof Error ? err.message : String(err);
@@ -2311,12 +2312,19 @@ async function handleDelegateSubmit(params) {
2311
2312
  maxFeePerGas: params.fees.maxFeePerGas ?? 0n,
2312
2313
  maxPriorityFeePerGas: params.fees.maxPriorityFeePerGas ?? 0n
2313
2314
  };
2315
+ const authorization = buildEip7702Authorization({
2316
+ chainId: params.chainId,
2317
+ address: batchExecutor,
2318
+ nonce: params.delegationNonce,
2319
+ authSig: params.authSig
2320
+ });
2314
2321
  const paymasterFields = await requestPaymaster({
2315
2322
  client: params.pafiBackendClient,
2316
2323
  chainId: params.chainId,
2317
2324
  scenario: "delegate",
2318
2325
  userOp,
2319
2326
  pointTokenAddress: batchExecutor,
2327
+ eip7702Auth: authorization,
2320
2328
  onWarning: params.onWarning
2321
2329
  });
2322
2330
  const merged = {
@@ -2342,12 +2350,6 @@ async function handleDelegateSubmit(params) {
2342
2350
  // is the user's "consent"; no separate AA signature is needed.
2343
2351
  "0x"
2344
2352
  );
2345
- const authorization = buildEip7702Authorization({
2346
- chainId: params.chainId,
2347
- address: batchExecutor,
2348
- nonce: params.delegationNonce,
2349
- authSig: params.authSig
2350
- });
2351
2353
  const result = await relayUserOp({
2352
2354
  client: params.pafiBackendClient,
2353
2355
  userOp: userOpJson,
@@ -3640,7 +3642,7 @@ var IssuerStateValidator = class _IssuerStateValidator {
3640
3642
  };
3641
3643
 
3642
3644
  // src/index.ts
3643
- var PAFI_ISSUER_SDK_VERSION = true ? "0.7.4" : "dev";
3645
+ var PAFI_ISSUER_SDK_VERSION = true ? "0.7.6" : "dev";
3644
3646
  export {
3645
3647
  AdapterMisconfiguredError,
3646
3648
  AuthError,