@pafi-dev/issuer 0.7.3 → 0.7.5
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 +115 -134
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +45 -48
- package/dist/index.d.ts +45 -48
- package/dist/index.js +16 -33
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,55 +1,18 @@
|
|
|
1
|
+
import { PafiSdkError, SdkErrorHttpStatus, PointTokenDomainConfig, PartialUserOperation, BurnRequest, PoolKey, UserOpTypedData, decodeBatchExecuteCalls, BROKER_HASHES, Eip7702AuthorizationJsonRpc, BuiltSponsorAuth, ENTRY_POINT_V08 } from '@pafi-dev/core';
|
|
2
|
+
export { PAFI_SUBGRAPH_URL, PafiSdkError, SdkErrorHttpStatus, ValidationError } from '@pafi-dev/core';
|
|
1
3
|
import { Address, Hex, PublicClient, WalletClient } from 'viem';
|
|
2
|
-
import { PointTokenDomainConfig, PartialUserOperation, BurnRequest, PoolKey, UserOpTypedData, decodeBatchExecuteCalls, BROKER_HASHES, Eip7702AuthorizationJsonRpc, BuiltSponsorAuth, ENTRY_POINT_V08 } from '@pafi-dev/core';
|
|
3
|
-
export { PAFI_SUBGRAPH_URL } from '@pafi-dev/core';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* v0.7.4 — `PafiSdkError` + `SdkErrorHttpStatus` were moved to
|
|
7
|
+
* `@pafi-dev/core/errors` so core-level errors (e.g. `OracleStaleError`)
|
|
8
|
+
* can extend the same base. Issuer re-exports the canonical types
|
|
9
|
+
* here for back-compat. See SDK_CORE_TRADING_AUDIT.md H3.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* `details` is `unknown` so subclasses can attach structured context
|
|
16
|
-
* (offending value, on-chain state snapshot, etc.) without locking
|
|
17
|
-
* the base shape.
|
|
18
|
-
*
|
|
19
|
-
* `httpStatus` is the recommended HTTP status the issuer's HTTP layer
|
|
20
|
-
* should surface. Kept on the SDK side because the SDK already knows
|
|
21
|
-
* the right status (e.g. `IssuerStateError` is always 422); leaving it
|
|
22
|
-
* to issuer controllers means each one re-implements the same mapping.
|
|
11
|
+
* Effect: `instanceof PafiSdkError` from EITHER package now catches
|
|
12
|
+
* errors thrown from EITHER package — no more silent fall-through to
|
|
13
|
+
* 500 for core-thrown errors.
|
|
23
14
|
*/
|
|
24
|
-
|
|
25
|
-
declare abstract class PafiSdkError extends Error {
|
|
26
|
-
abstract readonly code: string;
|
|
27
|
-
/**
|
|
28
|
-
* `true` when the FE should consider a retry safe — typically because
|
|
29
|
-
* the failure is transient (`MINT_CAP_EXCEEDED` may free up,
|
|
30
|
-
* `RELAY_FEE_EXCEEDS_AMOUNT` may drop on next quote). Defaults to
|
|
31
|
-
* `false` — subclasses opt in per-code.
|
|
32
|
-
*/
|
|
33
|
-
readonly safeToRetry: boolean;
|
|
34
|
-
readonly details?: unknown;
|
|
35
|
-
abstract readonly httpStatus: SdkErrorHttpStatus;
|
|
36
|
-
constructor(message: string);
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Generic validation failure for routine 4xx-class request errors —
|
|
40
|
-
* unsupported chainId, missing field, address checksum mismatch,
|
|
41
|
-
* out-of-range amount, etc. Replaces ~12 raw `throw new Error(...)`
|
|
42
|
-
* call sites in `IssuerApiHandlers` that previously leaked as 500s
|
|
43
|
-
* via `createSdkErrorMapper`'s "non-PafiSdkError → rethrow" path.
|
|
44
|
-
*
|
|
45
|
-
* v0.7.1 — added per SDK_ISSUER_AUDIT.md H1.
|
|
46
|
-
*/
|
|
47
|
-
declare class ValidationError extends PafiSdkError {
|
|
48
|
-
readonly httpStatus: "unprocessable";
|
|
49
|
-
readonly code: string;
|
|
50
|
-
readonly details?: Record<string, unknown>;
|
|
51
|
-
constructor(code: string, message: string, details?: Record<string, unknown>);
|
|
52
|
-
}
|
|
15
|
+
|
|
53
16
|
/**
|
|
54
17
|
* Issuer wired the SDK without a dependency the requested endpoint
|
|
55
18
|
* needs (e.g. `/gas-fee` called but `feeManager` not configured;
|
|
@@ -1331,6 +1294,24 @@ interface SponsorshipRequest {
|
|
|
1331
1294
|
scenario: string;
|
|
1332
1295
|
userOp: SponsorshipUserOp;
|
|
1333
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
|
+
};
|
|
1334
1315
|
}
|
|
1335
1316
|
interface SponsorshipResponse {
|
|
1336
1317
|
paymaster: Address;
|
|
@@ -2680,6 +2661,22 @@ interface RequestPaymasterParams {
|
|
|
2680
2661
|
* scenario name).
|
|
2681
2662
|
*/
|
|
2682
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
|
+
};
|
|
2683
2680
|
/** Optional logger for the "sponsorship declined" warning. */
|
|
2684
2681
|
onWarning?: (msg: string) => void;
|
|
2685
2682
|
}
|
|
@@ -2832,4 +2829,4 @@ declare class IssuerStateValidator {
|
|
|
2832
2829
|
|
|
2833
2830
|
declare const PAFI_ISSUER_SDK_VERSION: string;
|
|
2834
2831
|
|
|
2835
|
-
export { AdapterMisconfiguredError, type ApiConfigResponse, type ApiGasFeeResponse, type ApiLoginRequest, type ApiLoginResponse, type ApiNonceResponse, type ApiPoolsRequest, type ApiPoolsResponse, type ApiUserRequest, type ApiUserResponse, type AuthContext, AuthError, type AuthErrorCode, AuthService, type AuthServiceConfig, BalanceAggregator, type BalanceAggregatorConfig, BundlerNotConfiguredError, BundlerRejectedError, type BurnEvent, BurnIndexer, type BurnIndexerConfig, type BurnStatusParams, type BurnStatusResponse, type ClaimDto, type CombinedBalance, type ConfigDto, ConfigurationError, type DecodedCallDto, DefaultPolicyEngine, type DefaultPolicyEngineOptions, type DelegatePrepareDto, type DelegateStatusDto, FeeManager, type FeeManagerConfig, type GasFeeDto, type HandleDelegateSubmitParams, type HandleDelegateSubmitResult, type HandleMobilePrepareParams, type HandleMobilePrepareResult, type HandleMobileSubmitParams, type IIndexerCursorStore, type IPendingUserOpStore, type IPointLedger, type IPolicyEngine, type ISessionStore, InMemoryCursorStore, IssuerApiAdapter, type IssuerApiAdapterConfig, IssuerApiHandlers, type IssuerApiHandlersConfig, type IssuerRegistryRecord, type IssuerService, type IssuerServiceConfig, IssuerStateError, IssuerStateValidator, LockNotFoundError, type LockedMintRequest, type LoginResult, MemoryPendingUserOpStore, MemorySessionStore, type MemorySessionStoreOptions, type MintEvent, type MintStatusParams, type MintStatusResponse, type MintingStatus, type MobilePrepareDto, type MobileSubmitDto, type NativePtQuoterConfig, NonceManager, 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,
|
|
2832
|
+
export { AdapterMisconfiguredError, type ApiConfigResponse, type ApiGasFeeResponse, type ApiLoginRequest, type ApiLoginResponse, type ApiNonceResponse, type ApiPoolsRequest, type ApiPoolsResponse, type ApiUserRequest, type ApiUserResponse, type AuthContext, AuthError, type AuthErrorCode, AuthService, type AuthServiceConfig, BalanceAggregator, type BalanceAggregatorConfig, BundlerNotConfiguredError, BundlerRejectedError, type BurnEvent, BurnIndexer, type BurnIndexerConfig, type BurnStatusParams, type BurnStatusResponse, type ClaimDto, type CombinedBalance, type ConfigDto, ConfigurationError, type DecodedCallDto, DefaultPolicyEngine, type DefaultPolicyEngineOptions, type DelegatePrepareDto, type DelegateStatusDto, FeeManager, type FeeManagerConfig, type GasFeeDto, type HandleDelegateSubmitParams, type HandleDelegateSubmitResult, type HandleMobilePrepareParams, type HandleMobilePrepareResult, type HandleMobileSubmitParams, type IIndexerCursorStore, type IPendingUserOpStore, type IPointLedger, type IPolicyEngine, type ISessionStore, InMemoryCursorStore, IssuerApiAdapter, type IssuerApiAdapterConfig, IssuerApiHandlers, type IssuerApiHandlersConfig, type IssuerRegistryRecord, type IssuerService, type IssuerServiceConfig, IssuerStateError, IssuerStateValidator, LockNotFoundError, type LockedMintRequest, type LoginResult, MemoryPendingUserOpStore, MemorySessionStore, type MemorySessionStoreOptions, type MintEvent, type MintStatusParams, type MintStatusResponse, type MintingStatus, type MobilePrepareDto, type MobileSubmitDto, type NativePtQuoterConfig, NonceManager, 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 PendingCredit, type PendingUserOpEntry, PendingUserOpForbiddenError, PendingUserOpNotFoundError, type PerpDepositDto, PerpDepositError, PerpDepositHandler, type PerpDepositHandlerConfig, type PerpDepositRequest, type PerpDepositResponse, PointIndexer, type PointIndexerConfig, type PolicyDecision, type PolicyEvalRequest, type PoolsDto, type PoolsProvider, type PreValidateMintResult, type PrepareBurnParams, type PrepareMintParams, type PrepareMobileUserOpParams, type PrepareMobileUserOpResult, type PreparedUserOp, type RedeemDto, type RedeemPrepareDto, RelayError, type RelayErrorCode, RelayService, type RelayUserOpParams, type RelayUserOpRequest, type RelayUserOpResponse, type RequestPaymasterParams, type RetryConfig, type SdkErrorBody, type SdkErrorMapperFactories, type SdkErrorStatus, type SerializedUserOpTypedData, type Session, type SponsorshipRequest, type SponsorshipResponse, type SponsorshipTarget, type SponsorshipUserOp, type SubgraphNativeUsdtQuoterConfig, type SubgraphPoolsProviderConfig, type UserDto, authenticateRequest, createIssuerService, createNativePtQuoter, createSdkErrorMapper, createSubgraphNativeUsdtQuoter, createSubgraphPoolsProvider, handleClaimStatus, handleDelegateSubmit, handleMobilePrepare, handleMobileSubmit, handleRedeemStatus, mergePaymasterFields, prepareMobileUserOp, relayUserOp, requestPaymaster, serializeEntryToJsonRpc, serializeUserOpTypedData };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,55 +1,18 @@
|
|
|
1
|
+
import { PafiSdkError, SdkErrorHttpStatus, PointTokenDomainConfig, PartialUserOperation, BurnRequest, PoolKey, UserOpTypedData, decodeBatchExecuteCalls, BROKER_HASHES, Eip7702AuthorizationJsonRpc, BuiltSponsorAuth, ENTRY_POINT_V08 } from '@pafi-dev/core';
|
|
2
|
+
export { PAFI_SUBGRAPH_URL, PafiSdkError, SdkErrorHttpStatus, ValidationError } from '@pafi-dev/core';
|
|
1
3
|
import { Address, Hex, PublicClient, WalletClient } from 'viem';
|
|
2
|
-
import { PointTokenDomainConfig, PartialUserOperation, BurnRequest, PoolKey, UserOpTypedData, decodeBatchExecuteCalls, BROKER_HASHES, Eip7702AuthorizationJsonRpc, BuiltSponsorAuth, ENTRY_POINT_V08 } from '@pafi-dev/core';
|
|
3
|
-
export { PAFI_SUBGRAPH_URL } from '@pafi-dev/core';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* v0.7.4 — `PafiSdkError` + `SdkErrorHttpStatus` were moved to
|
|
7
|
+
* `@pafi-dev/core/errors` so core-level errors (e.g. `OracleStaleError`)
|
|
8
|
+
* can extend the same base. Issuer re-exports the canonical types
|
|
9
|
+
* here for back-compat. See SDK_CORE_TRADING_AUDIT.md H3.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* `details` is `unknown` so subclasses can attach structured context
|
|
16
|
-
* (offending value, on-chain state snapshot, etc.) without locking
|
|
17
|
-
* the base shape.
|
|
18
|
-
*
|
|
19
|
-
* `httpStatus` is the recommended HTTP status the issuer's HTTP layer
|
|
20
|
-
* should surface. Kept on the SDK side because the SDK already knows
|
|
21
|
-
* the right status (e.g. `IssuerStateError` is always 422); leaving it
|
|
22
|
-
* to issuer controllers means each one re-implements the same mapping.
|
|
11
|
+
* Effect: `instanceof PafiSdkError` from EITHER package now catches
|
|
12
|
+
* errors thrown from EITHER package — no more silent fall-through to
|
|
13
|
+
* 500 for core-thrown errors.
|
|
23
14
|
*/
|
|
24
|
-
|
|
25
|
-
declare abstract class PafiSdkError extends Error {
|
|
26
|
-
abstract readonly code: string;
|
|
27
|
-
/**
|
|
28
|
-
* `true` when the FE should consider a retry safe — typically because
|
|
29
|
-
* the failure is transient (`MINT_CAP_EXCEEDED` may free up,
|
|
30
|
-
* `RELAY_FEE_EXCEEDS_AMOUNT` may drop on next quote). Defaults to
|
|
31
|
-
* `false` — subclasses opt in per-code.
|
|
32
|
-
*/
|
|
33
|
-
readonly safeToRetry: boolean;
|
|
34
|
-
readonly details?: unknown;
|
|
35
|
-
abstract readonly httpStatus: SdkErrorHttpStatus;
|
|
36
|
-
constructor(message: string);
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Generic validation failure for routine 4xx-class request errors —
|
|
40
|
-
* unsupported chainId, missing field, address checksum mismatch,
|
|
41
|
-
* out-of-range amount, etc. Replaces ~12 raw `throw new Error(...)`
|
|
42
|
-
* call sites in `IssuerApiHandlers` that previously leaked as 500s
|
|
43
|
-
* via `createSdkErrorMapper`'s "non-PafiSdkError → rethrow" path.
|
|
44
|
-
*
|
|
45
|
-
* v0.7.1 — added per SDK_ISSUER_AUDIT.md H1.
|
|
46
|
-
*/
|
|
47
|
-
declare class ValidationError extends PafiSdkError {
|
|
48
|
-
readonly httpStatus: "unprocessable";
|
|
49
|
-
readonly code: string;
|
|
50
|
-
readonly details?: Record<string, unknown>;
|
|
51
|
-
constructor(code: string, message: string, details?: Record<string, unknown>);
|
|
52
|
-
}
|
|
15
|
+
|
|
53
16
|
/**
|
|
54
17
|
* Issuer wired the SDK without a dependency the requested endpoint
|
|
55
18
|
* needs (e.g. `/gas-fee` called but `feeManager` not configured;
|
|
@@ -1331,6 +1294,24 @@ interface SponsorshipRequest {
|
|
|
1331
1294
|
scenario: string;
|
|
1332
1295
|
userOp: SponsorshipUserOp;
|
|
1333
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
|
+
};
|
|
1334
1315
|
}
|
|
1335
1316
|
interface SponsorshipResponse {
|
|
1336
1317
|
paymaster: Address;
|
|
@@ -2680,6 +2661,22 @@ interface RequestPaymasterParams {
|
|
|
2680
2661
|
* scenario name).
|
|
2681
2662
|
*/
|
|
2682
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
|
+
};
|
|
2683
2680
|
/** Optional logger for the "sponsorship declined" warning. */
|
|
2684
2681
|
onWarning?: (msg: string) => void;
|
|
2685
2682
|
}
|
|
@@ -2832,4 +2829,4 @@ declare class IssuerStateValidator {
|
|
|
2832
2829
|
|
|
2833
2830
|
declare const PAFI_ISSUER_SDK_VERSION: string;
|
|
2834
2831
|
|
|
2835
|
-
export { AdapterMisconfiguredError, type ApiConfigResponse, type ApiGasFeeResponse, type ApiLoginRequest, type ApiLoginResponse, type ApiNonceResponse, type ApiPoolsRequest, type ApiPoolsResponse, type ApiUserRequest, type ApiUserResponse, type AuthContext, AuthError, type AuthErrorCode, AuthService, type AuthServiceConfig, BalanceAggregator, type BalanceAggregatorConfig, BundlerNotConfiguredError, BundlerRejectedError, type BurnEvent, BurnIndexer, type BurnIndexerConfig, type BurnStatusParams, type BurnStatusResponse, type ClaimDto, type CombinedBalance, type ConfigDto, ConfigurationError, type DecodedCallDto, DefaultPolicyEngine, type DefaultPolicyEngineOptions, type DelegatePrepareDto, type DelegateStatusDto, FeeManager, type FeeManagerConfig, type GasFeeDto, type HandleDelegateSubmitParams, type HandleDelegateSubmitResult, type HandleMobilePrepareParams, type HandleMobilePrepareResult, type HandleMobileSubmitParams, type IIndexerCursorStore, type IPendingUserOpStore, type IPointLedger, type IPolicyEngine, type ISessionStore, InMemoryCursorStore, IssuerApiAdapter, type IssuerApiAdapterConfig, IssuerApiHandlers, type IssuerApiHandlersConfig, type IssuerRegistryRecord, type IssuerService, type IssuerServiceConfig, IssuerStateError, IssuerStateValidator, LockNotFoundError, type LockedMintRequest, type LoginResult, MemoryPendingUserOpStore, MemorySessionStore, type MemorySessionStoreOptions, type MintEvent, type MintStatusParams, type MintStatusResponse, type MintingStatus, type MobilePrepareDto, type MobileSubmitDto, type NativePtQuoterConfig, NonceManager, 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,
|
|
2832
|
+
export { AdapterMisconfiguredError, type ApiConfigResponse, type ApiGasFeeResponse, type ApiLoginRequest, type ApiLoginResponse, type ApiNonceResponse, type ApiPoolsRequest, type ApiPoolsResponse, type ApiUserRequest, type ApiUserResponse, type AuthContext, AuthError, type AuthErrorCode, AuthService, type AuthServiceConfig, BalanceAggregator, type BalanceAggregatorConfig, BundlerNotConfiguredError, BundlerRejectedError, type BurnEvent, BurnIndexer, type BurnIndexerConfig, type BurnStatusParams, type BurnStatusResponse, type ClaimDto, type CombinedBalance, type ConfigDto, ConfigurationError, type DecodedCallDto, DefaultPolicyEngine, type DefaultPolicyEngineOptions, type DelegatePrepareDto, type DelegateStatusDto, FeeManager, type FeeManagerConfig, type GasFeeDto, type HandleDelegateSubmitParams, type HandleDelegateSubmitResult, type HandleMobilePrepareParams, type HandleMobilePrepareResult, type HandleMobileSubmitParams, type IIndexerCursorStore, type IPendingUserOpStore, type IPointLedger, type IPolicyEngine, type ISessionStore, InMemoryCursorStore, IssuerApiAdapter, type IssuerApiAdapterConfig, IssuerApiHandlers, type IssuerApiHandlersConfig, type IssuerRegistryRecord, type IssuerService, type IssuerServiceConfig, IssuerStateError, IssuerStateValidator, LockNotFoundError, type LockedMintRequest, type LoginResult, MemoryPendingUserOpStore, MemorySessionStore, type MemorySessionStoreOptions, type MintEvent, type MintStatusParams, type MintStatusResponse, type MintingStatus, type MobilePrepareDto, type MobileSubmitDto, type NativePtQuoterConfig, NonceManager, 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 PendingCredit, type PendingUserOpEntry, PendingUserOpForbiddenError, PendingUserOpNotFoundError, type PerpDepositDto, PerpDepositError, PerpDepositHandler, type PerpDepositHandlerConfig, type PerpDepositRequest, type PerpDepositResponse, PointIndexer, type PointIndexerConfig, type PolicyDecision, type PolicyEvalRequest, type PoolsDto, type PoolsProvider, type PreValidateMintResult, type PrepareBurnParams, type PrepareMintParams, type PrepareMobileUserOpParams, type PrepareMobileUserOpResult, type PreparedUserOp, type RedeemDto, type RedeemPrepareDto, RelayError, type RelayErrorCode, RelayService, type RelayUserOpParams, type RelayUserOpRequest, type RelayUserOpResponse, type RequestPaymasterParams, type RetryConfig, type SdkErrorBody, type SdkErrorMapperFactories, type SdkErrorStatus, type SerializedUserOpTypedData, type Session, type SponsorshipRequest, type SponsorshipResponse, type SponsorshipTarget, type SponsorshipUserOp, type SubgraphNativeUsdtQuoterConfig, type SubgraphPoolsProviderConfig, type UserDto, authenticateRequest, createIssuerService, createNativePtQuoter, createSdkErrorMapper, createSubgraphNativeUsdtQuoter, createSubgraphPoolsProvider, handleClaimStatus, handleDelegateSubmit, handleMobilePrepare, handleMobileSubmit, handleRedeemStatus, mergePaymasterFields, prepareMobileUserOp, relayUserOp, requestPaymaster, serializeEntryToJsonRpc, serializeUserOpTypedData };
|
package/dist/index.js
CHANGED
|
@@ -1,29 +1,10 @@
|
|
|
1
1
|
// src/errors.ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
safeToRetry = false;
|
|
10
|
-
details;
|
|
11
|
-
constructor(message) {
|
|
12
|
-
super(message);
|
|
13
|
-
this.name = new.target.name;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
var ValidationError = class extends PafiSdkError {
|
|
17
|
-
httpStatus = "unprocessable";
|
|
18
|
-
code;
|
|
19
|
-
details;
|
|
20
|
-
constructor(code, message, details) {
|
|
21
|
-
super(message);
|
|
22
|
-
this.code = code;
|
|
23
|
-
this.details = details;
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
var ConfigurationError = class extends PafiSdkError {
|
|
2
|
+
import {
|
|
3
|
+
PafiSdkError
|
|
4
|
+
} from "@pafi-dev/core";
|
|
5
|
+
import { PafiSdkError as PafiSdkError2 } from "@pafi-dev/core";
|
|
6
|
+
import { ValidationError } from "@pafi-dev/core";
|
|
7
|
+
var ConfigurationError = class extends PafiSdkError2 {
|
|
27
8
|
httpStatus = "service_unavailable";
|
|
28
9
|
code;
|
|
29
10
|
details;
|
|
@@ -1881,7 +1862,8 @@ async function requestPaymaster(params) {
|
|
|
1881
1862
|
contract: params.pointTokenAddress,
|
|
1882
1863
|
function: fn,
|
|
1883
1864
|
pointToken: params.pointTokenAddress
|
|
1884
|
-
}
|
|
1865
|
+
},
|
|
1866
|
+
...params.eip7702Auth ? { eip7702Auth: params.eip7702Auth } : {}
|
|
1885
1867
|
});
|
|
1886
1868
|
} catch (err) {
|
|
1887
1869
|
const msg = err instanceof Error ? err.message : String(err);
|
|
@@ -2330,12 +2312,19 @@ async function handleDelegateSubmit(params) {
|
|
|
2330
2312
|
maxFeePerGas: params.fees.maxFeePerGas ?? 0n,
|
|
2331
2313
|
maxPriorityFeePerGas: params.fees.maxPriorityFeePerGas ?? 0n
|
|
2332
2314
|
};
|
|
2315
|
+
const authorization = buildEip7702Authorization({
|
|
2316
|
+
chainId: params.chainId,
|
|
2317
|
+
address: batchExecutor,
|
|
2318
|
+
nonce: params.delegationNonce,
|
|
2319
|
+
authSig: params.authSig
|
|
2320
|
+
});
|
|
2333
2321
|
const paymasterFields = await requestPaymaster({
|
|
2334
2322
|
client: params.pafiBackendClient,
|
|
2335
2323
|
chainId: params.chainId,
|
|
2336
2324
|
scenario: "delegate",
|
|
2337
2325
|
userOp,
|
|
2338
2326
|
pointTokenAddress: batchExecutor,
|
|
2327
|
+
eip7702Auth: authorization,
|
|
2339
2328
|
onWarning: params.onWarning
|
|
2340
2329
|
});
|
|
2341
2330
|
const merged = {
|
|
@@ -2361,12 +2350,6 @@ async function handleDelegateSubmit(params) {
|
|
|
2361
2350
|
// is the user's "consent"; no separate AA signature is needed.
|
|
2362
2351
|
"0x"
|
|
2363
2352
|
);
|
|
2364
|
-
const authorization = buildEip7702Authorization({
|
|
2365
|
-
chainId: params.chainId,
|
|
2366
|
-
address: batchExecutor,
|
|
2367
|
-
nonce: params.delegationNonce,
|
|
2368
|
-
authSig: params.authSig
|
|
2369
|
-
});
|
|
2370
2353
|
const result = await relayUserOp({
|
|
2371
2354
|
client: params.pafiBackendClient,
|
|
2372
2355
|
userOp: userOpJson,
|
|
@@ -3659,7 +3642,7 @@ var IssuerStateValidator = class _IssuerStateValidator {
|
|
|
3659
3642
|
};
|
|
3660
3643
|
|
|
3661
3644
|
// src/index.ts
|
|
3662
|
-
var PAFI_ISSUER_SDK_VERSION = true ? "0.7.
|
|
3645
|
+
var PAFI_ISSUER_SDK_VERSION = true ? "0.7.5" : "dev";
|
|
3663
3646
|
export {
|
|
3664
3647
|
AdapterMisconfiguredError,
|
|
3665
3648
|
AuthError,
|