@pepu-chain/sdk 0.2.0 → 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.
- package/README.md +25 -0
- package/dist/aa/kernel.cjs +1 -0
- package/dist/aa/kernel.guard.js +15 -0
- package/dist/aa/react-direct.cjs +4 -3
- package/dist/aa/react-direct.guard.js +15 -0
- package/dist/aa/react-direct.js +2 -2
- package/dist/aa/react.cjs +4 -3
- package/dist/aa/react.d.cts +1 -1
- package/dist/aa/react.d.ts +1 -1
- package/dist/aa/react.guard.js +15 -0
- package/dist/aa/react.js +2 -2
- package/dist/aa.cjs +9 -9
- package/dist/aa.d.cts +1 -1
- package/dist/aa.d.ts +1 -1
- package/dist/aa.js +2 -2
- package/dist/{chunk-MBA4CLA5.js → chunk-7PVR7QSE.js} +3 -3
- package/dist/{chunk-MBA4CLA5.js.map → chunk-7PVR7QSE.js.map} +1 -1
- package/dist/{chunk-SLW7FRTL.cjs → chunk-BGALSKAF.cjs} +50 -20
- package/dist/chunk-BGALSKAF.cjs.map +1 -0
- package/dist/{chunk-KIIFL4VM.js → chunk-F2R473FR.js} +41 -11
- package/dist/chunk-F2R473FR.js.map +1 -0
- package/dist/{chunk-TIEAZYHF.cjs → chunk-K7JSQPZO.cjs} +8 -2
- package/dist/chunk-K7JSQPZO.cjs.map +1 -0
- package/dist/{chunk-FCXSP2YF.js → chunk-KJYNF5KH.js} +8 -3
- package/dist/chunk-KJYNF5KH.js.map +1 -0
- package/dist/{chunk-ET3P6TX6.cjs → chunk-RCMKPJZO.cjs} +4 -4
- package/dist/{chunk-ET3P6TX6.cjs.map → chunk-RCMKPJZO.cjs.map} +1 -1
- package/dist/combo/react.cjs +1 -0
- package/dist/combo/react.guard.js +15 -0
- package/dist/combo.cjs +4 -3
- package/dist/combo.guard.js +15 -0
- package/dist/combo.js +2 -2
- package/dist/index.cjs +26 -22
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -4
- package/dist/paymaster.cjs +2 -2
- package/dist/paymaster.js +1 -1
- package/dist/privy/react.cjs +1 -0
- package/dist/privy/react.guard.js +15 -0
- package/dist/privy/server.cjs +1 -0
- package/dist/privy/server.guard.js +15 -0
- package/dist/privy/wagmi.guard.js +15 -0
- package/dist/react.cjs +4 -3
- package/dist/react.d.cts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.guard.js +15 -0
- package/dist/react.js +2 -2
- package/dist/session/kernel.cjs +1 -0
- package/dist/session/kernel.guard.js +15 -0
- package/dist/session/react.cjs +1 -0
- package/dist/session/react.guard.js +15 -0
- package/dist/session/server.cjs +1 -0
- package/dist/session/server.guard.js +15 -0
- package/dist/{status-DwkkOrGQ.d.ts → status-Dx9zAFo9.d.ts} +42 -10
- package/dist/{status-CmOsyPmO.d.cts → status-wgTM26V7.d.cts} +42 -10
- package/package.json +38 -2
- package/dist/chunk-FCXSP2YF.js.map +0 -1
- package/dist/chunk-KIIFL4VM.js.map +0 -1
- package/dist/chunk-SLW7FRTL.cjs.map +0 -1
- package/dist/chunk-TIEAZYHF.cjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { redactSecrets } from './chunk-D52PADVY.js';
|
|
2
|
-
import { getContract } from './chunk-
|
|
2
|
+
import { getContract } from './chunk-KJYNF5KH.js';
|
|
3
3
|
import { resolvePepuEndpoints, PEPU_ENV } from './chunk-XC4IBCI2.js';
|
|
4
4
|
import { pepuMainnet } from './chunk-VTQIHMF3.js';
|
|
5
5
|
import { PepuBundlerError, PepuConfigError } from './chunk-6DSZ4Z2N.js';
|
|
@@ -30,7 +30,18 @@ var BUNDLER_METHODS = [
|
|
|
30
30
|
"pimlico_getUserOperationGasPrice",
|
|
31
31
|
"zd_getUserOperationGasPrice"
|
|
32
32
|
];
|
|
33
|
+
var REQUIRED_BUNDLER_METHODS = [
|
|
34
|
+
"eth_sendUserOperation",
|
|
35
|
+
"eth_estimateUserOperationGas",
|
|
36
|
+
"eth_getUserOperationReceipt"
|
|
37
|
+
];
|
|
33
38
|
var METHOD_NOT_FOUND = -32601;
|
|
39
|
+
function isMethodNotFound(error) {
|
|
40
|
+
if (!error || error.code !== METHOD_NOT_FOUND) return false;
|
|
41
|
+
const message = error.message ?? "";
|
|
42
|
+
if (/invalid discriminator value/i.test(message)) return true;
|
|
43
|
+
return !/validation error|invalid params|must contain|required at/i.test(message);
|
|
44
|
+
}
|
|
34
45
|
function hostOf(url) {
|
|
35
46
|
try {
|
|
36
47
|
return new URL(url).host;
|
|
@@ -96,22 +107,31 @@ async function probeBundler(url, o = {}) {
|
|
|
96
107
|
for (const m of BUNDLER_METHODS) {
|
|
97
108
|
try {
|
|
98
109
|
const r = await rpc(f, url, m, [], timeoutMs);
|
|
99
|
-
supportedMethods[m] = r.error
|
|
110
|
+
supportedMethods[m] = !isMethodNotFound(r.error);
|
|
100
111
|
} catch {
|
|
101
112
|
supportedMethods[m] = false;
|
|
102
113
|
}
|
|
103
114
|
}
|
|
104
115
|
const ep07 = getContract(pepuMainnet.id, "entryPoint07");
|
|
105
116
|
const want = ep07?.status === "deployed" ? ep07.address.toLowerCase() : void 0;
|
|
106
|
-
const
|
|
107
|
-
const
|
|
117
|
+
const missing = REQUIRED_BUNDLER_METHODS.filter((m) => supportedMethods[m] !== true);
|
|
118
|
+
const chainAndEntryPointOk = chainId === pepuMainnet.id && (want === void 0 || (entryPoints?.some((a) => a.toLowerCase() === want) ?? false));
|
|
119
|
+
const ok = chainAndEntryPointOk && missing.length === 0;
|
|
120
|
+
const out = {
|
|
121
|
+
ok,
|
|
122
|
+
latencyMs: Date.now() - started,
|
|
123
|
+
supportedMethods,
|
|
124
|
+
missingRequiredMethods: [...missing]
|
|
125
|
+
};
|
|
108
126
|
if (chainId !== void 0) out.chainId = chainId;
|
|
109
127
|
if (entryPoints) out.entryPoints = entryPoints;
|
|
110
128
|
if (!ok) {
|
|
111
129
|
out.error = new PepuBundlerError(
|
|
112
130
|
"BUNDLER_UNREACHABLE",
|
|
113
|
-
chainId !== void 0 && chainId !== pepuMainnet.id ? `The bundler serves chain ${chainId}, not ${pepuMainnet.id}.` : "The bundler does not list EntryPoint v0.7.",
|
|
114
|
-
{
|
|
131
|
+
chainId !== void 0 && chainId !== pepuMainnet.id ? `The bundler serves chain ${chainId}, not ${pepuMainnet.id}.` : !chainAndEntryPointOk ? "The bundler does not list EntryPoint v0.7." : `The bundler does not support ${missing.join(", ")}.`,
|
|
132
|
+
{
|
|
133
|
+
hint: "Point PEPU_BUNDLER_URL at a bundler for chain 97741 that supports EntryPoint v0.7 and the ERC-4337 UserOperation methods."
|
|
134
|
+
}
|
|
115
135
|
);
|
|
116
136
|
}
|
|
117
137
|
return out;
|
|
@@ -167,14 +187,24 @@ async function probePaymaster(url, o = {}) {
|
|
|
167
187
|
timeoutMs
|
|
168
188
|
);
|
|
169
189
|
reached = true;
|
|
170
|
-
|
|
171
|
-
|
|
190
|
+
const rpcError = reply.error !== null && typeof reply.error === "object";
|
|
191
|
+
speaksRpc = reply.result !== void 0 || rpcError;
|
|
192
|
+
if (reply.result !== void 0) {
|
|
193
|
+
out.erc7677StubOk = true;
|
|
194
|
+
out.erc7677 = "stub-ok";
|
|
195
|
+
} else if (rpcError) {
|
|
196
|
+
out.erc7677 = "needs-credential";
|
|
197
|
+
} else {
|
|
198
|
+
out.erc7677StubOk = false;
|
|
199
|
+
out.erc7677 = "not-responding";
|
|
200
|
+
}
|
|
172
201
|
} catch (e) {
|
|
173
202
|
lastError = e;
|
|
174
203
|
out.erc7677StubOk = false;
|
|
204
|
+
out.erc7677 = "not-responding";
|
|
175
205
|
}
|
|
176
206
|
out.latencyMs = Date.now() - started;
|
|
177
|
-
out.ok = out.health
|
|
207
|
+
out.ok = speaksRpc && out.health !== false;
|
|
178
208
|
if (!reached) out.error = unreachable(url, lastError);
|
|
179
209
|
else if (!out.ok) {
|
|
180
210
|
out.error = new PepuBundlerError("BUNDLER_UNREACHABLE", `${hostOf(url)} answered but is not a PEPU paymaster service.`, {
|
|
@@ -270,5 +300,5 @@ async function checkSponsorship(options = {}) {
|
|
|
270
300
|
}
|
|
271
301
|
|
|
272
302
|
export { KERNEL_V3_1_IMPLEMENTATION_ADDRESS, checkSponsorship, entryPointV07Abi, getKernelAccountAddress, getPaymasterDeposit, getPepuKernelStack, getSponsorshipStatus, kernelFactoryAbi, probeBundler, probePaymaster };
|
|
273
|
-
//# sourceMappingURL=chunk-
|
|
274
|
-
//# sourceMappingURL=chunk-
|
|
303
|
+
//# sourceMappingURL=chunk-F2R473FR.js.map
|
|
304
|
+
//# sourceMappingURL=chunk-F2R473FR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/abi/kernelFactory.ts","../src/abi/entryPointV07.ts","../src/aa/probes.ts","../src/aa/status.ts"],"names":["parseAbi"],"mappings":";;;;;;;AA6BO,IAAM,mBAAmB,QAAA,CAAS;AAAA,EACvC,kDAAA;AAAA,EACA,+EAAA;AAAA,EACA;AACF,CAAC;AAOM,IAAM,kCAAA,GACX;ACdK,IAAM,mBAAmBA,QAAAA,CAAS;AAAA,EACvC,6EAAA;AAAA,EACA,4DAAA;AAAA,EACA,6CAAA;AAAA,EACA,8EAAA;AAAA,EACA,wJAAA;AAAA,EACA,gEAAA;AAAA,EACA;AACF,CAAC;;;ACuBD,IAAM,eAAA,GAAkB;AAAA,EACtB,uBAAA;AAAA,EACA,8BAAA;AAAA,EACA,6BAAA;AAAA,EACA,4BAAA;AAAA,EACA,kCAAA;AAAA,EACA;AACF,CAAA;AAGO,IAAM,wBAAA,GAA2B;AAAA,EACtC,uBAAA;AAAA,EACA,8BAAA;AAAA,EACA;AACF,CAAA;AAEA,IAAM,gBAAA,GAAmB,MAAA;AASzB,SAAS,iBAAiB,KAAA,EAAiE;AACzF,EAAA,IAAI,CAAC,KAAA,IAAS,KAAA,CAAM,IAAA,KAAS,kBAAkB,OAAO,KAAA;AACtD,EAAA,MAAM,OAAA,GAAU,MAAM,OAAA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M,UAAA,GAAa,UAAA,KAAe,IAAA,IAAQ,YAAA,KAAiB,IAAA;AAC3D,EAAA,MAAM,MAAA,GAAS,SAAA,GACX,4EAAA,GACA,CAAC,aACC,qHAAA,GACA,wEAAA;AACN,EAAA,OAAO;AAAA,IACL,SAAA;AAAA,IACA,SAAA,EAAW,aAAa,QAAA,GAAW,MAAA;AAAA,IACnC,OAAA,EAAS,EAAE,UAAA,EAAY,UAAA,KAAe,IAAA,EAAM,GAAI,MAAA,GAAS,EAAE,KAAA,EAAO,MAAA,EAAO,GAAI,EAAC,EAAG;AAAA,IACjF,SAAA,EAAW;AAAA,MACT,YAAY,YAAA,KAAiB,IAAA;AAAA,MAC7B,GAAI,MAAA,GAAS,EAAE,KAAA,EAAO,MAAA,KAAW,EAAC;AAAA,MAClC,GAAI,UAAA,KAAe,MAAA,GAAY,EAAE,UAAA,KAAe;AAAC,KACnD;AAAA,IACA,MAAA;AAAA,IACA;AAAA,GACF;AACF","file":"chunk-F2R473FR.js","sourcesContent":["import { parseAbi } from \"viem\";\n\n/**\n * ZeroDev Kernel v3 account factory ABI, at\n * `0xaac5D4240AF87249B3f71BC8E4A2cae074A3E419` (deployed on PEPU mainnet\n * only; see `pepuContracts.kernelFactory` in `../contracts.js`).\n *\n * Verified live against mainnet 2026-09-24 via `eth_call`:\n * - `implementation()` returns `0xbAC849bB641841b44E965fb01A4Bf5F074F84B4d` —\n * ZeroDev's Kernel v3.1 singleton implementation address, deployed at the\n * same address on every chain that has it via CREATE2.\n * - `getAddress(bytes,bytes32)`, called with empty `data` and a zero salt,\n * returns a computed address without reverting.\n * - `createAccount(bytes,bytes32)`, simulated (not sent) with the same\n * empty `data` and zero salt via `eth_call`, returns the **same** address\n * `getAddress` computed for those inputs — exactly the counterfactual-\n * address behavior a CREATE2 account factory is supposed to have.\n *\n * What this package does NOT ship: a helper that encodes the `data`\n * argument (Kernel v3.1's `initialize(...)` calldata — root validator,\n * hook, validator data, hook data, init config). No account has ever been\n * created through this factory on PEPU yet (its transaction history is\n * empty as of the verification date above), so there was nothing on-chain\n * to check a hand-rolled encoding against, and guessing one here would be\n * exactly the kind of invented byte layout this package's rules forbid.\n * Use ZeroDev's own `@zerodev/sdk` (or the public Kernel contracts source)\n * to build that payload, then pass the resulting bytes into\n * `getAddress`/`createAccount` from this ABI.\n */\nexport const kernelFactoryAbi = parseAbi([\n \"function implementation() view returns (address)\",\n \"function getAddress(bytes calldata data, bytes32 salt) view returns (address)\",\n \"function createAccount(bytes calldata data, bytes32 salt) payable returns (address)\",\n]);\n\n/**\n * The verified Kernel v3.1 singleton implementation address that\n * `kernelFactoryAbi`'s `implementation()` resolves to on PEPU mainnet. Same\n * address ZeroDev uses across every chain that has this Kernel version.\n */\nexport const KERNEL_V3_1_IMPLEMENTATION_ADDRESS =\n \"0xbAC849bB641841b44E965fb01A4Bf5F074F84B4d\" as const;\n","import { parseAbi } from \"viem\";\n\n/**\n * ERC-4337 EntryPoint v0.7 ABI — the subset a dapp actually needs to manage\n * a smart account's gas deposit and read its nonce, at the canonical address\n * `0x0000000071727De22E5E9d8BAf0edAc6f37da032` (deployed on PEPU mainnet\n * only; see `pepuContracts.entryPoint07` in `../contracts.js`).\n *\n * This is NOT the full `IEntryPoint` interface (no `handleOps`,\n * `simulateValidation`, etc.) — those are normally called by a bundler, and\n * PEPU has no publicly hosted bundler yet (see `getSponsorshipStatus` in\n * `../aa/status.js`). This ABI only covers deposit/nonce management, which works\n * today with a plain viem wallet client and no bundler at all.\n *\n * Verified live against mainnet 2026-09-24 via `eth_call`:\n * - `getNonce(address,uint192)` for the zero address/key returns `0`.\n * - `balanceOf(address)` for the zero address returns `0`.\n * - `getDepositInfo(address)` for the zero address returns a 5-word\n * (all-zero) tuple, matching the v0.7 `DepositInfo` struct shape\n * `(uint256 deposit, bool staked, uint96 stake, uint32 unstakeDelaySec,\n * uint48 withdrawTime)` field-for-field.\n * `depositTo`/`withdrawTo` share the same `IStakeManager` interface as the\n * verified `getDepositInfo`/`balanceOf` pair and are standard across every\n * EntryPoint version; they were not separately simulated (both mutate\n * state, and simulating a withdrawal from an empty deposit would only prove\n * it reverts, not that it works).\n */\nexport const entryPointV07Abi = parseAbi([\n \"function getNonce(address sender, uint192 key) view returns (uint256 nonce)\",\n \"function balanceOf(address account) view returns (uint256)\",\n \"function depositTo(address account) payable\",\n \"function withdrawTo(address payable withdrawAddress, uint256 withdrawAmount)\",\n \"function getDepositInfo(address account) view returns ((uint256 deposit, bool staked, uint96 stake, uint32 unstakeDelaySec, uint48 withdrawTime) info)\",\n \"event Deposited(address indexed account, uint256 totalDeposit)\",\n \"event Withdrawn(address indexed account, address withdrawAddress, uint256 amount)\",\n]);\n","import type { Address, PublicClient } from \"viem\";\n\nimport { entryPointV07Abi } from \"../abi/entryPointV07.js\";\nimport { pepuMainnet } from \"../chains.js\";\nimport { getContract } from \"../contracts.js\";\nimport { PepuBundlerError, PepuConfigError } from \"../errors.js\";\nimport { redactSecrets } from \"./describe.js\";\n\n/** Minimal fetch signature, so tests and non-browser hosts can inject one. */\nexport type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;\n\nexport interface ProbeOptions {\n fetch?: FetchLike;\n /** Per-request timeout. Default 8000. */\n timeoutMs?: number;\n}\n\nexport interface BundlerProbeResult {\n ok: boolean;\n chainId?: number;\n entryPoints?: Address[];\n /**\n * `true` when the method exists. Each method is called with deliberately empty\n * (invalid) params, so nothing is ever sent on-chain: an \"invalid params\" or\n * validation answer means the method exists, a \"method not found\" answer\n * (including Alto's \"Invalid discriminator value\") means it does not.\n */\n supportedMethods?: Record<string, boolean>;\n /** Required methods (see `REQUIRED_BUNDLER_METHODS`) the bundler lacks. Empty when all are present. */\n missingRequiredMethods?: string[];\n latencyMs: number;\n error?: PepuBundlerError;\n}\n\nexport interface PaymasterProbeResult {\n ok: boolean;\n /** `GET <origin>/health` answered `{ status: \"ok\" }`. */\n health?: boolean;\n /** Body of `GET <origin>/v2/free-tier` when the service exposes it. */\n freeTier?: unknown;\n /**\n * `true` when the URL answered `pm_getPaymasterStubData` with a stub result,\n * `false` when it did not answer JSON-RPC at all. A JSON-RPC denial (no\n * credential, unknown sender) leaves it `undefined`: the endpoint speaks\n * ERC-7677 but the probe has no credential, so a stub cannot be judged. Read\n * `erc7677` for the three-way answer.\n */\n erc7677StubOk?: boolean;\n /**\n * `\"stub-ok\"`: a stub came back. `\"needs-credential\"`: the endpoint speaks ERC-7677\n * JSON-RPC and answered with an error (no credential, unknown sender), so the stub\n * check is not applicable without a client token. `\"not-responding\"`: no JSON-RPC answer.\n */\n erc7677?: \"stub-ok\" | \"needs-credential\" | \"not-responding\";\n latencyMs: number;\n error?: PepuBundlerError;\n}\n\nconst BUNDLER_METHODS = [\n \"eth_sendUserOperation\",\n \"eth_estimateUserOperationGas\",\n \"eth_getUserOperationReceipt\",\n \"eth_getUserOperationByHash\",\n \"pimlico_getUserOperationGasPrice\",\n \"zd_getUserOperationGasPrice\",\n] as const;\n\n/** Methods a bundler must support to be usable for PEPU sponsored UserOperations. */\nexport const REQUIRED_BUNDLER_METHODS = [\n \"eth_sendUserOperation\",\n \"eth_estimateUserOperationGas\",\n \"eth_getUserOperationReceipt\",\n] as const;\n\nconst METHOD_NOT_FOUND = -32601;\n\n/**\n * A bundler answers a method that does not exist with \"method not found\". Alto\n * (Pimlico) also reports bad params of a KNOWN method with code -32601 and a\n * \"Validation error: ...\" message, and an unknown method as \"Validation error:\n * Invalid discriminator value\". So -32601 means unsupported unless the message is\n * a params validation error that is not the discriminator one.\n */\nfunction isMethodNotFound(error: { code?: number; message?: string } | undefined): boolean {\n if (!error || error.code !== METHOD_NOT_FOUND) return false;\n const message = error.message ?? \"\";\n if (/invalid discriminator value/i.test(message)) return true;\n return !/validation error|invalid params|must contain|required at/i.test(message);\n}\n\nfunction hostOf(url: string): string {\n try {\n return new URL(url).host;\n } catch {\n return \"the configured host\";\n }\n}\n\nfunction checkUrl(url: string, label: string): void {\n let u: URL;\n try {\n u = new URL(url);\n } catch {\n throw new PepuConfigError(\"CONFIG_BAD_URL\", `${label} is not a valid URL.`);\n }\n if (u.protocol !== \"http:\" && u.protocol !== \"https:\") {\n throw new PepuConfigError(\"CONFIG_BAD_URL\", `${label} must be an http(s) URL.`);\n }\n}\n\nasync function timedFetch(f: FetchLike, url: string, init: RequestInit, timeoutMs: number): Promise<Response> {\n const ctl = new AbortController();\n const t = setTimeout(() => ctl.abort(), timeoutMs);\n try {\n return await f(url, { ...init, signal: ctl.signal });\n } finally {\n clearTimeout(t);\n }\n}\n\ninterface RpcReply {\n result?: unknown;\n error?: { code?: number; message?: string; data?: unknown };\n}\n\nasync function rpc(f: FetchLike, url: string, method: string, params: unknown[], timeoutMs: number): Promise<RpcReply> {\n const res = await timedFetch(\n f,\n url,\n {\n method: \"POST\",\n headers: { \"content-type\": \"application/json\" },\n body: JSON.stringify({ jsonrpc: \"2.0\", id: 1, method, params }),\n },\n timeoutMs,\n );\n let body: unknown;\n try {\n body = await res.json();\n } catch {\n throw new Error(`HTTP ${res.status} with a non-JSON body`);\n }\n if (!body || typeof body !== \"object\") throw new Error(`HTTP ${res.status} with an unexpected body`);\n return body as RpcReply;\n}\n\nfunction unreachable(url: string, e: unknown): PepuBundlerError {\n const reason = e instanceof Error && e.name === \"AbortError\" ? \"timed out\" : redactSecrets(e instanceof Error ? e.message : String(e)).replace(/https?:\\/\\/\\S+/g, \"[url]\");\n return new PepuBundlerError(\"BUNDLER_UNREACHABLE\", `Could not reach ${hostOf(url)}: ${reason}`, { cause: e });\n}\n\n/**\n * Probe a bundler URL: `eth_chainId`, `eth_supportedEntryPoints` and a\n * capability check of the methods PEPU apps use (a method answered with\n * anything but \"method not found\" counts as supported; nothing is sent\n * on-chain). Never throws for network trouble; returns `ok: false` with a\n * `BUNDLER_UNREACHABLE` error. Throws `CONFIG_BAD_URL` for a malformed URL.\n *\n * @example\n * const r = await probeBundler(\"https://bundler.example.com\");\n * if (!r.ok) console.log(r.error?.hint);\n */\nexport async function probeBundler(url: string, o: ProbeOptions = {}): Promise<BundlerProbeResult> {\n checkUrl(url, \"Bundler URL\");\n const f: FetchLike = o.fetch ?? ((i, init) => fetch(i, init));\n const timeoutMs = o.timeoutMs ?? 8000;\n const started = Date.now();\n try {\n const chain = await rpc(f, url, \"eth_chainId\", [], timeoutMs);\n const eps = await rpc(f, url, \"eth_supportedEntryPoints\", [], timeoutMs);\n const chainId = typeof chain.result === \"string\" ? Number(BigInt(chain.result)) : undefined;\n const entryPoints = Array.isArray(eps.result) ? (eps.result as Address[]) : undefined;\n const supportedMethods: Record<string, boolean> = {};\n for (const m of BUNDLER_METHODS) {\n try {\n const r = await rpc(f, url, m, [], timeoutMs);\n supportedMethods[m] = !isMethodNotFound(r.error);\n } catch {\n supportedMethods[m] = false;\n }\n }\n const ep07 = getContract(pepuMainnet.id, \"entryPoint07\");\n const want = ep07?.status === \"deployed\" ? ep07.address.toLowerCase() : undefined;\n const missing = REQUIRED_BUNDLER_METHODS.filter((m) => supportedMethods[m] !== true);\n const chainAndEntryPointOk =\n chainId === pepuMainnet.id &&\n (want === undefined || (entryPoints?.some((a) => a.toLowerCase() === want) ?? false));\n const ok = chainAndEntryPointOk && missing.length === 0;\n const out: BundlerProbeResult = {\n ok,\n latencyMs: Date.now() - started,\n supportedMethods,\n missingRequiredMethods: [...missing],\n };\n if (chainId !== undefined) out.chainId = chainId;\n if (entryPoints) out.entryPoints = entryPoints;\n if (!ok) {\n out.error = new PepuBundlerError(\n \"BUNDLER_UNREACHABLE\",\n chainId !== undefined && chainId !== pepuMainnet.id\n ? `The bundler serves chain ${chainId}, not ${pepuMainnet.id}.`\n : !chainAndEntryPointOk\n ? \"The bundler does not list EntryPoint v0.7.\"\n : `The bundler does not support ${missing.join(\", \")}.`,\n {\n hint: \"Point PEPU_BUNDLER_URL at a bundler for chain 97741 that supports EntryPoint v0.7 and the ERC-4337 UserOperation methods.\",\n },\n );\n }\n return out;\n } catch (e) {\n return { ok: false, latencyMs: Date.now() - started, error: unreachable(url, e) };\n }\n}\n\nconst STUB_PROBE_OP = {\n sender: \"0x0000000000000000000000000000000000000001\",\n nonce: \"0x0\",\n callData: \"0x\",\n callGasLimit: \"0x0\",\n verificationGasLimit: \"0x0\",\n preVerificationGas: \"0x0\",\n maxFeePerGas: \"0x0\",\n maxPriorityFeePerGas: \"0x0\",\n signature: \"0x\",\n} as const;\n\n/**\n * Probe a paymaster URL: the service base (`https://paymaster.pepeunchained.com`) or the ERC-7677 endpoint\n * (`https://host/v2/paymaster/<token>`).\n * Checks `GET <origin>/health`, `GET <origin>/v2/free-tier`, and whether the URL\n * answers JSON-RPC `pm_getPaymasterStubData` (`erc7677`: without a client token a\n * JSON-RPC denial is reported as `\"needs-credential\"`, not as a failure). `ok` means\n * every capability that could be checked is fine: `/health` did not fail and the URL\n * spoke ERC-7677 JSON-RPC. The URL (which can embed a\n * token) never appears in the returned error.\n *\n * @example\n * const r = await probePaymaster(process.env.PEPU_PAYMASTER_URL!);\n * console.log(r.ok, r.freeTier);\n */\nexport async function probePaymaster(url: string, o: ProbeOptions = {}): Promise<PaymasterProbeResult> {\n checkUrl(url, \"Paymaster URL\");\n const f: FetchLike = o.fetch ?? ((i, init) => fetch(i, init));\n const timeoutMs = o.timeoutMs ?? 8000;\n const started = Date.now();\n const origin = new URL(url).origin;\n const out: PaymasterProbeResult = { ok: false, latencyMs: 0 };\n let reached = false;\n let lastError: unknown;\n\n try {\n const res = await timedFetch(f, `${origin}/health`, { method: \"GET\" }, timeoutMs);\n reached = true;\n const body = (await res.json().catch(() => null)) as { status?: unknown } | null;\n out.health = res.ok && body?.status === \"ok\";\n } catch (e) {\n lastError = e;\n out.health = false;\n }\n\n try {\n const res = await timedFetch(f, `${origin}/v2/free-tier`, { method: \"GET\" }, timeoutMs);\n reached = true;\n if (res.ok) out.freeTier = await res.json().catch(() => undefined);\n } catch (e) {\n lastError = e;\n }\n\n let speaksRpc = false;\n try {\n const ep07 = getContract(pepuMainnet.id, \"entryPoint07\");\n const ep = ep07?.status === \"deployed\" ? ep07.address : \"0x0000000071727De22E5E9d8BAf0edAc6f37da032\";\n const reply = await rpc(\n f,\n url,\n \"pm_getPaymasterStubData\",\n [STUB_PROBE_OP, ep, `0x${pepuMainnet.id.toString(16)}`, {}],\n timeoutMs,\n );\n reached = true;\n // A JSON-RPC answer has a result, or an error OBJECT (a REST 404 body like {\"error\":\"not_found\"} is not one).\n const rpcError = reply.error !== null && typeof reply.error === \"object\";\n speaksRpc = reply.result !== undefined || rpcError;\n if (reply.result !== undefined) {\n out.erc7677StubOk = true;\n out.erc7677 = \"stub-ok\";\n } else if (rpcError) {\n // Alive and speaking JSON-RPC, but the probe has no credential: not applicable, not a failure.\n out.erc7677 = \"needs-credential\";\n } else {\n out.erc7677StubOk = false;\n out.erc7677 = \"not-responding\";\n }\n } catch (e) {\n lastError = e;\n out.erc7677StubOk = false;\n out.erc7677 = \"not-responding\";\n }\n\n out.latencyMs = Date.now() - started;\n out.ok = speaksRpc && out.health !== false;\n if (!reached) out.error = unreachable(url, lastError);\n else if (!out.ok) {\n out.error = new PepuBundlerError(\"BUNDLER_UNREACHABLE\", `${hostOf(url)} answered but is not a PEPU paymaster service.`, {\n hint: \"Check PEPU_PAYMASTER_URL points at the policy service (https://paymaster.pepeunchained.com), or its /v2/paymaster/<client token> endpoint.\",\n });\n }\n return out;\n}\n\n/**\n * The paymaster's EntryPoint v0.7 deposit in wei. A drop across a UserOperation\n * is the proof that it was sponsored. Defaults to PEPU's deployed paymaster.\n *\n * @example\n * const before = await getPaymasterDeposit(publicClient);\n */\nexport async function getPaymasterDeposit(client: PublicClient, paymaster?: Address): Promise<bigint> {\n const pm = getContract(pepuMainnet.id, \"paymaster\");\n const ep = getContract(pepuMainnet.id, \"entryPoint07\");\n const account = paymaster ?? (pm?.status === \"deployed\" ? pm.address : undefined);\n if (!account || ep?.status !== \"deployed\") {\n throw new PepuConfigError(\"CONFIG_MISSING_ENV\", \"No paymaster address is known; pass one explicitly.\", {\n hint: \"Pass the paymaster address as the second argument.\",\n });\n }\n return client.readContract({\n address: ep.address,\n abi: entryPointV07Abi,\n functionName: \"balanceOf\",\n args: [account],\n });\n}\n","import type { Address, Hex, PublicClient, Transport } from \"viem\";\n\nimport { kernelFactoryAbi } from \"../abi/kernelFactory.js\";\nimport type { PepuChain } from \"../chains.js\";\nimport type { DeployedContract } from \"../contracts.js\";\nimport { getContract } from \"../contracts.js\";\nimport { PEPU_ENV, resolvePepuEndpoints } from \"../endpoints.js\";\nimport { getPaymasterDeposit, probeBundler, probePaymaster } from \"./probes.js\";\nimport type { BundlerProbeResult, FetchLike, PaymasterProbeResult } from \"./probes.js\";\n\n/**\n * The account-abstraction contracts a Kernel v3 smart account needs,\n * narrowed to their {@link DeployedContract} form for a given chain.\n * Returns `undefined` if any one of them isn't deployed on that chain\n * (today: everything except mainnet, `97741`) — this package never fabricates\n * a partial/best-effort bundle.\n */\nexport interface PepuKernelStack {\n readonly entryPoint06: DeployedContract;\n readonly entryPoint07: DeployedContract;\n readonly kernelFactory: DeployedContract;\n readonly kernelMetaFactory: DeployedContract;\n readonly ecdsaValidator: DeployedContract;\n}\n\n/**\n * Look up every AA contract this package knows about for `chainId`, already\n * narrowed to {@link DeployedContract}. Returns `undefined` unless *all* five\n * are deployed on that chain (today, only PEPU mainnet qualifies) — a caller\n * building a Kernel account needs every one of them, so a partial result\n * would just move the \"is this actually usable\" check into every caller.\n *\n * This is a convenience grouping over `getContract` from `./contracts.js`;\n * it doesn't add any address or fact that registry doesn't already have.\n */\nexport function getPepuKernelStack(chainId: number): PepuKernelStack | undefined {\n const entryPoint06 = getContract(chainId, \"entryPoint06\");\n const entryPoint07 = getContract(chainId, \"entryPoint07\");\n const kernelFactory = getContract(chainId, \"kernelFactory\");\n const kernelMetaFactory = getContract(chainId, \"kernelMetaFactory\");\n const ecdsaValidator = getContract(chainId, \"ecdsaValidator\");\n\n if (\n entryPoint06?.status !== \"deployed\" ||\n entryPoint07?.status !== \"deployed\" ||\n kernelFactory?.status !== \"deployed\" ||\n kernelMetaFactory?.status !== \"deployed\" ||\n ecdsaValidator?.status !== \"deployed\"\n ) {\n return undefined;\n }\n\n return { entryPoint06, entryPoint07, kernelFactory, kernelMetaFactory, ecdsaValidator };\n}\n\n/**\n * Legacy static gas-sponsorship status for PEPU. **Always reports\n * unavailable** (it never probes). Sponsorship is PROVEN end to end on PEPU\n * mainnet through the hosted bundler and paymaster service (a zero-balance\n * Kernel smart account transacted, paid for by the paymaster); use\n * `checkSponsorship()` for the live answer. This function\n * exists so nothing downstream (this package, `@pepu-chain/mcp`, an app)\n * has to independently invent an \"is sponsorship on?\" check, and so that\n * check can't silently start lying once this file changes.\n *\n * Do not treat the presence of `kernelFactory`/`ecdsaValidator`/`paymaster`\n * addresses in {@link getPepuKernelStack} / the contract registry as\n * sponsorship support — those let you build and deploy a Kernel account and\n * send its UserOperations through a normal `eth_sendTransaction`-style flow\n * (self-paying its own gas via the EntryPoint deposit), which is a real,\n * working feature; sponsoring that gas needs a funded project or free-tier token.\n */\nexport interface SponsorshipStatus {\n readonly available: false;\n readonly reason: string;\n /**\n * Extension point for a future bundler/paymaster integration. Passing a\n * URL here does **not** make sponsorship available — `available` stays\n * `false` regardless — this field only exists so a caller can start\n * wiring a URL through their own config today and have this function\n * start using it later without an API change.\n */\n readonly bundlerUrl?: string;\n}\n\n/** Options for {@link getSponsorshipStatus}. */\nexport interface GetSponsorshipStatusOptions {\n /** See {@link SponsorshipStatus.bundlerUrl}. Not yet used for anything. */\n readonly bundlerUrl?: string;\n}\n\n/**\n * @deprecated Always reports `available: false`. Use `checkSponsorship()` (live\n * bundler and paymaster probe) from `@pepu-chain/sdk`. Kept for 0.1 callers.\n */\nexport function getSponsorshipStatus(\n options?: GetSponsorshipStatusOptions,\n): SponsorshipStatus {\n const reason =\n \"This deprecated function never probes anything and always reports \" +\n \"unavailable. The hosted bundler (bundler.pepeunchained.com) and \" +\n \"paymaster service (paymaster.pepeunchained.com) are live, and \" +\n \"sponsorship is proven end to end on mainnet through them. Call \" +\n \"checkSponsorship() for the live status. A Kernel v3 smart account \" +\n \"without a funded project or free-tier token must still fund its own \" +\n \"EntryPoint deposit and pay its own gas, like a normal EOA-sent transaction.\";\n return options?.bundlerUrl === undefined\n ? { available: false, reason }\n : { available: false, reason, bundlerUrl: options.bundlerUrl };\n}\n\n/**\n * Compute (or confirm) the counterfactual address of a Kernel v3 smart\n * account via the verified factory's `getAddress(data, salt)` — a thin,\n * typed pass-through, not a re-implementation.\n *\n * Deliberately does **not** build `data` (Kernel v3.1's `initialize(...)`\n * calldata: root validator, hook, validator data, hook data, init config)\n * for you. A hand-rolled encoding here would be a second, unverified copy of\n * the byte layout that ZeroDev's SDK already produces (and that has been\n * exercised against PEPU's factory through the sponsored-transaction run),\n * which is exactly the kind of invented encoding this package's rules\n * forbid for addresses. Build `data` with ZeroDev's\n * `@zerodev/sdk` (or by hand from the public Kernel v3 contracts source),\n * then pass the result here.\n */\nexport async function getKernelAccountAddress(\n client: PublicClient<Transport, PepuChain>,\n factory: Pick<DeployedContract, \"address\">,\n args: { readonly data: Hex; readonly salt: Hex },\n): Promise<Address> {\n return client.readContract({\n address: factory.address,\n abi: kernelFactoryAbi,\n functionName: \"getAddress\",\n args: [args.data, args.salt],\n });\n}\n\n/** Live sponsorship report from {@link checkSponsorship}. */\nexport interface SponsorshipReport {\n /** True only when a bundler and a paymaster are configured and both answer. */\n available: boolean;\n /** `direct` when you bring your own bundler and paymaster URLs; `none` when nothing is configured. */\n transport: \"direct\" | \"none\";\n bundler: { configured: boolean; probe?: BundlerProbeResult };\n paymaster: { configured: boolean; probe?: PaymasterProbeResult; depositWei?: bigint };\n /** One sentence for a human or an agent. */\n reason: string;\n /** Concrete next steps, empty when `available`. */\n fixes: string[];\n}\n\n/** Options for {@link checkSponsorship}. */\nexport interface CheckSponsorshipOptions {\n bundlerUrl?: string;\n paymasterUrl?: string;\n env?: Record<string, string | undefined>;\n fetch?: FetchLike;\n /** When given, also read the paymaster's EntryPoint deposit. */\n publicClient?: PublicClient;\n /** Paymaster contract to read the deposit of. Defaults to PEPU's deployed paymaster. */\n paymasterAddress?: Address;\n timeoutMs?: number;\n}\n\n/**\n * Live gas-sponsorship status. Resolves the bundler and paymaster URLs from\n * options, env, then the hosted defaults (bundler.pepeunchained.com and the paymaster\n * service base; with no token URL the service is probed at its base), probes both,\n * and optionally reads the paymaster deposit. Never throws for an\n * unreachable service; it reports `available: false` with `fixes`.\n * Replaces the hard-coded {@link getSponsorshipStatus}.\n *\n * @example\n * const s = await checkSponsorship({ publicClient });\n * if (!s.available) console.log(s.reason, s.fixes);\n */\nexport async function checkSponsorship(options: CheckSponsorshipOptions = {}): Promise<SponsorshipReport> {\n const { bundlerUrl, paymasterUrl: erc7677Url, paymasterBaseUrl } = resolvePepuEndpoints({\n ...(options.bundlerUrl !== undefined ? { bundlerUrl: options.bundlerUrl } : {}),\n ...(options.paymasterUrl !== undefined ? { paymasterUrl: options.paymasterUrl } : {}),\n ...(options.env ? { env: options.env } : {}),\n });\n // No token means no complete ERC-7677 URL: probe the service base (health + free-tier state) instead.\n const paymasterUrl = erc7677Url ?? paymasterBaseUrl;\n const probeOpts = {\n ...(options.fetch ? { fetch: options.fetch } : {}),\n ...(options.timeoutMs !== undefined ? { timeoutMs: options.timeoutMs } : {}),\n };\n const fixes: string[] = [];\n if (bundlerUrl === null) fixes.push(`Set ${PEPU_ENV.bundlerUrl} to a bundler for chain 97741 (EntryPoint v0.7).`);\n if (paymasterUrl === null) fixes.push(`Set ${PEPU_ENV.paymasterUrl} to your ERC-7677 paymaster endpoint (https://paymaster.pepeunchained.com/v2/paymaster/<client token>).`);\n\n const [bProbe, pProbe] = await Promise.all([\n bundlerUrl === null ? undefined : probeBundler(bundlerUrl, probeOpts),\n paymasterUrl === null ? undefined : probePaymaster(paymasterUrl, probeOpts),\n ]);\n if (bProbe && !bProbe.ok) fixes.push(bProbe.error?.hint ?? \"The bundler did not answer correctly.\");\n if (pProbe && !pProbe.ok) fixes.push(pProbe.error?.hint ?? \"The paymaster did not answer correctly.\");\n\n let depositWei: bigint | undefined;\n if (options.publicClient) {\n try {\n depositWei = await getPaymasterDeposit(options.publicClient, options.paymasterAddress);\n if (depositWei === 0n) fixes.push(\"The paymaster's EntryPoint deposit is empty. Deposit PEPU to it.\");\n } catch {\n // A failed read must not flip availability; the probes are the source of truth.\n }\n }\n\n const available = !!bProbe?.ok && !!pProbe?.ok && depositWei !== 0n;\n const configured = bundlerUrl !== null || paymasterUrl !== null;\n const reason = available\n ? \"Bundler and paymaster are reachable; sponsored UserOperations can be sent.\"\n : !configured\n ? \"No bundler or paymaster URL is configured. Set PEPU_BUNDLER_URL and PEPU_PAYMASTER_URL, or use the hosted defaults.\"\n : \"A bundler or paymaster is configured but not fully working. See fixes.\";\n return {\n available,\n transport: configured ? \"direct\" : \"none\",\n bundler: { configured: bundlerUrl !== null, ...(bProbe ? { probe: bProbe } : {}) },\n paymaster: {\n configured: paymasterUrl !== null,\n ...(pProbe ? { probe: pProbe } : {}),\n ...(depositWei !== undefined ? { depositWei } : {}),\n },\n reason,\n fixes,\n };\n}\n"]}
|
|
@@ -215,11 +215,17 @@ function getPepuAddresses(chainId = chunkDPCZJLB3_cjs.pepuMainnet.id) {
|
|
|
215
215
|
} : { key, name: e.name, status: "pending", note: e.reason };
|
|
216
216
|
});
|
|
217
217
|
}
|
|
218
|
+
function getPepuAddressMap(chainId = chunkDPCZJLB3_cjs.pepuMainnet.id) {
|
|
219
|
+
const out = {};
|
|
220
|
+
for (const row of getPepuAddresses(chainId)) out[row.key] = row;
|
|
221
|
+
return out;
|
|
222
|
+
}
|
|
218
223
|
|
|
219
224
|
exports.getContract = getContract;
|
|
225
|
+
exports.getPepuAddressMap = getPepuAddressMap;
|
|
220
226
|
exports.getPepuAddresses = getPepuAddresses;
|
|
221
227
|
exports.isDeployed = isDeployed;
|
|
222
228
|
exports.listContracts = listContracts;
|
|
223
229
|
exports.pepuContracts = pepuContracts;
|
|
224
|
-
//# sourceMappingURL=chunk-
|
|
225
|
-
//# sourceMappingURL=chunk-
|
|
230
|
+
//# sourceMappingURL=chunk-K7JSQPZO.cjs.map
|
|
231
|
+
//# sourceMappingURL=chunk-K7JSQPZO.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/contracts.ts"],"names":["pepuMainnet","pepuTestnet"],"mappings":";;;;;AAwEA,IAAM,yBAAA,GACJ,oYAAA;AAOF,IAAM,wBAAA,GACJ,ufAAA;AASF,IAAM,aAAA,GACJ,+GAAA;AAGF,IAAM,sBAAA,GACJ,2MAAA;AAIF,IAAM,qBAAA,GACJ,oeAAA;AAQF,IAAM,uBAAA,GACJ,yjBAAA;AASF,IAAM,WAAA,GAAc,YAAA;AAGpB,IAAM,wBAAA,GAA2B,YAAA;AAEjC,IAAM,oBACJ,aAAA,GACA,0IAAA;AAGF,IAAM,cAAA,GACJ,iFAAA;AAEF,IAAM,kBAAA,GACJ,saAAA;AAMF,IAAM,kBAAA,GACJ,miBAAA;AAOF,IAAM,gCAAA,GACJ,+QAAA;AAIF,IAAM,yBAAA,GACJ,8PAAA;AAsBK,IAAM,aAAA,GAET;AAAA,EACF,CAACA,6BAAA,CAAY,EAAE,GAAG;AAAA,IAChB,cAAA,EAAgB;AAAA,MACd,MAAA,EAAQ,UAAA;AAAA,MACR,IAAA,EAAM,gCAAA;AAAA,MACN,OAAA,EAAS,4CAAA;AAAA,MACT,UAAA,EAAY,WAAA;AAAA,MACZ,KAAA,EAAO;AAAA,KACT;AAAA,IACA,UAAA,EAAY;AAAA,MACV,MAAA,EAAQ,UAAA;AAAA,MACR,IAAA,EAAM,YAAA;AAAA,MACN,OAAA,EAAS,4CAAA;AAAA,MACT,UAAA,EAAY,WAAA;AAAA,MACZ,KAAA,EAAO;AAAA,KACT;AAAA,IACA,OAAA,EAAS;AAAA,MACP,MAAA,EAAQ,UAAA;AAAA,MACR,IAAA,EAAM,SAAA;AAAA,MACN,OAAA,EAAS,4CAAA;AAAA,MACT,UAAA,EAAY,WAAA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,MACE,GAAA;AAAA,MACA,MAAM,CAAA,CAAE,IAAA;AAAA,MACR,MAAA,EAAQ,UAAA;AAAA,MACR,SAAS,CAAA,CAAE,OAAA;AAAA,MACX,GAAI,EAAE,UAAA,GAAa,EAAE,YAAY,CAAA,CAAE,UAAA,KAAe,EAAC;AAAA,MACnD,GAAI,CAAA,CAAE,OAAA,GAAU,EAAE,OAAA,EAAS,IAAA,KAAkB,EAAC;AAAA,MAC9C,IAAA,EAAM,EAAE,KAAA,IAAS;AAAA,KACnB,GACA,EAAE,GAAA,EAAK,IAAA,EAAM,CAAA,CAAE,MAAM,MAAA,EAAQ,SAAA,EAAW,IAAA,EAAM,CAAA,CAAE,MAAA,EAAO;AAAA,EAC7D,CAAC,CAAA;AACH;AAYO,SAAS,iBAAA,CAAkB,OAAA,GAAkBA,6BAAA,CAAY,EAAA,EAAuD;AACrH,EAAA,MAAM,MAAyD,EAAC;AAChE,EAAA,KAAA,MAAW,OAAO,gBAAA,CAAiB,OAAO,GAAG,GAAA,CAAI,GAAA,CAAI,GAAG,CAAA,GAAI,GAAA;AAC5D,EAAA,OAAO,GAAA;AACT","file":"chunk-K7JSQPZO.cjs","sourcesContent":["import type { Address } from \"viem\";\n\nimport { pepuMainnet, pepuTestnet } from \"./chains.js\";\n\n/**\n * Canonical keys for contracts tracked by this registry. Adding a new key\n * here (and a corresponding entry per chain below) is not a breaking\n * change for consumers that read the registry through {@link getContract}\n * or {@link listContracts}.\n */\nexport type PepuContractName =\n | \"create2Factory\"\n | \"multicall3\"\n | \"permit2\"\n | \"entryPoint06\"\n | \"entryPoint07\"\n | \"kernelFactory\"\n | \"kernelMetaFactory\"\n | \"ecdsaValidator\"\n | \"paymaster\"\n | \"kernelImplementation\"\n | \"kernelEcdsaSignerModule\"\n | \"kernelCallPolicyV004\"\n | \"kernelTimestampPolicy\"\n | \"tapScore\"\n | \"paymasterV1\"\n | \"paymasterV2\";\n\n/** A contract that is confirmed live on-chain at `address`. */\nexport interface DeployedContract {\n readonly status: \"deployed\";\n /** Human-readable name, for logging/UI. */\n readonly name: string;\n /** Verified contract address. */\n readonly address: Address;\n /** Optional short note, e.g. how the address was verified. */\n readonly notes?: string;\n /**\n * ISO date (YYYY-MM-DD) on which the address was last confirmed to have\n * bytecode via `eth_getCode` against the PEPU mainnet RPC. Re-run\n * `node packages/sdk/scripts/live-check.mjs` to refresh.\n */\n readonly verifiedAt?: string;\n /**\n * True when the contract still has bytecode but must not be used (for example\n * the v1 paymaster, whose EntryPoint deposit was withdrawn). Never route new\n * work to a retired contract.\n */\n readonly retired?: true;\n}\n\n/**\n * A contract that is not yet deployed on this chain. Deliberately has no\n * `address` field — callers must not be able to accidentally read a\n * placeholder value and treat it as real. Use {@link getContract} /\n * {@link isDeployed} to narrow before reading an address.\n */\nexport interface PendingContract {\n readonly status: \"pending\";\n /** Human-readable name, for logging/UI. */\n readonly name: string;\n /** Why this contract has no verified address yet. */\n readonly reason: string;\n}\n\nexport type ContractEntry = DeployedContract | PendingContract;\n\n/** Per-chain contract catalog, keyed by {@link PepuContractName}. */\nexport type PepuContractRegistry = Readonly<\n Record<PepuContractName, ContractEntry>\n>;\n\nconst MULTICALL3_PENDING_REASON =\n \"Canonical Multicall3 (0xcA11bde05977b3631167028862bE2a173976CA11) was \" +\n \"deployed elsewhere via a pre-signed CREATE transaction with a \" +\n \"1,000,000 gas limit. This Arbitrum Nitro chain needs ~14.3M gas to \" +\n \"deploy the same bytecode, so that transaction cannot execute here and \" +\n \"the canonical address is unreachable. A PEPU-specific deployment is \" +\n \"pending; do not substitute the canonical address.\";\n\nconst MULTICALL3_MAINNET_NOTES =\n \"PEPU-specific deployment. NOT at the canonical Multicall3 address, \" +\n \"which is unreachable on this Nitro chain (the canonical pre-signed \" +\n \"CREATE tx carries a 1,000,000 gas limit; this bytecode needs ~14.3M). \" +\n \"Deployed from canonical mds1/multicall3 source (solc 0.8.12, optimizer \" +\n \"10,000,000 runs) via the CREATE2 deterministic deployer with a zero \" +\n \"salt, so the same source reproduces this address on any chain that has \" +\n \"that deployer. Verified on pepuscan. viem/wagmi multicall confirmed \" +\n \"working against it.\";\n\nconst ZERODEV_NOTES =\n \"Deployed by ZeroDev's one-click Conduit Marketplace integration \" +\n \"(mainnet only — not present on testnet).\";\n\nconst PERMIT2_PENDING_REASON =\n \"Not yet deployed on this chain. The CREATE2 deterministic deployer \" +\n \"needed to reproduce Permit2's canonical address is live, so this is \" +\n \"unblocked, but no deployment has happened (and been verified) yet.\";\n\nconst PERMIT2_MAINNET_NOTES =\n \"Deployed at the canonical Permit2 address via the CREATE2 deterministic \" +\n \"deployer, same as on every other chain that has it. Verified live \" +\n \"2026-09-24 via eth_getCode (9,152 bytes, matching Permit2's known \" +\n \"bytecode size) plus a successful DOMAIN_SEPARATOR() eth_call. This is \" +\n \"the canonical Permit2 — do not confuse it with PepuSwap's own separate \" +\n \"Permit2 deployment at pepuSwapContracts.permit2NonCanonical in ./dex.js, \" +\n \"which predates this one and is not interchangeable with it.\";\n\nconst PAYMASTER_MAINNET_NOTES =\n \"Alias of `paymasterV2`: the tiered PepuSponsoredPaymasterV7 canary (0xdb28...C30D), deployed \" +\n \"around block 10537341 and funded in small tranches. Internally reviewed 3x, external audit \" +\n \"pending. Owner 0x5966dFaB11c8AEe767e0739083417D02f4a634A1, manager \" +\n \"0x063Ab6C16c38D19A4bC76E7c39A4A0A73afCaBb0. The free pool was seeded with 300 PEPU; free-tier \" +\n \"destinations are TapScore only for now. It sponsors only through the hosted policy service \" +\n \"(paymaster.pepeunchained.com) with the hosted bundler (bundler.pepeunchained.com). The v1 \" +\n \"paymaster is retired (see `paymasterV1`).\";\n\n/** Date the mainnet addresses below were last checked with eth_getCode. */\nconst VERIFIED_AT = \"2026-10-02\";\n\n/** Date the v2 paymaster canary was verified live (deployment record: deploy-receipt-v2.json). */\nconst PAYMASTER_V2_VERIFIED_AT = \"2026-10-14\";\n\nconst KERNEL_IMPL_NOTES =\n ZERODEV_NOTES +\n \" Kernel v3.1 implementation that kernelFactory.implementation() resolves to; \" +\n \"same address ZeroDev uses on every chain with this version.\";\n\nconst TAPSCORE_NOTES =\n \"TapScore demo contract used by the game-app template. Verified via eth_getCode.\";\n\nconst PAYMASTER_V1_NOTES =\n \"RETIRED. The project's first verifying paymaster (PepuVerifyingPaymasterV7). Its EntryPoint \" +\n \"deposit was withdrawn (deposit is 0), so it cannot sponsor anything. The contract still has \" +\n \"bytecode; do not deposit to it or route new work to it. Superseded by `paymasterV2`. A real \" +\n \"sponsored operation ran through the hosted URLs on v1 before retirement (tx \" +\n \"0x57cf2f5a332248476d775c096b4b8339d81867c14211ed3bc4fcb1895dff0f9f).\";\n\nconst PAYMASTER_V2_NOTES =\n \"PepuSponsoredPaymasterV7 (v2), deployed on PEPU mainnet as a canary around block 10537341: \" +\n \"internally reviewed 3x, external audit pending, funded in small tranches. Owner \" +\n \"0x5966dFaB11c8AEe767e0739083417D02f4a634A1, manager 0x063Ab6C16c38D19A4bC76E7c39A4A0A73afCaBb0. \" +\n \"Free pool seeded with 300 PEPU; free-tier destinations are TapScore only for now. Free tier per \" +\n \"user is 100 PEPU/day and 50 PEPU/hour, enforced by the policy service; beyond that a dApp \" +\n \"deposits into its own project. Record: services/paymaster/contracts/deployed-address-v2.txt.\";\n\nconst PAYMASTER_TESTNET_PENDING_REASON =\n \"No paymaster (or any other ERC-4337 infrastructure) has been deployed to testnet — see \" +\n \"TESTNET_AA_PENDING_REASON. The mainnet paymaster is a project-specific deployment, not \" +\n \"something that would appear on testnet by default even once the rest of the AA stack does.\";\n\nconst TESTNET_AA_PENDING_REASON =\n \"Account-abstraction contracts were deployed on mainnet (97741) only, \" +\n \"via ZeroDev's Conduit Marketplace integration. Nothing has been \" +\n \"deployed to testnet, and testnet is currently out of scope (no faucet \" +\n \"exists, so it cannot be funded without bridging).\";\n\n/**\n * Contract registry, keyed by chain id. Tracked as independent per-chain\n * entries because deployments happen per-chain and have already diverged:\n * mainnet has the CREATE2 deployer, a PEPU-specific Multicall3, the\n * canonical Permit2, the full ZeroDev Kernel v3 AA stack (EntryPoint\n * v0.6/v0.7, Kernel factory/meta-factory, ECDSA validator), and a\n * project-deployed, funded verifying paymaster. Testnet has only the\n * CREATE2 deployer — everything else is `status: \"pending\"` because\n * testnet is out of scope for this package (no faucet exists to fund\n * verification there).\n *\n * Note on the paymaster specifically: `status: \"deployed\"` here means the\n * contract has live bytecode and a real EntryPoint deposit — it does NOT\n * mean gas sponsorship is usable by an application. See\n * `getSponsorshipStatus` in `./aa/status.js`, which is the single source of\n * truth for that separate question.\n */\nexport const pepuContracts: Readonly<\n Record<number, PepuContractRegistry>\n> = {\n [pepuMainnet.id]: {\n create2Factory: {\n status: \"deployed\",\n name: \"CREATE2 Deterministic Deployer\",\n address: \"0x4e59b44847b379578588920cA78FbF26c0B4956C\",\n verifiedAt: VERIFIED_AT,\n notes: \"Standard Nick's-method deterministic deployer.\",\n },\n multicall3: {\n status: \"deployed\",\n name: \"Multicall3\",\n address: \"0x9CE19273Ae9c24437DFF512E8DFCAed4E4B001bd\",\n verifiedAt: VERIFIED_AT,\n notes: MULTICALL3_MAINNET_NOTES,\n },\n permit2: {\n status: \"deployed\",\n name: \"Permit2\",\n address: \"0x000000000022D473030F116dDEE9F6B43aC78BA3\",\n verifiedAt: VERIFIED_AT,\n notes: PERMIT2_MAINNET_NOTES,\n },\n entryPoint06: {\n status: \"deployed\",\n name: \"ERC-4337 EntryPoint v0.6\",\n address: \"0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789\",\n verifiedAt: VERIFIED_AT,\n notes: ZERODEV_NOTES + \" At the canonical v0.6 address.\",\n },\n entryPoint07: {\n status: \"deployed\",\n name: \"ERC-4337 EntryPoint v0.7\",\n address: \"0x0000000071727De22E5E9d8BAf0edAc6f37da032\",\n verifiedAt: VERIFIED_AT,\n notes:\n ZERODEV_NOTES +\n \" At the canonical v0.7 address; getNonce/balanceOf confirmed live.\",\n },\n kernelFactory: {\n status: \"deployed\",\n name: \"Kernel v3 Account Factory\",\n address: \"0xaac5D4240AF87249B3f71BC8E4A2cae074A3E419\",\n verifiedAt: VERIFIED_AT,\n notes: ZERODEV_NOTES,\n },\n kernelMetaFactory: {\n status: \"deployed\",\n name: \"Kernel MetaFactory\",\n address: \"0xd703aaE79538628d27099B8c4f621bE4CCd142d5\",\n verifiedAt: VERIFIED_AT,\n notes: ZERODEV_NOTES,\n },\n ecdsaValidator: {\n status: \"deployed\",\n name: \"Kernel ECDSA Validator\",\n address: \"0x845ADb2C711129d4f3966735eD98a9F09fC4cE57\",\n verifiedAt: VERIFIED_AT,\n notes: ZERODEV_NOTES,\n },\n paymaster: {\n status: \"deployed\",\n name: \"Sponsored Paymaster v2 (PepuSponsoredPaymasterV7, alias of paymasterV2)\",\n address: \"0xdb28528C9399C33c9A0297E8A62F39145acbC30D\",\n verifiedAt: PAYMASTER_V2_VERIFIED_AT,\n notes: PAYMASTER_MAINNET_NOTES,\n },\n kernelImplementation: {\n status: \"deployed\",\n name: \"Kernel v3.1 Implementation\",\n address: \"0xbAC849bB641841b44E965fb01A4Bf5F074F84B4d\",\n verifiedAt: VERIFIED_AT,\n notes: KERNEL_IMPL_NOTES,\n },\n kernelEcdsaSignerModule: {\n status: \"deployed\",\n name: \"Kernel ECDSA Signer (permission signer module)\",\n address: \"0x6A6F069E2a08c2468e7724Ab3250CdBFBA14D4FF\",\n verifiedAt: VERIFIED_AT,\n notes: ZERODEV_NOTES + \" Used as the signer in permission-validator session keys.\",\n },\n kernelCallPolicyV004: {\n status: \"deployed\",\n name: \"ZeroDev Call Policy v0.0.4\",\n address: \"0x9a52283276A0ec8740DF50bF01B28A80D880eaf2\",\n verifiedAt: VERIFIED_AT,\n notes: ZERODEV_NOTES + \" Scopes a session key to specific targets and selectors.\",\n },\n kernelTimestampPolicy: {\n status: \"deployed\",\n name: \"ZeroDev Timestamp Policy\",\n address: \"0xB9f8f524bE6EcD8C945b1b87f9ae5C192FdCE20F\",\n verifiedAt: VERIFIED_AT,\n notes: ZERODEV_NOTES + \" Bounds a session key to a validity window.\",\n },\n tapScore: {\n status: \"deployed\",\n name: \"TapScore\",\n address: \"0x261eA5971B93237a56990206A46Bc80318e4d078\",\n verifiedAt: VERIFIED_AT,\n notes: TAPSCORE_NOTES,\n },\n paymasterV1: {\n status: \"deployed\",\n name: \"Verifying Paymaster v1 (PepuVerifyingPaymasterV7) - RETIRED\",\n address: \"0x2B6FED323bFA24f0475f4e1Dd3C7F6Cc1f3ae8B0\",\n verifiedAt: VERIFIED_AT,\n retired: true,\n notes: PAYMASTER_V1_NOTES,\n },\n paymasterV2: {\n status: \"deployed\",\n name: \"Sponsored Paymaster v2 (PepuSponsoredPaymasterV7), canary\",\n address: \"0xdb28528C9399C33c9A0297E8A62F39145acbC30D\",\n verifiedAt: PAYMASTER_V2_VERIFIED_AT,\n notes: PAYMASTER_V2_NOTES,\n },\n },\n [pepuTestnet.id]: {\n create2Factory: {\n status: \"deployed\",\n name: \"CREATE2 Deterministic Deployer\",\n address: \"0x4e59b44847b379578588920cA78FbF26c0B4956C\",\n notes: \"Standard Nick's-method deterministic deployer.\",\n },\n multicall3: {\n status: \"pending\",\n name: \"Multicall3\",\n reason: MULTICALL3_PENDING_REASON,\n },\n permit2: {\n status: \"pending\",\n name: \"Permit2\",\n reason: PERMIT2_PENDING_REASON,\n },\n entryPoint06: {\n status: \"pending\",\n name: \"ERC-4337 EntryPoint v0.6\",\n reason: TESTNET_AA_PENDING_REASON,\n },\n entryPoint07: {\n status: \"pending\",\n name: \"ERC-4337 EntryPoint v0.7\",\n reason: TESTNET_AA_PENDING_REASON,\n },\n kernelFactory: {\n status: \"pending\",\n name: \"Kernel v3 Account Factory\",\n reason: TESTNET_AA_PENDING_REASON,\n },\n kernelMetaFactory: {\n status: \"pending\",\n name: \"Kernel MetaFactory\",\n reason: TESTNET_AA_PENDING_REASON,\n },\n ecdsaValidator: {\n status: \"pending\",\n name: \"Kernel ECDSA Validator\",\n reason: TESTNET_AA_PENDING_REASON,\n },\n paymaster: {\n status: \"pending\",\n name: \"Verifying Paymaster (PepuVerifyingPaymasterV7)\",\n reason: PAYMASTER_TESTNET_PENDING_REASON,\n },\n kernelImplementation: { status: \"pending\", name: \"Kernel v3.1 Implementation\", reason: TESTNET_AA_PENDING_REASON },\n kernelEcdsaSignerModule: { status: \"pending\", name: \"Kernel ECDSA Signer (permission signer module)\", reason: TESTNET_AA_PENDING_REASON },\n kernelCallPolicyV004: { status: \"pending\", name: \"ZeroDev Call Policy v0.0.4\", reason: TESTNET_AA_PENDING_REASON },\n kernelTimestampPolicy: { status: \"pending\", name: \"ZeroDev Timestamp Policy\", reason: TESTNET_AA_PENDING_REASON },\n tapScore: { status: \"pending\", name: \"TapScore\", reason: \"Deployed on mainnet only.\" },\n paymasterV1: { status: \"pending\", name: \"Verifying Paymaster v1 (PepuVerifyingPaymasterV7)\", reason: PAYMASTER_TESTNET_PENDING_REASON },\n paymasterV2: { status: \"pending\", name: \"Verifying Paymaster v2\", reason: PAYMASTER_TESTNET_PENDING_REASON },\n },\n};\n\n/** Look up one contract entry for a chain id. Returns `undefined` if the chain isn't in the registry. */\nexport function getContract(\n chainId: number,\n name: PepuContractName,\n): ContractEntry | undefined {\n return pepuContracts[chainId]?.[name];\n}\n\n/** List all tracked contract entries for a chain id, in registry order. */\nexport function listContracts(\n chainId: number,\n): readonly ContractEntry[] {\n const registry = pepuContracts[chainId];\n return registry ? Object.values(registry) : [];\n}\n\n/** Narrow a {@link ContractEntry} to {@link DeployedContract}. */\nexport function isDeployed(\n entry: ContractEntry | undefined,\n): entry is DeployedContract {\n return entry?.status === \"deployed\";\n}\n\n/** One row of the address table returned by {@link getPepuAddresses}. */\nexport interface PepuAddressRow {\n readonly key: PepuContractName;\n readonly name: string;\n readonly status: \"deployed\" | \"pending\";\n /** Present only when `status` is `\"deployed\"`. */\n readonly address?: Address;\n /** ISO date of the last `eth_getCode` check, when known. */\n readonly verifiedAt?: string;\n /** True for a deployed contract that is retired and must not be used (the v1 paymaster). */\n readonly retired?: true;\n /** Notes (deployed) or reason (pending). */\n readonly note: string;\n}\n\n/**\n * The full supporting-contract table for a chain, flattened for docs and\n * MCP rendering. **Returns an ARRAY of rows** (one {@link PepuAddressRow} per\n * contract, each carrying its own `key`), not an object keyed by contract name:\n * `getPepuAddresses().paymaster` is `undefined`. To look one contract up by name use\n * {@link getContract}, or {@link getPepuAddressMap} for the same rows keyed by name.\n * Pending entries carry no `address`.\n *\n * @example\n * ```ts\n * const rows = getPepuAddresses(); // PepuAddressRow[], mainnet by default\n * const live = rows.filter((r) => r.status === \"deployed\");\n * const paymaster = rows.find((r) => r.key === \"paymaster\");\n * ```\n */\nexport function getPepuAddresses(chainId: number = pepuMainnet.id): readonly PepuAddressRow[] {\n const registry = pepuContracts[chainId];\n if (!registry) return [];\n return (Object.keys(registry) as PepuContractName[]).map((key): PepuAddressRow => {\n const e = registry[key];\n return e.status === \"deployed\"\n ? {\n key,\n name: e.name,\n status: \"deployed\",\n address: e.address,\n ...(e.verifiedAt ? { verifiedAt: e.verifiedAt } : {}),\n ...(e.retired ? { retired: true as const } : {}),\n note: e.notes ?? \"\",\n }\n : { key, name: e.name, status: \"pending\", note: e.reason };\n });\n}\n\n/**\n * The same rows as {@link getPepuAddresses}, keyed by contract name instead of\n * returned as an array. An unknown chain yields an empty object.\n *\n * @example\n * ```ts\n * const map = getPepuAddressMap();\n * map.paymaster?.address; // Address | undefined\n * ```\n */\nexport function getPepuAddressMap(chainId: number = pepuMainnet.id): Partial<Record<PepuContractName, PepuAddressRow>> {\n const out: Partial<Record<PepuContractName, PepuAddressRow>> = {};\n for (const row of getPepuAddresses(chainId)) out[row.key] = row;\n return out;\n}\n"]}
|
|
@@ -213,7 +213,12 @@ function getPepuAddresses(chainId = pepuMainnet.id) {
|
|
|
213
213
|
} : { key, name: e.name, status: "pending", note: e.reason };
|
|
214
214
|
});
|
|
215
215
|
}
|
|
216
|
+
function getPepuAddressMap(chainId = pepuMainnet.id) {
|
|
217
|
+
const out = {};
|
|
218
|
+
for (const row of getPepuAddresses(chainId)) out[row.key] = row;
|
|
219
|
+
return out;
|
|
220
|
+
}
|
|
216
221
|
|
|
217
|
-
export { getContract, getPepuAddresses, isDeployed, listContracts, pepuContracts };
|
|
218
|
-
//# sourceMappingURL=chunk-
|
|
219
|
-
//# sourceMappingURL=chunk-
|
|
222
|
+
export { getContract, getPepuAddressMap, getPepuAddresses, isDeployed, listContracts, pepuContracts };
|
|
223
|
+
//# sourceMappingURL=chunk-KJYNF5KH.js.map
|
|
224
|
+
//# sourceMappingURL=chunk-KJYNF5KH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/contracts.ts"],"names":[],"mappings":";;;AAwEA,IAAM,yBAAA,GACJ,oYAAA;AAOF,IAAM,wBAAA,GACJ,ufAAA;AASF,IAAM,aAAA,GACJ,+GAAA;AAGF,IAAM,sBAAA,GACJ,2MAAA;AAIF,IAAM,qBAAA,GACJ,oeAAA;AAQF,IAAM,uBAAA,GACJ,yjBAAA;AASF,IAAM,WAAA,GAAc,YAAA;AAGpB,IAAM,wBAAA,GAA2B,YAAA;AAEjC,IAAM,oBACJ,aAAA,GACA,0IAAA;AAGF,IAAM,cAAA,GACJ,iFAAA;AAEF,IAAM,kBAAA,GACJ,saAAA;AAMF,IAAM,kBAAA,GACJ,miBAAA;AAOF,IAAM,gCAAA,GACJ,+QAAA;AAIF,IAAM,yBAAA,GACJ,8PAAA;AAsBK,IAAM,aAAA,GAET;AAAA,EACF,CAAC,WAAA,CAAY,EAAE,GAAG;AAAA,IAChB,cAAA,EAAgB;AAAA,MACd,MAAA,EAAQ,UAAA;AAAA,MACR,IAAA,EAAM,gCAAA;AAAA,MACN,OAAA,EAAS,4CAAA;AAAA,MACT,UAAA,EAAY,WAAA;AAAA,MACZ,KAAA,EAAO;AAAA,KACT;AAAA,IACA,UAAA,EAAY;AAAA,MACV,MAAA,EAAQ,UAAA;AAAA,MACR,IAAA,EAAM,YAAA;AAAA,MACN,OAAA,EAAS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EAAU,OAAO,EAAC;AACvB,EAAA,OAAQ,OAAO,IAAA,CAAK,QAAQ,CAAA,CAAyB,GAAA,CAAI,CAAC,GAAA,KAAwB;AAChF,IAAA,MAAM,CAAA,GAAI,SAAS,GAAG,CAAA;AACtB,IAAA,OAAO,CAAA,CAAE,WAAW,UAAA,GAChB;AAAA,MACE,GAAA;AAAA,MACA,MAAM,CAAA,CAAE,IAAA;AAAA,MACR,MAAA,EAAQ,UAAA;AAAA,MACR,SAAS,CAAA,CAAE,OAAA;AAAA,MACX,GAAI,EAAE,UAAA,GAAa,EAAE,YAAY,CAAA,CAAE,UAAA,KAAe,EAAC;AAAA,MACnD,GAAI,CAAA,CAAE,OAAA,GAAU,EAAE,OAAA,EAAS,IAAA,KAAkB,EAAC;AAAA,MAC9C,IAAA,EAAM,EAAE,KAAA,IAAS;AAAA,KACnB,GACA,EAAE,GAAA,EAAK,IAAA,EAAM,CAAA,CAAE,MAAM,MAAA,EAAQ,SAAA,EAAW,IAAA,EAAM,CAAA,CAAE,MAAA,EAAO;AAAA,EAC7D,CAAC,CAAA;AACH;AAYO,SAAS,iBAAA,CAAkB,OAAA,GAAkB,WAAA,CAAY,EAAA,EAAuD;AACrH,EAAA,MAAM,MAAyD,EAAC;AAChE,EAAA,KAAA,MAAW,OAAO,gBAAA,CAAiB,OAAO,GAAG,GAAA,CAAI,GAAA,CAAI,GAAG,CAAA,GAAI,GAAA;AAC5D,EAAA,OAAO,GAAA;AACT","file":"chunk-KJYNF5KH.js","sourcesContent":["import type { Address } from \"viem\";\n\nimport { pepuMainnet, pepuTestnet } from \"./chains.js\";\n\n/**\n * Canonical keys for contracts tracked by this registry. Adding a new key\n * here (and a corresponding entry per chain below) is not a breaking\n * change for consumers that read the registry through {@link getContract}\n * or {@link listContracts}.\n */\nexport type PepuContractName =\n | \"create2Factory\"\n | \"multicall3\"\n | \"permit2\"\n | \"entryPoint06\"\n | \"entryPoint07\"\n | \"kernelFactory\"\n | \"kernelMetaFactory\"\n | \"ecdsaValidator\"\n | \"paymaster\"\n | \"kernelImplementation\"\n | \"kernelEcdsaSignerModule\"\n | \"kernelCallPolicyV004\"\n | \"kernelTimestampPolicy\"\n | \"tapScore\"\n | \"paymasterV1\"\n | \"paymasterV2\";\n\n/** A contract that is confirmed live on-chain at `address`. */\nexport interface DeployedContract {\n readonly status: \"deployed\";\n /** Human-readable name, for logging/UI. */\n readonly name: string;\n /** Verified contract address. */\n readonly address: Address;\n /** Optional short note, e.g. how the address was verified. */\n readonly notes?: string;\n /**\n * ISO date (YYYY-MM-DD) on which the address was last confirmed to have\n * bytecode via `eth_getCode` against the PEPU mainnet RPC. Re-run\n * `node packages/sdk/scripts/live-check.mjs` to refresh.\n */\n readonly verifiedAt?: string;\n /**\n * True when the contract still has bytecode but must not be used (for example\n * the v1 paymaster, whose EntryPoint deposit was withdrawn). Never route new\n * work to a retired contract.\n */\n readonly retired?: true;\n}\n\n/**\n * A contract that is not yet deployed on this chain. Deliberately has no\n * `address` field — callers must not be able to accidentally read a\n * placeholder value and treat it as real. Use {@link getContract} /\n * {@link isDeployed} to narrow before reading an address.\n */\nexport interface PendingContract {\n readonly status: \"pending\";\n /** Human-readable name, for logging/UI. */\n readonly name: string;\n /** Why this contract has no verified address yet. */\n readonly reason: string;\n}\n\nexport type ContractEntry = DeployedContract | PendingContract;\n\n/** Per-chain contract catalog, keyed by {@link PepuContractName}. */\nexport type PepuContractRegistry = Readonly<\n Record<PepuContractName, ContractEntry>\n>;\n\nconst MULTICALL3_PENDING_REASON =\n \"Canonical Multicall3 (0xcA11bde05977b3631167028862bE2a173976CA11) was \" +\n \"deployed elsewhere via a pre-signed CREATE transaction with a \" +\n \"1,000,000 gas limit. This Arbitrum Nitro chain needs ~14.3M gas to \" +\n \"deploy the same bytecode, so that transaction cannot execute here and \" +\n \"the canonical address is unreachable. A PEPU-specific deployment is \" +\n \"pending; do not substitute the canonical address.\";\n\nconst MULTICALL3_MAINNET_NOTES =\n \"PEPU-specific deployment. NOT at the canonical Multicall3 address, \" +\n \"which is unreachable on this Nitro chain (the canonical pre-signed \" +\n \"CREATE tx carries a 1,000,000 gas limit; this bytecode needs ~14.3M). \" +\n \"Deployed from canonical mds1/multicall3 source (solc 0.8.12, optimizer \" +\n \"10,000,000 runs) via the CREATE2 deterministic deployer with a zero \" +\n \"salt, so the same source reproduces this address on any chain that has \" +\n \"that deployer. Verified on pepuscan. viem/wagmi multicall confirmed \" +\n \"working against it.\";\n\nconst ZERODEV_NOTES =\n \"Deployed by ZeroDev's one-click Conduit Marketplace integration \" +\n \"(mainnet only — not present on testnet).\";\n\nconst PERMIT2_PENDING_REASON =\n \"Not yet deployed on this chain. The CREATE2 deterministic deployer \" +\n \"needed to reproduce Permit2's canonical address is live, so this is \" +\n \"unblocked, but no deployment has happened (and been verified) yet.\";\n\nconst PERMIT2_MAINNET_NOTES =\n \"Deployed at the canonical Permit2 address via the CREATE2 deterministic \" +\n \"deployer, same as on every other chain that has it. Verified live \" +\n \"2026-09-24 via eth_getCode (9,152 bytes, matching Permit2's known \" +\n \"bytecode size) plus a successful DOMAIN_SEPARATOR() eth_call. This is \" +\n \"the canonical Permit2 — do not confuse it with PepuSwap's own separate \" +\n \"Permit2 deployment at pepuSwapContracts.permit2NonCanonical in ./dex.js, \" +\n \"which predates this one and is not interchangeable with it.\";\n\nconst PAYMASTER_MAINNET_NOTES =\n \"Alias of `paymasterV2`: the tiered PepuSponsoredPaymasterV7 canary (0xdb28...C30D), deployed \" +\n \"around block 10537341 and funded in small tranches. Internally reviewed 3x, external audit \" +\n \"pending. Owner 0x5966dFaB11c8AEe767e0739083417D02f4a634A1, manager \" +\n \"0x063Ab6C16c38D19A4bC76E7c39A4A0A73afCaBb0. The free pool was seeded with 300 PEPU; free-tier \" +\n \"destinations are TapScore only for now. It sponsors only through the hosted policy service \" +\n \"(paymaster.pepeunchained.com) with the hosted bundler (bundler.pepeunchained.com). The v1 \" +\n \"paymaster is retired (see `paymasterV1`).\";\n\n/** Date the mainnet addresses below were last checked with eth_getCode. */\nconst VERIFIED_AT = \"2026-10-02\";\n\n/** Date the v2 paymaster canary was verified live (deployment record: deploy-receipt-v2.json). */\nconst PAYMASTER_V2_VERIFIED_AT = \"2026-10-14\";\n\nconst KERNEL_IMPL_NOTES =\n ZERODEV_NOTES +\n \" Kernel v3.1 implementation that kernelFactory.implementation() resolves to; \" +\n \"same address ZeroDev uses on every chain with this version.\";\n\nconst TAPSCORE_NOTES =\n \"TapScore demo contract used by the game-app template. Verified via eth_getCode.\";\n\nconst PAYMASTER_V1_NOTES =\n \"RETIRED. The project's first verifying paymaster (PepuVerifyingPaymasterV7). Its EntryPoint \" +\n \"deposit was withdrawn (deposit is 0), so it cannot sponsor anything. The contract still has \" +\n \"bytecode; do not deposit to it or route new work to it. Superseded by `paymasterV2`. A real \" +\n \"sponsored operation ran through the hosted URLs on v1 before retirement (tx \" +\n \"0x57cf2f5a332248476d775c096b4b8339d81867c14211ed3bc4fcb1895dff0f9f).\";\n\nconst PAYMASTER_V2_NOTES =\n \"PepuSponsoredPaymasterV7 (v2), deployed on PEPU mainnet as a canary around block 10537341: \" +\n \"internally reviewed 3x, external audit pending, funded in small tranches. Owner \" +\n \"0x5966dFaB11c8AEe767e0739083417D02f4a634A1, manager 0x063Ab6C16c38D19A4bC76E7c39A4A0A73afCaBb0. \" +\n \"Free pool seeded with 300 PEPU; free-tier destinations are TapScore only for now. Free tier per \" +\n \"user is 100 PEPU/day and 50 PEPU/hour, enforced by the policy service; beyond that a dApp \" +\n \"deposits into its own project. Record: services/paymaster/contracts/deployed-address-v2.txt.\";\n\nconst PAYMASTER_TESTNET_PENDING_REASON =\n \"No paymaster (or any other ERC-4337 infrastructure) has been deployed to testnet — see \" +\n \"TESTNET_AA_PENDING_REASON. The mainnet paymaster is a project-specific deployment, not \" +\n \"something that would appear on testnet by default even once the rest of the AA stack does.\";\n\nconst TESTNET_AA_PENDING_REASON =\n \"Account-abstraction contracts were deployed on mainnet (97741) only, \" +\n \"via ZeroDev's Conduit Marketplace integration. Nothing has been \" +\n \"deployed to testnet, and testnet is currently out of scope (no faucet \" +\n \"exists, so it cannot be funded without bridging).\";\n\n/**\n * Contract registry, keyed by chain id. Tracked as independent per-chain\n * entries because deployments happen per-chain and have already diverged:\n * mainnet has the CREATE2 deployer, a PEPU-specific Multicall3, the\n * canonical Permit2, the full ZeroDev Kernel v3 AA stack (EntryPoint\n * v0.6/v0.7, Kernel factory/meta-factory, ECDSA validator), and a\n * project-deployed, funded verifying paymaster. Testnet has only the\n * CREATE2 deployer — everything else is `status: \"pending\"` because\n * testnet is out of scope for this package (no faucet exists to fund\n * verification there).\n *\n * Note on the paymaster specifically: `status: \"deployed\"` here means the\n * contract has live bytecode and a real EntryPoint deposit — it does NOT\n * mean gas sponsorship is usable by an application. See\n * `getSponsorshipStatus` in `./aa/status.js`, which is the single source of\n * truth for that separate question.\n */\nexport const pepuContracts: Readonly<\n Record<number, PepuContractRegistry>\n> = {\n [pepuMainnet.id]: {\n create2Factory: {\n status: \"deployed\",\n name: \"CREATE2 Deterministic Deployer\",\n address: \"0x4e59b44847b379578588920cA78FbF26c0B4956C\",\n verifiedAt: VERIFIED_AT,\n notes: \"Standard Nick's-method deterministic deployer.\",\n },\n multicall3: {\n status: \"deployed\",\n name: \"Multicall3\",\n address: \"0x9CE19273Ae9c24437DFF512E8DFCAed4E4B001bd\",\n verifiedAt: VERIFIED_AT,\n notes: MULTICALL3_MAINNET_NOTES,\n },\n permit2: {\n status: \"deployed\",\n name: \"Permit2\",\n address: \"0x000000000022D473030F116dDEE9F6B43aC78BA3\",\n verifiedAt: VERIFIED_AT,\n notes: PERMIT2_MAINNET_NOTES,\n },\n entryPoint06: {\n status: \"deployed\",\n name: \"ERC-4337 EntryPoint v0.6\",\n address: \"0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789\",\n verifiedAt: VERIFIED_AT,\n notes: ZERODEV_NOTES + \" At the canonical v0.6 address.\",\n },\n entryPoint07: {\n status: \"deployed\",\n name: \"ERC-4337 EntryPoint v0.7\",\n address: \"0x0000000071727De22E5E9d8BAf0edAc6f37da032\",\n verifiedAt: VERIFIED_AT,\n notes:\n ZERODEV_NOTES +\n \" At the canonical v0.7 address; getNonce/balanceOf confirmed live.\",\n },\n kernelFactory: {\n status: \"deployed\",\n name: \"Kernel v3 Account Factory\",\n address: \"0xaac5D4240AF87249B3f71BC8E4A2cae074A3E419\",\n verifiedAt: VERIFIED_AT,\n notes: ZERODEV_NOTES,\n },\n kernelMetaFactory: {\n status: \"deployed\",\n name: \"Kernel MetaFactory\",\n address: \"0xd703aaE79538628d27099B8c4f621bE4CCd142d5\",\n verifiedAt: VERIFIED_AT,\n notes: ZERODEV_NOTES,\n },\n ecdsaValidator: {\n status: \"deployed\",\n name: \"Kernel ECDSA Validator\",\n address: \"0x845ADb2C711129d4f3966735eD98a9F09fC4cE57\",\n verifiedAt: VERIFIED_AT,\n notes: ZERODEV_NOTES,\n },\n paymaster: {\n status: \"deployed\",\n name: \"Sponsored Paymaster v2 (PepuSponsoredPaymasterV7, alias of paymasterV2)\",\n address: \"0xdb28528C9399C33c9A0297E8A62F39145acbC30D\",\n verifiedAt: PAYMASTER_V2_VERIFIED_AT,\n notes: PAYMASTER_MAINNET_NOTES,\n },\n kernelImplementation: {\n status: \"deployed\",\n name: \"Kernel v3.1 Implementation\",\n address: \"0xbAC849bB641841b44E965fb01A4Bf5F074F84B4d\",\n verifiedAt: VERIFIED_AT,\n notes: KERNEL_IMPL_NOTES,\n },\n kernelEcdsaSignerModule: {\n status: \"deployed\",\n name: \"Kernel ECDSA Signer (permission signer module)\",\n address: \"0x6A6F069E2a08c2468e7724Ab3250CdBFBA14D4FF\",\n verifiedAt: VERIFIED_AT,\n notes: ZERODEV_NOTES + \" Used as the signer in permission-validator session keys.\",\n },\n kernelCallPolicyV004: {\n status: \"deployed\",\n name: \"ZeroDev Call Policy v0.0.4\",\n address: \"0x9a52283276A0ec8740DF50bF01B28A80D880eaf2\",\n verifiedAt: VERIFIED_AT,\n notes: ZERODEV_NOTES + \" Scopes a session key to specific targets and selectors.\",\n },\n kernelTimestampPolicy: {\n status: \"deployed\",\n name: \"ZeroDev Timestamp Policy\",\n address: \"0xB9f8f524bE6EcD8C945b1b87f9ae5C192FdCE20F\",\n verifiedAt: VERIFIED_AT,\n notes: ZERODEV_NOTES + \" Bounds a session key to a validity window.\",\n },\n tapScore: {\n status: \"deployed\",\n name: \"TapScore\",\n address: \"0x261eA5971B93237a56990206A46Bc80318e4d078\",\n verifiedAt: VERIFIED_AT,\n notes: TAPSCORE_NOTES,\n },\n paymasterV1: {\n status: \"deployed\",\n name: \"Verifying Paymaster v1 (PepuVerifyingPaymasterV7) - RETIRED\",\n address: \"0x2B6FED323bFA24f0475f4e1Dd3C7F6Cc1f3ae8B0\",\n verifiedAt: VERIFIED_AT,\n retired: true,\n notes: PAYMASTER_V1_NOTES,\n },\n paymasterV2: {\n status: \"deployed\",\n name: \"Sponsored Paymaster v2 (PepuSponsoredPaymasterV7), canary\",\n address: \"0xdb28528C9399C33c9A0297E8A62F39145acbC30D\",\n verifiedAt: PAYMASTER_V2_VERIFIED_AT,\n notes: PAYMASTER_V2_NOTES,\n },\n },\n [pepuTestnet.id]: {\n create2Factory: {\n status: \"deployed\",\n name: \"CREATE2 Deterministic Deployer\",\n address: \"0x4e59b44847b379578588920cA78FbF26c0B4956C\",\n notes: \"Standard Nick's-method deterministic deployer.\",\n },\n multicall3: {\n status: \"pending\",\n name: \"Multicall3\",\n reason: MULTICALL3_PENDING_REASON,\n },\n permit2: {\n status: \"pending\",\n name: \"Permit2\",\n reason: PERMIT2_PENDING_REASON,\n },\n entryPoint06: {\n status: \"pending\",\n name: \"ERC-4337 EntryPoint v0.6\",\n reason: TESTNET_AA_PENDING_REASON,\n },\n entryPoint07: {\n status: \"pending\",\n name: \"ERC-4337 EntryPoint v0.7\",\n reason: TESTNET_AA_PENDING_REASON,\n },\n kernelFactory: {\n status: \"pending\",\n name: \"Kernel v3 Account Factory\",\n reason: TESTNET_AA_PENDING_REASON,\n },\n kernelMetaFactory: {\n status: \"pending\",\n name: \"Kernel MetaFactory\",\n reason: TESTNET_AA_PENDING_REASON,\n },\n ecdsaValidator: {\n status: \"pending\",\n name: \"Kernel ECDSA Validator\",\n reason: TESTNET_AA_PENDING_REASON,\n },\n paymaster: {\n status: \"pending\",\n name: \"Verifying Paymaster (PepuVerifyingPaymasterV7)\",\n reason: PAYMASTER_TESTNET_PENDING_REASON,\n },\n kernelImplementation: { status: \"pending\", name: \"Kernel v3.1 Implementation\", reason: TESTNET_AA_PENDING_REASON },\n kernelEcdsaSignerModule: { status: \"pending\", name: \"Kernel ECDSA Signer (permission signer module)\", reason: TESTNET_AA_PENDING_REASON },\n kernelCallPolicyV004: { status: \"pending\", name: \"ZeroDev Call Policy v0.0.4\", reason: TESTNET_AA_PENDING_REASON },\n kernelTimestampPolicy: { status: \"pending\", name: \"ZeroDev Timestamp Policy\", reason: TESTNET_AA_PENDING_REASON },\n tapScore: { status: \"pending\", name: \"TapScore\", reason: \"Deployed on mainnet only.\" },\n paymasterV1: { status: \"pending\", name: \"Verifying Paymaster v1 (PepuVerifyingPaymasterV7)\", reason: PAYMASTER_TESTNET_PENDING_REASON },\n paymasterV2: { status: \"pending\", name: \"Verifying Paymaster v2\", reason: PAYMASTER_TESTNET_PENDING_REASON },\n },\n};\n\n/** Look up one contract entry for a chain id. Returns `undefined` if the chain isn't in the registry. */\nexport function getContract(\n chainId: number,\n name: PepuContractName,\n): ContractEntry | undefined {\n return pepuContracts[chainId]?.[name];\n}\n\n/** List all tracked contract entries for a chain id, in registry order. */\nexport function listContracts(\n chainId: number,\n): readonly ContractEntry[] {\n const registry = pepuContracts[chainId];\n return registry ? Object.values(registry) : [];\n}\n\n/** Narrow a {@link ContractEntry} to {@link DeployedContract}. */\nexport function isDeployed(\n entry: ContractEntry | undefined,\n): entry is DeployedContract {\n return entry?.status === \"deployed\";\n}\n\n/** One row of the address table returned by {@link getPepuAddresses}. */\nexport interface PepuAddressRow {\n readonly key: PepuContractName;\n readonly name: string;\n readonly status: \"deployed\" | \"pending\";\n /** Present only when `status` is `\"deployed\"`. */\n readonly address?: Address;\n /** ISO date of the last `eth_getCode` check, when known. */\n readonly verifiedAt?: string;\n /** True for a deployed contract that is retired and must not be used (the v1 paymaster). */\n readonly retired?: true;\n /** Notes (deployed) or reason (pending). */\n readonly note: string;\n}\n\n/**\n * The full supporting-contract table for a chain, flattened for docs and\n * MCP rendering. **Returns an ARRAY of rows** (one {@link PepuAddressRow} per\n * contract, each carrying its own `key`), not an object keyed by contract name:\n * `getPepuAddresses().paymaster` is `undefined`. To look one contract up by name use\n * {@link getContract}, or {@link getPepuAddressMap} for the same rows keyed by name.\n * Pending entries carry no `address`.\n *\n * @example\n * ```ts\n * const rows = getPepuAddresses(); // PepuAddressRow[], mainnet by default\n * const live = rows.filter((r) => r.status === \"deployed\");\n * const paymaster = rows.find((r) => r.key === \"paymaster\");\n * ```\n */\nexport function getPepuAddresses(chainId: number = pepuMainnet.id): readonly PepuAddressRow[] {\n const registry = pepuContracts[chainId];\n if (!registry) return [];\n return (Object.keys(registry) as PepuContractName[]).map((key): PepuAddressRow => {\n const e = registry[key];\n return e.status === \"deployed\"\n ? {\n key,\n name: e.name,\n status: \"deployed\",\n address: e.address,\n ...(e.verifiedAt ? { verifiedAt: e.verifiedAt } : {}),\n ...(e.retired ? { retired: true as const } : {}),\n note: e.notes ?? \"\",\n }\n : { key, name: e.name, status: \"pending\", note: e.reason };\n });\n}\n\n/**\n * The same rows as {@link getPepuAddresses}, keyed by contract name instead of\n * returned as an array. An unknown chain yields an empty object.\n *\n * @example\n * ```ts\n * const map = getPepuAddressMap();\n * map.paymaster?.address; // Address | undefined\n * ```\n */\nexport function getPepuAddressMap(chainId: number = pepuMainnet.id): Partial<Record<PepuContractName, PepuAddressRow>> {\n const out: Partial<Record<PepuContractName, PepuAddressRow>> = {};\n for (const row of getPepuAddresses(chainId)) out[row.key] = row;\n return out;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkK7JSQPZO_cjs = require('./chunk-K7JSQPZO.cjs');
|
|
4
4
|
var chunkDPCZJLB3_cjs = require('./chunk-DPCZJLB3.cjs');
|
|
5
5
|
var viem = require('viem');
|
|
6
6
|
|
|
@@ -19,7 +19,7 @@ function buildPaymasterContext(entries = {}) {
|
|
|
19
19
|
return context;
|
|
20
20
|
}
|
|
21
21
|
function buildParams(options) {
|
|
22
|
-
const entryPointEntry =
|
|
22
|
+
const entryPointEntry = chunkK7JSQPZO_cjs.getContract(chunkDPCZJLB3_cjs.pepuMainnet.id, "entryPoint07");
|
|
23
23
|
const entryPoint = options.entryPoint ?? (entryPointEntry?.status === "deployed" ? entryPointEntry.address : void 0);
|
|
24
24
|
if (!entryPoint) throw new Error("buildPaymasterRequest: no EntryPoint v0.7 address available.");
|
|
25
25
|
const chainId = viem.toHex(options.chainId ?? chunkDPCZJLB3_cjs.pepuMainnet.id);
|
|
@@ -45,5 +45,5 @@ function buildPaymasterDataRequest(options) {
|
|
|
45
45
|
exports.buildPaymasterContext = buildPaymasterContext;
|
|
46
46
|
exports.buildPaymasterDataRequest = buildPaymasterDataRequest;
|
|
47
47
|
exports.buildPaymasterStubDataRequest = buildPaymasterStubDataRequest;
|
|
48
|
-
//# sourceMappingURL=chunk-
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-RCMKPJZO.cjs.map
|
|
49
|
+
//# sourceMappingURL=chunk-RCMKPJZO.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/erc7677.ts"],"names":["getContract","pepuMainnet","toHex"],"mappings":";;;;;;AAkGO,SAAS,qBAAA,CACd,OAAA,GAA6C,EAAC,EAC5B;AAClB,EAAA,MAAM,UAA4B,EAAC;AACnC,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,KAAK,KAAK,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CAAQ,OAAA,GACX,CAAC,OAAA,CAAQ,eAAe,UAAA,EAAY,OAAA,EAAS,OAAA,CAAQ,OAAO,CAAA,GAC5D,CAAC,OAAA,CAAQ,aAAA,EAAe,YAAY,OAAO,CAAA;AACjD;AAGO,SAAS,8BACd,OAAA,EAC0B;AAC1B,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,KAAA;AAAA,IACT,EAAA,EAAI,QAAQ,EAAA,IAAM,CAAA;AAAA,IAClB,MAAA,EAAQ,yBAAA;AAAA,IACR,MAAA,EAAQ,YAAY,OAAO;AAAA,GAC7B;AACF;AAGO,SAAS,0BACd,OAAA,EACsB;AACtB,EAAA,OAAO;AAAA,IACL,OAAA,EAAS,KAAA;AAAA,IACT,EAAA,EAAI,QAAQ,EAAA,IAAM,CAAA;AAAA,IAClB,MAAA,EAAQ,qBAAA;AAAA,IACR,MAAA,EAAQ,YAAY,OAAO;AAAA,GAC7B;AACF","file":"chunk-RCMKPJZO.cjs","sourcesContent":["import { toHex } from \"viem\";\nimport type { Address, Hex } from \"viem\";\n\nimport { pepuMainnet } from \"./chains.js\";\nimport { getContract } from \"./contracts.js\";\n\n/**\n * ERC-7677 paymaster web-service types, for the two JSON-RPC methods PEPU's\n * paymaster policy service implements: `pm_getPaymasterStubData` and\n * `pm_getPaymasterData`. See https://eips.ethereum.org/EIPS/eip-7677.\n *\n * Pure types plus a few tiny builders: no network, no secrets, safe in a\n * browser bundle. Quantities are `0x`-prefixed hex strings, as on the wire.\n *\n * Note this package never implies sponsorship is available to an app: see\n * `getSponsorshipStatus()`. These types describe the protocol only.\n */\n\n/** An ERC-4337 v0.7 UserOperation in its unpacked JSON-RPC shape. */\nexport interface Erc7677UserOperation {\n sender: Address;\n nonce: Hex;\n factory?: Address;\n factoryData?: Hex;\n callData: Hex;\n callGasLimit: Hex;\n verificationGasLimit: Hex;\n preVerificationGas: Hex;\n maxFeePerGas: Hex;\n maxPriorityFeePerGas: Hex;\n paymaster?: Address;\n paymasterVerificationGasLimit?: Hex;\n paymasterPostOpGasLimit?: Hex;\n paymasterData?: Hex;\n signature: Hex;\n}\n\n/** Paymaster-defined, JSON-serializable context (params[3]). */\nexport type PaymasterContext = Record<string, unknown>;\n\nexport type PaymasterRpcParams = readonly [\n userOperation: Partial<Erc7677UserOperation> & Pick<Erc7677UserOperation, \"sender\" | \"callData\">,\n entryPoint: Address,\n chainId: Hex,\n context?: PaymasterContext,\n];\n\nexport interface PaymasterStubDataRequest {\n jsonrpc: \"2.0\";\n id: number | string;\n method: \"pm_getPaymasterStubData\";\n params: PaymasterRpcParams;\n}\n\nexport interface PaymasterDataRequest {\n jsonrpc: \"2.0\";\n id: number | string;\n method: \"pm_getPaymasterData\";\n params: PaymasterRpcParams;\n}\n\n/** Result of `pm_getPaymasterStubData`. Stub values are for gas estimation only. */\nexport interface PaymasterStubDataResult {\n paymaster: Address;\n paymasterData: Hex;\n paymasterVerificationGasLimit?: Hex;\n paymasterPostOpGasLimit?: Hex;\n /** `true` when the stub values are also the final values. */\n isFinal?: boolean;\n sponsor?: { name: string; icon?: string };\n}\n\n/** Result of `pm_getPaymasterData`: the signed values to submit. */\nexport interface PaymasterDataResult {\n paymaster: Address;\n paymasterData: Hex;\n paymasterVerificationGasLimit?: Hex;\n paymasterPostOpGasLimit?: Hex;\n}\n\nexport interface PaymasterRpcError {\n code: number;\n message: string;\n /** PEPU's policy service puts the machine-readable denial reason in `data.reason`. */\n data?: { reason?: string } & Record<string, unknown>;\n}\n\nexport type PaymasterRpcResponse<TResult> =\n | { jsonrpc: \"2.0\"; id: number | string | null; result: TResult }\n | { jsonrpc: \"2.0\"; id: number | string | null; error: PaymasterRpcError };\n\n/**\n * Build a paymaster `context` object: drops `undefined` entries and throws on\n * anything that would not survive `JSON.stringify` (bigint, function, symbol),\n * so a bad value fails here instead of as an opaque RPC error. Returns `{}`\n * for no input. The context is paymaster-defined; PEPU's policy service\n * currently accepts and ignores it.\n */\nexport function buildPaymasterContext(\n entries: Readonly<Record<string, unknown>> = {},\n): PaymasterContext {\n const context: PaymasterContext = {};\n for (const [key, value] of Object.entries(entries)) {\n if (value === undefined) continue;\n const kind = typeof value;\n if (kind === \"bigint\" || kind === \"function\" || kind === \"symbol\") {\n throw new Error(\n `buildPaymasterContext: \"${key}\" is a ${kind}, which is not JSON-serializable. Convert it to a string or number first.`,\n );\n }\n context[key] = value;\n }\n return context;\n}\n\nexport interface BuildPaymasterRequestOptions {\n userOperation: PaymasterRpcParams[0];\n /** Defaults to PEPU mainnet's EntryPoint v0.7. */\n entryPoint?: Address;\n /** Defaults to 97741 (PEPU mainnet). */\n chainId?: number;\n context?: PaymasterContext;\n id?: number | string;\n}\n\nfunction buildParams(options: BuildPaymasterRequestOptions): PaymasterRpcParams {\n const entryPointEntry = getContract(pepuMainnet.id, \"entryPoint07\");\n const entryPoint =\n options.entryPoint ??\n (entryPointEntry?.status === \"deployed\" ? entryPointEntry.address : undefined);\n if (!entryPoint) throw new Error(\"buildPaymasterRequest: no EntryPoint v0.7 address available.\");\n const chainId = toHex(options.chainId ?? pepuMainnet.id);\n return options.context\n ? [options.userOperation, entryPoint, chainId, options.context]\n : [options.userOperation, entryPoint, chainId];\n}\n\n/** Build a `pm_getPaymasterStubData` JSON-RPC request body. */\nexport function buildPaymasterStubDataRequest(\n options: BuildPaymasterRequestOptions,\n): PaymasterStubDataRequest {\n return {\n jsonrpc: \"2.0\",\n id: options.id ?? 1,\n method: \"pm_getPaymasterStubData\",\n params: buildParams(options),\n };\n}\n\n/** Build a `pm_getPaymasterData` JSON-RPC request body. */\nexport function buildPaymasterDataRequest(\n options: BuildPaymasterRequestOptions,\n): PaymasterDataRequest {\n return {\n jsonrpc: \"2.0\",\n id: options.id ?? 1,\n method: \"pm_getPaymasterData\",\n params: buildParams(options),\n };\n}\n"]}
|
package/dist/combo/react.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
+
/* @pepu-chain/peer-guard */(function(){var p=["react","@privy-io/react-auth","@zerodev/sdk","@zerodev/permissions","@zerodev/ecdsa-validator"];for(var i=0;i<p.length;i++){try{require.resolve(p[i])}catch(e){if(e&&e.code==="MODULE_NOT_FOUND"){var m="@pepu-chain/sdk/combo/react needs peer packages that are not installed: react @privy-io/react-auth @zerodev/sdk @zerodev/permissions @zerodev/ecdsa-validator. Install with: npm i react @privy-io/react-auth @zerodev/sdk @zerodev/permissions @zerodev/ecdsa-validator (or let create-pepu-app scaffold everything).";var x=new Error(m);x.code="PEPU_MISSING_PEER";throw x}}}})();
|
|
2
3
|
|
|
3
4
|
var chunkR5PXQNO3_cjs = require('../chunk-R5PXQNO3.cjs');
|
|
4
5
|
var chunkPHM3ZORG_cjs = require('../chunk-PHM3ZORG.cjs');
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Generated by scripts/guard-peers.mjs. Used only under the "node" export condition.
|
|
2
|
+
const peers = ["react","@privy-io/react-auth","@zerodev/sdk","@zerodev/permissions","@zerodev/ecdsa-validator"];
|
|
3
|
+
for (const peer of peers) {
|
|
4
|
+
try {
|
|
5
|
+
import.meta.resolve?.(peer);
|
|
6
|
+
} catch (e) {
|
|
7
|
+
if (e && e.code === "ERR_MODULE_NOT_FOUND") {
|
|
8
|
+
const err = new Error("@pepu-chain/sdk/combo/react needs peer packages that are not installed: react @privy-io/react-auth @zerodev/sdk @zerodev/permissions @zerodev/ecdsa-validator. Install with: npm i react @privy-io/react-auth @zerodev/sdk @zerodev/permissions @zerodev/ecdsa-validator (or let create-pepu-app scaffold everything).");
|
|
9
|
+
err.code = "PEPU_MISSING_PEER";
|
|
10
|
+
throw err;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const mod = await import("./react.js");
|
|
15
|
+
export const { DEFAULT_SESSION_ENDPOINTS, deriveSessionPhase, grantKernelSession, useSponsoredSession } = mod;
|
package/dist/combo.cjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
+
/* @pepu-chain/peer-guard */(function(){var p=["@privy-io/node","@zerodev/sdk","@zerodev/permissions","@zerodev/ecdsa-validator"];for(var i=0;i<p.length;i++){try{require.resolve(p[i])}catch(e){if(e&&e.code==="MODULE_NOT_FOUND"){var m="@pepu-chain/sdk/combo needs peer packages that are not installed: @privy-io/node @zerodev/sdk @zerodev/permissions @zerodev/ecdsa-validator. Install with: npm i @privy-io/node @zerodev/sdk @zerodev/permissions @zerodev/ecdsa-validator (or let create-pepu-app scaffold everything).";var x=new Error(m);x.code="PEPU_MISSING_PEER";throw x}}}})();
|
|
2
3
|
|
|
3
4
|
var chunkPHM3ZORG_cjs = require('./chunk-PHM3ZORG.cjs');
|
|
4
5
|
var chunkNVOPDXTA_cjs = require('./chunk-NVOPDXTA.cjs');
|
|
5
6
|
require('./chunk-7MNJF2OB.cjs');
|
|
6
7
|
var chunkAJS4UFQX_cjs = require('./chunk-AJS4UFQX.cjs');
|
|
7
8
|
require('./chunk-A5LP2UCS.cjs');
|
|
8
|
-
var
|
|
9
|
+
var chunkRCMKPJZO_cjs = require('./chunk-RCMKPJZO.cjs');
|
|
9
10
|
require('./chunk-WANILJZQ.cjs');
|
|
10
|
-
require('./chunk-
|
|
11
|
+
require('./chunk-K7JSQPZO.cjs');
|
|
11
12
|
var chunkJ3O2ZGG3_cjs = require('./chunk-J3O2ZGG3.cjs');
|
|
12
13
|
require('./chunk-4GINFJO6.cjs');
|
|
13
14
|
var chunkVF3D6KLQ_cjs = require('./chunk-VF3D6KLQ.cjs');
|
|
@@ -202,7 +203,7 @@ function createSponsoredSessionRoutes(o) {
|
|
|
202
203
|
...o.endpoints?.bundlerUrl !== void 0 ? { bundlerUrl: o.endpoints.bundlerUrl } : {},
|
|
203
204
|
...o.endpoints?.paymasterUrl !== void 0 ? { paymasterUrl: o.endpoints.paymasterUrl } : {},
|
|
204
205
|
...o.endpoints?.paymasterToken !== void 0 ? { paymasterToken: o.endpoints.paymasterToken } : {},
|
|
205
|
-
...privyToken ? { paymasterContext:
|
|
206
|
+
...privyToken ? { paymasterContext: chunkRCMKPJZO_cjs.buildPaymasterContext({ privyAccessToken: privyToken }) } : {}
|
|
206
207
|
});
|
|
207
208
|
const result = await chunkNVOPDXTA_cjs.sendSponsored({ client: kernel, calls });
|
|
208
209
|
const actions = record.actions + (result.success ? 1 : 0);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Generated by scripts/guard-peers.mjs. Used only under the "node" export condition.
|
|
2
|
+
const peers = ["@privy-io/node","@zerodev/sdk","@zerodev/permissions","@zerodev/ecdsa-validator"];
|
|
3
|
+
for (const peer of peers) {
|
|
4
|
+
try {
|
|
5
|
+
import.meta.resolve?.(peer);
|
|
6
|
+
} catch (e) {
|
|
7
|
+
if (e && e.code === "ERR_MODULE_NOT_FOUND") {
|
|
8
|
+
const err = new Error("@pepu-chain/sdk/combo needs peer packages that are not installed: @privy-io/node @zerodev/sdk @zerodev/permissions @zerodev/ecdsa-validator. Install with: npm i @privy-io/node @zerodev/sdk @zerodev/permissions @zerodev/ecdsa-validator (or let create-pepu-app scaffold everything).");
|
|
9
|
+
err.code = "PEPU_MISSING_PEER";
|
|
10
|
+
throw err;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const mod = await import("./combo.js");
|
|
15
|
+
export const { createMemoryStore, isLive, resolveSessionMinutes, assertCallsInScope, createSponsoredSessionRoutes } = mod;
|
package/dist/combo.js
CHANGED
|
@@ -4,9 +4,9 @@ import { createPepuSponsoredClient, sendSponsored, getKernelAddress } from './ch
|
|
|
4
4
|
import './chunk-IB2FSPMJ.js';
|
|
5
5
|
import { normalizeCalls } from './chunk-VBH3JLQ5.js';
|
|
6
6
|
import './chunk-IY3ALPUJ.js';
|
|
7
|
-
import { buildPaymasterContext } from './chunk-
|
|
7
|
+
import { buildPaymasterContext } from './chunk-7PVR7QSE.js';
|
|
8
8
|
import './chunk-D52PADVY.js';
|
|
9
|
-
import './chunk-
|
|
9
|
+
import './chunk-KJYNF5KH.js';
|
|
10
10
|
import { isCallInScope, describeKernelSessionScope, checkApproval } from './chunk-ESMNAXUI.js';
|
|
11
11
|
import './chunk-J6UXXHBE.js';
|
|
12
12
|
import { resolvePepuEndpoints } from './chunk-XC4IBCI2.js';
|