@pafi-dev/issuer 0.23.0 → 0.25.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/dist/index.d.cts CHANGED
@@ -1029,6 +1029,23 @@ interface ISingletonLock {
1029
1029
  acquire(key: string): Promise<SingletonLockHandle | null>;
1030
1030
  }
1031
1031
 
1032
+ declare class PointIndexerFinalizeError extends Error {
1033
+ readonly context: {
1034
+ pointToken: Address;
1035
+ to: Address;
1036
+ amount: bigint;
1037
+ txHash: `0x${string}`;
1038
+ blockNumber: bigint;
1039
+ };
1040
+ readonly cause: unknown;
1041
+ constructor(message: string, context: {
1042
+ pointToken: Address;
1043
+ to: Address;
1044
+ amount: bigint;
1045
+ txHash: `0x${string}`;
1046
+ blockNumber: bigint;
1047
+ }, cause: unknown);
1048
+ }
1032
1049
  interface PointIndexerConfig {
1033
1050
  provider: PublicClient;
1034
1051
  pointTokenAddress: Address;
@@ -1179,6 +1196,33 @@ declare class PointIndexer {
1179
1196
  private finalize;
1180
1197
  }
1181
1198
 
1199
+ /**
1200
+ * Mirror of `PointIndexerFinalizeError` — raised when
1201
+ * `ledger.resolveCreditByBurnTx` rejects. See audit M-12: pre-fix this
1202
+ * was silently swallowed and the cursor advanced regardless,
1203
+ * permanently dropping confirmed on-chain burns from the off-chain
1204
+ * credit pipeline. Post-fix the error propagates, the chunk's cursor
1205
+ * save is skipped, and the next tick retries.
1206
+ */
1207
+ declare class BurnIndexerFinalizeError extends Error {
1208
+ readonly context: {
1209
+ pointToken: Address;
1210
+ from: Address;
1211
+ amount: bigint;
1212
+ txHash: `0x${string}`;
1213
+ blockNumber: bigint;
1214
+ lockId: string;
1215
+ };
1216
+ readonly cause: unknown;
1217
+ constructor(message: string, context: {
1218
+ pointToken: Address;
1219
+ from: Address;
1220
+ amount: bigint;
1221
+ txHash: `0x${string}`;
1222
+ blockNumber: bigint;
1223
+ lockId: string;
1224
+ }, cause: unknown);
1225
+ }
1182
1226
  interface BurnIndexerConfig {
1183
1227
  provider: PublicClient;
1184
1228
  pointTokenAddress: Address;
@@ -1421,7 +1465,6 @@ interface ApiUserRequest {
1421
1465
  pointTokenAddress: Address;
1422
1466
  }
1423
1467
  interface ApiUserResponse {
1424
- mintRequestNonce: bigint;
1425
1468
  /**
1426
1469
  * Off-chain point balance from the issuer's ledger (excludes PENDING locks).
1427
1470
  * This is what the user can claim into on-chain PT via `/claim`.
@@ -2651,7 +2694,7 @@ interface IssuerStateValidatorLike {
2651
2694
  * own composer — gg56 uses a timestamp-key 2D nonce). Caller layers
2652
2695
  * paymaster sponsorship + sponsorAuth on top of the returned UserOps.
2653
2696
  */
2654
- type PTClaimErrorCode = "INVALID_AMOUNT" | "VALIDATION_FAILED" | "BUILD_FAILED";
2697
+ type PTClaimErrorCode = "INVALID_AMOUNT" | "VALIDATION_FAILED" | "BUILD_FAILED" | "NONCE_READ_FAILED" | "NONCE_IN_FLIGHT";
2655
2698
  declare class PTClaimError extends PafiSdkError {
2656
2699
  readonly httpStatus: "unprocessable";
2657
2700
  readonly code: PTClaimErrorCode;
@@ -2708,8 +2751,6 @@ interface PTClaimRequest {
2708
2751
  chainId: number;
2709
2752
  /** ERC-4337 account nonce for the user's EOA. */
2710
2753
  aaNonce: bigint;
2711
- /** Current `mintRequestNonces[userAddress]` from PointToken. */
2712
- mintRequestNonce: bigint;
2713
2754
  }
2714
2755
  interface PTClaimResponse {
2715
2756
  /** Sponsored UserOp — mint + PT fee transfer (when feeAmount > 0). */
@@ -2730,6 +2771,7 @@ interface PTClaimResponse {
2730
2771
  }
2731
2772
  declare class PTClaimHandler {
2732
2773
  private readonly cfg;
2774
+ private readonly inFlightNonces;
2733
2775
  constructor(config: PTClaimHandlerConfig);
2734
2776
  handle(request: PTClaimRequest): Promise<PTClaimResponse>;
2735
2777
  }
@@ -3143,7 +3185,6 @@ interface PoolsDto {
3143
3185
  pools: unknown[];
3144
3186
  }
3145
3187
  interface UserDto {
3146
- mintRequestNonce: string;
3147
3188
  offChainBalance: string;
3148
3189
  onChainBalance: string;
3149
3190
  totalBalance: string;
@@ -3261,7 +3302,6 @@ declare class IssuerApiAdapter {
3261
3302
  pointTokenAddress: Address;
3262
3303
  amount: bigint;
3263
3304
  aaNonce: bigint;
3264
- mintRequestNonce: bigint;
3265
3305
  }): Promise<ClaimDto>;
3266
3306
  redeem(input: {
3267
3307
  authenticatedAddress: Address;
@@ -3283,7 +3323,6 @@ declare class IssuerApiAdapter {
3283
3323
  pointTokenAddress: Address;
3284
3324
  amount: bigint;
3285
3325
  aaNonce: bigint;
3286
- mintRequestNonce: bigint;
3287
3326
  }): Promise<MobilePrepareDto>;
3288
3327
  claimSubmit(input: {
3289
3328
  authenticatedAddress: Address;
@@ -3646,34 +3685,48 @@ declare function relayUserOp(params: RelayUserOpParams): Promise<{
3646
3685
  userOpHash: Hex;
3647
3686
  }>;
3648
3687
 
3688
+ /**
3689
+ * Registry record returned by `IssuerRegistry.getIssuer()` in V2
3690
+ * dual-bucket. Schema reshape from V1:
3691
+ *
3692
+ * V1: { issuerAddress, signerAddress, name, symbol, active, pointToken, mintingOracle }
3693
+ * V2: { signerAddress, name, active, capitalBase, basisPoints }
3694
+ *
3695
+ * `issuerAddress` is the lookup key the caller passed; we don't
3696
+ * re-emit it here because the caller already has it. `capitalBase` +
3697
+ * `basisPoints` drive the EQUITY-bucket cap (`capitalBase *
3698
+ * basisPoints / 10000`).
3699
+ */
3649
3700
  interface IssuerRegistryRecord {
3650
- issuerAddress: Address;
3651
3701
  signerAddress: Address;
3652
3702
  name: string;
3653
- symbol: string;
3654
3703
  active: boolean;
3655
- pointToken: Address;
3656
- mintingOracle: Address;
3704
+ capitalBase: bigint;
3705
+ basisPoints: number;
3657
3706
  }
3658
3707
  /**
3659
- * Per-token cap config read from `MintingOracle.tokenCaps()`. Caps
3660
- * live per PointToken (not per issuer), so a single issuer can run
3661
- * many PointTokens with different supply policies.
3708
+ * Equity-bucket cap snapshot computed from the `IssuerRegistryRecord`.
3709
+ *
3710
+ * V1 had a separate `TokenCapRecord` sourced from
3711
+ * `MintingOracle.tokenCaps`; in V2 the oracle is stateless and the
3712
+ * EQUITY cap derives from the registry's `capitalBase` + `basisPoints`.
3713
+ * Kept as a distinct shape (rather than inlining into
3714
+ * `PreValidateMintResult`) so admin tooling can read it without
3715
+ * re-deriving the multiplication.
3662
3716
  */
3663
- interface TokenCapRecord {
3664
- declaredTotalSupply: bigint;
3665
- capBasisPoints: number;
3717
+ interface EquityCapRecord {
3718
+ capitalBase: bigint;
3719
+ basisPoints: number;
3720
+ hardCap: bigint;
3666
3721
  }
3667
3722
  interface PreValidateMintResult {
3668
3723
  /** Registry record read at pre-validation time. */
3669
3724
  issuer: IssuerRegistryRecord;
3670
- /** Per-token cap config from MintingOracle. */
3671
- tokenCap: TokenCapRecord;
3672
- /** Current on-chain PointToken.totalSupply(). */
3673
- totalSupply: bigint;
3674
- /** declaredTotalSupply × capBasisPoints / 10000. */
3675
- hardCap: bigint;
3676
- /** hardCap − totalSupply (clamped to 0). */
3725
+ /** Equity-bucket cap derived from issuer.capitalBase × basisPoints. */
3726
+ equityCap: EquityCapRecord;
3727
+ /** Current on-chain `PointToken.equitySupply()`. */
3728
+ equitySupply: bigint;
3729
+ /** equityCap.hardCap equitySupply (clamped to 0). */
3677
3730
  remaining: bigint;
3678
3731
  }
3679
3732
  /**
@@ -3827,4 +3880,4 @@ declare class MemoryRedemptionHistoryStore implements IRedemptionHistoryStore {
3827
3880
 
3828
3881
  declare const PAFI_ISSUER_SDK_VERSION: string;
3829
3882
 
3830
- export { AdapterMisconfiguredError, type ApiConfigResponse, type ApiGasFeeResponse, type ApiLoginRequest, type ApiLoginResponse, type ApiNonceResponse, type ApiPoolsRequest, type ApiPoolsResponse, type ApiRedemptionEvaluateRequest, type ApiRedemptionEvaluateResponse, type ApiRedemptionPreviewRequest, type ApiRedemptionPreviewResponse, type ApiUserRequest, type ApiUserResponse, type AuthContext, AuthError, type AuthErrorCode, AuthService, type AuthServiceConfig, type BundlerEstimatorClient, BundlerNotConfiguredError, BundlerRejectedError, type BurnEvent, BurnIndexer, type BurnIndexerConfig, type BurnStatusParams, type BurnStatusResponse, type ClaimDto, type ConfigDto, ConfigurationError, DEFAULT_REDEMPTION_POLICY, type DecodedCallDto, DefaultPolicyEngine, type DefaultPolicyEngineOptions, type DelegatePrepareDto, type DelegateStatusDto, type EstimateGasFeeOptions, type EvaluateInput, FeeManager, type FeeManagerConfig, type FeeManagerMetrics, type FetchFailureReason, type FetchImpl, type FetchResult, type GasFeeDto, type GasFeeSource, type HandleDelegateSubmitParams, type HandleDelegateSubmitResult, type HandleMobilePrepareParams, type HandleMobilePrepareResult, type HandleMobileSubmitParams, type IIndexerCursorStore, type IPendingUserOpStore, type IPointLedger, type IPolicyEngine, type IRateLimiter, type IRedemptionHistoryStore, type ISessionStore, type ISingletonLock, InMemoryCursorStore, IssuerApiAdapter, type IssuerApiAdapterConfig, IssuerApiHandlers, type IssuerApiHandlersConfig, type IssuerRegistryRecord, type IssuerService, type IssuerServiceConfig, IssuerStateError, IssuerStateValidator, LockNotFoundError, type LockedMintRequest, type LoginResult, MemoryPendingUserOpStore, MemoryRateLimiter, MemoryRedemptionHistoryStore, MemorySessionStore, type MemorySessionStoreOptions, type MintEvent, type MintStatusParams, type MintStatusResponse, type MintingStatus, type MobilePrepareDto, type MobileSubmitDto, type NativePtQuoterConfig, NonceManager, NoopRateLimiter, PAFI_ISSUER_SDK_VERSION, PTClaimError, PTClaimHandler, type PTClaimHandlerConfig, type PTClaimRequest, type PTClaimResponse, PTRedeemError, PTRedeemHandler, type PTRedeemHandlerConfig, type PTRedeemRequest, type PTRedeemResponse, PafiBackendClient, type PafiBackendConfig, PafiBackendError, type PafiBackendErrorCode, type PafiEstimatorClientConfig, PafiEstimatorHttpError, type PaymasterGasEstimates, type PendingCredit, type PendingUserOpEntry, PendingUserOpForbiddenError, PendingUserOpNotFoundError, type PerpDepositDto, PerpDepositError, PerpDepositHandler, type PerpDepositHandlerConfig, type PerpDepositRequest, type PerpDepositResponse, PointIndexer, type PointIndexerConfig, PointTokenDomainResolver, type PointTokenDomainResolverConfig, type PolicyDecision, type PolicyEvalRequest, PolicyProvider, type PolicyProviderConfig, type PoolsDto, type PoolsProvider, type PostgresQueryRunner, type PreValidateMintResult, type PrepareBurnParams, type PrepareMintParams, type PrepareMobileUserOpParams, type PrepareMobileUserOpResult, type PreparedUserOp, type PreviewBurnParams, type PreviewMintParams, REDEMPTION_HISTORY_WINDOW_SEC, type RateLimitAction, type RateLimiterConfig, type RedeemDto, type RedeemPrepareDto, RedemptionService, type RedemptionServiceConfig, RelayError, type RelayErrorCode, RelayService, type RelayUserOpParams, type RelayUserOpRequest, type RelayUserOpResponse, type RequestPaymasterParams, type ResolvedPolicy, type RetryConfig, type SdkErrorBody, type SdkErrorMapperFactories, type SdkErrorStatus, type SerializedUserOpTypedData, type Session, SettlementClient, type SettlementClientConfig, type SingletonLockHandle, type SponsorshipRequest, type SponsorshipResponse, type SponsorshipTarget, type SponsorshipUserOp, type SubgraphNativeUsdtQuoterConfig, type SubgraphPoolsProviderConfig, type UserDto, type UserHistory, applyPaymasterGasEstimates, authenticateRequest, buildSdkErrorBody, createIssuerService, createNativePtQuoter, createPafiEstimatorClient, createSdkErrorMapper, createSubgraphNativeUsdtQuoter, createSubgraphPoolsProvider, defaultPolicyFor, evaluateRedemption, handleClaimStatus, handleDelegateSubmit, handleMobilePrepare, handleMobileSubmit, handleRedeemStatus, makePostgresSingletonLock, mergePaymasterFields, prepareMobileUserOp, relayUserOp, requestPaymaster, serializeEntryToJsonRpc, serializeUserOpTypedData };
3883
+ export { AdapterMisconfiguredError, type ApiConfigResponse, type ApiGasFeeResponse, type ApiLoginRequest, type ApiLoginResponse, type ApiNonceResponse, type ApiPoolsRequest, type ApiPoolsResponse, type ApiRedemptionEvaluateRequest, type ApiRedemptionEvaluateResponse, type ApiRedemptionPreviewRequest, type ApiRedemptionPreviewResponse, type ApiUserRequest, type ApiUserResponse, type AuthContext, AuthError, type AuthErrorCode, AuthService, type AuthServiceConfig, type BundlerEstimatorClient, BundlerNotConfiguredError, BundlerRejectedError, type BurnEvent, BurnIndexer, type BurnIndexerConfig, BurnIndexerFinalizeError, type BurnStatusParams, type BurnStatusResponse, type ClaimDto, type ConfigDto, ConfigurationError, DEFAULT_REDEMPTION_POLICY, type DecodedCallDto, DefaultPolicyEngine, type DefaultPolicyEngineOptions, type DelegatePrepareDto, type DelegateStatusDto, type EstimateGasFeeOptions, type EvaluateInput, FeeManager, type FeeManagerConfig, type FeeManagerMetrics, type FetchFailureReason, type FetchImpl, type FetchResult, type GasFeeDto, type GasFeeSource, type HandleDelegateSubmitParams, type HandleDelegateSubmitResult, type HandleMobilePrepareParams, type HandleMobilePrepareResult, type HandleMobileSubmitParams, type IIndexerCursorStore, type IPendingUserOpStore, type IPointLedger, type IPolicyEngine, type IRateLimiter, type IRedemptionHistoryStore, type ISessionStore, type ISingletonLock, InMemoryCursorStore, IssuerApiAdapter, type IssuerApiAdapterConfig, IssuerApiHandlers, type IssuerApiHandlersConfig, type IssuerRegistryRecord, type IssuerService, type IssuerServiceConfig, IssuerStateError, IssuerStateValidator, LockNotFoundError, type LockedMintRequest, type LoginResult, MemoryPendingUserOpStore, MemoryRateLimiter, MemoryRedemptionHistoryStore, MemorySessionStore, type MemorySessionStoreOptions, type MintEvent, type MintStatusParams, type MintStatusResponse, type MintingStatus, type MobilePrepareDto, type MobileSubmitDto, type NativePtQuoterConfig, NonceManager, NoopRateLimiter, PAFI_ISSUER_SDK_VERSION, PTClaimError, PTClaimHandler, type PTClaimHandlerConfig, type PTClaimRequest, type PTClaimResponse, PTRedeemError, PTRedeemHandler, type PTRedeemHandlerConfig, type PTRedeemRequest, type PTRedeemResponse, PafiBackendClient, type PafiBackendConfig, PafiBackendError, type PafiBackendErrorCode, type PafiEstimatorClientConfig, PafiEstimatorHttpError, type PaymasterGasEstimates, type PendingCredit, type PendingUserOpEntry, PendingUserOpForbiddenError, PendingUserOpNotFoundError, type PerpDepositDto, PerpDepositError, PerpDepositHandler, type PerpDepositHandlerConfig, type PerpDepositRequest, type PerpDepositResponse, PointIndexer, type PointIndexerConfig, PointIndexerFinalizeError, PointTokenDomainResolver, type PointTokenDomainResolverConfig, type PolicyDecision, type PolicyEvalRequest, PolicyProvider, type PolicyProviderConfig, type PoolsDto, type PoolsProvider, type PostgresQueryRunner, type PreValidateMintResult, type PrepareBurnParams, type PrepareMintParams, type PrepareMobileUserOpParams, type PrepareMobileUserOpResult, type PreparedUserOp, type PreviewBurnParams, type PreviewMintParams, REDEMPTION_HISTORY_WINDOW_SEC, type RateLimitAction, type RateLimiterConfig, type RedeemDto, type RedeemPrepareDto, RedemptionService, type RedemptionServiceConfig, RelayError, type RelayErrorCode, RelayService, type RelayUserOpParams, type RelayUserOpRequest, type RelayUserOpResponse, type RequestPaymasterParams, type ResolvedPolicy, type RetryConfig, type SdkErrorBody, type SdkErrorMapperFactories, type SdkErrorStatus, type SerializedUserOpTypedData, type Session, SettlementClient, type SettlementClientConfig, type SingletonLockHandle, type SponsorshipRequest, type SponsorshipResponse, type SponsorshipTarget, type SponsorshipUserOp, type SubgraphNativeUsdtQuoterConfig, type SubgraphPoolsProviderConfig, type UserDto, type UserHistory, applyPaymasterGasEstimates, authenticateRequest, buildSdkErrorBody, createIssuerService, createNativePtQuoter, createPafiEstimatorClient, createSdkErrorMapper, createSubgraphNativeUsdtQuoter, createSubgraphPoolsProvider, defaultPolicyFor, evaluateRedemption, handleClaimStatus, handleDelegateSubmit, handleMobilePrepare, handleMobileSubmit, handleRedeemStatus, makePostgresSingletonLock, mergePaymasterFields, prepareMobileUserOp, relayUserOp, requestPaymaster, serializeEntryToJsonRpc, serializeUserOpTypedData };
package/dist/index.d.ts CHANGED
@@ -1029,6 +1029,23 @@ interface ISingletonLock {
1029
1029
  acquire(key: string): Promise<SingletonLockHandle | null>;
1030
1030
  }
1031
1031
 
1032
+ declare class PointIndexerFinalizeError extends Error {
1033
+ readonly context: {
1034
+ pointToken: Address;
1035
+ to: Address;
1036
+ amount: bigint;
1037
+ txHash: `0x${string}`;
1038
+ blockNumber: bigint;
1039
+ };
1040
+ readonly cause: unknown;
1041
+ constructor(message: string, context: {
1042
+ pointToken: Address;
1043
+ to: Address;
1044
+ amount: bigint;
1045
+ txHash: `0x${string}`;
1046
+ blockNumber: bigint;
1047
+ }, cause: unknown);
1048
+ }
1032
1049
  interface PointIndexerConfig {
1033
1050
  provider: PublicClient;
1034
1051
  pointTokenAddress: Address;
@@ -1179,6 +1196,33 @@ declare class PointIndexer {
1179
1196
  private finalize;
1180
1197
  }
1181
1198
 
1199
+ /**
1200
+ * Mirror of `PointIndexerFinalizeError` — raised when
1201
+ * `ledger.resolveCreditByBurnTx` rejects. See audit M-12: pre-fix this
1202
+ * was silently swallowed and the cursor advanced regardless,
1203
+ * permanently dropping confirmed on-chain burns from the off-chain
1204
+ * credit pipeline. Post-fix the error propagates, the chunk's cursor
1205
+ * save is skipped, and the next tick retries.
1206
+ */
1207
+ declare class BurnIndexerFinalizeError extends Error {
1208
+ readonly context: {
1209
+ pointToken: Address;
1210
+ from: Address;
1211
+ amount: bigint;
1212
+ txHash: `0x${string}`;
1213
+ blockNumber: bigint;
1214
+ lockId: string;
1215
+ };
1216
+ readonly cause: unknown;
1217
+ constructor(message: string, context: {
1218
+ pointToken: Address;
1219
+ from: Address;
1220
+ amount: bigint;
1221
+ txHash: `0x${string}`;
1222
+ blockNumber: bigint;
1223
+ lockId: string;
1224
+ }, cause: unknown);
1225
+ }
1182
1226
  interface BurnIndexerConfig {
1183
1227
  provider: PublicClient;
1184
1228
  pointTokenAddress: Address;
@@ -1421,7 +1465,6 @@ interface ApiUserRequest {
1421
1465
  pointTokenAddress: Address;
1422
1466
  }
1423
1467
  interface ApiUserResponse {
1424
- mintRequestNonce: bigint;
1425
1468
  /**
1426
1469
  * Off-chain point balance from the issuer's ledger (excludes PENDING locks).
1427
1470
  * This is what the user can claim into on-chain PT via `/claim`.
@@ -2651,7 +2694,7 @@ interface IssuerStateValidatorLike {
2651
2694
  * own composer — gg56 uses a timestamp-key 2D nonce). Caller layers
2652
2695
  * paymaster sponsorship + sponsorAuth on top of the returned UserOps.
2653
2696
  */
2654
- type PTClaimErrorCode = "INVALID_AMOUNT" | "VALIDATION_FAILED" | "BUILD_FAILED";
2697
+ type PTClaimErrorCode = "INVALID_AMOUNT" | "VALIDATION_FAILED" | "BUILD_FAILED" | "NONCE_READ_FAILED" | "NONCE_IN_FLIGHT";
2655
2698
  declare class PTClaimError extends PafiSdkError {
2656
2699
  readonly httpStatus: "unprocessable";
2657
2700
  readonly code: PTClaimErrorCode;
@@ -2708,8 +2751,6 @@ interface PTClaimRequest {
2708
2751
  chainId: number;
2709
2752
  /** ERC-4337 account nonce for the user's EOA. */
2710
2753
  aaNonce: bigint;
2711
- /** Current `mintRequestNonces[userAddress]` from PointToken. */
2712
- mintRequestNonce: bigint;
2713
2754
  }
2714
2755
  interface PTClaimResponse {
2715
2756
  /** Sponsored UserOp — mint + PT fee transfer (when feeAmount > 0). */
@@ -2730,6 +2771,7 @@ interface PTClaimResponse {
2730
2771
  }
2731
2772
  declare class PTClaimHandler {
2732
2773
  private readonly cfg;
2774
+ private readonly inFlightNonces;
2733
2775
  constructor(config: PTClaimHandlerConfig);
2734
2776
  handle(request: PTClaimRequest): Promise<PTClaimResponse>;
2735
2777
  }
@@ -3143,7 +3185,6 @@ interface PoolsDto {
3143
3185
  pools: unknown[];
3144
3186
  }
3145
3187
  interface UserDto {
3146
- mintRequestNonce: string;
3147
3188
  offChainBalance: string;
3148
3189
  onChainBalance: string;
3149
3190
  totalBalance: string;
@@ -3261,7 +3302,6 @@ declare class IssuerApiAdapter {
3261
3302
  pointTokenAddress: Address;
3262
3303
  amount: bigint;
3263
3304
  aaNonce: bigint;
3264
- mintRequestNonce: bigint;
3265
3305
  }): Promise<ClaimDto>;
3266
3306
  redeem(input: {
3267
3307
  authenticatedAddress: Address;
@@ -3283,7 +3323,6 @@ declare class IssuerApiAdapter {
3283
3323
  pointTokenAddress: Address;
3284
3324
  amount: bigint;
3285
3325
  aaNonce: bigint;
3286
- mintRequestNonce: bigint;
3287
3326
  }): Promise<MobilePrepareDto>;
3288
3327
  claimSubmit(input: {
3289
3328
  authenticatedAddress: Address;
@@ -3646,34 +3685,48 @@ declare function relayUserOp(params: RelayUserOpParams): Promise<{
3646
3685
  userOpHash: Hex;
3647
3686
  }>;
3648
3687
 
3688
+ /**
3689
+ * Registry record returned by `IssuerRegistry.getIssuer()` in V2
3690
+ * dual-bucket. Schema reshape from V1:
3691
+ *
3692
+ * V1: { issuerAddress, signerAddress, name, symbol, active, pointToken, mintingOracle }
3693
+ * V2: { signerAddress, name, active, capitalBase, basisPoints }
3694
+ *
3695
+ * `issuerAddress` is the lookup key the caller passed; we don't
3696
+ * re-emit it here because the caller already has it. `capitalBase` +
3697
+ * `basisPoints` drive the EQUITY-bucket cap (`capitalBase *
3698
+ * basisPoints / 10000`).
3699
+ */
3649
3700
  interface IssuerRegistryRecord {
3650
- issuerAddress: Address;
3651
3701
  signerAddress: Address;
3652
3702
  name: string;
3653
- symbol: string;
3654
3703
  active: boolean;
3655
- pointToken: Address;
3656
- mintingOracle: Address;
3704
+ capitalBase: bigint;
3705
+ basisPoints: number;
3657
3706
  }
3658
3707
  /**
3659
- * Per-token cap config read from `MintingOracle.tokenCaps()`. Caps
3660
- * live per PointToken (not per issuer), so a single issuer can run
3661
- * many PointTokens with different supply policies.
3708
+ * Equity-bucket cap snapshot computed from the `IssuerRegistryRecord`.
3709
+ *
3710
+ * V1 had a separate `TokenCapRecord` sourced from
3711
+ * `MintingOracle.tokenCaps`; in V2 the oracle is stateless and the
3712
+ * EQUITY cap derives from the registry's `capitalBase` + `basisPoints`.
3713
+ * Kept as a distinct shape (rather than inlining into
3714
+ * `PreValidateMintResult`) so admin tooling can read it without
3715
+ * re-deriving the multiplication.
3662
3716
  */
3663
- interface TokenCapRecord {
3664
- declaredTotalSupply: bigint;
3665
- capBasisPoints: number;
3717
+ interface EquityCapRecord {
3718
+ capitalBase: bigint;
3719
+ basisPoints: number;
3720
+ hardCap: bigint;
3666
3721
  }
3667
3722
  interface PreValidateMintResult {
3668
3723
  /** Registry record read at pre-validation time. */
3669
3724
  issuer: IssuerRegistryRecord;
3670
- /** Per-token cap config from MintingOracle. */
3671
- tokenCap: TokenCapRecord;
3672
- /** Current on-chain PointToken.totalSupply(). */
3673
- totalSupply: bigint;
3674
- /** declaredTotalSupply × capBasisPoints / 10000. */
3675
- hardCap: bigint;
3676
- /** hardCap − totalSupply (clamped to 0). */
3725
+ /** Equity-bucket cap derived from issuer.capitalBase × basisPoints. */
3726
+ equityCap: EquityCapRecord;
3727
+ /** Current on-chain `PointToken.equitySupply()`. */
3728
+ equitySupply: bigint;
3729
+ /** equityCap.hardCap equitySupply (clamped to 0). */
3677
3730
  remaining: bigint;
3678
3731
  }
3679
3732
  /**
@@ -3827,4 +3880,4 @@ declare class MemoryRedemptionHistoryStore implements IRedemptionHistoryStore {
3827
3880
 
3828
3881
  declare const PAFI_ISSUER_SDK_VERSION: string;
3829
3882
 
3830
- export { AdapterMisconfiguredError, type ApiConfigResponse, type ApiGasFeeResponse, type ApiLoginRequest, type ApiLoginResponse, type ApiNonceResponse, type ApiPoolsRequest, type ApiPoolsResponse, type ApiRedemptionEvaluateRequest, type ApiRedemptionEvaluateResponse, type ApiRedemptionPreviewRequest, type ApiRedemptionPreviewResponse, type ApiUserRequest, type ApiUserResponse, type AuthContext, AuthError, type AuthErrorCode, AuthService, type AuthServiceConfig, type BundlerEstimatorClient, BundlerNotConfiguredError, BundlerRejectedError, type BurnEvent, BurnIndexer, type BurnIndexerConfig, type BurnStatusParams, type BurnStatusResponse, type ClaimDto, type ConfigDto, ConfigurationError, DEFAULT_REDEMPTION_POLICY, type DecodedCallDto, DefaultPolicyEngine, type DefaultPolicyEngineOptions, type DelegatePrepareDto, type DelegateStatusDto, type EstimateGasFeeOptions, type EvaluateInput, FeeManager, type FeeManagerConfig, type FeeManagerMetrics, type FetchFailureReason, type FetchImpl, type FetchResult, type GasFeeDto, type GasFeeSource, type HandleDelegateSubmitParams, type HandleDelegateSubmitResult, type HandleMobilePrepareParams, type HandleMobilePrepareResult, type HandleMobileSubmitParams, type IIndexerCursorStore, type IPendingUserOpStore, type IPointLedger, type IPolicyEngine, type IRateLimiter, type IRedemptionHistoryStore, type ISessionStore, type ISingletonLock, InMemoryCursorStore, IssuerApiAdapter, type IssuerApiAdapterConfig, IssuerApiHandlers, type IssuerApiHandlersConfig, type IssuerRegistryRecord, type IssuerService, type IssuerServiceConfig, IssuerStateError, IssuerStateValidator, LockNotFoundError, type LockedMintRequest, type LoginResult, MemoryPendingUserOpStore, MemoryRateLimiter, MemoryRedemptionHistoryStore, MemorySessionStore, type MemorySessionStoreOptions, type MintEvent, type MintStatusParams, type MintStatusResponse, type MintingStatus, type MobilePrepareDto, type MobileSubmitDto, type NativePtQuoterConfig, NonceManager, NoopRateLimiter, PAFI_ISSUER_SDK_VERSION, PTClaimError, PTClaimHandler, type PTClaimHandlerConfig, type PTClaimRequest, type PTClaimResponse, PTRedeemError, PTRedeemHandler, type PTRedeemHandlerConfig, type PTRedeemRequest, type PTRedeemResponse, PafiBackendClient, type PafiBackendConfig, PafiBackendError, type PafiBackendErrorCode, type PafiEstimatorClientConfig, PafiEstimatorHttpError, type PaymasterGasEstimates, type PendingCredit, type PendingUserOpEntry, PendingUserOpForbiddenError, PendingUserOpNotFoundError, type PerpDepositDto, PerpDepositError, PerpDepositHandler, type PerpDepositHandlerConfig, type PerpDepositRequest, type PerpDepositResponse, PointIndexer, type PointIndexerConfig, PointTokenDomainResolver, type PointTokenDomainResolverConfig, type PolicyDecision, type PolicyEvalRequest, PolicyProvider, type PolicyProviderConfig, type PoolsDto, type PoolsProvider, type PostgresQueryRunner, type PreValidateMintResult, type PrepareBurnParams, type PrepareMintParams, type PrepareMobileUserOpParams, type PrepareMobileUserOpResult, type PreparedUserOp, type PreviewBurnParams, type PreviewMintParams, REDEMPTION_HISTORY_WINDOW_SEC, type RateLimitAction, type RateLimiterConfig, type RedeemDto, type RedeemPrepareDto, RedemptionService, type RedemptionServiceConfig, RelayError, type RelayErrorCode, RelayService, type RelayUserOpParams, type RelayUserOpRequest, type RelayUserOpResponse, type RequestPaymasterParams, type ResolvedPolicy, type RetryConfig, type SdkErrorBody, type SdkErrorMapperFactories, type SdkErrorStatus, type SerializedUserOpTypedData, type Session, SettlementClient, type SettlementClientConfig, type SingletonLockHandle, type SponsorshipRequest, type SponsorshipResponse, type SponsorshipTarget, type SponsorshipUserOp, type SubgraphNativeUsdtQuoterConfig, type SubgraphPoolsProviderConfig, type UserDto, type UserHistory, applyPaymasterGasEstimates, authenticateRequest, buildSdkErrorBody, createIssuerService, createNativePtQuoter, createPafiEstimatorClient, createSdkErrorMapper, createSubgraphNativeUsdtQuoter, createSubgraphPoolsProvider, defaultPolicyFor, evaluateRedemption, handleClaimStatus, handleDelegateSubmit, handleMobilePrepare, handleMobileSubmit, handleRedeemStatus, makePostgresSingletonLock, mergePaymasterFields, prepareMobileUserOp, relayUserOp, requestPaymaster, serializeEntryToJsonRpc, serializeUserOpTypedData };
3883
+ export { AdapterMisconfiguredError, type ApiConfigResponse, type ApiGasFeeResponse, type ApiLoginRequest, type ApiLoginResponse, type ApiNonceResponse, type ApiPoolsRequest, type ApiPoolsResponse, type ApiRedemptionEvaluateRequest, type ApiRedemptionEvaluateResponse, type ApiRedemptionPreviewRequest, type ApiRedemptionPreviewResponse, type ApiUserRequest, type ApiUserResponse, type AuthContext, AuthError, type AuthErrorCode, AuthService, type AuthServiceConfig, type BundlerEstimatorClient, BundlerNotConfiguredError, BundlerRejectedError, type BurnEvent, BurnIndexer, type BurnIndexerConfig, BurnIndexerFinalizeError, type BurnStatusParams, type BurnStatusResponse, type ClaimDto, type ConfigDto, ConfigurationError, DEFAULT_REDEMPTION_POLICY, type DecodedCallDto, DefaultPolicyEngine, type DefaultPolicyEngineOptions, type DelegatePrepareDto, type DelegateStatusDto, type EstimateGasFeeOptions, type EvaluateInput, FeeManager, type FeeManagerConfig, type FeeManagerMetrics, type FetchFailureReason, type FetchImpl, type FetchResult, type GasFeeDto, type GasFeeSource, type HandleDelegateSubmitParams, type HandleDelegateSubmitResult, type HandleMobilePrepareParams, type HandleMobilePrepareResult, type HandleMobileSubmitParams, type IIndexerCursorStore, type IPendingUserOpStore, type IPointLedger, type IPolicyEngine, type IRateLimiter, type IRedemptionHistoryStore, type ISessionStore, type ISingletonLock, InMemoryCursorStore, IssuerApiAdapter, type IssuerApiAdapterConfig, IssuerApiHandlers, type IssuerApiHandlersConfig, type IssuerRegistryRecord, type IssuerService, type IssuerServiceConfig, IssuerStateError, IssuerStateValidator, LockNotFoundError, type LockedMintRequest, type LoginResult, MemoryPendingUserOpStore, MemoryRateLimiter, MemoryRedemptionHistoryStore, MemorySessionStore, type MemorySessionStoreOptions, type MintEvent, type MintStatusParams, type MintStatusResponse, type MintingStatus, type MobilePrepareDto, type MobileSubmitDto, type NativePtQuoterConfig, NonceManager, NoopRateLimiter, PAFI_ISSUER_SDK_VERSION, PTClaimError, PTClaimHandler, type PTClaimHandlerConfig, type PTClaimRequest, type PTClaimResponse, PTRedeemError, PTRedeemHandler, type PTRedeemHandlerConfig, type PTRedeemRequest, type PTRedeemResponse, PafiBackendClient, type PafiBackendConfig, PafiBackendError, type PafiBackendErrorCode, type PafiEstimatorClientConfig, PafiEstimatorHttpError, type PaymasterGasEstimates, type PendingCredit, type PendingUserOpEntry, PendingUserOpForbiddenError, PendingUserOpNotFoundError, type PerpDepositDto, PerpDepositError, PerpDepositHandler, type PerpDepositHandlerConfig, type PerpDepositRequest, type PerpDepositResponse, PointIndexer, type PointIndexerConfig, PointIndexerFinalizeError, PointTokenDomainResolver, type PointTokenDomainResolverConfig, type PolicyDecision, type PolicyEvalRequest, PolicyProvider, type PolicyProviderConfig, type PoolsDto, type PoolsProvider, type PostgresQueryRunner, type PreValidateMintResult, type PrepareBurnParams, type PrepareMintParams, type PrepareMobileUserOpParams, type PrepareMobileUserOpResult, type PreparedUserOp, type PreviewBurnParams, type PreviewMintParams, REDEMPTION_HISTORY_WINDOW_SEC, type RateLimitAction, type RateLimiterConfig, type RedeemDto, type RedeemPrepareDto, RedemptionService, type RedemptionServiceConfig, RelayError, type RelayErrorCode, RelayService, type RelayUserOpParams, type RelayUserOpRequest, type RelayUserOpResponse, type RequestPaymasterParams, type ResolvedPolicy, type RetryConfig, type SdkErrorBody, type SdkErrorMapperFactories, type SdkErrorStatus, type SerializedUserOpTypedData, type Session, SettlementClient, type SettlementClientConfig, type SingletonLockHandle, type SponsorshipRequest, type SponsorshipResponse, type SponsorshipTarget, type SponsorshipUserOp, type SubgraphNativeUsdtQuoterConfig, type SubgraphPoolsProviderConfig, type UserDto, type UserHistory, applyPaymasterGasEstimates, authenticateRequest, buildSdkErrorBody, createIssuerService, createNativePtQuoter, createPafiEstimatorClient, createSdkErrorMapper, createSubgraphNativeUsdtQuoter, createSubgraphPoolsProvider, defaultPolicyFor, evaluateRedemption, handleClaimStatus, handleDelegateSubmit, handleMobilePrepare, handleMobileSubmit, handleRedeemStatus, makePostgresSingletonLock, mergePaymasterFields, prepareMobileUserOp, relayUserOp, requestPaymaster, serializeEntryToJsonRpc, serializeUserOpTypedData };