@pafi-dev/core 0.7.7 → 0.8.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.
Files changed (63) hide show
  1. package/dist/abi/index.cjs +7 -3
  2. package/dist/abi/index.cjs.map +1 -1
  3. package/dist/abi/index.d.cts +451 -2
  4. package/dist/abi/index.d.ts +451 -2
  5. package/dist/abi/index.js +7 -3
  6. package/dist/auth/index.cjs +6 -2
  7. package/dist/auth/index.cjs.map +1 -1
  8. package/dist/auth/index.d.cts +21 -9
  9. package/dist/auth/index.d.ts +21 -9
  10. package/dist/auth/index.js +5 -1
  11. package/dist/{chunk-6UX2IFA2.js → chunk-4EGXLYMM.js} +20 -2
  12. package/dist/chunk-4EGXLYMM.js.map +1 -0
  13. package/dist/chunk-644KZUKR.cjs +519 -0
  14. package/dist/chunk-644KZUKR.cjs.map +1 -0
  15. package/dist/{chunk-5254AG3Z.cjs → chunk-75JWR5SA.cjs} +21 -3
  16. package/dist/chunk-75JWR5SA.cjs.map +1 -0
  17. package/dist/{chunk-6CXTFOIH.js → chunk-ABNM6LMP.js} +266 -1
  18. package/dist/chunk-ABNM6LMP.js.map +1 -0
  19. package/dist/{chunk-M5ULOZ3A.cjs → chunk-ACQHZWHP.cjs} +55 -3
  20. package/dist/chunk-ACQHZWHP.cjs.map +1 -0
  21. package/dist/{chunk-5JZOJIBT.js → chunk-B2NDSIAI.js} +1 -1095
  22. package/dist/chunk-B2NDSIAI.js.map +1 -0
  23. package/dist/{chunk-WJSIB5GF.js → chunk-BB5YW57R.js} +53 -1
  24. package/dist/chunk-BB5YW57R.js.map +1 -0
  25. package/dist/chunk-CUVUSVWR.js +519 -0
  26. package/dist/chunk-CUVUSVWR.js.map +1 -0
  27. package/dist/chunk-JEWSN7Q3.cjs +1059 -0
  28. package/dist/chunk-JEWSN7Q3.cjs.map +1 -0
  29. package/dist/{chunk-Q6WCDZXI.cjs → chunk-RFANYF24.cjs} +267 -2
  30. package/dist/chunk-RFANYF24.cjs.map +1 -0
  31. package/dist/{chunk-YDLMVWDH.js → chunk-Y4CFC4OC.js} +5 -3
  32. package/dist/{chunk-YDLMVWDH.js.map → chunk-Y4CFC4OC.js.map} +1 -1
  33. package/dist/{chunk-CLPRSQT2.cjs → chunk-YCY7MBSJ.cjs} +14 -12
  34. package/dist/chunk-YCY7MBSJ.cjs.map +1 -0
  35. package/dist/contract/index.cjs +4 -3
  36. package/dist/contract/index.cjs.map +1 -1
  37. package/dist/contract/index.d.cts +1 -1
  38. package/dist/contract/index.d.ts +1 -1
  39. package/dist/contract/index.js +3 -2
  40. package/dist/eip712/index.cjs +7 -2
  41. package/dist/eip712/index.cjs.map +1 -1
  42. package/dist/eip712/index.d.cts +39 -4
  43. package/dist/eip712/index.d.ts +39 -4
  44. package/dist/eip712/index.js +6 -1
  45. package/dist/index.cjs +169 -60
  46. package/dist/index.cjs.map +1 -1
  47. package/dist/index.d.cts +112 -31
  48. package/dist/index.d.ts +112 -31
  49. package/dist/index.js +132 -23
  50. package/dist/index.js.map +1 -1
  51. package/dist/{types-BAkmxgVo.d.cts → types-BS4kpO4Z.d.cts} +62 -5
  52. package/dist/{types-BAkmxgVo.d.ts → types-BS4kpO4Z.d.ts} +62 -5
  53. package/package.json +1 -1
  54. package/dist/chunk-5254AG3Z.cjs.map +0 -1
  55. package/dist/chunk-5JZOJIBT.js.map +0 -1
  56. package/dist/chunk-6CXTFOIH.js.map +0 -1
  57. package/dist/chunk-6UX2IFA2.js.map +0 -1
  58. package/dist/chunk-CLPRSQT2.cjs.map +0 -1
  59. package/dist/chunk-LRHY7GOR.cjs +0 -2153
  60. package/dist/chunk-LRHY7GOR.cjs.map +0 -1
  61. package/dist/chunk-M5ULOZ3A.cjs.map +0 -1
  62. package/dist/chunk-Q6WCDZXI.cjs.map +0 -1
  63. package/dist/chunk-WJSIB5GF.js.map +0 -1
package/dist/index.d.cts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { Address, Hex, TypedDataDomain, PublicClient, WalletClient, TransactionReceipt, HttpTransport } from 'viem';
2
- import { P as PoolKey, C as ChainConfig, a as PafiSDKConfig, b as PointTokenDomainConfig, M as MintRequest, R as ReceiverConsent, E as EIP712Signature, S as SignatureVerification } from './types-BAkmxgVo.cjs';
3
- export { B as BestQuote, c as BurnRequest, I as Issuer, d as PathKey, Q as QuoteResult } from './types-BAkmxgVo.cjs';
4
- export { pointTokenAbi as POINT_TOKEN_V2_ABI, erc20Abi, issuerRegistryAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v4QuoterAbi } from './abi/index.cjs';
5
- export { buildBurnRequestTypedData, buildDomain, buildMintRequestTypedData, buildReceiverConsentTypedData, signBurnRequest, signMintRequest, signReceiverConsent, verifyBurnRequest, verifyMintRequest, verifyReceiverConsent } from './eip712/index.cjs';
2
+ import { P as PoolKey, C as ChainConfig, a as PafiSDKConfig, b as PointTokenDomainConfig, M as MintRequest, R as ReceiverConsent, E as EIP712Signature, S as SignatureVerification } from './types-BS4kpO4Z.cjs';
3
+ export { B as BestQuote, c as BlackoutWindow, d as BurnRequest, I as Issuer, e as PathKey, Q as QuoteResult, f as Recipient, g as RedemptionDecision, h as RedemptionDenial, i as RedemptionDenialCode, j as RedemptionPolicy, k as RedemptionPolicySource, l as RedemptionPreview } from './types-BS4kpO4Z.cjs';
4
+ export { pointTokenAbi as POINT_TOKEN_V2_ABI, erc20Abi, issuerRegistryAbi, mintFeeWrapperAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v4QuoterAbi } from './abi/index.cjs';
5
+ export { Eip712DomainMismatchError, assertDomainMatchesContract, buildBurnRequestTypedData, buildDomain, buildMintRequestTypedData, buildReceiverConsentTypedData, signBurnRequest, signMintRequest, signReceiverConsent, verifyBurnRequest, verifyMintRequest, verifyReceiverConsent } from './eip712/index.cjs';
6
6
  export { getBurnRequestNonce, getIssuer, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getReceiverConsentNonce, getTokenName, isActiveIssuer, isMinter, issuerRegistryGetIssuerFlatAbi, verifyMintCap } from './contract/index.cjs';
