@pepu-chain/sdk 0.0.0-stage → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +590 -2
  3. package/dist/aa/kernel.cjs +41 -0
  4. package/dist/aa/kernel.cjs.map +1 -0
  5. package/dist/aa/kernel.d.cts +88 -0
  6. package/dist/aa/kernel.d.ts +88 -0
  7. package/dist/aa/kernel.guard.js +15 -0
  8. package/dist/aa/kernel.js +11 -0
  9. package/dist/aa/kernel.js.map +1 -0
  10. package/dist/aa/react-direct.cjs +111 -0
  11. package/dist/aa/react-direct.cjs.map +1 -0
  12. package/dist/aa/react-direct.d.cts +42 -0
  13. package/dist/aa/react-direct.d.ts +42 -0
  14. package/dist/aa/react-direct.guard.js +15 -0
  15. package/dist/aa/react-direct.js +107 -0
  16. package/dist/aa/react-direct.js.map +1 -0
  17. package/dist/aa/react.cjs +152 -0
  18. package/dist/aa/react.cjs.map +1 -0
  19. package/dist/aa/react.d.cts +62 -0
  20. package/dist/aa/react.d.ts +62 -0
  21. package/dist/aa/react.guard.js +15 -0
  22. package/dist/aa/react.js +147 -0
  23. package/dist/aa/react.js.map +1 -0
  24. package/dist/aa.cjs +84 -0
  25. package/dist/aa.cjs.map +1 -0
  26. package/dist/aa.d.cts +85 -0
  27. package/dist/aa.d.ts +85 -0
  28. package/dist/aa.js +11 -0
  29. package/dist/aa.js.map +1 -0
  30. package/dist/api-Dz4sCHH_.d.cts +654 -0
  31. package/dist/api-Dz4sCHH_.d.ts +654 -0
  32. package/dist/calls-BRPjKgjl.d.cts +70 -0
  33. package/dist/calls-z_EQOtFb.d.ts +70 -0
  34. package/dist/chains-DK13zGIp.d.cts +235 -0
  35. package/dist/chains-DK13zGIp.d.ts +235 -0
  36. package/dist/chunk-3XUGQODR.js +194 -0
  37. package/dist/chunk-3XUGQODR.js.map +1 -0
  38. package/dist/chunk-45KSZH26.cjs +145 -0
  39. package/dist/chunk-45KSZH26.cjs.map +1 -0
  40. package/dist/chunk-4GINFJO6.cjs +44 -0
  41. package/dist/chunk-4GINFJO6.cjs.map +1 -0
  42. package/dist/chunk-62M2LKQW.js +136 -0
  43. package/dist/chunk-62M2LKQW.js.map +1 -0
  44. package/dist/chunk-6DSZ4Z2N.js +498 -0
  45. package/dist/chunk-6DSZ4Z2N.js.map +1 -0
  46. package/dist/chunk-7MNJF2OB.cjs +72 -0
  47. package/dist/chunk-7MNJF2OB.cjs.map +1 -0
  48. package/dist/chunk-7PVR7QSE.js +45 -0
  49. package/dist/chunk-7PVR7QSE.js.map +1 -0
  50. package/dist/chunk-A5LP2UCS.cjs +2729 -0
  51. package/dist/chunk-A5LP2UCS.cjs.map +1 -0
  52. package/dist/chunk-AJS4UFQX.cjs +121 -0
  53. package/dist/chunk-AJS4UFQX.cjs.map +1 -0
  54. package/dist/chunk-BGALSKAF.cjs +315 -0
  55. package/dist/chunk-BGALSKAF.cjs.map +1 -0
  56. package/dist/chunk-C2XW44FI.cjs +200 -0
  57. package/dist/chunk-C2XW44FI.cjs.map +1 -0
  58. package/dist/chunk-C7IC36XS.cjs +13 -0
  59. package/dist/chunk-C7IC36XS.cjs.map +1 -0
  60. package/dist/chunk-D52PADVY.js +84 -0
  61. package/dist/chunk-D52PADVY.js.map +1 -0
  62. package/dist/chunk-DH6BFNVJ.cjs +272 -0
  63. package/dist/chunk-DH6BFNVJ.cjs.map +1 -0
  64. package/dist/chunk-DPCZJLB3.cjs +87 -0
  65. package/dist/chunk-DPCZJLB3.cjs.map +1 -0
  66. package/dist/chunk-EHBPIYY4.js +262 -0
  67. package/dist/chunk-EHBPIYY4.js.map +1 -0
  68. package/dist/chunk-ESMNAXUI.js +86 -0
  69. package/dist/chunk-ESMNAXUI.js.map +1 -0
  70. package/dist/chunk-F2R473FR.js +304 -0
  71. package/dist/chunk-F2R473FR.js.map +1 -0
  72. package/dist/chunk-IB2FSPMJ.js +66 -0
  73. package/dist/chunk-IB2FSPMJ.js.map +1 -0
  74. package/dist/chunk-IG7RSL2Y.cjs +178 -0
  75. package/dist/chunk-IG7RSL2Y.cjs.map +1 -0
  76. package/dist/chunk-IY3ALPUJ.js +2716 -0
  77. package/dist/chunk-IY3ALPUJ.js.map +1 -0
  78. package/dist/chunk-J3O2ZGG3.cjs +93 -0
  79. package/dist/chunk-J3O2ZGG3.cjs.map +1 -0
  80. package/dist/chunk-J6UXXHBE.js +37 -0
  81. package/dist/chunk-J6UXXHBE.js.map +1 -0
  82. package/dist/chunk-JLZ4LZ4Z.js +22 -0
  83. package/dist/chunk-JLZ4LZ4Z.js.map +1 -0
  84. package/dist/chunk-K7JSQPZO.cjs +231 -0
  85. package/dist/chunk-K7JSQPZO.cjs.map +1 -0
  86. package/dist/chunk-KJYNF5KH.js +224 -0
  87. package/dist/chunk-KJYNF5KH.js.map +1 -0
  88. package/dist/chunk-KVG3AYYR.js +99 -0
  89. package/dist/chunk-KVG3AYYR.js.map +1 -0
  90. package/dist/chunk-NE3QKDOB.cjs +24 -0
  91. package/dist/chunk-NE3QKDOB.cjs.map +1 -0
  92. package/dist/chunk-NVOPDXTA.cjs +95 -0
  93. package/dist/chunk-NVOPDXTA.cjs.map +1 -0
  94. package/dist/chunk-OH3QMAIB.js +11 -0
  95. package/dist/chunk-OH3QMAIB.js.map +1 -0
  96. package/dist/chunk-PHM3ZORG.cjs +110 -0
  97. package/dist/chunk-PHM3ZORG.cjs.map +1 -0
  98. package/dist/chunk-R5PXQNO3.cjs +209 -0
  99. package/dist/chunk-R5PXQNO3.cjs.map +1 -0
  100. package/dist/chunk-RCMKPJZO.cjs +49 -0
  101. package/dist/chunk-RCMKPJZO.cjs.map +1 -0
  102. package/dist/chunk-SVWRRALU.cjs +17 -0
  103. package/dist/chunk-SVWRRALU.cjs.map +1 -0
  104. package/dist/chunk-T43PQXJD.js +202 -0
  105. package/dist/chunk-T43PQXJD.js.map +1 -0
  106. package/dist/chunk-VBH3JLQ5.js +116 -0
  107. package/dist/chunk-VBH3JLQ5.js.map +1 -0
  108. package/dist/chunk-VF3D6KLQ.cjs +94 -0
  109. package/dist/chunk-VF3D6KLQ.cjs.map +1 -0
  110. package/dist/chunk-VTQIHMF3.js +82 -0
  111. package/dist/chunk-VTQIHMF3.js.map +1 -0
  112. package/dist/chunk-W3JN3YIW.js +15 -0
  113. package/dist/chunk-W3JN3YIW.js.map +1 -0
  114. package/dist/chunk-WANILJZQ.cjs +87 -0
  115. package/dist/chunk-WANILJZQ.cjs.map +1 -0
  116. package/dist/chunk-XC4IBCI2.js +86 -0
  117. package/dist/chunk-XC4IBCI2.js.map +1 -0
  118. package/dist/chunk-YKEWWQEJ.js +165 -0
  119. package/dist/chunk-YKEWWQEJ.js.map +1 -0
  120. package/dist/chunk-YQL7NISX.cjs +515 -0
  121. package/dist/chunk-YQL7NISX.cjs.map +1 -0
  122. package/dist/chunk-ZB6SVBK4.js +89 -0
  123. package/dist/chunk-ZB6SVBK4.js.map +1 -0
  124. package/dist/combo/react.cjs +236 -0
  125. package/dist/combo/react.cjs.map +1 -0
  126. package/dist/combo/react.d.cts +148 -0
  127. package/dist/combo/react.d.ts +148 -0
  128. package/dist/combo/react.guard.js +15 -0
  129. package/dist/combo/react.js +230 -0
  130. package/dist/combo/react.js.map +1 -0
  131. package/dist/combo.cjs +263 -0
  132. package/dist/combo.cjs.map +1 -0
  133. package/dist/combo.d.cts +139 -0
  134. package/dist/combo.d.ts +139 -0
  135. package/dist/combo.guard.js +15 -0
  136. package/dist/combo.js +249 -0
  137. package/dist/combo.js.map +1 -0
  138. package/dist/config-CHjz7ZjZ.d.cts +57 -0
  139. package/dist/config-COjhIZTh.d.ts +57 -0
  140. package/dist/doctor.cjs +354 -0
  141. package/dist/doctor.cjs.map +1 -0
  142. package/dist/doctor.d.cts +177 -0
  143. package/dist/doctor.d.ts +177 -0
  144. package/dist/doctor.js +345 -0
  145. package/dist/doctor.js.map +1 -0
  146. package/dist/erc7677-DOW58QBE.d.cts +111 -0
  147. package/dist/erc7677-DOW58QBE.d.ts +111 -0
  148. package/dist/errors-CgX1vNj7.d.cts +100 -0
  149. package/dist/errors-CgX1vNj7.d.ts +100 -0
  150. package/dist/index.cjs +806 -0
  151. package/dist/index.cjs.map +1 -0
  152. package/dist/index.d.cts +2398 -0
  153. package/dist/index.d.ts +2398 -0
  154. package/dist/index.js +559 -0
  155. package/dist/index.js.map +1 -0
  156. package/dist/paymaster/server.cjs +38 -0
  157. package/dist/paymaster/server.cjs.map +1 -0
  158. package/dist/paymaster/server.d.cts +57 -0
  159. package/dist/paymaster/server.d.ts +57 -0
  160. package/dist/paymaster/server.js +36 -0
  161. package/dist/paymaster/server.js.map +1 -0
  162. package/dist/paymaster.cjs +356 -0
  163. package/dist/paymaster.cjs.map +1 -0
  164. package/dist/paymaster.d.cts +1851 -0
  165. package/dist/paymaster.d.ts +1851 -0
  166. package/dist/paymaster.js +289 -0
  167. package/dist/paymaster.js.map +1 -0
  168. package/dist/privy/react.cjs +49 -0
  169. package/dist/privy/react.cjs.map +1 -0
  170. package/dist/privy/react.d.cts +194 -0
  171. package/dist/privy/react.d.ts +194 -0
  172. package/dist/privy/react.guard.js +15 -0
  173. package/dist/privy/react.js +7 -0
  174. package/dist/privy/react.js.map +1 -0
  175. package/dist/privy/server.cjs +44 -0
  176. package/dist/privy/server.cjs.map +1 -0
  177. package/dist/privy/server.d.cts +192 -0
  178. package/dist/privy/server.d.ts +192 -0
  179. package/dist/privy/server.guard.js +15 -0
  180. package/dist/privy/server.js +6 -0
  181. package/dist/privy/server.js.map +1 -0
  182. package/dist/privy/wagmi.d.ts +90 -0
  183. package/dist/privy/wagmi.guard.js +15 -0
  184. package/dist/privy/wagmi.js +55 -0
  185. package/dist/privy/wagmi.js.map +1 -0
  186. package/dist/privy.cjs +34 -0
  187. package/dist/privy.cjs.map +1 -0
  188. package/dist/privy.d.cts +4 -0
  189. package/dist/privy.d.ts +4 -0
  190. package/dist/privy.js +5 -0
  191. package/dist/privy.js.map +1 -0
  192. package/dist/react.cjs +73 -0
  193. package/dist/react.cjs.map +1 -0
  194. package/dist/react.d.cts +66 -0
  195. package/dist/react.d.ts +66 -0
  196. package/dist/react.guard.js +15 -0
  197. package/dist/react.js +68 -0
  198. package/dist/react.js.map +1 -0
  199. package/dist/requirements-C-QiJkL9.d.cts +134 -0
  200. package/dist/requirements-C-QiJkL9.d.ts +134 -0
  201. package/dist/scope-DBRkN7bR.d.cts +94 -0
  202. package/dist/scope-DBRkN7bR.d.ts +94 -0
  203. package/dist/server.cjs +59 -0
  204. package/dist/server.cjs.map +1 -0
  205. package/dist/server.d.cts +208 -0
  206. package/dist/server.d.ts +208 -0
  207. package/dist/server.js +8 -0
  208. package/dist/server.js.map +1 -0
  209. package/dist/session/kernel.cjs +83 -0
  210. package/dist/session/kernel.cjs.map +1 -0
  211. package/dist/session/kernel.d.cts +131 -0
  212. package/dist/session/kernel.d.ts +131 -0
  213. package/dist/session/kernel.guard.js +15 -0
  214. package/dist/session/kernel.js +13 -0
  215. package/dist/session/kernel.js.map +1 -0
  216. package/dist/session/react.cjs +38 -0
  217. package/dist/session/react.cjs.map +1 -0
  218. package/dist/session/react.d.cts +119 -0
  219. package/dist/session/react.d.ts +119 -0
  220. package/dist/session/react.guard.js +15 -0
  221. package/dist/session/react.js +8 -0
  222. package/dist/session/react.js.map +1 -0
  223. package/dist/session/server.cjs +268 -0
  224. package/dist/session/server.cjs.map +1 -0
  225. package/dist/session/server.d.cts +151 -0
  226. package/dist/session/server.d.ts +151 -0
  227. package/dist/session/server.guard.js +15 -0
  228. package/dist/session/server.js +252 -0
  229. package/dist/session/server.js.map +1 -0
  230. package/dist/session.cjs +74 -0
  231. package/dist/session.cjs.map +1 -0
  232. package/dist/session.d.cts +3 -0
  233. package/dist/session.d.ts +3 -0
  234. package/dist/session.js +5 -0
  235. package/dist/session.js.map +1 -0
  236. package/dist/status-Dx9zAFo9.d.ts +327 -0
  237. package/dist/status-wgTM26V7.d.cts +327 -0
  238. package/dist/store-CjmLgp9g.d.cts +64 -0
  239. package/dist/store-CjmLgp9g.d.ts +64 -0
  240. package/dist/types-BEEM7WdG.d.cts +25 -0
  241. package/dist/types-BEEM7WdG.d.ts +25 -0
  242. package/dist/types-BilBTDqK.d.cts +27 -0
  243. package/dist/types-BilBTDqK.d.ts +27 -0
  244. package/package.json +245 -3
