@pafi-dev/issuer 0.40.0 → 0.41.1

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
@@ -1,4 +1,4 @@
1
- import { PafiSdkError, SdkErrorHttpStatus, PointTokenDomainConfig, PartialUserOperation, BurnRequest, PoolKey, RedemptionPolicy, RedemptionPolicySource, RedemptionPreview, RedemptionDecision, RedemptionDenialCode, decodeKernelExecuteCalls, BROKER_HASHES, PafiErrorType, BuiltSponsorAuth, ENTRY_POINT_V08 } from '@pafi-dev/core';
1
+ import { PafiSdkError, SdkErrorHttpStatus, PointTokenDomainConfig, PartialUserOperation, BurnRequest, PoolKey, RedemptionPolicy, RedemptionPolicySource, RedemptionPreview, RedemptionDecision, RedemptionDenialCode, decodeKernelExecuteCalls, BROKER_HASHES, PafiErrorType, ENTRY_POINT_V07 } from '@pafi-dev/core';
2
2
  export { PAFI_SUBGRAPH_URL, PafiErrorType, PafiSdkError, SDK_ERROR_HTTP_STATUS_CODE, SdkErrorHttpStatus, ValidationError, defaultErrorTypeForStatus } from '@pafi-dev/core';
3
3
  export { GenericHttpExceptionDescriptor, NormalizeContext, PafiErrorEnvelope, PafiErrorPayload, buildErrorEnvelope, payloadFromGenericError, payloadFromHttpException, payloadFromPafiSdkError } from './http/index.cjs';
4
4
  import { Address, Hex, PublicClient, WalletClient } from 'viem';
@@ -2749,7 +2749,11 @@ interface HandleMobileSubmitParams {
2749
2749
  */
2750
2750
  bindUserOpHash: (lockId: string, userOpHash: Hex) => Promise<void>;
2751
2751
  pafiBackendClient?: PafiBackendClient | null;
2752
- /** Defaults to `ENTRY_POINT_V08`. */
2752
+ /**
2753
+ * Defaults to `ENTRY_POINT_V07` — the version ZeroDev Kernel v3.3
2754
+ * validates against and the only one sponsor-relayer's /bundler/relay
2755
+ * accepts. Do NOT pass v0.8 (retired with the Pimlico stack).
2756
+ */
2753
2757
  entryPoint?: string;
2754
2758
  }
2755
2759
  /**
@@ -2788,7 +2792,7 @@ interface IssuerStateValidatorLike {
2788
2792
  *
2789
2793
  * Caller fetches AA + mintRequest nonces (so issuers can plug in their
2790
2794
  * own composer — gg56 uses a timestamp-key 2D nonce). Caller layers
2791
- * paymaster sponsorship + sponsorAuth on top of the returned UserOps.
2795
+ * paymaster sponsorship on top of the returned UserOps.
2792
2796
  */
2793
2797
  type PTClaimErrorCode = "INVALID_AMOUNT" | "VALIDATION_FAILED" | "BUILD_FAILED" | "NONCE_READ_FAILED" | "NONCE_IN_FLIGHT" | "UNSUPPORTED_POINT_TOKEN";