7
7
  import { LoginMessageParams } from './auth/index.cjs';
8
- export { BuildSponsorAuthParams, BuiltSponsorAuth, SPONSOR_AUTH_DOMAIN_NAME, SPONSOR_AUTH_TYPES, SponsorAuthPayload, SponsorAuthVerifyResult, VerifyLoginResult, buildAndSignSponsorAuth, buildSponsorAuthDomain, buildSponsorAuthTypedData, computeCallDataHash, createLoginMessage, generateSponsorAuthNonce, parseLoginMessage, signSponsorAuth, verifyLoginMessage, verifySponsorAuth } from './auth/index.cjs';
8
+ export { BuildSponsorAuthParams, BuiltSponsorAuth, SPONSOR_AUTH_DOMAIN_ANCHOR_BASE_MAINNET, SPONSOR_AUTH_DOMAIN_NAME, SPONSOR_AUTH_TYPES, SponsorAuthPayload, SponsorAuthVerifyResult, VerifyLoginResult, buildAndSignSponsorAuth, buildSponsorAuthDomain, buildSponsorAuthTypedData, computeCallDataHash, createLoginMessage, generateSponsorAuthNonce, getSponsorAuthDomainAnchor, parseLoginMessage, signSponsorAuth, verifyLoginMessage, verifySponsorAuth } from './auth/index.cjs';
9
9
 