@@ -0,0 +1,327 @@
1
+ import { Address, PublicClient, Transport, Hex } from 'viem';
2
+ import { P as PepuChain } from './chains-DK13zGIp.js';
3
+ import { a as PepuBundlerError } from './errors-CgX1vNj7.js';
4
+
5
+ /** Minimal fetch signature, so tests and non-browser hosts can inject one. */
6
+ type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
7
+ interface ProbeOptions {
8
+ fetch?: FetchLike;
9
+ /** Per-request timeout. Default 8000. */
10
+ timeoutMs?: number;
11
+ }
12
+ interface BundlerProbeResult {
13
+ ok: boolean;
14
+ chainId?: number;
15
+ entryPoints?: Address[];
16
+ /**
17
+ * `true` when the method exists. Each method is called with deliberately empty
18
+ * (invalid) params, so nothing is ever sent on-chain: an "invalid params" or
19
+ * validation answer means the method exists, a "method not found" answer
20
+ * (including Alto's "Invalid discriminator value") means it does not.
21
+ */
22
+ supportedMethods?: Record<string, boolean>;
23
+ /** Required methods (see `REQUIRED_BUNDLER_METHODS`) the bundler lacks. Empty when all are present. */
24
+ missingRequiredMethods?: string[];
25
+ latencyMs: number;
26
+ error?: PepuBundlerError;
27
+ }
28
+ interface PaymasterProbeResult {
29
+ ok: boolean;
30
+ /** `GET <origin>/health` answered `{ status: "ok" }`. */
31
+ health?: boolean;
32
+ /** Body of `GET <origin>/v2/free-tier` when the service exposes it. */
33
+ freeTier?: unknown;
34
+ /**
35
+ * `true` when the URL answered `pm_getPaymasterStubData` with a stub result,
36
+ * `false` when it did not answer JSON-RPC at all. A JSON-RPC denial (no
37
+ * credential, unknown sender) leaves it `undefined`: the endpoint speaks
38
+ * ERC-7677 but the probe has no credential, so a stub cannot be judged. Read
39
+ * `erc7677` for the three-way answer.
40
+ */
41
+ erc7677StubOk?: boolean;
42
+ /**
43
+ * `"stub-ok"`: a stub came back. `"needs-credential"`: the endpoint speaks ERC-7677
44
+ * JSON-RPC and answered with an error (no credential, unknown sender), so the stub
45
+ * check is not applicable without a client token. `"not-responding"`: no JSON-RPC answer.
46
+ */
47
+ erc7677?: "stub-ok" | "needs-credential" | "not-responding";
48
+ latencyMs: number;
49
+ error?: PepuBundlerError;
50
+ }
51
+ /**
52
+ * Probe a bundler URL: `eth_chainId`, `eth_supportedEntryPoints` and a
53
+ * capability check of the methods PEPU apps use (a method answered with
54
+ * anything but "method not found" counts as supported; nothing is sent
55
+ * on-chain). Never throws for network trouble; returns `ok: false` with a
56
+ * `BUNDLER_UNREACHABLE` error. Throws `CONFIG_BAD_URL` for a malformed URL.
57
+ *
58
+ * @example
59
+ * const r = await probeBundler("https://bundler.example.com");
60
+ * if (!r.ok) console.log(r.error?.hint);
61
+ */
62
+ declare function probeBundler(url: string, o?: ProbeOptions): Promise<BundlerProbeResult>;
63
+ /**
64
+ * Probe a paymaster URL: the service base (`https://paymaster.pepeunchained.com`) or the ERC-7677 endpoint
65
+ * (`https://host/v2/paymaster/<token>`).
66
+ * Checks `GET <origin>/health`, `GET <origin>/v2/free-tier`, and whether the URL
67
+ * answers JSON-RPC `pm_getPaymasterStubData` (`erc7677`: without a client token a
68
+ * JSON-RPC denial is reported as `"needs-credential"`, not as a failure). `ok` means
69
+ * every capability that could be checked is fine: `/health` did not fail and the URL
70
+ * spoke ERC-7677 JSON-RPC. The URL (which can embed a
71
+ * token) never appears in the returned error.
72
+ *
73
+ * @example
74
+ * const r = await probePaymaster(process.env.PEPU_PAYMASTER_URL!);
75
+ * console.log(r.ok, r.freeTier);
76
+ */
77
+ declare function probePaymaster(url: string, o?: ProbeOptions): Promise<PaymasterProbeResult>;
78
+ /**
79
+ * The paymaster's EntryPoint v0.7 deposit in wei. A drop across a UserOperation
80
+ * is the proof that it was sponsored. Defaults to PEPU's deployed paymaster.
81
+ *
82
+ * @example
83
+ * const before = await getPaymasterDeposit(publicClient);
84
+ */
85
+ declare function getPaymasterDeposit(client: PublicClient, paymaster?: Address): Promise<bigint>;
86
+
87
+ /**
88
+ * Canonical keys for contracts tracked by this registry. Adding a new key
89
+ * here (and a corresponding entry per chain below) is not a breaking
90
+ * change for consumers that read the registry through {@link getContract}
91
+ * or {@link listContracts}.
92
+ */
93
+ type PepuContractName = "create2Factory" | "multicall3" | "permit2" | "entryPoint06" | "entryPoint07" | "kernelFactory" | "kernelMetaFactory" | "ecdsaValidator" | "paymaster" | "kernelImplementation" | "kernelEcdsaSignerModule" | "kernelCallPolicyV004" | "kernelTimestampPolicy" | "tapScore" | "paymasterV1" | "paymasterV2";
94
+ /** A contract that is confirmed live on-chain at `address`. */
95
+ interface DeployedContract {
96
+ readonly status: "deployed";
97
+ /** Human-readable name, for logging/UI. */
98
+ readonly name: string;
99
+ /** Verified contract address. */
100
+ readonly address: Address;
101
+ /** Optional short note, e.g. how the address was verified. */
102
+ readonly notes?: string;
103
+ /**
104
+ * ISO date (YYYY-MM-DD) on which the address was last confirmed to have
105
+ * bytecode via `eth_getCode` against the PEPU mainnet RPC. Re-run
106
+ * `node packages/sdk/scripts/live-check.mjs` to refresh.
107
+ */
108
+ readonly verifiedAt?: string;
109
+ /**
110
+ * True when the contract still has bytecode but must not be used (for example
111
+ * the v1 paymaster, whose EntryPoint deposit was withdrawn). Never route new
112
+ * work to a retired contract.
113
+ */
114
+ readonly retired?: true;
115
+ }
116
+ /**
117
+ * A contract that is not yet deployed on this chain. Deliberately has no
118
+ * `address` field — callers must not be able to accidentally read a
119
+ * placeholder value and treat it as real. Use {@link getContract} /
120
+ * {@link isDeployed} to narrow before reading an address.
121
+ */
122
+ interface PendingContract {
123
+ readonly status: "pending";
124
+ /** Human-readable name, for logging/UI. */
125
+ readonly name: string;
126
+ /** Why this contract has no verified address yet. */
127
+ readonly reason: string;
128
+ }
129
+ type ContractEntry = DeployedContract | PendingContract;
130
+ /** Per-chain contract catalog, keyed by {@link PepuContractName}. */
131
+ type PepuContractRegistry = Readonly<Record<PepuContractName, ContractEntry>>;
132
+ /**
133
+ * Contract registry, keyed by chain id. Tracked as independent per-chain
134
+ * entries because deployments happen per-chain and have already diverged:
135
+ * mainnet has the CREATE2 deployer, a PEPU-specific Multicall3, the
136
+ * canonical Permit2, the full ZeroDev Kernel v3 AA stack (EntryPoint
137
+ * v0.6/v0.7, Kernel factory/meta-factory, ECDSA validator), and a
138
+ * project-deployed, funded verifying paymaster. Testnet has only the
139
+ * CREATE2 deployer — everything else is `status: "pending"` because
140
+ * testnet is out of scope for this package (no faucet exists to fund
141
+ * verification there).
142
+ *
143
+ * Note on the paymaster specifically: `status: "deployed"` here means the
144
+ * contract has live bytecode and a real EntryPoint deposit — it does NOT
145
+ * mean gas sponsorship is usable by an application. See
146
+ * `getSponsorshipStatus` in `./aa/status.js`, which is the single source of
147
+ * truth for that separate question.
148
+ */
149
+ declare const pepuContracts: Readonly<Record<number, PepuContractRegistry>>;
150
+ /** Look up one contract entry for a chain id. Returns `undefined` if the chain isn't in the registry. */
151
+ declare function getContract(chainId: number, name: PepuContractName): ContractEntry | undefined;
152
+ /** List all tracked contract entries for a chain id, in registry order. */
153
+ declare function listContracts(chainId: number): readonly ContractEntry[];
154
+ /** Narrow a {@link ContractEntry} to {@link DeployedContract}. */
155
+ declare function isDeployed(entry: ContractEntry | undefined): entry is DeployedContract;
156
+ /** One row of the address table returned by {@link getPepuAddresses}. */
157
+ interface PepuAddressRow {
158
+ readonly key: PepuContractName;
159
+ readonly name: string;
160
+ readonly status: "deployed" | "pending";
161
+ /** Present only when `status` is `"deployed"`. */
162
+ readonly address?: Address;
163
+ /** ISO date of the last `eth_getCode` check, when known. */
164
+ readonly verifiedAt?: string;
165
+ /** True for a deployed contract that is retired and must not be used (the v1 paymaster). */
166
+ readonly retired?: true;
167
+ /** Notes (deployed) or reason (pending). */
168
+ readonly note: string;
169
+ }
170
+ /**
171
+ * The full supporting-contract table for a chain, flattened for docs and
172
+ * MCP rendering. **Returns an ARRAY of rows** (one {@link PepuAddressRow} per
173
+ * contract, each carrying its own `key`), not an object keyed by contract name:
174
+ * `getPepuAddresses().paymaster` is `undefined`. To look one contract up by name use
175
+ * {@link getContract}, or {@link getPepuAddressMap} for the same rows keyed by name.
176
+ * Pending entries carry no `address`.
177
+ *
178
+ * @example
179
+ * ```ts
180
+ * const rows = getPepuAddresses(); // PepuAddressRow[], mainnet by default
181
+ * const live = rows.filter((r) => r.status === "deployed");
182
+ * const paymaster = rows.find((r) => r.key === "paymaster");
183
+ * ```
184
+ */
185
+ declare function getPepuAddresses(chainId?: number): readonly PepuAddressRow[];
186
+ /**
187
+ * The same rows as {@link getPepuAddresses}, keyed by contract name instead of
188
+ * returned as an array. An unknown chain yields an empty object.
189
+ *
190
+ * @example
191
+ * ```ts
192
+ * const map = getPepuAddressMap();
193
+ * map.paymaster?.address; // Address | undefined
194
+ * ```
195
+ */
196
+ declare function getPepuAddressMap(chainId?: number): Partial<Record<PepuContractName, PepuAddressRow>>;
197
+
198
+ /**
199
+ * The account-abstraction contracts a Kernel v3 smart account needs,
200
+ * narrowed to their {@link DeployedContract} form for a given chain.
201
+ * Returns `undefined` if any one of them isn't deployed on that chain
202
+ * (today: everything except mainnet, `97741`) — this package never fabricates
203
+ * a partial/best-effort bundle.
204
+ */
205
+ interface PepuKernelStack {
206
+ readonly entryPoint06: DeployedContract;
207
+ readonly entryPoint07: DeployedContract;
208
+ readonly kernelFactory: DeployedContract;
209
+ readonly kernelMetaFactory: DeployedContract;
210
+ readonly ecdsaValidator: DeployedContract;
211
+ }
212
+ /**
213
+ * Look up every AA contract this package knows about for `chainId`, already
214
+ * narrowed to {@link DeployedContract}. Returns `undefined` unless *all* five
215
+ * are deployed on that chain (today, only PEPU mainnet qualifies) — a caller
216
+ * building a Kernel account needs every one of them, so a partial result
217
+ * would just move the "is this actually usable" check into every caller.
218
+ *
219
+ * This is a convenience grouping over `getContract` from `./contracts.js`;
220
+ * it doesn't add any address or fact that registry doesn't already have.
221
+ */
222
+ declare function getPepuKernelStack(chainId: number): PepuKernelStack | undefined;
223
+ /**
224
+ * Legacy static gas-sponsorship status for PEPU. **Always reports
225
+ * unavailable** (it never probes). Sponsorship is PROVEN end to end on PEPU
226
+ * mainnet through the hosted bundler and paymaster service (a zero-balance
227
+ * Kernel smart account transacted, paid for by the paymaster); use
228
+ * `checkSponsorship()` for the live answer. This function
229
+ * exists so nothing downstream (this package, `@pepu-chain/mcp`, an app)
230
+ * has to independently invent an "is sponsorship on?" check, and so that
231
+ * check can't silently start lying once this file changes.
232
+ *
233
+ * Do not treat the presence of `kernelFactory`/`ecdsaValidator`/`paymaster`
234
+ * addresses in {@link getPepuKernelStack} / the contract registry as
235
+ * sponsorship support — those let you build and deploy a Kernel account and
236
+ * send its UserOperations through a normal `eth_sendTransaction`-style flow
237
+ * (self-paying its own gas via the EntryPoint deposit), which is a real,
238
+ * working feature; sponsoring that gas needs a funded project or free-tier token.
239
+ */
240
+ interface SponsorshipStatus {
241
+ readonly available: false;
242
+ readonly reason: string;
243
+ /**
244
+ * Extension point for a future bundler/paymaster integration. Passing a
245
+ * URL here does **not** make sponsorship available — `available` stays
246
+ * `false` regardless — this field only exists so a caller can start
247
+ * wiring a URL through their own config today and have this function
248
+ * start using it later without an API change.
249
+ */
250
+ readonly bundlerUrl?: string;
251
+ }
252
+ /** Options for {@link getSponsorshipStatus}. */
253
+ interface GetSponsorshipStatusOptions {
254
+ /** See {@link SponsorshipStatus.bundlerUrl}. Not yet used for anything. */
255
+ readonly bundlerUrl?: string;
256
+ }
257
+ /**
258
+ * @deprecated Always reports `available: false`. Use `checkSponsorship()` (live
259
+ * bundler and paymaster probe) from `@pepu-chain/sdk`. Kept for 0.1 callers.
260
+ */
261
+ declare function getSponsorshipStatus(options?: GetSponsorshipStatusOptions): SponsorshipStatus;
262
+ /**
263
+ * Compute (or confirm) the counterfactual address of a Kernel v3 smart
264
+ * account via the verified factory's `getAddress(data, salt)` — a thin,
265
+ * typed pass-through, not a re-implementation.
266
+ *
267
+ * Deliberately does **not** build `data` (Kernel v3.1's `initialize(...)`
268
+ * calldata: root validator, hook, validator data, hook data, init config)
269
+ * for you. A hand-rolled encoding here would be a second, unverified copy of
270
+ * the byte layout that ZeroDev's SDK already produces (and that has been
271
+ * exercised against PEPU's factory through the sponsored-transaction run),
272
+ * which is exactly the kind of invented encoding this package's rules
273
+ * forbid for addresses. Build `data` with ZeroDev's
274
+ * `@zerodev/sdk` (or by hand from the public Kernel v3 contracts source),
275
+ * then pass the result here.
276
+ */
277
+ declare function getKernelAccountAddress(client: PublicClient<Transport, PepuChain>, factory: Pick<DeployedContract, "address">, args: {
278
+ readonly data: Hex;
279
+ readonly salt: Hex;
280
+ }): Promise<Address>;
281
+ /** Live sponsorship report from {@link checkSponsorship}. */
282
+ interface SponsorshipReport {
283
+ /** True only when a bundler and a paymaster are configured and both answer. */
284
+ available: boolean;
285
+ /** `direct` when you bring your own bundler and paymaster URLs; `none` when nothing is configured. */
286
+ transport: "direct" | "none";
287
+ bundler: {
288
+ configured: boolean;
289
+ probe?: BundlerProbeResult;
290
+ };
291
+ paymaster: {
292
+ configured: boolean;
293
+ probe?: PaymasterProbeResult;
294
+ depositWei?: bigint;
295
+ };
296
+ /** One sentence for a human or an agent. */
297
+ reason: string;
298
+ /** Concrete next steps, empty when `available`. */
299
+ fixes: string[];
300
+ }
301
+ /** Options for {@link checkSponsorship}. */
302
+ interface CheckSponsorshipOptions {
303
+ bundlerUrl?: string;
304
+ paymasterUrl?: string;
305
+ env?: Record<string, string | undefined>;
306
+ fetch?: FetchLike;
307
+ /** When given, also read the paymaster's EntryPoint deposit. */
308
+ publicClient?: PublicClient;
309
+ /** Paymaster contract to read the deposit of. Defaults to PEPU's deployed paymaster. */
310
+ paymasterAddress?: Address;
311
+ timeoutMs?: number;
312
+ }
313
+ /**
314
+ * Live gas-sponsorship status. Resolves the bundler and paymaster URLs from
315
+ * options, env, then the hosted defaults (bundler.pepeunchained.com and the paymaster
316
+ * service base; with no token URL the service is probed at its base), probes both,
317
+ * and optionally reads the paymaster deposit. Never throws for an
318
+ * unreachable service; it reports `available: false` with `fixes`.
319
+ * Replaces the hard-coded {@link getSponsorshipStatus}.
320
+ *
321
+ * @example
322
+ * const s = await checkSponsorship({ publicClient });
323
+ * if (!s.available) console.log(s.reason, s.fixes);
324
+ */
325
+ declare function checkSponsorship(options?: CheckSponsorshipOptions): Promise<SponsorshipReport>;
326
+
327
+ export { type BundlerProbeResult as B, type CheckSponsorshipOptions as C, type DeployedContract as D, type FetchLike as F, type GetSponsorshipStatusOptions as G, type PaymasterProbeResult as P, type SponsorshipReport as S, type PepuKernelStack as a, type ProbeOptions as b, type SponsorshipStatus as c, checkSponsorship as d, getPaymasterDeposit as e, getPepuKernelStack as f, getKernelAccountAddress as g, getSponsorshipStatus as h, probePaymaster as i, type ContractEntry as j, type PendingContract as k, type PepuAddressRow as l, type PepuContractName as m, type PepuContractRegistry as n, getContract as o, probeBundler as p, getPepuAddressMap as q, getPepuAddresses as r, isDeployed as s, listContracts as t, pepuContracts as u };
@@ -0,0 +1,327 @@
1
+ import { Address, PublicClient, Transport, Hex } from 'viem';
2
+ import { P as PepuChain } from './chains-DK13zGIp.cjs';
3
+ import { a as PepuBundlerError } from './errors-CgX1vNj7.cjs';
4
+
5
+ /** Minimal fetch signature, so tests and non-browser hosts can inject one. */
6
+ type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
7
+ interface ProbeOptions {
8
+ fetch?: FetchLike;
9
+ /** Per-request timeout. Default 8000. */
10
+ timeoutMs?: number;
11
+ }
12
+ interface BundlerProbeResult {
13
+ ok: boolean;
14
+ chainId?: number;
15
+ entryPoints?: Address[];
16
+ /**
17
+ * `true` when the method exists. Each method is called with deliberately empty
18
+ * (invalid) params, so nothing is ever sent on-chain: an "invalid params" or
19
+ * validation answer means the method exists, a "method not found" answer
20
+ * (including Alto's "Invalid discriminator value") means it does not.
21
+ */
22
+ supportedMethods?: Record<string, boolean>;
23
+ /** Required methods (see `REQUIRED_BUNDLER_METHODS`) the bundler lacks. Empty when all are present. */
24
+ missingRequiredMethods?: string[];
25
+ latencyMs: number;
26
+ error?: PepuBundlerError;
27
+ }
28
+ interface PaymasterProbeResult {
29
+ ok: boolean;
30
+ /** `GET <origin>/health` answered `{ status: "ok" }`. */
31
+ health?: boolean;
32
+ /** Body of `GET <origin>/v2/free-tier` when the service exposes it. */
33
+ freeTier?: unknown;
34
+ /**
35
+ * `true` when the URL answered `pm_getPaymasterStubData` with a stub result,
36
+ * `false` when it did not answer JSON-RPC at all. A JSON-RPC denial (no
37
+ * credential, unknown sender) leaves it `undefined`: the endpoint speaks
38
+ * ERC-7677 but the probe has no credential, so a stub cannot be judged. Read
39
+ * `erc7677` for the three-way answer.
40
+ */
41
+ erc7677StubOk?: boolean;
42
+ /**
43
+ * `"stub-ok"`: a stub came back. `"needs-credential"`: the endpoint speaks ERC-7677
44
+ * JSON-RPC and answered with an error (no credential, unknown sender), so the stub
45
+ * check is not applicable without a client token. `"not-responding"`: no JSON-RPC answer.
46
+ */
47
+ erc7677?: "stub-ok" | "needs-credential" | "not-responding";
48
+ latencyMs: number;
49
+ error?: PepuBundlerError;
50
+ }
51
+ /**
52
+ * Probe a bundler URL: `eth_chainId`, `eth_supportedEntryPoints` and a
53
+ * capability check of the methods PEPU apps use (a method answered with
54
+ * anything but "method not found" counts as supported; nothing is sent
55
+ * on-chain). Never throws for network trouble; returns `ok: false` with a
56
+ * `BUNDLER_UNREACHABLE` error. Throws `CONFIG_BAD_URL` for a malformed URL.
57
+ *
58
+ * @example
59
+ * const r = await probeBundler("https://bundler.example.com");
60
+ * if (!r.ok) console.log(r.error?.hint);
61
+ */
62
+ declare function probeBundler(url: string, o?: ProbeOptions): Promise<BundlerProbeResult>;
63
+ /**
64
+ * Probe a paymaster URL: the service base (`https://paymaster.pepeunchained.com`) or the ERC-7677 endpoint
65
+ * (`https://host/v2/paymaster/<token>`).
66
+ * Checks `GET <origin>/health`, `GET <origin>/v2/free-tier`, and whether the URL
67
+ * answers JSON-RPC `pm_getPaymasterStubData` (`erc7677`: without a client token a
68
+ * JSON-RPC denial is reported as `"needs-credential"`, not as a failure). `ok` means
69
+ * every capability that could be checked is fine: `/health` did not fail and the URL
70
+ * spoke ERC-7677 JSON-RPC. The URL (which can embed a
71
+ * token) never appears in the returned error.
72
+ *
73
+ * @example
74
+ * const r = await probePaymaster(process.env.PEPU_PAYMASTER_URL!);
75
+ * console.log(r.ok, r.freeTier);
76
+ */
77
+ declare function probePaymaster(url: string, o?: ProbeOptions): Promise<PaymasterProbeResult>;
78
+ /**
79
+ * The paymaster's EntryPoint v0.7 deposit in wei. A drop across a UserOperation
80
+ * is the proof that it was sponsored. Defaults to PEPU's deployed paymaster.
81
+ *
82
+ * @example
83
+ * const before = await getPaymasterDeposit(publicClient);
84
+ */
85
+ declare function getPaymasterDeposit(client: PublicClient, paymaster?: Address): Promise<bigint>;
86
+
87
+ /**
88
+ * Canonical keys for contracts tracked by this registry. Adding a new key
89
+ * here (and a corresponding entry per chain below) is not a breaking
90
+ * change for consumers that read the registry through {@link getContract}
91
+ * or {@link listContracts}.
92
+ */
93
+ type PepuContractName = "create2Factory" | "multicall3" | "permit2" | "entryPoint06" | "entryPoint07" | "kernelFactory" | "kernelMetaFactory" | "ecdsaValidator" | "paymaster" | "kernelImplementation" | "kernelEcdsaSignerModule" | "kernelCallPolicyV004" | "kernelTimestampPolicy" | "tapScore" | "paymasterV1" | "paymasterV2";
94
+ /** A contract that is confirmed live on-chain at `address`. */
95
+ interface DeployedContract {
96
+ readonly status: "deployed";
97
+ /** Human-readable name, for logging/UI. */
98
+ readonly name: string;
99
+ /** Verified contract address. */
100
+ readonly address: Address;
101
+ /** Optional short note, e.g. how the address was verified. */
102
+ readonly notes?: string;
103
+ /**
104
+ * ISO date (YYYY-MM-DD) on which the address was last confirmed to have
105
+ * bytecode via `eth_getCode` against the PEPU mainnet RPC. Re-run
106
+ * `node packages/sdk/scripts/live-check.mjs` to refresh.
107
+ */
108
+ readonly verifiedAt?: string;
109
+ /**
110
+ * True when the contract still has bytecode but must not be used (for example
111
+ * the v1 paymaster, whose EntryPoint deposit was withdrawn). Never route new
112
+ * work to a retired contract.
113
+ */
114
+ readonly retired?: true;
115
+ }
116
+ /**
117
+ * A contract that is not yet deployed on this chain. Deliberately has no
118
+ * `address` field — callers must not be able to accidentally read a
119
+ * placeholder value and treat it as real. Use {@link getContract} /
120
+ * {@link isDeployed} to narrow before reading an address.
121
+ */
122
+ interface PendingContract {
123
+ readonly status: "pending";
124
+ /** Human-readable name, for logging/UI. */
125
+ readonly name: string;
126
+ /** Why this contract has no verified address yet. */
127
+ readonly reason: string;
128
+ }
129
+ type ContractEntry = DeployedContract | PendingContract;
130
+ /** Per-chain contract catalog, keyed by {@link PepuContractName}. */
131
+ type PepuContractRegistry = Readonly<Record<PepuContractName, ContractEntry>>;
132
+ /**
133
+ * Contract registry, keyed by chain id. Tracked as independent per-chain
134
+ * entries because deployments happen per-chain and have already diverged:
135
+ * mainnet has the CREATE2 deployer, a PEPU-specific Multicall3, the
136
+ * canonical Permit2, the full ZeroDev Kernel v3 AA stack (EntryPoint
137
+ * v0.6/v0.7, Kernel factory/meta-factory, ECDSA validator), and a
138
+ * project-deployed, funded verifying paymaster. Testnet has only the
139
+ * CREATE2 deployer — everything else is `status: "pending"` because
140
+ * testnet is out of scope for this package (no faucet exists to fund
141
+ * verification there).
142
+ *
143
+ * Note on the paymaster specifically: `status: "deployed"` here means the
144
+ * contract has live bytecode and a real EntryPoint deposit — it does NOT
145
+ * mean gas sponsorship is usable by an application. See
146
+ * `getSponsorshipStatus` in `./aa/status.js`, which is the single source of
147
+ * truth for that separate question.
148
+ */
149
+ declare const pepuContracts: Readonly<Record<number, PepuContractRegistry>>;
150
+ /** Look up one contract entry for a chain id. Returns `undefined` if the chain isn't in the registry. */
151
+ declare function getContract(chainId: number, name: PepuContractName): ContractEntry | undefined;
152
+ /** List all tracked contract entries for a chain id, in registry order. */
153
+ declare function listContracts(chainId: number): readonly ContractEntry[];
154
+ /** Narrow a {@link ContractEntry} to {@link DeployedContract}. */
155
+ declare function isDeployed(entry: ContractEntry | undefined): entry is DeployedContract;
156
+ /** One row of the address table returned by {@link getPepuAddresses}. */
157
+ interface PepuAddressRow {
158
+ readonly key: PepuContractName;
159
+ readonly name: string;
160
+ readonly status: "deployed" | "pending";
161
+ /** Present only when `status` is `"deployed"`. */
162
+ readonly address?: Address;
163
+ /** ISO date of the last `eth_getCode` check, when known. */
164
+ readonly verifiedAt?: string;
165
+ /** True for a deployed contract that is retired and must not be used (the v1 paymaster). */
166
+ readonly retired?: true;
167
+ /** Notes (deployed) or reason (pending). */
168
+ readonly note: string;
169
+ }
170
+ /**
171
+ * The full supporting-contract table for a chain, flattened for docs and
172
+ * MCP rendering. **Returns an ARRAY of rows** (one {@link PepuAddressRow} per
173
+ * contract, each carrying its own `key`), not an object keyed by contract name:
174
+ * `getPepuAddresses().paymaster` is `undefined`. To look one contract up by name use
175
+ * {@link getContract}, or {@link getPepuAddressMap} for the same rows keyed by name.
176
+ * Pending entries carry no `address`.
177
+ *
178
+ * @example
179
+ * ```ts
180
+ * const rows = getPepuAddresses(); // PepuAddressRow[], mainnet by default
181
+ * const live = rows.filter((r) => r.status === "deployed");
182
+ * const paymaster = rows.find((r) => r.key === "paymaster");
183
+ * ```
184
+ */
185
+ declare function getPepuAddresses(chainId?: number): readonly PepuAddressRow[];
186
+ /**
187
+ * The same rows as {@link getPepuAddresses}, keyed by contract name instead of
188
+ * returned as an array. An unknown chain yields an empty object.
189
+ *
190
+ * @example
191
+ * ```ts
192
+ * const map = getPepuAddressMap();
193
+ * map.paymaster?.address; // Address | undefined
194
+ * ```
195
+ */
196
+ declare function getPepuAddressMap(chainId?: number): Partial<Record<PepuContractName, PepuAddressRow>>;
197
+
198
+ /**
199
+ * The account-abstraction contracts a Kernel v3 smart account needs,
200
+ * narrowed to their {@link DeployedContract} form for a given chain.
201
+ * Returns `undefined` if any one of them isn't deployed on that chain
202
+ * (today: everything except mainnet, `97741`) — this package never fabricates
203
+ * a partial/best-effort bundle.
204
+ */
205
+ interface PepuKernelStack {
206
+ readonly entryPoint06: DeployedContract;
207
+ readonly entryPoint07: DeployedContract;
208
+ readonly kernelFactory: DeployedContract;
209
+ readonly kernelMetaFactory: DeployedContract;
210
+ readonly ecdsaValidator: DeployedContract;
211
+ }
212
+ /**
213
+ * Look up every AA contract this package knows about for `chainId`, already
214
+ * narrowed to {@link DeployedContract}. Returns `undefined` unless *all* five
215
+ * are deployed on that chain (today, only PEPU mainnet qualifies) — a caller
216
+ * building a Kernel account needs every one of them, so a partial result
217
+ * would just move the "is this actually usable" check into every caller.
218
+ *
219
+ * This is a convenience grouping over `getContract` from `./contracts.js`;
220
+ * it doesn't add any address or fact that registry doesn't already have.
221
+ */
222
+ declare function getPepuKernelStack(chainId: number): PepuKernelStack | undefined;
223
+ /**
224
+ * Legacy static gas-sponsorship status for PEPU. **Always reports
225
+ * unavailable** (it never probes). Sponsorship is PROVEN end to end on PEPU
226
+ * mainnet through the hosted bundler and paymaster service (a zero-balance
227
+ * Kernel smart account transacted, paid for by the paymaster); use
228
+ * `checkSponsorship()` for the live answer. This function
229
+ * exists so nothing downstream (this package, `@pepu-chain/mcp`, an app)
230
+ * has to independently invent an "is sponsorship on?" check, and so that
231
+ * check can't silently start lying once this file changes.
232
+ *
233
+ * Do not treat the presence of `kernelFactory`/`ecdsaValidator`/`paymaster`
234
+ * addresses in {@link getPepuKernelStack} / the contract registry as
235
+ * sponsorship support — those let you build and deploy a Kernel account and
236
+ * send its UserOperations through a normal `eth_sendTransaction`-style flow
237
+ * (self-paying its own gas via the EntryPoint deposit), which is a real,
238
+ * working feature; sponsoring that gas needs a funded project or free-tier token.
239
+ */
240
+ interface SponsorshipStatus {
241
+ readonly available: false;
242
+ readonly reason: string;
243
+ /**
244
+ * Extension point for a future bundler/paymaster integration. Passing a
245
+ * URL here does **not** make sponsorship available — `available` stays
246
+ * `false` regardless — this field only exists so a caller can start
247
+ * wiring a URL through their own config today and have this function
248
+ * start using it later without an API change.
249
+ */
250
+ readonly bundlerUrl?: string;
251
+ }
252
+ /** Options for {@link getSponsorshipStatus}. */
253
+ interface GetSponsorshipStatusOptions {
254
+ /** See {@link SponsorshipStatus.bundlerUrl}. Not yet used for anything. */
255
+ readonly bundlerUrl?: string;
256
+ }
257
+ /**
258
+ * @deprecated Always reports `available: false`. Use `checkSponsorship()` (live
259
+ * bundler and paymaster probe) from `@pepu-chain/sdk`. Kept for 0.1 callers.
260
+ */
261
+ declare function getSponsorshipStatus(options?: GetSponsorshipStatusOptions): SponsorshipStatus;
262
+ /**
263
+ * Compute (or confirm) the counterfactual address of a Kernel v3 smart
264
+ * account via the verified factory's `getAddress(data, salt)` — a thin,
265
+ * typed pass-through, not a re-implementation.
266
+ *
267
+ * Deliberately does **not** build `data` (Kernel v3.1's `initialize(...)`
268
+ * calldata: root validator, hook, validator data, hook data, init config)
269
+ * for you. A hand-rolled encoding here would be a second, unverified copy of
270
+ * the byte layout that ZeroDev's SDK already produces (and that has been
271
+ * exercised against PEPU's factory through the sponsored-transaction run),
272
+ * which is exactly the kind of invented encoding this package's rules
273
+ * forbid for addresses. Build `data` with ZeroDev's
274
+ * `@zerodev/sdk` (or by hand from the public Kernel v3 contracts source),
275
+ * then pass the result here.
276
+ */
277
+ declare function getKernelAccountAddress(client: PublicClient<Transport, PepuChain>, factory: Pick<DeployedContract, "address">, args: {
278
+ readonly data: Hex;
279
+ readonly salt: Hex;
280
+ }): Promise<Address>;
281
+ /** Live sponsorship report from {@link checkSponsorship}. */
282
+ interface SponsorshipReport {
283
+ /** True only when a bundler and a paymaster are configured and both answer. */
284
+ available: boolean;
285
+ /** `direct` when you bring your own bundler and paymaster URLs; `none` when nothing is configured. */
286
+ transport: "direct" | "none";
287
+ bundler: {
288
+ configured: boolean;
289
+ probe?: BundlerProbeResult;
290
+ };
291
+ paymaster: {
292
+ configured: boolean;
293
+ probe?: PaymasterProbeResult;
294
+ depositWei?: bigint;
295
+ };
296
+ /** One sentence for a human or an agent. */
297
+ reason: string;
298
+ /** Concrete next steps, empty when `available`. */
299
+ fixes: string[];
300
+ }
301
+ /** Options for {@link checkSponsorship}. */
302
+ interface CheckSponsorshipOptions {
303
+ bundlerUrl?: string;
304
+ paymasterUrl?: string;
305
+ env?: Record<string, string | undefined>;
306
+ fetch?: FetchLike;
307
+ /** When given, also read the paymaster's EntryPoint deposit. */
308
+ publicClient?: PublicClient;
309
+ /** Paymaster contract to read the deposit of. Defaults to PEPU's deployed paymaster. */
310
+ paymasterAddress?: Address;
311
+ timeoutMs?: number;
312
+ }
313
+ /**
314
+ * Live gas-sponsorship status. Resolves the bundler and paymaster URLs from
315
+ * options, env, then the hosted defaults (bundler.pepeunchained.com and the paymaster
316
+ * service base; with no token URL the service is probed at its base), probes both,
317
+ * and optionally reads the paymaster deposit. Never throws for an
318
+ * unreachable service; it reports `available: false` with `fixes`.
319
+ * Replaces the hard-coded {@link getSponsorshipStatus}.
320
+ *
321
+ * @example
322
+ * const s = await checkSponsorship({ publicClient });
323
+ * if (!s.available) console.log(s.reason, s.fixes);
324
+ */
325
+ declare function checkSponsorship(options?: CheckSponsorshipOptions): Promise<SponsorshipReport>;
326
+
327
+ export { type BundlerProbeResult as B, type CheckSponsorshipOptions as C, type DeployedContract as D, type FetchLike as F, type GetSponsorshipStatusOptions as G, type PaymasterProbeResult as P, type SponsorshipReport as S, type PepuKernelStack as a, type ProbeOptions as b, type SponsorshipStatus as c, checkSponsorship as d, getPaymasterDeposit as e, getPepuKernelStack as f, getKernelAccountAddress as g, getSponsorshipStatus as h, probePaymaster as i, type ContractEntry as j, type PendingContract as k, type PepuAddressRow as l, type PepuContractName as m, type PepuContractRegistry as n, getContract as o, probeBundler as p, getPepuAddressMap as q, getPepuAddresses as r, isDeployed as s, listContracts as t, pepuContracts as u };