2794
2798
  declare class PTClaimError extends PafiSdkError {
@@ -3245,7 +3249,7 @@ declare function createIssuerService(config: IssuerServiceConfig): Promise<Issue
3245
3249
  * What this absorbs:
3246
3250
  * - Reading + reshaping IssuerApiHandlers responses into wire DTOs
3247
3251
  * (bigint → string, etc.)
3248
- * - Composing handler.handle() output with sponsorAuth + decoded calls
3252
+ * - Composing handler.handle() output with decoded calls
3249
3253
  * - Wiring handleMobilePrepare / handleMobileSubmit / handleClaimStatus
3250
3254
  * - Quoting PT → USDT for the cashout preview
3251
3255
  *
@@ -3263,9 +3267,15 @@ interface IssuerApiAdapterConfig {
3263
3267
  issuerService: IssuerService;
3264
3268
  ledger: IPointLedger;
3265
3269
  provider: PublicClient;
3266
- /** Issuer signer wallet — used for `buildSponsorAuth` (EIP-712 sign). */
3267
- issuerSignerWallet: WalletClient;
3268
- /** Optional issuer id when omitted, sponsorAuth is skipped (returns `undefined`). */
3270
+ /**
3271
+ * @deprecated No longer used. `sponsorAuth` was removed — nothing
3272
+ * validated it (the sponsor-relayer independently decodes
3273
+ * `UserOp.callData` to validate intent + fee), so signing it burned one
3274
+ * HSM/KMS signature per request for no security benefit. Kept optional
3275
+ * for back-compat; safe to stop passing.
3276
+ */
3277
+ issuerSignerWallet?: WalletClient;
3278
+ /** @deprecated No longer used — see {@link IssuerApiAdapterConfig.issuerSignerWallet}. */
3269
3279
  pafiIssuerId?: string;
3270
3280
  /** Sig-gated mint handler. Required for `claim` / `claimPrepare`. */
3271
3281
  ptClaimHandler?: PTClaimHandler | null;
@@ -3309,7 +3319,6 @@ interface ClaimDto {
3309
3319
  feeAmount: string;
3310
3320
  lockId: string;
3311
3321
  signatureDeadline: string;
3312
- sponsorAuth?: BuiltSponsorAuth;
3313
3322
  }
3314
3323
  interface RedeemDto {
3315
3324
  calls: DecodedCallDto[];
@@ -3321,7 +3330,6 @@ interface RedeemDto {
3321
3330
  netCreditAmountFallback?: string;
3322
3331
  expiresInSeconds: number;
3323
3332
  signatureDeadline: string;
3324
- sponsorAuth?: BuiltSponsorAuth;
3325
3333
  }
3326
3334
  interface PerpDepositDto {
3327
3335
  calls: DecodedCallDto[];
@@ -3334,7 +3342,6 @@ interface PerpDepositDto {
3334
3342
  brokerHash: Hex;
3335
3343
  usdcAddress: Address;
3336
3344
  relayAddress: Address;
3337
- sponsorAuth?: BuiltSponsorAuth;
3338
3345
  }
3339
3346
  interface MobilePrepareDto {
3340
3347
  lockId: string;
@@ -3445,11 +3452,6 @@ declare class IssuerApiAdapter {
3445
3452
  }): Promise<MobileSubmitDto>;
3446
3453
  claimStatus(authenticatedAddress: Address, lockId: string): Promise<MintStatusResponse>;
3447
3454
  redeemStatus(authenticatedAddress: Address, lockId: string): Promise<BurnStatusResponse>;
3448
- /**
3449
- * Build + sign a SponsorAuth payload. Returns `undefined` when no
3450
- * issuer id is configured, so the controller can skip the field.
3451
- */
3452
- private buildSponsorAuth;
3453
3455
  private runMobilePrepare;
3454
3456
  private assertRedeemHandler;
3455
3457
  /**
@@ -3735,8 +3737,8 @@ interface RequestPaymasterParams {
3735
3737
  declare function requestPaymaster(params: RequestPaymasterParams): Promise<Awaited<ReturnType<PafiBackendClient["requestSponsorship"]>> | undefined>;
3736
3738
  interface RelayUserOpParams {
3737
3739
  client: PafiBackendClient | null | undefined;
3738
- /** EntryPoint address — typically `ENTRY_POINT_V08` from core. */
3739
- entryPoint: typeof ENTRY_POINT_V08 | string;
3740
+ /** EntryPoint address — typically `ENTRY_POINT_V07` from core. */
3741
+ entryPoint: typeof ENTRY_POINT_V07 | string;
3740
3742
  userOp: Record<string, string | null>;
3741
3743
  /** EIP-7702 authorization (delegation UserOps only). */
3742
3744
  eip7702Auth?: {
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { PafiSdkError, SdkErrorHttpStatus, PointTokenDomainConfig, PartialUserOperation, BurnRequest, PoolKey, RedemptionPolicy, RedemptionPolicySource, RedemptionPreview, RedemptionDecision, RedemptionDenialCode, decodeKernelExecuteCalls, BROKER_HASHES, PafiErrorType, BuiltSponsorAuth, ENTRY_POINT_V08 } from '@pafi-dev/core';
1
+ import { PafiSdkError, SdkErrorHttpStatus, PointTokenDomainConfig, PartialUserOperation, BurnRequest, PoolKey, RedemptionPolicy, RedemptionPolicySource, RedemptionPreview, RedemptionDecision, RedemptionDenialCode, decodeKernelExecuteCalls, BROKER_HASHES, PafiErrorType, ENTRY_POINT_V07 } from '@pafi-dev/core';
2
2
  export { PAFI_SUBGRAPH_URL, PafiErrorType, PafiSdkError, SDK_ERROR_HTTP_STATUS_CODE, SdkErrorHttpStatus, ValidationError, defaultErrorTypeForStatus } from '@pafi-dev/core';
3
3
  export { GenericHttpExceptionDescriptor, NormalizeContext, PafiErrorEnvelope, PafiErrorPayload, buildErrorEnvelope, payloadFromGenericError, payloadFromHttpException, payloadFromPafiSdkError } from './http/index.js';
4
4
  import { Address, Hex, PublicClient, WalletClient } from 'viem';
@@ -2749,7 +2749,11 @@ interface HandleMobileSubmitParams {
2749
2749
  */
2750
2750
  bindUserOpHash: (lockId: string, userOpHash: Hex) => Promise<void>;
2751
2751
  pafiBackendClient?: PafiBackendClient | null;
2752
- /** Defaults to `ENTRY_POINT_V08`. */
2752
+ /**
2753
+ * Defaults to `ENTRY_POINT_V07` — the version ZeroDev Kernel v3.3
2754
+ * validates against and the only one sponsor-relayer's /bundler/relay
2755
+ * accepts. Do NOT pass v0.8 (retired with the Pimlico stack).
2756
+ */
2753
2757
  entryPoint?: string;
2754
2758
  }
2755
2759
  /**
@@ -2788,7 +2792,7 @@ interface IssuerStateValidatorLike {
2788
2792
  *
2789
2793
  * Caller fetches AA + mintRequest nonces (so issuers can plug in their
2790
2794
  * own composer — gg56 uses a timestamp-key 2D nonce). Caller layers
2791
- * paymaster sponsorship + sponsorAuth on top of the returned UserOps.
2795
+ * paymaster sponsorship on top of the returned UserOps.
2792
2796
  */
2793
2797
  type PTClaimErrorCode = "INVALID_AMOUNT" | "VALIDATION_FAILED" | "BUILD_FAILED" | "NONCE_READ_FAILED" | "NONCE_IN_FLIGHT" | "UNSUPPORTED_POINT_TOKEN";
2794
2798
  declare class PTClaimError extends PafiSdkError {
@@ -3245,7 +3249,7 @@ declare function createIssuerService(config: IssuerServiceConfig): Promise<Issue
3245
3249
  * What this absorbs:
3246
3250
  * - Reading + reshaping IssuerApiHandlers responses into wire DTOs
3247
3251
  * (bigint → string, etc.)
3248
- * - Composing handler.handle() output with sponsorAuth + decoded calls
3252
+ * - Composing handler.handle() output with decoded calls
3249
3253
  * - Wiring handleMobilePrepare / handleMobileSubmit / handleClaimStatus
3250
3254
  * - Quoting PT → USDT for the cashout preview
3251
3255
  *
@@ -3263,9 +3267,15 @@ interface IssuerApiAdapterConfig {
3263
3267
  issuerService: IssuerService;
3264
3268
  ledger: IPointLedger;
3265
3269
  provider: PublicClient;
3266
- /** Issuer signer wallet — used for `buildSponsorAuth` (EIP-712 sign). */
3267
- issuerSignerWallet: WalletClient;
3268
- /** Optional issuer id when omitted, sponsorAuth is skipped (returns `undefined`). */
3270
+ /**
3271
+ * @deprecated No longer used. `sponsorAuth` was removed — nothing
3272
+ * validated it (the sponsor-relayer independently decodes
3273
+ * `UserOp.callData` to validate intent + fee), so signing it burned one
3274
+ * HSM/KMS signature per request for no security benefit. Kept optional
3275
+ * for back-compat; safe to stop passing.
3276
+ */
3277
+ issuerSignerWallet?: WalletClient;
3278
+ /** @deprecated No longer used — see {@link IssuerApiAdapterConfig.issuerSignerWallet}. */
3269
3279
  pafiIssuerId?: string;
3270
3280
  /** Sig-gated mint handler. Required for `claim` / `claimPrepare`. */
3271
3281
  ptClaimHandler?: PTClaimHandler | null;
@@ -3309,7 +3319,6 @@ interface ClaimDto {
3309
3319
  feeAmount: string;
3310
3320
  lockId: string;
3311
3321
  signatureDeadline: string;
3312
- sponsorAuth?: BuiltSponsorAuth;
3313
3322
  }
3314
3323
  interface RedeemDto {
3315
3324
  calls: DecodedCallDto[];
@@ -3321,7 +3330,6 @@ interface RedeemDto {
3321
3330
  netCreditAmountFallback?: string;
3322
3331
  expiresInSeconds: number;
3323
3332
  signatureDeadline: string;
3324
- sponsorAuth?: BuiltSponsorAuth;
3325
3333
  }
3326
3334
  interface PerpDepositDto {
3327
3335
  calls: DecodedCallDto[];
@@ -3334,7 +3342,6 @@ interface PerpDepositDto {
3334
3342
  brokerHash: Hex;
3335
3343
  usdcAddress: Address;
3336
3344
  relayAddress: Address;
3337
- sponsorAuth?: BuiltSponsorAuth;
3338
3345
  }
3339
3346
  interface MobilePrepareDto {
3340
3347
  lockId: string;
@@ -3445,11 +3452,6 @@ declare class IssuerApiAdapter {
3445
3452
  }): Promise<MobileSubmitDto>;
3446
3453
  claimStatus(authenticatedAddress: Address, lockId: string): Promise<MintStatusResponse>;
3447
3454
  redeemStatus(authenticatedAddress: Address, lockId: string): Promise<BurnStatusResponse>;
3448
- /**
3449
- * Build + sign a SponsorAuth payload. Returns `undefined` when no
3450
- * issuer id is configured, so the controller can skip the field.
3451
- */
3452
- private buildSponsorAuth;
3453
3455
  private runMobilePrepare;
3454
3456
  private assertRedeemHandler;
3455
3457
  /**
@@ -3735,8 +3737,8 @@ interface RequestPaymasterParams {
3735
3737
  declare function requestPaymaster(params: RequestPaymasterParams): Promise<Awaited<ReturnType<PafiBackendClient["requestSponsorship"]>> | undefined>;
3736
3738
  interface RelayUserOpParams {
3737
3739
  client: PafiBackendClient | null | undefined;
3738
- /** EntryPoint address — typically `ENTRY_POINT_V08` from core. */
3739
- entryPoint: typeof ENTRY_POINT_V08 | string;
3740
+ /** EntryPoint address — typically `ENTRY_POINT_V07` from core. */
3741
+ entryPoint: typeof ENTRY_POINT_V07 | string;
3740
3742
  userOp: Record<string, string | null>;
3741
3743
  /** EIP-7702 authorization (delegation UserOps only). */
3742
3744
  eip7702Auth?: {
package/dist/index.js CHANGED
@@ -2440,7 +2440,7 @@ __name(handleRedeemStatus, "handleRedeemStatus");
2440
2440
 
2441
2441
  // src/api/mobileHandlers.ts
2442
2442
  import { getAddress as getAddress8 } from "viem";
2443
- import { ENTRY_POINT_V08, parseEip7702DelegatedAddress } from "@pafi-dev/core";
2443
+ import { ENTRY_POINT_V07, parseEip7702DelegatedAddress } from "@pafi-dev/core";
2444
2444
 
2445
2445
  // src/userop-store/serialize.ts
2446
2446
  import { serializeUserOpToJsonRpc } from "@pafi-dev/core";
@@ -2784,7 +2784,7 @@ async function handleMobileSubmit(params) {
2784
2784
  const result = await relayUserOp({
2785
2785
  client: params.pafiBackendClient,
2786
2786
  userOp: userOpJson,
2787
- entryPoint: params.entryPoint ?? ENTRY_POINT_V08,
2787
+ entryPoint: params.entryPoint ?? ENTRY_POINT_V07,
2788
2788
  eip7702Auth: entry.eip7702Auth
2789
2789
  });
2790
2790
  const targetLockId = variant === "fallback" && entry.fallback?.lockId ? entry.fallback.lockId : params.lockId;
@@ -3157,7 +3157,7 @@ var PerpDepositHandler = class {
3157
3157
 
3158
3158
  // src/api/issuerApiAdapter.ts
3159
3159
  import { getAddress as getAddress10 } from "viem";
3160
- import { buildAndSignSponsorAuth, decodeKernelExecuteCalls as decodeKernelExecuteCalls3 } from "@pafi-dev/core";
3160
+ import { decodeKernelExecuteCalls as decodeKernelExecuteCalls3 } from "@pafi-dev/core";
3161
3161
  var AdapterMisconfiguredError = class extends Error {
3162
3162
  static {
3163
3163
  __name(this, "AdapterMisconfiguredError");
@@ -3246,14 +3246,12 @@ var IssuerApiAdapter = class {
3246
3246
  chainId: input.chainId,
3247
3247
  aaNonce: input.aaNonce
3248
3248
  });
3249
- const sponsorAuth = await this.buildSponsorAuth(input.authenticatedAddress, result.userOp.callData, input.chainId, "mint");
3250
3249
  return {
3251
3250
  calls: result.calls,
3252
3251
  callsFallback: result.callsFallback,
3253
3252
  feeAmount: result.feeAmount.toString(),
3254
3253
  lockId: result.lockId,
3255
- signatureDeadline: result.signatureDeadline.toString(),
3256
- sponsorAuth
3254
+ signatureDeadline: result.signatureDeadline.toString()
3257
3255
  };
3258
3256
  }
3259
3257
  async redeem(input) {
@@ -3267,7 +3265,6 @@ var IssuerApiAdapter = class {
3267
3265
  aaNonce: input.aaNonce,
3268
3266
  chainId: input.chainId
3269
3267
  });
3270
- const sponsorAuth = await this.buildSponsorAuth(input.authenticatedAddress, response.userOp.callData, input.chainId, "burn");
3271
3268
  return {
3272
3269
  calls: decodeKernelExecuteCalls3(response.userOp.callData),
3273
3270
  callsFallback: response.fallback ? decodeKernelExecuteCalls3(response.fallback.userOp.callData) : void 0,
@@ -3277,8 +3274,7 @@ var IssuerApiAdapter = class {
3277
3274
  netCreditAmount: response.netCreditAmount.toString(),
3278
3275
  netCreditAmountFallback: response.fallback?.netCreditAmount.toString(),
3279
3276
  expiresInSeconds: response.expiresInSeconds,
3280
- signatureDeadline: response.signatureDeadline.toString(),
3281
- sponsorAuth
3277
+ signatureDeadline: response.signatureDeadline.toString()
3282
3278
  };
3283
3279
  }
3284
3280
  // swap() removed (2026-04-27) — moved to @pafi-dev/trading.
@@ -3292,7 +3288,6 @@ var IssuerApiAdapter = class {
3292
3288
  brokerId: input.brokerId,
3293
3289
  aaNonce: input.aaNonce
3294
3290
  });
3295
- const sponsorAuth = await this.buildSponsorAuth(input.authenticatedAddress, result.userOp.callData, input.chainId, "perp-deposit");
3296
3291
  return {
3297
3292
  calls: result.calls,
3298
3293
  callsFallback: result.callsFallback,
@@ -3303,8 +3298,7 @@ var IssuerApiAdapter = class {
3303
3298
  accountId: result.accountId,
3304
3299
  brokerHash: result.brokerHash,
3305
3300
  usdcAddress: result.usdcAddress,
3306
- relayAddress: result.relayAddress,
3307
- sponsorAuth
3301
+ relayAddress: result.relayAddress
3308
3302
  };
3309
3303
  }
3310
3304
  // ------------------------------ Mobile endpoints -------------------------
@@ -3404,21 +3398,6 @@ var IssuerApiAdapter = class {
3404
3398
  // bundler applies SetCode + handleOps in one tx, so there is no
3405
3399
  // separate `/delegate/*` flow. See `handleMobilePrepare`.
3406
3400
  // ------------------------------ Internal helpers -------------------------
3407
- /**
3408
- * Build + sign a SponsorAuth payload. Returns `undefined` when no
3409
- * issuer id is configured, so the controller can skip the field.
3410
- */
3411
- async buildSponsorAuth(authenticatedAddress, callData, chainId, scenario) {
3412
- if (!this.cfg.pafiIssuerId) return void 0;
3413
- return buildAndSignSponsorAuth({
3414
- userAddress: authenticatedAddress,
3415
- callData,
3416
- chainId,
3417
- scenario,
3418
- issuerId: this.cfg.pafiIssuerId,
3419
- issuerSignerWallet: this.cfg.issuerSignerWallet
3420
- });
3421
- }
3422
3401
  async runMobilePrepare(authenticatedAddress, chainId, lockId, partialUserOp, partialUserOpFallback, scenario, pointTokenAddress, ttlSeconds, eip7702Auth, lockIdFallback) {
3423
3402
  return await handleMobilePrepare({
3424
3403
  userAddress: authenticatedAddress,
@@ -4775,7 +4754,7 @@ var MemoryRedemptionHistoryStore = class {
4775
4754
  };
4776
4755
 
4777
4756
  // src/index.ts
4778
- var PAFI_ISSUER_SDK_VERSION = true ? "0.40.0" : "dev";
4757
+ var PAFI_ISSUER_SDK_VERSION = true ? "0.41.1" : "dev";
4779
4758
  export {
4780
4759
  AdapterMisconfiguredError,
4781
4760
  AuthError,