10
10
  declare const mintRequestTypes: {
11
11
  readonly MintRequest: readonly [{
@@ -83,17 +83,25 @@ declare const ENTRY_POINT_V08: Address;
83
83
  declare const PERMIT2_ADDRESS: Address;
84
84
 
85
85
  /**
86
- * v0.7.1 — unified error base for the entire SDK (core + issuer +
87
- * trading). Subclasses declare `code` (machine-readable) and
88
- * `httpStatus` (recommended HTTP status for issuer's controller).
86
+ * Unified error base for the entire SDK (core + issuer + trading).
87
+ * Subclasses declare `code` (machine-readable) and `httpStatus`
88
+ * (recommended HTTP status for issuer's controller).
89
89
  *
90
90
  * Issuer's `createSdkErrorMapper` routes any `PafiSdkError` instance
91
91
  * through framework-specific exception factories; non-PafiSdkError
92
92
  * still becomes 500.
93
- *
94
- * See SDK_CORE_TRADING_AUDIT.md H3.
95
93
  */
96
94
  type SdkErrorHttpStatus = "not_found" | "forbidden" | "unprocessable" | "service_unavailable";
95
+ /**
96
+ * Stripe-style error taxonomy. The SDK emits one of these on every
97
+ * error so consumers can branch UI behavior on `type` (toast vs modal
98
+ * vs retry banner) without whitelisting individual `code` values.
99
+ */
100
+ type PafiErrorType = "validation_error" | "authentication_error" | "authorization_error" | "not_found_error" | "business_logic_error" | "rate_limit_error" | "server_error" | "service_unavailable_error";
101
+ /** Numeric HTTP status implied by an `SdkErrorHttpStatus` slot. */
102
+ declare const SDK_ERROR_HTTP_STATUS_CODE: Record<SdkErrorHttpStatus, number>;
103
+ /** Default `type` slot for a numeric HTTP status. */
104
+ declare function defaultErrorTypeForStatus(status: number): PafiErrorType;
97
105
  declare abstract class PafiSdkError extends Error {
98
106
  abstract readonly code: string;
99
107
  /**
@@ -103,14 +111,32 @@ declare abstract class PafiSdkError extends Error {
103
111
  readonly safeToRetry: boolean;
104
112
  readonly details?: unknown;
105
113
  abstract readonly httpStatus: SdkErrorHttpStatus;
114
+ /**
115
+ * Optional Stripe-style taxonomy override. Defaults to the type
116
+ * implied by `httpStatus` (forbidden→authorization_error,
117
+ * unprocessable→business_logic_error, etc).
118
+ */
119
+ readonly type?: PafiErrorType;
120
+ /**
121
+ * Optional name of the request field that triggered the error (e.g.
122
+ * `"amount"`, `"chainId"`). Surfaced on validation failures so the
123
+ * client can highlight the offending field.
124
+ */
125
+ readonly param?: string;
126
+ /**
127
+ * Optional structured context (e.g. `{ available, requested }` for a
128
+ * cap denial). Distinct from `details` — `metadata` is meant for
129
+ * UI consumption; `details` carries raw debug info.
130
+ */
131
+ readonly metadata?: Record<string, unknown>;
106
132
  constructor(message: string);
107
133
  }
108
134
  /**
109
- * @deprecated v0.7.1 — use `PafiSdkError` (capital S, lowercase dk).
135
+ * @deprecated Use `PafiSdkError` (capital S, lowercase dk).
110
136
  * The two classes existed in parallel ("PafiSDKError" in core,
111
137
  * "PafiSdkError" in issuer) due to historical drift; consolidating
112
138
  * here. Kept as alias for back-compat through v0.7.x; will be removed
113
- * in v0.8. See SDK_CORE_TRADING_AUDIT.md H3.
139
+ * in v0.8.
114
140
  */
115
141
  declare class PafiSDKError extends Error {
116
142
  constructor(message: string);
@@ -133,11 +159,8 @@ declare class ApiError extends PafiSDKError {
133
159
  /**
134
160
  * Thrown by `quoteOperatorFee*` when an upstream price source
135
161
  * (Chainlink ETH/USD, PAFI subgraph) is unavailable or stale and the
136
- * caller did not opt in to the hardcoded fallback prices.
137
- *
138
- * v0.7.1 — previously `quoteOperatorFeePt` silently fell back to
139
- * ETH=$3000 / PT=$0.10 with `console.warn`. Now opt-in via
140
- * `allowStaleFallback: true`. See SDK_CORE_TRADING_AUDIT.md C2.
162
+ * caller did not opt in to the hardcoded fallback prices via
163
+ * `allowStaleFallback: true`.
141
164
  *
142
165
  * Extends the unified `PafiSdkError` so issuer's `createSdkErrorMapper`
143
166
  * routes it to 503 instead of leaking as a 500.
@@ -156,14 +179,18 @@ declare class OracleStaleError extends PafiSdkError {
156
179
  *
157
180
  * Uses an instance `details` field so subclasses can override the
158
181
  * declaration; matches the issuer-side shape that pre-existed here.
159
- *
160
- * v0.7.4 — added per SDK_CORE_TRADING_AUDIT.md H2/H13.
161
182
  */
162
183
  declare class ValidationError extends PafiSdkError {
163
184
  readonly httpStatus: "unprocessable";
185
+ readonly type: "validation_error";
164
186
  readonly code: string;
165
187
  readonly details?: Record<string, unknown>;
166
- constructor(code: string, message: string, details?: Record<string, unknown>);
188
+ readonly param?: string;
189
+ readonly metadata?: Record<string, unknown>;
190
+ constructor(code: string, message: string, details?: Record<string, unknown>, options?: {
191
+ param?: string;
192
+ metadata?: Record<string, unknown>;
193
+ });
167
194
  }
168
195
 
169
196
  /**
@@ -1392,10 +1419,6 @@ interface SmartAccountSender {
1392
1419
  *
1393
1420
  * Use this to decide whether retrying without a paymaster makes sense.
1394
1421
  * Contract reverts (AA23, AA24, AA25) and bundler errors are NOT matched.
1395
- *
1396
- * v0.7.1 — replaced naive substring matching that false-positived on
1397
- * arbitrary text containing "503"/"403"/"429" (e.g. address/transit ID).
1398
- * See SDK_CORE_TRADING_AUDIT.md C3.
1399
1422
  */
1400
1423
  declare function isPaymasterError(err: unknown): boolean;
1401
1424
  interface SendWithPaymasterFallbackParams {
@@ -1459,8 +1482,7 @@ declare function sendWithPaymasterFallback(params: SendWithPaymasterFallbackPara
1459
1482
  * perp-deposit — `buildPerpDepositViaRelay` 800k (LayerZero msg)
1460
1483
  * delegate — minimal no-op self-call, 200k margin
1461
1484
  *
1462
- * Pass an explicit `gasUnits` to override. v0.7.4 — added per
1463
- * SDK_CORE_TRADING_AUDIT.md H12.
1485
+ * Pass an explicit `gasUnits` to override.
1464
1486
  */
1465
1487
  type FeeScenario = "mint" | "burn" | "swap" | "perp-deposit" | "delegate";
1466
1488
  interface QuoteOperatorFeePtConfig {
@@ -1497,17 +1519,38 @@ interface QuoteOperatorFeePtConfig {
1497
1519
  * `true` AND configure `fallbackEthPriceUsd` / `fallbackPtPriceUsdt`
1498
1520
  * to absorb oracle outages instead of surfacing them.
1499
1521
  *
1500
- * v0.7.1 previously fallback was always-on with hardcoded
1501
- * defaults (ETH=$3000, PT=$0.10), causing under-priced fees during
1502
- * incidents. See SDK_CORE_TRADING_AUDIT.md C2.
1522
+ * When fallback fires, callers SHOULD observe via `onFallback` so
1523
+ * production can flag the under-priced quote (e.g. show "fee priced
1524
+ * against stale oracle" banner in FE; alert on-call).
1503
1525
  */
1504
1526
  allowStaleFallback?: boolean;
1505
1527
  /** Fallback ETH price (USD) when Chainlink is unreachable. Only used when `allowStaleFallback: true`. Default 3000. */
1506
1528
  fallbackEthPriceUsd?: number;
1507
1529
  /** Fallback PT price (USDT per 1 PT) when subgraph is unreachable. Only used when `allowStaleFallback: true`. Default 0.1. */
1508
1530
  fallbackPtPriceUsdt?: number;
1531
+ /**
1532
+ * Observability hook fired when the quoter falls back to stale
1533
+ * prices. Callers SHOULD wire this to their alert pipeline (Sentry,
1534
+ * Datadog, PagerDuty) so under-priced quotes don't go unnoticed.
1535
+ * When omitted, falls back to `console.warn` (kept for back-compat
1536
+ * but invisible in most prod log shippers).
1537
+ */
1538
+ onFallback?: (info: FallbackInfo) => void;
1509
1539
  fetchImpl?: typeof fetch;
1510
1540
  }
1541
+ /**
1542
+ * Detail surfaced via `onFallback` when the quoter substitutes a
1543
+ * stale-fallback price. Callers can format this into a UI banner or
1544
+ * log line.
1545
+ */
1546
+ interface FallbackInfo {
1547
+ /** Which oracle failed. */
1548
+ source: "chainlink" | "subgraph";
1549
+ /** Underlying reason from the oracle call (e.g. RPC error message). */
1550
+ reason: string;
1551
+ /** The fallback value that was used (in source-native units). */
1552
+ fallbackValue: number;
1553
+ }
1511
1554
  /**
1512
1555
  * Subset of `QuoteOperatorFeePtConfig` that doesn't need the V4 pool
1513
1556
  * step — used by `quoteOperatorFeeUsdt` (FE cashout-preview / `/gas-fee`
@@ -1525,10 +1568,12 @@ interface QuoteOperatorFeeUsdtConfig {
1525
1568
  usdtDecimals?: number;
1526
1569
  /**
1527
1570
  * Opt-in fallback price when Chainlink is unavailable. Default
1528
- * `false` — throw `OracleStaleError`. v0.7.1 — see C2.
1571
+ * `false` — throw `OracleStaleError`.
1529
1572
  */
1530
1573
  allowStaleFallback?: boolean;
1531
1574
  fallbackEthPriceUsd?: number;
1575
+ /** See QuoteOperatorFeePtConfig.onFallback. */
1576
+ onFallback?: (info: FallbackInfo) => void;
1532
1577
  }
1533
1578
  /**
1534
1579
  * Operator fee quoted in USDT raw units (default 6 decimals). Returns
@@ -1634,6 +1679,42 @@ declare const POINT_TOKEN_IMPL_ADDRESSES: Record<number, Address>;
1634
1679
  */
1635
1680
  declare function getContractAddresses(chainId: number): ContractAddresses;
1636
1681
 
1682
+ /**
1683
+ * PAFI HTTP service URLs by chainId. Mirrors the `getContractAddresses`
1684
+ * pattern: SDK ships with the URL for each supported chain so issuers
1685
+ * don't pass URLs as env vars / constructor args.
1686
+ *
1687
+ * When PAFI changes URLs (rebrand, re-host, environment migration),
1688
+ * bump the SDK version and re-publish. Issuers pin a version, get the
1689
+ * URLs that match.
1690
+ *
1691
+ * No env override is provided on purpose — different environments use
1692
+ * different SDK versions (e.g. an `@pafi-dev/issuer-dev` channel for
1693
+ * staging). This keeps issuer integration to chainId + creds only.
1694
+ */
1695
+ interface PafiServiceUrls {
1696
+ /**
1697
+ * sponsor-relayer base URL (paymaster proxy). PafiBackendClient
1698
+ * appends `/paymaster/sponsor`, `/bundler/receipt`, etc.
1699
+ */
1700
+ sponsorRelayer: string;
1701
+ /**
1702
+ * issuer-api base URL. SettlementClient appends
1703
+ * `/issuers/:issuerId/redemption-policy`.
1704
+ */
1705
+ issuerApi: string;
1706
+ }
1707
+ /**
1708
+ * Per-chain URL map. URLs follow the pattern
1709
+ * `https://<host>/api/<service>` so Kong gateway can route by path.
1710
+ *
1711
+ * NOTE: placeholder URLs — Phi will swap in real prod/staging hosts
1712
+ * once the deploy targets are finalized. SDK version bump captures
1713
+ * the change.
1714
+ */
1715
+ declare const PAFI_SERVICE_URLS: Record<number, PafiServiceUrls>;
1716
+ declare function getPafiServiceUrls(chainId: number): PafiServiceUrls;
1717
+
1637
1718
  /**
1638
1719
  * Public contract surface for `@pafi-dev/core/contracts`.
1639
1720
  *
@@ -1971,4 +2052,4 @@ declare class PafiSDK {
1971
2052
  signLoginMessage(message: string): Promise<Hex>;
1972
2053
  }
1973
2054
 
1974
- export { ApiError, BATCH_EXECUTOR_7702_IMPL, BATCH_EXECUTOR_ABI, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, BROKER_HASHES, type BuildDelegationUserOpParams, type BuildPartialUserOpParams, type BuildPerpDepositViaRelayParams, type BuildPerpDepositWithGasDeductionParams, COMMON_POOLS, COMMON_TOKENS, CONTRACT_ADDRESSES, ChainConfig, type CheckEthAndBranchParams, ConfigurationError, type ContractAddresses, DUMMY_SIGNATURE_V07, type DelegateDirectParams, type DelegateDirectResult, type DelegateImpl, EIP712Signature, ENTRY_POINT_V07, ENTRY_POINT_V08, type Eip7702AuthorizationJsonRpc, LoginMessageParams, MintRequest, type ModalOpenOptions, ORDERLY_RELAY_ABI, ORDERLY_VAULT_ABI, ORDERLY_VAULT_ADDRESSES, ORDERLY_VAULT_BASE_MAINNET, type Operation, OracleStaleError, type OrderlyRelayDepositRequest, PAFI_SUBGRAPH_URL, PERMIT2_ADDRESS, POINT_TOKEN_FACTORY_ADDRESSES, POINT_TOKEN_IMPL_ADDRESSES, POINT_TOKEN_POOLS, type PackedUserOperationMessage, type PafiProxyTransportParams, PafiSDK, PafiSDKConfig, PafiSDKError, PafiSdkError, type PafiWebModalAdapter, type PafiWebModalHandle, type PartialUserOperation, type PaymasterConfig, type PaymasterFields, PointTokenDomainConfig, PoolKey, type QuoteOperatorFeePtConfig, type QuoteOperatorFeeUsdtConfig, ReceiverConsent, SIMPLE_7702_IMPL_BASE_MAINNET, SUPPORTED_CHAINS, type SdkErrorHttpStatus, type SendWithPaymasterFallbackParams, type SignAuthorizationFn, type SignatureStruct, SignatureVerification, type SignedAuthorization, SigningError, SimulationError, type SmartAccountSender, type SponsorshipScenario, type SubmissionPath, TOKEN_HASHES, UNIVERSAL_ROUTER_ADDRESSES, type UserOpReceipt, type UserOpTypedData, type UserOperation, V4_QUOTER_ADDRESSES, ValidationError, type VaultDepositFE, ZERO_VALUE, _resetPaymasterConfigForTests, assembleUserOperation, buildDelegationUserOp, buildEip7702Authorization, buildPartialUserOperation, buildPerpDepositViaRelay, buildPerpDepositWithGasDeduction, buildUserOpTypedData, burnRequestTypes, checkDelegation, checkEthAndBranch, computeAccountId, computeAuthorizationHash, computeUserOpHash, createPafiProxyTransport, decodeBatchExecuteCalls, delegateDirect, detectDelegateImpl, encodeBatchExecute, erc20ApproveOp, erc20BurnOp, erc20TransferOp, fetchPafiPools, getAaNonce, getContractAddresses, getDummySignatureFor7702, getPafiWebModalAdapter, getPaymasterConfig, isDelegatedTo, isDelegatedToTarget, isPaymasterConfigured, isPaymasterError, mintRequestTypes, openPafiWebModal, openWebPopup, parseEip7702DelegatedAddress, quoteOperatorFeePt, quoteOperatorFeeUsdt, rawCallOp, receiverConsentTypes, sendWithPaymasterFallback, serializeUserOpToJsonRpc, setPafiWebModalAdapter, setPaymasterConfig, splitAuthorizationSig, webPopupAdapter };
2055
+ export { ApiError, BATCH_EXECUTOR_7702_IMPL, BATCH_EXECUTOR_ABI, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, BROKER_HASHES, type BuildDelegationUserOpParams, type BuildPartialUserOpParams, type BuildPerpDepositViaRelayParams, type BuildPerpDepositWithGasDeductionParams, COMMON_POOLS, COMMON_TOKENS, CONTRACT_ADDRESSES, ChainConfig, type CheckEthAndBranchParams, ConfigurationError, type ContractAddresses, DUMMY_SIGNATURE_V07, type DelegateDirectParams, type DelegateDirectResult, type DelegateImpl, EIP712Signature, ENTRY_POINT_V07, ENTRY_POINT_V08, type Eip7702AuthorizationJsonRpc, LoginMessageParams, MintRequest, type ModalOpenOptions, ORDERLY_RELAY_ABI, ORDERLY_VAULT_ABI, ORDERLY_VAULT_ADDRESSES, ORDERLY_VAULT_BASE_MAINNET, type Operation, OracleStaleError, type OrderlyRelayDepositRequest, PAFI_SERVICE_URLS, PAFI_SUBGRAPH_URL, PERMIT2_ADDRESS, POINT_TOKEN_FACTORY_ADDRESSES, POINT_TOKEN_IMPL_ADDRESSES, POINT_TOKEN_POOLS, type PackedUserOperationMessage, type PafiErrorType, type PafiProxyTransportParams, PafiSDK, PafiSDKConfig, PafiSDKError, PafiSdkError, type PafiServiceUrls, type PafiWebModalAdapter, type PafiWebModalHandle, type PartialUserOperation, type PaymasterConfig, type PaymasterFields, PointTokenDomainConfig, PoolKey, type QuoteOperatorFeePtConfig, type QuoteOperatorFeeUsdtConfig, ReceiverConsent, SDK_ERROR_HTTP_STATUS_CODE, SIMPLE_7702_IMPL_BASE_MAINNET, SUPPORTED_CHAINS, type SdkErrorHttpStatus, type SendWithPaymasterFallbackParams, type SignAuthorizationFn, type SignatureStruct, SignatureVerification, type SignedAuthorization, SigningError, SimulationError, type SmartAccountSender, type SponsorshipScenario, type SubmissionPath, TOKEN_HASHES, UNIVERSAL_ROUTER_ADDRESSES, type UserOpReceipt, type UserOpTypedData, type UserOperation, V4_QUOTER_ADDRESSES, ValidationError, type VaultDepositFE, ZERO_VALUE, _resetPaymasterConfigForTests, assembleUserOperation, buildDelegationUserOp, buildEip7702Authorization, buildPartialUserOperation, buildPerpDepositViaRelay, buildPerpDepositWithGasDeduction, buildUserOpTypedData, burnRequestTypes, checkDelegation, checkEthAndBranch, computeAccountId, computeAuthorizationHash, computeUserOpHash, createPafiProxyTransport, decodeBatchExecuteCalls, defaultErrorTypeForStatus, delegateDirect, detectDelegateImpl, encodeBatchExecute, erc20ApproveOp, erc20BurnOp, erc20TransferOp, fetchPafiPools, getAaNonce, getContractAddresses, getDummySignatureFor7702, getPafiServiceUrls, getPafiWebModalAdapter, getPaymasterConfig, isDelegatedTo, isDelegatedToTarget, isPaymasterConfigured, isPaymasterError, mintRequestTypes, openPafiWebModal, openWebPopup, parseEip7702DelegatedAddress, quoteOperatorFeePt, quoteOperatorFeeUsdt, rawCallOp, receiverConsentTypes, sendWithPaymasterFallback, serializeUserOpToJsonRpc, setPafiWebModalAdapter, setPaymasterConfig, splitAuthorizationSig, webPopupAdapter };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { Address, Hex, TypedDataDomain, PublicClient, WalletClient, TransactionReceipt, HttpTransport } from 'viem';
2
- import { P as PoolKey, C as ChainConfig, a as PafiSDKConfig, b as PointTokenDomainConfig, M as MintRequest, R as ReceiverConsent, E as EIP712Signature, S as SignatureVerification } from './types-BAkmxgVo.js';
3
- export { B as BestQuote, c as BurnRequest, I as Issuer, d as PathKey, Q as QuoteResult } from './types-BAkmxgVo.js';
4
- export { pointTokenAbi as POINT_TOKEN_V2_ABI, erc20Abi, issuerRegistryAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v4QuoterAbi } from './abi/index.js';
5
- export { buildBurnRequestTypedData, buildDomain, buildMintRequestTypedData, buildReceiverConsentTypedData, signBurnRequest, signMintRequest, signReceiverConsent, verifyBurnRequest, verifyMintRequest, verifyReceiverConsent } from './eip712/index.js';
2
+ import { P as PoolKey, C as ChainConfig, a as PafiSDKConfig, b as PointTokenDomainConfig, M as MintRequest, R as ReceiverConsent, E as EIP712Signature, S as SignatureVerification } from './types-BS4kpO4Z.js';
3
+ export { B as BestQuote, c as BlackoutWindow, d as BurnRequest, I as Issuer, e as PathKey, Q as QuoteResult, f as Recipient, g as RedemptionDecision, h as RedemptionDenial, i as RedemptionDenialCode, j as RedemptionPolicy, k as RedemptionPolicySource, l as RedemptionPreview } from './types-BS4kpO4Z.js';
4
+ export { pointTokenAbi as POINT_TOKEN_V2_ABI, erc20Abi, issuerRegistryAbi, mintFeeWrapperAbi, mintingOracleAbi, permit2Abi, pointTokenAbi, pointTokenFactoryAbi, universalRouterAbi, v4QuoterAbi } from './abi/index.js';
5
+ export { Eip712DomainMismatchError, assertDomainMatchesContract, buildBurnRequestTypedData, buildDomain, buildMintRequestTypedData, buildReceiverConsentTypedData, signBurnRequest, signMintRequest, signReceiverConsent, verifyBurnRequest, verifyMintRequest, verifyReceiverConsent } from './eip712/index.js';
6
6
  export { getBurnRequestNonce, getIssuer, getMintRequestNonce, getPointTokenBalance, getPointTokenIssuer, getPointTokenIssuerAddress, getReceiverConsentNonce, getTokenName, isActiveIssuer, isMinter, issuerRegistryGetIssuerFlatAbi, verifyMintCap } from './contract/index.js';
7
7
  import { LoginMessageParams } from './auth/index.js';
8
- export { BuildSponsorAuthParams, BuiltSponsorAuth, SPONSOR_AUTH_DOMAIN_NAME, SPONSOR_AUTH_TYPES, SponsorAuthPayload, SponsorAuthVerifyResult, VerifyLoginResult, buildAndSignSponsorAuth, buildSponsorAuthDomain, buildSponsorAuthTypedData, computeCallDataHash, createLoginMessage, generateSponsorAuthNonce, parseLoginMessage, signSponsorAuth, verifyLoginMessage, verifySponsorAuth } from './auth/index.js';
8
+ export { BuildSponsorAuthParams, BuiltSponsorAuth, SPONSOR_AUTH_DOMAIN_ANCHOR_BASE_MAINNET, SPONSOR_AUTH_DOMAIN_NAME, SPONSOR_AUTH_TYPES, SponsorAuthPayload, SponsorAuthVerifyResult, VerifyLoginResult, buildAndSignSponsorAuth, buildSponsorAuthDomain, buildSponsorAuthTypedData, computeCallDataHash, createLoginMessage, generateSponsorAuthNonce, getSponsorAuthDomainAnchor, parseLoginMessage, signSponsorAuth, verifyLoginMessage, verifySponsorAuth } from './auth/index.js';
9
9
 
10
10
  declare const mintRequestTypes: {
11
11
  readonly MintRequest: readonly [{
@@ -83,17 +83,25 @@ declare const ENTRY_POINT_V08: Address;
83
83
  declare const PERMIT2_ADDRESS: Address;
84
84
 
85
85
  /**
86
- * v0.7.1 — unified error base for the entire SDK (core + issuer +
87
- * trading). Subclasses declare `code` (machine-readable) and
88
- * `httpStatus` (recommended HTTP status for issuer's controller).
86
+ * Unified error base for the entire SDK (core + issuer + trading).
87
+ * Subclasses declare `code` (machine-readable) and `httpStatus`
88
+ * (recommended HTTP status for issuer's controller).
89
89
  *
90
90
  * Issuer's `createSdkErrorMapper` routes any `PafiSdkError` instance
91
91
  * through framework-specific exception factories; non-PafiSdkError
92
92
  * still becomes 500.
93
- *
94
- * See SDK_CORE_TRADING_AUDIT.md H3.
95
93
  */
96
94
  type SdkErrorHttpStatus = "not_found" | "forbidden" | "unprocessable" | "service_unavailable";
95
+ /**
96
+ * Stripe-style error taxonomy. The SDK emits one of these on every
97
+ * error so consumers can branch UI behavior on `type` (toast vs modal
98
+ * vs retry banner) without whitelisting individual `code` values.
99
+ */
100
+ type PafiErrorType = "validation_error" | "authentication_error" | "authorization_error" | "not_found_error" | "business_logic_error" | "rate_limit_error" | "server_error" | "service_unavailable_error";
101
+ /** Numeric HTTP status implied by an `SdkErrorHttpStatus` slot. */
102
+ declare const SDK_ERROR_HTTP_STATUS_CODE: Record<SdkErrorHttpStatus, number>;
103
+ /** Default `type` slot for a numeric HTTP status. */
104
+ declare function defaultErrorTypeForStatus(status: number): PafiErrorType;
97
105
  declare abstract class PafiSdkError extends Error {
98
106
  abstract readonly code: string;
99
107
  /**
@@ -103,14 +111,32 @@ declare abstract class PafiSdkError extends Error {
103
111
  readonly safeToRetry: boolean;
104
112
  readonly details?: unknown;
105
113
  abstract readonly httpStatus: SdkErrorHttpStatus;
114
+ /**
115
+ * Optional Stripe-style taxonomy override. Defaults to the type
116
+ * implied by `httpStatus` (forbidden→authorization_error,
117
+ * unprocessable→business_logic_error, etc).
118
+ */
119
+ readonly type?: PafiErrorType;
120
+ /**
121
+ * Optional name of the request field that triggered the error (e.g.
122
+ * `"amount"`, `"chainId"`). Surfaced on validation failures so the
123
+ * client can highlight the offending field.
124
+ */
125
+ readonly param?: string;
126
+ /**
127
+ * Optional structured context (e.g. `{ available, requested }` for a
128
+ * cap denial). Distinct from `details` — `metadata` is meant for
129
+ * UI consumption; `details` carries raw debug info.
130
+ */
131
+ readonly metadata?: Record<string, unknown>;
106
132
  constructor(message: string);
107
133
  }
108
134
  /**
109
- * @deprecated v0.7.1 — use `PafiSdkError` (capital S, lowercase dk).
135
+ * @deprecated Use `PafiSdkError` (capital S, lowercase dk).
110
136
  * The two classes existed in parallel ("PafiSDKError" in core,
111
137
  * "PafiSdkError" in issuer) due to historical drift; consolidating
112
138
  * here. Kept as alias for back-compat through v0.7.x; will be removed
113
- * in v0.8. See SDK_CORE_TRADING_AUDIT.md H3.
139
+ * in v0.8.
114
140
  */
115
141
  declare class PafiSDKError extends Error {
116
142
  constructor(message: string);
@@ -133,11 +159,8 @@ declare class ApiError extends PafiSDKError {
133
159
  /**
134
160
  * Thrown by `quoteOperatorFee*` when an upstream price source
135
161
  * (Chainlink ETH/USD, PAFI subgraph) is unavailable or stale and the
136
- * caller did not opt in to the hardcoded fallback prices.
137
- *
138
- * v0.7.1 — previously `quoteOperatorFeePt` silently fell back to
139
- * ETH=$3000 / PT=$0.10 with `console.warn`. Now opt-in via
140
- * `allowStaleFallback: true`. See SDK_CORE_TRADING_AUDIT.md C2.
162
+ * caller did not opt in to the hardcoded fallback prices via
163
+ * `allowStaleFallback: true`.
141
164
  *
142
165
  * Extends the unified `PafiSdkError` so issuer's `createSdkErrorMapper`
143
166
  * routes it to 503 instead of leaking as a 500.
@@ -156,14 +179,18 @@ declare class OracleStaleError extends PafiSdkError {
156
179
  *
157
180
  * Uses an instance `details` field so subclasses can override the
158
181
  * declaration; matches the issuer-side shape that pre-existed here.
159
- *
160
- * v0.7.4 — added per SDK_CORE_TRADING_AUDIT.md H2/H13.
161
182
  */
162
183
  declare class ValidationError extends PafiSdkError {
163
184
  readonly httpStatus: "unprocessable";
185
+ readonly type: "validation_error";
164
186
  readonly code: string;
165
187
  readonly details?: Record<string, unknown>;
166
- constructor(code: string, message: string, details?: Record<string, unknown>);
188
+ readonly param?: string;
189
+ readonly metadata?: Record<string, unknown>;
190
+ constructor(code: string, message: string, details?: Record<string, unknown>, options?: {
191
+ param?: string;
192
+ metadata?: Record<string, unknown>;
193
+ });
167
194
  }
168
195
 
169
196
  /**
@@ -1392,10 +1419,6 @@ interface SmartAccountSender {
1392
1419
  *
1393
1420
  * Use this to decide whether retrying without a paymaster makes sense.
1394
1421
  * Contract reverts (AA23, AA24, AA25) and bundler errors are NOT matched.
1395
- *
1396
- * v0.7.1 — replaced naive substring matching that false-positived on
1397
- * arbitrary text containing "503"/"403"/"429" (e.g. address/transit ID).
1398
- * See SDK_CORE_TRADING_AUDIT.md C3.
1399
1422
  */
1400
1423
  declare function isPaymasterError(err: unknown): boolean;
1401
1424
  interface SendWithPaymasterFallbackParams {
@@ -1459,8 +1482,7 @@ declare function sendWithPaymasterFallback(params: SendWithPaymasterFallbackPara
1459
1482
  * perp-deposit — `buildPerpDepositViaRelay` 800k (LayerZero msg)
1460
1483
  * delegate — minimal no-op self-call, 200k margin
1461
1484
  *
1462
- * Pass an explicit `gasUnits` to override. v0.7.4 — added per
1463
- * SDK_CORE_TRADING_AUDIT.md H12.
1485
+ * Pass an explicit `gasUnits` to override.
1464
1486
  */
1465
1487
  type FeeScenario = "mint" | "burn" | "swap" | "perp-deposit" | "delegate";
1466
1488
  interface QuoteOperatorFeePtConfig {
@@ -1497,17 +1519,38 @@ interface QuoteOperatorFeePtConfig {
1497
1519
  * `true` AND configure `fallbackEthPriceUsd` / `fallbackPtPriceUsdt`
1498
1520
  * to absorb oracle outages instead of surfacing them.
1499
1521
  *
1500
- * v0.7.1 previously fallback was always-on with hardcoded
1501
- * defaults (ETH=$3000, PT=$0.10), causing under-priced fees during
1502
- * incidents. See SDK_CORE_TRADING_AUDIT.md C2.
1522
+ * When fallback fires, callers SHOULD observe via `onFallback` so
1523
+ * production can flag the under-priced quote (e.g. show "fee priced
1524
+ * against stale oracle" banner in FE; alert on-call).
1503
1525
  */
1504
1526
  allowStaleFallback?: boolean;
1505
1527
  /** Fallback ETH price (USD) when Chainlink is unreachable. Only used when `allowStaleFallback: true`. Default 3000. */
1506
1528
  fallbackEthPriceUsd?: number;
1507
1529
  /** Fallback PT price (USDT per 1 PT) when subgraph is unreachable. Only used when `allowStaleFallback: true`. Default 0.1. */
1508
1530
  fallbackPtPriceUsdt?: number;
1531
+ /**
1532
+ * Observability hook fired when the quoter falls back to stale
1533
+ * prices. Callers SHOULD wire this to their alert pipeline (Sentry,
1534
+ * Datadog, PagerDuty) so under-priced quotes don't go unnoticed.
1535
+ * When omitted, falls back to `console.warn` (kept for back-compat
1536
+ * but invisible in most prod log shippers).
1537
+ */
1538
+ onFallback?: (info: FallbackInfo) => void;
1509
1539
  fetchImpl?: typeof fetch;
1510
1540
  }
1541
+ /**
1542
+ * Detail surfaced via `onFallback` when the quoter substitutes a
1543
+ * stale-fallback price. Callers can format this into a UI banner or
1544
+ * log line.
1545
+ */
1546
+ interface FallbackInfo {
1547
+ /** Which oracle failed. */
1548
+ source: "chainlink" | "subgraph";
1549
+ /** Underlying reason from the oracle call (e.g. RPC error message). */
1550
+ reason: string;
1551
+ /** The fallback value that was used (in source-native units). */
1552
+ fallbackValue: number;
1553
+ }
1511
1554
  /**
1512
1555
  * Subset of `QuoteOperatorFeePtConfig` that doesn't need the V4 pool
1513
1556
  * step — used by `quoteOperatorFeeUsdt` (FE cashout-preview / `/gas-fee`
@@ -1525,10 +1568,12 @@ interface QuoteOperatorFeeUsdtConfig {
1525
1568
  usdtDecimals?: number;
1526
1569
  /**
1527
1570
  * Opt-in fallback price when Chainlink is unavailable. Default
1528
- * `false` — throw `OracleStaleError`. v0.7.1 — see C2.
1571
+ * `false` — throw `OracleStaleError`.
1529
1572
  */
1530
1573
  allowStaleFallback?: boolean;
1531
1574
  fallbackEthPriceUsd?: number;
1575
+ /** See QuoteOperatorFeePtConfig.onFallback. */
1576
+ onFallback?: (info: FallbackInfo) => void;
1532
1577
  }
1533
1578
  /**
1534
1579
  * Operator fee quoted in USDT raw units (default 6 decimals). Returns
@@ -1634,6 +1679,42 @@ declare const POINT_TOKEN_IMPL_ADDRESSES: Record<number, Address>;
1634
1679
  */
1635
1680
  declare function getContractAddresses(chainId: number): ContractAddresses;
1636
1681
 
1682
+ /**
1683
+ * PAFI HTTP service URLs by chainId. Mirrors the `getContractAddresses`
1684
+ * pattern: SDK ships with the URL for each supported chain so issuers
1685
+ * don't pass URLs as env vars / constructor args.
1686
+ *
1687
+ * When PAFI changes URLs (rebrand, re-host, environment migration),
1688
+ * bump the SDK version and re-publish. Issuers pin a version, get the
1689
+ * URLs that match.
1690
+ *
1691
+ * No env override is provided on purpose — different environments use
1692
+ * different SDK versions (e.g. an `@pafi-dev/issuer-dev` channel for
1693
+ * staging). This keeps issuer integration to chainId + creds only.
1694
+ */
1695
+ interface PafiServiceUrls {
1696
+ /**
1697
+ * sponsor-relayer base URL (paymaster proxy). PafiBackendClient
1698
+ * appends `/paymaster/sponsor`, `/bundler/receipt`, etc.
1699
+ */
1700
+ sponsorRelayer: string;
1701
+ /**
1702
+ * issuer-api base URL. SettlementClient appends
1703
+ * `/issuers/:issuerId/redemption-policy`.
1704
+ */
1705
+ issuerApi: string;
1706
+ }
1707
+ /**
1708
+ * Per-chain URL map. URLs follow the pattern
1709
+ * `https://<host>/api/<service>` so Kong gateway can route by path.
1710
+ *
1711
+ * NOTE: placeholder URLs — Phi will swap in real prod/staging hosts
1712
+ * once the deploy targets are finalized. SDK version bump captures
1713
+ * the change.
1714
+ */
1715
+ declare const PAFI_SERVICE_URLS: Record<number, PafiServiceUrls>;
1716
+ declare function getPafiServiceUrls(chainId: number): PafiServiceUrls;
1717
+
1637
1718
  /**
1638
1719
  * Public contract surface for `@pafi-dev/core/contracts`.
1639
1720
  *
@@ -1971,4 +2052,4 @@ declare class PafiSDK {
1971
2052
  signLoginMessage(message: string): Promise<Hex>;
1972
2053
  }
1973
2054
 
1974
- export { ApiError, BATCH_EXECUTOR_7702_IMPL, BATCH_EXECUTOR_ABI, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, BROKER_HASHES, type BuildDelegationUserOpParams, type BuildPartialUserOpParams, type BuildPerpDepositViaRelayParams, type BuildPerpDepositWithGasDeductionParams, COMMON_POOLS, COMMON_TOKENS, CONTRACT_ADDRESSES, ChainConfig, type CheckEthAndBranchParams, ConfigurationError, type ContractAddresses, DUMMY_SIGNATURE_V07, type DelegateDirectParams, type DelegateDirectResult, type DelegateImpl, EIP712Signature, ENTRY_POINT_V07, ENTRY_POINT_V08, type Eip7702AuthorizationJsonRpc, LoginMessageParams, MintRequest, type ModalOpenOptions, ORDERLY_RELAY_ABI, ORDERLY_VAULT_ABI, ORDERLY_VAULT_ADDRESSES, ORDERLY_VAULT_BASE_MAINNET, type Operation, OracleStaleError, type OrderlyRelayDepositRequest, PAFI_SUBGRAPH_URL, PERMIT2_ADDRESS, POINT_TOKEN_FACTORY_ADDRESSES, POINT_TOKEN_IMPL_ADDRESSES, POINT_TOKEN_POOLS, type PackedUserOperationMessage, type PafiProxyTransportParams, PafiSDK, PafiSDKConfig, PafiSDKError, PafiSdkError, type PafiWebModalAdapter, type PafiWebModalHandle, type PartialUserOperation, type PaymasterConfig, type PaymasterFields, PointTokenDomainConfig, PoolKey, type QuoteOperatorFeePtConfig, type QuoteOperatorFeeUsdtConfig, ReceiverConsent, SIMPLE_7702_IMPL_BASE_MAINNET, SUPPORTED_CHAINS, type SdkErrorHttpStatus, type SendWithPaymasterFallbackParams, type SignAuthorizationFn, type SignatureStruct, SignatureVerification, type SignedAuthorization, SigningError, SimulationError, type SmartAccountSender, type SponsorshipScenario, type SubmissionPath, TOKEN_HASHES, UNIVERSAL_ROUTER_ADDRESSES, type UserOpReceipt, type UserOpTypedData, type UserOperation, V4_QUOTER_ADDRESSES, ValidationError, type VaultDepositFE, ZERO_VALUE, _resetPaymasterConfigForTests, assembleUserOperation, buildDelegationUserOp, buildEip7702Authorization, buildPartialUserOperation, buildPerpDepositViaRelay, buildPerpDepositWithGasDeduction, buildUserOpTypedData, burnRequestTypes, checkDelegation, checkEthAndBranch, computeAccountId, computeAuthorizationHash, computeUserOpHash, createPafiProxyTransport, decodeBatchExecuteCalls, delegateDirect, detectDelegateImpl, encodeBatchExecute, erc20ApproveOp, erc20BurnOp, erc20TransferOp, fetchPafiPools, getAaNonce, getContractAddresses, getDummySignatureFor7702, getPafiWebModalAdapter, getPaymasterConfig, isDelegatedTo, isDelegatedToTarget, isPaymasterConfigured, isPaymasterError, mintRequestTypes, openPafiWebModal, openWebPopup, parseEip7702DelegatedAddress, quoteOperatorFeePt, quoteOperatorFeeUsdt, rawCallOp, receiverConsentTypes, sendWithPaymasterFallback, serializeUserOpToJsonRpc, setPafiWebModalAdapter, setPaymasterConfig, splitAuthorizationSig, webPopupAdapter };
2055
+ export { ApiError, BATCH_EXECUTOR_7702_IMPL, BATCH_EXECUTOR_ABI, BATCH_EXECUTOR_ADDRESS_BASE_MAINNET, BATCH_EXECUTOR_ADDRESS_BASE_SEPOLIA, BROKER_HASHES, type BuildDelegationUserOpParams, type BuildPartialUserOpParams, type BuildPerpDepositViaRelayParams, type BuildPerpDepositWithGasDeductionParams, COMMON_POOLS, COMMON_TOKENS, CONTRACT_ADDRESSES, ChainConfig, type CheckEthAndBranchParams, ConfigurationError, type ContractAddresses, DUMMY_SIGNATURE_V07, type DelegateDirectParams, type DelegateDirectResult, type DelegateImpl, EIP712Signature, ENTRY_POINT_V07, ENTRY_POINT_V08, type Eip7702AuthorizationJsonRpc, LoginMessageParams, MintRequest, type ModalOpenOptions, ORDERLY_RELAY_ABI, ORDERLY_VAULT_ABI, ORDERLY_VAULT_ADDRESSES, ORDERLY_VAULT_BASE_MAINNET, type Operation, OracleStaleError, type OrderlyRelayDepositRequest, PAFI_SERVICE_URLS, PAFI_SUBGRAPH_URL, PERMIT2_ADDRESS, POINT_TOKEN_FACTORY_ADDRESSES, POINT_TOKEN_IMPL_ADDRESSES, POINT_TOKEN_POOLS, type PackedUserOperationMessage, type PafiErrorType, type PafiProxyTransportParams, PafiSDK, PafiSDKConfig, PafiSDKError, PafiSdkError, type PafiServiceUrls, type PafiWebModalAdapter, type PafiWebModalHandle, type PartialUserOperation, type PaymasterConfig, type PaymasterFields, PointTokenDomainConfig, PoolKey, type QuoteOperatorFeePtConfig, type QuoteOperatorFeeUsdtConfig, ReceiverConsent, SDK_ERROR_HTTP_STATUS_CODE, SIMPLE_7702_IMPL_BASE_MAINNET, SUPPORTED_CHAINS, type SdkErrorHttpStatus, type SendWithPaymasterFallbackParams, type SignAuthorizationFn, type SignatureStruct, SignatureVerification, type SignedAuthorization, SigningError, SimulationError, type SmartAccountSender, type SponsorshipScenario, type SubmissionPath, TOKEN_HASHES, UNIVERSAL_ROUTER_ADDRESSES, type UserOpReceipt, type UserOpTypedData, type UserOperation, V4_QUOTER_ADDRESSES, ValidationError, type VaultDepositFE, ZERO_VALUE, _resetPaymasterConfigForTests, assembleUserOperation, buildDelegationUserOp, buildEip7702Authorization, buildPartialUserOperation, buildPerpDepositViaRelay, buildPerpDepositWithGasDeduction, buildUserOpTypedData, burnRequestTypes, checkDelegation, checkEthAndBranch, computeAccountId, computeAuthorizationHash, computeUserOpHash, createPafiProxyTransport, decodeBatchExecuteCalls, defaultErrorTypeForStatus, delegateDirect, detectDelegateImpl, encodeBatchExecute, erc20ApproveOp, erc20BurnOp, erc20TransferOp, fetchPafiPools, getAaNonce, getContractAddresses, getDummySignatureFor7702, getPafiServiceUrls, getPafiWebModalAdapter, getPaymasterConfig, isDelegatedTo, isDelegatedToTarget, isPaymasterConfigured, isPaymasterError, mintRequestTypes, openPafiWebModal, openWebPopup, parseEip7702DelegatedAddress, quoteOperatorFeePt, quoteOperatorFeeUsdt, rawCallOp, receiverConsentTypes, sendWithPaymasterFallback, serializeUserOpToJsonRpc, setPafiWebModalAdapter, setPaymasterConfig, splitAuthorizationSig, webPopupAdapter };