@pafi-dev/issuer 0.39.3 → 0.41.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.cjs +60 -286
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +51 -172
- package/dist/index.d.ts +51 -172
- package/dist/index.js +45 -269
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PafiSdkError, SdkErrorHttpStatus, PointTokenDomainConfig, PartialUserOperation, BurnRequest, PoolKey, RedemptionPolicy, RedemptionPolicySource, RedemptionPreview, RedemptionDecision, RedemptionDenialCode,
|
|
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';
|
|
@@ -1392,14 +1392,12 @@ interface ApiConfigResponse {
|
|
|
1392
1392
|
usdt?: Address;
|
|
1393
1393
|
/**
|
|
1394
1394
|
* EIP-7702 delegation target — the single contract every user's
|
|
1395
|
-
* EOA
|
|
1396
|
-
* Base mainnet this is
|
|
1397
|
-
* `
|
|
1398
|
-
*
|
|
1399
|
-
* BatchExecutor, which had a SignatureWrapper incompatibility
|
|
1400
|
-
* surfacing as AA23 0x3c10b94e during validateUserOp).
|
|
1395
|
+
* EOA delegates to (folded-in with the first sponsored UserOp).
|
|
1396
|
+
* On Base mainnet this is the ZeroDev Kernel v3.3 account impl
|
|
1397
|
+
* (`getContractAddresses(chainId).kernel`), replacing the earlier
|
|
1398
|
+
* Pimlico `Simple7702Account` BatchExecutor.
|
|
1401
1399
|
*/
|
|
1402
|
-
|
|
1400
|
+
kernel?: Address;
|
|
1403
1401
|
/**
|
|
1404
1402
|
* Single global MintFeeWrapper that skims a fee on every
|
|
1405
1403
|
* sig-gated mint and distributes across the configured recipients.
|
|
@@ -2408,33 +2406,6 @@ declare class MemoryPendingUserOpStore implements IPendingUserOpStore {
|
|
|
2408
2406
|
delete(lockId: string): Promise<void>;
|
|
2409
2407
|
}
|
|
2410
2408
|
|
|
2411
|
-
/**
|
|
2412
|
-
* Re-shape `UserOpTypedData` so all `bigint` fields become hex strings —
|
|
2413
|
-
* required for JSON transport over HTTP. Mirrors the inverse of what
|
|
2414
|
-
* `walletClient.signTypedData` accepts on the client (it auto-coerces hex
|
|
2415
|
-
* strings back to bigints for `uint256` fields).
|
|
2416
|
-
*/
|
|
2417
|
-
type SerializedUserOpTypedData = {
|
|
2418
|
-
domain: UserOpTypedData["domain"];
|
|
2419
|
-
types: UserOpTypedData["types"];
|
|
2420
|
-
primaryType: UserOpTypedData["primaryType"];
|
|
2421
|
-
message: {
|
|
2422
|
-
sender: Address;
|
|
2423
|
-
nonce: Hex;
|
|
2424
|
-
initCode: Hex;
|
|
2425
|
-
callData: Hex;
|
|
2426
|
-
accountGasLimits: Hex;
|
|
2427
|
-
preVerificationGas: Hex;
|
|
2428
|
-
gasFees: Hex;
|
|
2429
|
-
paymasterAndData: Hex;
|
|
2430
|
-
};
|
|
2431
|
-
};
|
|
2432
|
-
/**
|
|
2433
|
-
* Convert a `UserOpTypedData` payload into the JSON-safe wire form
|
|
2434
|
-
* (bigint → hex string). The mobile client passes this directly to
|
|
2435
|
-
* `eth_signTypedData_v4` / viem's `signTypedData`.
|
|
2436
|
-
*/
|
|
2437
|
-
declare function serializeUserOpTypedData(td: UserOpTypedData): SerializedUserOpTypedData;
|
|
2438
2409
|
/**
|
|
2439
2410
|
* Merge Pimlico's paymaster-sponsorship response into a UserOp
|
|
2440
2411
|
* skeleton, applying only fields that are actually defined.
|
|
@@ -2485,14 +2456,16 @@ interface PreparedUserOp {
|
|
|
2485
2456
|
paymasterVerificationGasLimit?: bigint;
|
|
2486
2457
|
paymasterPostOpGasLimit?: bigint;
|
|
2487
2458
|
};
|
|
2488
|
-
/**
|
|
2459
|
+
/**
|
|
2460
|
+
* ERC-4337 v0.7 userOpHash (Kernel). Equals `EntryPoint.getUserOpHash`.
|
|
2461
|
+
* Mobile signs it via `personal_sign(userOpHash)` i.e.
|
|
2462
|
+
* `signMessage({ message: { raw: userOpHash } })`.
|
|
2463
|
+
*/
|
|
2489
2464
|
userOpHash: Hex;
|
|
2490
|
-
/** Typed-data payload — pass directly to `eth_signTypedData_v4`. */
|
|
2491
|
-
typedData: SerializedUserOpTypedData;
|
|
2492
2465
|
}
|
|
2493
2466
|
/**
|
|
2494
|
-
* Atomic "merge paymaster fields + compute hash
|
|
2495
|
-
*
|
|
2467
|
+
* Atomic "merge paymaster fields + compute hash" — the only place the
|
|
2468
|
+
* SDK should be doing both operations.
|
|
2496
2469
|
*
|
|
2497
2470
|
* Why bundled into one call:
|
|
2498
2471
|
*
|
|
@@ -2509,28 +2482,25 @@ interface PreparedUserOp {
|
|
|
2509
2482
|
* Splitting "merge" and "hash" into two free functions invites
|
|
2510
2483
|
* exactly this bug: each call site has to reinvent the merge logic,
|
|
2511
2484
|
* and any drift between sites silently produces stale hashes.
|
|
2512
|
-
* Returning
|
|
2513
|
-
*
|
|
2514
|
-
*
|
|
2515
|
-
*
|
|
2485
|
+
* Returning both pieces (`userOp`, `userOpHash`) from a single call
|
|
2486
|
+
* makes "hash before merge" structurally impossible: there is no
|
|
2487
|
+
* intermediate userOp to compute a stale hash over.
|
|
2488
|
+
*
|
|
2489
|
+
* `computeUserOpHash` returns the ERC-4337 v0.7 userOpHash (Kernel);
|
|
2490
|
+
* mobile signs it via `personal_sign(userOpHash)` — no typed-data
|
|
2491
|
+
* envelope is produced anymore.
|
|
2516
2492
|
*
|
|
2517
2493
|
* Behaviour:
|
|
2518
2494
|
* - When `paymasterFields` is undefined (paymaster declined / Path
|
|
2519
|
-
* C self-pay), the result is just the hash
|
|
2520
|
-
*
|
|
2495
|
+
* C self-pay), the result is just the hash of the caller's
|
|
2496
|
+
* `partialUserOp` — no fields are touched.
|
|
2521
2497
|
* - When provided, only defined keys in `paymasterFields` overwrite
|
|
2522
2498
|
* the matching fields. Original gas/fee estimates survive when
|
|
2523
2499
|
* the paymaster did not re-estimate.
|
|
2524
2500
|
*
|
|
2525
|
-
* Replaces:
|
|
2526
|
-
* - manual spread merges (e.g. previous `delegateHandler.ts`)
|
|
2527
|
-
* - `mergePaymasterFields` + separate `computeUserOpHash` +
|
|
2528
|
-
* `buildUserOpTypedData` triplets in any new call site.
|
|
2529
|
-
*
|
|
2530
2501
|
* Note: the original `mergePaymasterFields` and the raw
|
|
2531
|
-
* `computeUserOpHash`
|
|
2532
|
-
*
|
|
2533
|
-
* stage the operations.
|
|
2502
|
+
* `computeUserOpHash` exports remain available — use this helper
|
|
2503
|
+
* unless you have a specific reason to stage the operations.
|
|
2534
2504
|
*/
|
|
2535
2505
|
declare function applyPaymasterGasEstimates(partialUserOp: PartialUserOperation & {
|
|
2536
2506
|
maxFeePerGas: bigint;
|
|
@@ -2627,11 +2597,11 @@ interface PrepareMobileUserOpResult {
|
|
|
2627
2597
|
* What this does, end-to-end:
|
|
2628
2598
|
* 1. Merge Pimlico's paymaster sponsorship + re-quoted gas into the
|
|
2629
2599
|
* caller's `partialUserOp` skeleton.
|
|
2630
|
-
* 2. Compute the
|
|
2631
|
-
*
|
|
2600
|
+
* 2. Compute the ERC-4337 v0.7 userOpHash (Kernel) — mobile signs it
|
|
2601
|
+
* via `personal_sign(userOpHash)`.
|
|
2632
2602
|
* 3. (Optional) Repeat for the `partialUserOpFallback` skeleton with
|
|
2633
|
-
* no paymaster fields — produces a separate hash
|
|
2634
|
-
*
|
|
2603
|
+
* no paymaster fields — produces a separate hash so the client can
|
|
2604
|
+
* re-sign if it falls back.
|
|
2635
2605
|
* 4. Persist a single store entry containing BOTH callData variants
|
|
2636
2606
|
* keyed by lockId. `serializeEntryToJsonRpc` reads the `variant`
|
|
2637
2607
|
* param at submit time.
|
|
@@ -2779,7 +2749,11 @@ interface HandleMobileSubmitParams {
|
|
|
2779
2749
|
*/
|
|
2780
2750
|
bindUserOpHash: (lockId: string, userOpHash: Hex) => Promise<void>;
|
|
2781
2751
|
pafiBackendClient?: PafiBackendClient | null;
|
|
2782
|
-
/**
|
|
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
|
+
*/
|
|
2783
2757
|
entryPoint?: string;
|
|
2784
2758
|
}
|
|
2785
2759
|
/**
|
|
@@ -2797,7 +2771,7 @@ declare function handleMobileSubmit(params: HandleMobileSubmitParams): Promise<{
|
|
|
2797
2771
|
userOpHash: Hex;
|
|
2798
2772
|
}>;
|
|
2799
2773
|
|
|
2800
|
-
type DecodedCall$1 = ReturnType<typeof
|
|
2774
|
+
type DecodedCall$1 = ReturnType<typeof decodeKernelExecuteCalls>[number];
|
|
2801
2775
|
|
|
2802
2776
|
/**
|
|
2803
2777
|
* Structural shape — accepts both the raw `IssuerStateValidator` from
|
|
@@ -2818,7 +2792,7 @@ interface IssuerStateValidatorLike {
|
|
|
2818
2792
|
*
|
|
2819
2793
|
* Caller fetches AA + mintRequest nonces (so issuers can plug in their
|
|
2820
2794
|
* own composer — gg56 uses a timestamp-key 2D nonce). Caller layers
|
|
2821
|
-
* paymaster sponsorship
|
|
2795
|
+
* paymaster sponsorship on top of the returned UserOps.
|
|
2822
2796
|
*/
|
|
2823
2797
|
type PTClaimErrorCode = "INVALID_AMOUNT" | "VALIDATION_FAILED" | "BUILD_FAILED" | "NONCE_READ_FAILED" | "NONCE_IN_FLIGHT" | "UNSUPPORTED_POINT_TOKEN";
|
|
2824
2798
|
declare class PTClaimError extends PafiSdkError {
|
|
@@ -2919,7 +2893,7 @@ declare class PTClaimHandler {
|
|
|
2919
2893
|
handle(request: PTClaimRequest): Promise<PTClaimResponse>;
|
|
2920
2894
|
}
|
|
2921
2895
|
|
|
2922
|
-
type DecodedCall = ReturnType<typeof
|
|
2896
|
+
type DecodedCall = ReturnType<typeof decodeKernelExecuteCalls>[number];
|
|
2923
2897
|
|
|
2924
2898
|
/**
|
|
2925
2899
|
* Orderly perp-deposit handler — builds the sponsored + fallback
|
|
@@ -2995,32 +2969,6 @@ declare class PerpDepositHandler {
|
|
|
2995
2969
|
handle(request: PerpDepositRequest): Promise<PerpDepositResponse>;
|
|
2996
2970
|
}
|
|
2997
2971
|
|
|
2998
|
-
interface HandleDelegateSubmitParams {
|
|
2999
|
-
lockId: string;
|
|
3000
|
-
/** Authenticated user EOA — must match the entry's `sender`. */
|
|
3001
|
-
authenticatedAddress: Address;
|
|
3002
|
-
/** User signature over the persisted userOpHash. */
|
|
3003
|
-
userOpSig: Hex;
|
|
3004
|
-
store: IPendingUserOpStore;
|
|
3005
|
-
pafiBackendClient?: PafiBackendClient | null;
|
|
3006
|
-
/** Defaults to `ENTRY_POINT_V08`. */
|
|
3007
|
-
entryPoint?: string;
|
|
3008
|
-
}
|
|
3009
|
-
interface HandleDelegateSubmitResult {
|
|
3010
|
-
userOpHash: Hex;
|
|
3011
|
-
}
|
|
3012
|
-
/**
|
|
3013
|
-
* Retrieve the persisted delegate UserOp, embed the user's signature,
|
|
3014
|
-
* and submit to the bundler with the cached `eip7702Auth` field.
|
|
3015
|
-
*
|
|
3016
|
-
* Throws:
|
|
3017
|
-
* - `PendingUserOpNotFoundError` — entry expired or already submitted (404)
|
|
3018
|
-
* - `PendingUserOpForbiddenError` — sender mismatch (403)
|
|
3019
|
-
* - `BundlerNotConfiguredError` — `pafiBackendClient` missing (503)
|
|
3020
|
-
* - `BundlerRejectedError` — bundler rejected the UserOp (422)
|
|
3021
|
-
*/
|
|
3022
|
-
declare function handleDelegateSubmit(params: HandleDelegateSubmitParams): Promise<HandleDelegateSubmitResult>;
|
|
3023
|
-
|
|
3024
2972
|
/**
|
|
3025
2973
|
* Normalized HTTP status the issuer controller should surface for a
|
|
3026
2974
|
* given SDK error. Mirrors `SdkErrorHttpStatus` on `PafiSdkError`.
|
|
@@ -3127,7 +3075,7 @@ interface IssuerServiceConfig {
|
|
|
3127
3075
|
pointTokenAddresses?: Address[];
|
|
3128
3076
|
/**
|
|
3129
3077
|
* Issuer-specific contract addresses merged into the `/config` response.
|
|
3130
|
-
* PAFI-owned addresses (
|
|
3078
|
+
* PAFI-owned addresses (kernel, usdt, issuerRegistry, mintingOracle,
|
|
3131
3079
|
* mintFeeWrapper, …) are auto-resolved from `getContractAddresses(chainId)`
|
|
3132
3080
|
* and can be omitted. Only `pointToken` / `pointTokens` must be provided.
|
|
3133
3081
|
*/
|
|
@@ -3301,9 +3249,8 @@ declare function createIssuerService(config: IssuerServiceConfig): Promise<Issue
|
|
|
3301
3249
|
* What this absorbs:
|
|
3302
3250
|
* - Reading + reshaping IssuerApiHandlers responses into wire DTOs
|
|
3303
3251
|
* (bigint → string, etc.)
|
|
3304
|
-
* - Composing handler.handle() output with
|
|
3252
|
+
* - Composing handler.handle() output with decoded calls
|
|
3305
3253
|
* - Wiring handleMobilePrepare / handleMobileSubmit / handleClaimStatus
|
|
3306
|
-
* - Building the EIP-7702 delegate UserOp + relay
|
|
3307
3254
|
* - Quoting PT → USDT for the cashout preview
|
|
3308
3255
|
*
|
|
3309
3256
|
* What stays in the issuer controller:
|
|
@@ -3320,9 +3267,15 @@ interface IssuerApiAdapterConfig {
|
|
|
3320
3267
|
issuerService: IssuerService;
|
|
3321
3268
|
ledger: IPointLedger;
|
|
3322
3269
|
provider: PublicClient;
|
|
3323
|
-
/**
|
|
3324
|
-
|
|
3325
|
-
|
|
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}. */
|
|
3326
3279
|
pafiIssuerId?: string;
|
|
3327
3280
|
/** Sig-gated mint handler. Required for `claim` / `claimPrepare`. */
|
|
3328
3281
|
ptClaimHandler?: PTClaimHandler | null;
|
|
@@ -3332,7 +3285,7 @@ interface IssuerApiAdapterConfig {
|
|
|
3332
3285
|
perpHandler?: PerpDepositHandler | null;
|
|
3333
3286
|
/** Pending UserOp store — required for mobile prepare/submit. */
|
|
3334
3287
|
pendingUserOpStore: IPendingUserOpStore;
|
|
3335
|
-
/** PAFI backend client — required for mobile submit +
|
|
3288
|
+
/** PAFI backend client — required for mobile submit + status fallback. */
|
|
3336
3289
|
pafiBackendClient?: PafiBackendClient | null;
|
|
3337
3290
|
/** Optional logger surface for non-fatal warnings. */
|
|
3338
3291
|
onWarning?: (msg: string) => void;
|
|
@@ -3366,7 +3319,6 @@ interface ClaimDto {
|
|
|
3366
3319
|
feeAmount: string;
|
|
3367
3320
|
lockId: string;
|
|
3368
3321
|
signatureDeadline: string;
|
|
3369
|
-
sponsorAuth?: BuiltSponsorAuth;
|
|
3370
3322
|
}
|
|
3371
3323
|
interface RedeemDto {
|
|
3372
3324
|
calls: DecodedCallDto[];
|
|
@@ -3378,7 +3330,6 @@ interface RedeemDto {
|
|
|
3378
3330
|
netCreditAmountFallback?: string;
|
|
3379
3331
|
expiresInSeconds: number;
|
|
3380
3332
|
signatureDeadline: string;
|
|
3381
|
-
sponsorAuth?: BuiltSponsorAuth;
|
|
3382
3333
|
}
|
|
3383
3334
|
interface PerpDepositDto {
|
|
3384
3335
|
calls: DecodedCallDto[];
|
|
@@ -3391,14 +3342,11 @@ interface PerpDepositDto {
|
|
|
3391
3342
|
brokerHash: Hex;
|
|
3392
3343
|
usdcAddress: Address;
|
|
3393
3344
|
relayAddress: Address;
|
|
3394
|
-
sponsorAuth?: BuiltSponsorAuth;
|
|
3395
3345
|
}
|
|
3396
3346
|
interface MobilePrepareDto {
|
|
3397
3347
|
lockId: string;
|
|
3398
3348
|
userOpHash: Hex;
|
|
3399
|
-
typedData: SerializedUserOpTypedData;
|
|
3400
3349
|
userOpHashFallback?: Hex;
|
|
3401
|
-
typedDataFallback?: SerializedUserOpTypedData;
|
|
3402
3350
|
feeAmount: string;
|
|
3403
3351
|
signatureDeadline: string;
|
|
3404
3352
|
expiresInSeconds: number;
|
|
@@ -3418,42 +3366,6 @@ interface RedeemPrepareDto extends MobilePrepareDto {
|
|
|
3418
3366
|
interface MobileSubmitDto {
|
|
3419
3367
|
userOpHash: Hex;
|
|
3420
3368
|
}
|
|
3421
|
-
interface DelegateStatusDto {
|
|
3422
|
-
isDelegated: boolean;
|
|
3423
|
-
batchExecutorAddress: Address;
|
|
3424
|
-
/**
|
|
3425
|
-
* EOA tx count fetched on-chain via `getTransactionCount(blockTag: 'pending')`.
|
|
3426
|
-
* Mobile passes this VERBATIM into Privy `signAuthorization({ ..., nonce })` —
|
|
3427
|
-
* MUST NOT hardcode `0` or fetch independently. For a fresh embedded wallet
|
|
3428
|
-
* it will be `"0"`, but re-delegation or post-activity wallets will be > 0.
|
|
3429
|
-
* Returned as decimal string (preserves bigint precision over JSON).
|
|
3430
|
-
*/
|
|
3431
|
-
delegationNonce: string;
|
|
3432
|
-
chainId: number;
|
|
3433
|
-
}
|
|
3434
|
-
interface DelegatePrepareDto {
|
|
3435
|
-
/**
|
|
3436
|
-
* v0.7.7 — refactored to mobile prepare/submit pattern. Mobile signs
|
|
3437
|
-
* the EIP-7702 authorization LOCALLY (Privy `signAuthorization`),
|
|
3438
|
-
* then signs `userOpHash` (or `typedData`) BEFORE submit. See
|
|
3439
|
-
* `handleDelegatePrepare` for rationale.
|
|
3440
|
-
*
|
|
3441
|
-
* Pre-v0.7.7 callers expected `{ authorizationHash, delegationNonce,
|
|
3442
|
-
* batchExecutorAddress, chainId }` — `delegationNonce` +
|
|
3443
|
-
* `batchExecutorAddress` retained for back-compat so mobile can
|
|
3444
|
-
* compute the authorization hash if needed; `authorizationHash`
|
|
3445
|
-
* removed (mobile's Privy hook computes it locally).
|
|
3446
|
-
*/
|
|
3447
|
-
lockId: string;
|
|
3448
|
-
userOpHash: Hex;
|
|
3449
|
-
typedData: SerializedUserOpTypedData;
|
|
3450
|
-
expiresInSeconds: number;
|
|
3451
|
-
isSponsored: boolean;
|
|
3452
|
-
/** Echoed for mobile to recompute the authorization hash if desired. */
|
|
3453
|
-
delegationNonce: string;
|
|
3454
|
-
batchExecutorAddress: Address;
|
|
3455
|
-
chainId: number;
|
|
3456
|
-
}
|
|
3457
3369
|
declare class AdapterMisconfiguredError extends Error {
|
|
3458
3370
|
readonly code: "ADAPTER_MISCONFIGURED";
|
|
3459
3371
|
constructor(message: string);
|
|
@@ -3540,39 +3452,6 @@ declare class IssuerApiAdapter {
|
|
|
3540
3452
|
}): Promise<MobileSubmitDto>;
|
|
3541
3453
|
claimStatus(authenticatedAddress: Address, lockId: string): Promise<MintStatusResponse>;
|
|
3542
3454
|
redeemStatus(authenticatedAddress: Address, lockId: string): Promise<BurnStatusResponse>;
|
|
3543
|
-
delegateStatus(authenticatedAddress: Address, chainId: number): Promise<DelegateStatusDto>;
|
|
3544
|
-
/**
|
|
3545
|
-
* Build the delegation-anchor UserOp + obtain paymaster sponsorship
|
|
3546
|
-
* + persist as a pending entry. Mobile must:
|
|
3547
|
-
*
|
|
3548
|
-
* 1. Sign EIP-7702 authorization LOCALLY (Privy `signAuthorization`
|
|
3549
|
-
* with `{contractAddress: batchExecutorAddress, chainId,
|
|
3550
|
-
* nonce: delegationNonce}`) → 65-byte authSig hex.
|
|
3551
|
-
* 2. POST `/delegate/prepare` with `{ chainId, delegationNonce,
|
|
3552
|
-
* authSig }` → this method.
|
|
3553
|
-
* 3. Sign returned `userOpHash` LOCALLY (`signTypedData(typedData)`).
|
|
3554
|
-
* 4. POST `/delegate/submit` with `{ lockId, userOpSig }`.
|
|
3555
|
-
*
|
|
3556
|
-
* v0.7.7 — replaces single-shot delegateSubmit that tried to relay
|
|
3557
|
-
* a UserOp with empty `signature: "0x"` (Simple7702Account's
|
|
3558
|
-
* validateUserOp reverts `ECDSAInvalidSignatureLength` 0xfce698f7).
|
|
3559
|
-
*/
|
|
3560
|
-
delegatePrepare(authenticatedAddress: Address, input: {
|
|
3561
|
-
chainId: number;
|
|
3562
|
-
delegationNonce: bigint;
|
|
3563
|
-
authSig: Hex | string;
|
|
3564
|
-
aaNonce: bigint;
|
|
3565
|
-
}): Promise<DelegatePrepareDto>;
|
|
3566
|
-
delegateSubmit(input: {
|
|
3567
|
-
authenticatedAddress: Address;
|
|
3568
|
-
lockId: string;
|
|
3569
|
-
userOpSig: Hex;
|
|
3570
|
-
}): Promise<MobileSubmitDto>;
|
|
3571
|
-
/**
|
|
3572
|
-
* Build + sign a SponsorAuth payload. Returns `undefined` when no
|
|
3573
|
-
* issuer id is configured, so the controller can skip the field.
|
|
3574
|
-
*/
|
|
3575
|
-
private buildSponsorAuth;
|
|
3576
3455
|
private runMobilePrepare;
|
|
3577
3456
|
private assertRedeemHandler;
|
|
3578
3457
|
/**
|
|
@@ -3858,8 +3737,8 @@ interface RequestPaymasterParams {
|
|
|
3858
3737
|
declare function requestPaymaster(params: RequestPaymasterParams): Promise<Awaited<ReturnType<PafiBackendClient["requestSponsorship"]>> | undefined>;
|
|
3859
3738
|
interface RelayUserOpParams {
|
|
3860
3739
|
client: PafiBackendClient | null | undefined;
|
|
3861
|
-
/** EntryPoint address — typically `
|
|
3862
|
-
entryPoint: typeof
|
|
3740
|
+
/** EntryPoint address — typically `ENTRY_POINT_V07` from core. */
|
|
3741
|
+
entryPoint: typeof ENTRY_POINT_V07 | string;
|
|
3863
3742
|
userOp: Record<string, string | null>;
|
|
3864
3743
|
/** EIP-7702 authorization (delegation UserOps only). */
|
|
3865
3744
|
eip7702Auth?: {
|
|
@@ -4090,4 +3969,4 @@ declare class MemoryRedemptionHistoryStore implements IRedemptionHistoryStore {
|
|
|
4090
3969
|
|
|
4091
3970
|
declare const PAFI_ISSUER_SDK_VERSION: string;
|
|
4092
3971
|
|
|
4093
|
-
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
|
|
3972
|
+
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 EstimateGasFeeOptions, type EvaluateInput, FeeManager, type FeeManagerConfig, type FeeManagerMetrics, type FetchFailureReason, type FetchImpl, type FetchResult, type GasFeeDto, type GasFeeSource, 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 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, handleMobilePrepare, handleMobileSubmit, handleRedeemStatus, makePostgresSingletonLock, mergePaymasterFields, prepareMobileUserOp, relayUserOp, requestPaymaster, serializeEntryToJsonRpc };
|