@pepu-chain/sdk 0.2.0 → 0.2.2
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 +26 -2
- package/dist/aa/kernel.cjs +11 -9
- package/dist/aa/kernel.guard.js +15 -0
- package/dist/aa/kernel.js +5 -4
- package/dist/aa/react-direct.cjs +14 -12
- package/dist/aa/react-direct.cjs.map +1 -1
- package/dist/aa/react-direct.guard.js +15 -0
- package/dist/aa/react-direct.js +7 -6
- package/dist/aa/react-direct.js.map +1 -1
- package/dist/aa/react.cjs +7 -5
- package/dist/aa/react.cjs.map +1 -1
- 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 +4 -3
- package/dist/aa/react.js.map +1 -1
- package/dist/aa.cjs +19 -18
- package/dist/aa.d.cts +1 -1
- package/dist/aa.d.ts +1 -1
- package/dist/aa.js +6 -5
- package/dist/chunk-4GEC7GUU.cjs +283 -0
- package/dist/chunk-4GEC7GUU.cjs.map +1 -0
- package/dist/{chunk-PHM3ZORG.cjs → chunk-4L4CHIXE.cjs} +9 -9
- package/dist/{chunk-PHM3ZORG.cjs.map → chunk-4L4CHIXE.cjs.map} +1 -1
- package/dist/{chunk-A5LP2UCS.cjs → chunk-65Y5UCQ7.cjs} +2 -276
- package/dist/chunk-65Y5UCQ7.cjs.map +1 -0
- 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-7MNJF2OB.cjs → chunk-DNWWZWUW.cjs} +4 -4
- package/dist/{chunk-7MNJF2OB.cjs.map → chunk-DNWWZWUW.cjs.map} +1 -1
- package/dist/{chunk-D52PADVY.js → chunk-GFKIM7HT.js} +25 -2
- package/dist/chunk-GFKIM7HT.js.map +1 -0
- package/dist/{chunk-IY3ALPUJ.js → chunk-GIZNH65Q.js} +5 -273
- package/dist/chunk-GIZNH65Q.js.map +1 -0
- package/dist/{chunk-WANILJZQ.cjs → chunk-HTCX46RJ.cjs} +25 -2
- package/dist/chunk-HTCX46RJ.cjs.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-KVG3AYYR.js → chunk-NHPWXIA2.js} +4 -4
- package/dist/{chunk-KVG3AYYR.js.map → chunk-NHPWXIA2.js.map} +1 -1
- package/dist/{chunk-ZB6SVBK4.js → chunk-QIDMFFAQ.js} +4 -4
- package/dist/{chunk-ZB6SVBK4.js.map → chunk-QIDMFFAQ.js.map} +1 -1
- package/dist/{chunk-IB2FSPMJ.js → chunk-QZKUPCUD.js} +3 -3
- package/dist/{chunk-IB2FSPMJ.js.map → chunk-QZKUPCUD.js.map} +1 -1
- package/dist/{chunk-ET3P6TX6.cjs → chunk-RCMKPJZO.cjs} +4 -4
- package/dist/{chunk-ET3P6TX6.cjs.map → chunk-RCMKPJZO.cjs.map} +1 -1
- package/dist/chunk-RSPAN44L.js +276 -0
- package/dist/chunk-RSPAN44L.js.map +1 -0
- package/dist/{chunk-NVOPDXTA.cjs → chunk-UQH4ZAXD.cjs} +10 -10
- package/dist/{chunk-NVOPDXTA.cjs.map → chunk-UQH4ZAXD.cjs.map} +1 -1
- package/dist/{chunk-SLW7FRTL.cjs → chunk-VYMAZVIK.cjs} +52 -22
- package/dist/chunk-VYMAZVIK.cjs.map +1 -0
- package/dist/{chunk-KIIFL4VM.js → chunk-XR5ONV2Y.js} +42 -12
- package/dist/chunk-XR5ONV2Y.js.map +1 -0
- package/dist/combo/react.cjs +62 -13
- package/dist/combo/react.cjs.map +1 -1
- package/dist/combo/react.d.cts +14 -2
- package/dist/combo/react.d.ts +14 -2
- package/dist/combo/react.guard.js +15 -0
- package/dist/combo/react.js +58 -11
- package/dist/combo/react.js.map +1 -1
- package/dist/combo.cjs +45 -29
- package/dist/combo.cjs.map +1 -1
- package/dist/combo.d.cts +11 -0
- package/dist/combo.d.ts +11 -0
- package/dist/combo.guard.js +15 -0
- package/dist/combo.js +33 -18
- package/dist/combo.js.map +1 -1
- package/dist/index.cjs +28 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/paymaster.cjs +39 -38
- package/dist/paymaster.cjs.map +1 -1
- package/dist/paymaster.js +4 -3
- package/dist/paymaster.js.map +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 +6 -4
- package/dist/react.cjs.map +1 -1
- 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 +4 -3
- package/dist/react.js.map +1 -1
- package/dist/session/kernel.cjs +19 -17
- package/dist/session/kernel.guard.js +15 -0
- package/dist/session/kernel.js +6 -5
- 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-A5LP2UCS.cjs.map +0 -1
- package/dist/chunk-D52PADVY.js.map +0 -1
- package/dist/chunk-FCXSP2YF.js.map +0 -1
- package/dist/chunk-IY3ALPUJ.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
- package/dist/chunk-WANILJZQ.cjs.map +0 -1
package/dist/session/kernel.cjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
+
/* @pepu-chain/peer-guard */(function(){var p=["@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/session/kernel needs peer packages that are not installed: @zerodev/sdk @zerodev/permissions @zerodev/ecdsa-validator. Install with: npm i @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
|
-
var
|
|
4
|
-
var
|
|
5
|
-
require('../chunk-
|
|
4
|
+
var chunk4L4CHIXE_cjs = require('../chunk-4L4CHIXE.cjs');
|
|
5
|
+
var chunkUQH4ZAXD_cjs = require('../chunk-UQH4ZAXD.cjs');
|
|
6
|
+
require('../chunk-DNWWZWUW.cjs');
|
|
6
7
|
require('../chunk-AJS4UFQX.cjs');
|
|
7
|
-
require('../chunk-
|
|
8
|
-
require('../chunk-
|
|
8
|
+
require('../chunk-4GEC7GUU.cjs');
|
|
9
|
+
require('../chunk-HTCX46RJ.cjs');
|
|
10
|
+
require('../chunk-65Y5UCQ7.cjs');
|
|
9
11
|
var chunkJ3O2ZGG3_cjs = require('../chunk-J3O2ZGG3.cjs');
|
|
10
12
|
require('../chunk-4GINFJO6.cjs');
|
|
11
13
|
require('../chunk-VF3D6KLQ.cjs');
|
|
@@ -16,51 +18,51 @@ require('../chunk-YQL7NISX.cjs');
|
|
|
16
18
|
|
|
17
19
|
Object.defineProperty(exports, "CALL_POLICY_V0_0_4_ADDRESS", {
|
|
18
20
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunk4L4CHIXE_cjs.CALL_POLICY_V0_0_4_ADDRESS; }
|
|
20
22
|
});
|
|
21
23
|
Object.defineProperty(exports, "SESSION_GAS_RESERVATION_PEPU", {
|
|
22
24
|
enumerable: true,
|
|
23
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunk4L4CHIXE_cjs.SESSION_GAS_RESERVATION_PEPU; }
|
|
24
26
|
});
|
|
25
27
|
Object.defineProperty(exports, "TIMESTAMP_POLICY_ADDRESS", {
|
|
26
28
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunk4L4CHIXE_cjs.TIMESTAMP_POLICY_ADDRESS; }
|
|
28
30
|
});
|
|
29
31
|
Object.defineProperty(exports, "approveKernelSession", {
|
|
30
32
|
enumerable: true,
|
|
31
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunk4L4CHIXE_cjs.approveKernelSession; }
|
|
32
34
|
});
|
|
33
35
|
Object.defineProperty(exports, "buildKernelSessionPolicies", {
|
|
34
36
|
enumerable: true,
|
|
35
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunk4L4CHIXE_cjs.buildKernelSessionPolicies; }
|
|
36
38
|
});
|
|
37
39
|
Object.defineProperty(exports, "createMemoryStore", {
|
|
38
40
|
enumerable: true,
|
|
39
|
-
get: function () { return
|
|
41
|
+
get: function () { return chunk4L4CHIXE_cjs.createMemoryStore; }
|
|
40
42
|
});
|
|
41
43
|
Object.defineProperty(exports, "expectedPermissionId", {
|
|
42
44
|
enumerable: true,
|
|
43
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunk4L4CHIXE_cjs.expectedPermissionId; }
|
|
44
46
|
});
|
|
45
47
|
Object.defineProperty(exports, "generateSessionKey", {
|
|
46
48
|
enumerable: true,
|
|
47
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunk4L4CHIXE_cjs.generateSessionKey; }
|
|
48
50
|
});
|
|
49
51
|
Object.defineProperty(exports, "isLive", {
|
|
50
52
|
enumerable: true,
|
|
51
|
-
get: function () { return
|
|
53
|
+
get: function () { return chunk4L4CHIXE_cjs.isLive; }
|
|
52
54
|
});
|
|
53
55
|
Object.defineProperty(exports, "loadKernelSessionAccount", {
|
|
54
56
|
enumerable: true,
|
|
55
|
-
get: function () { return
|
|
57
|
+
get: function () { return chunk4L4CHIXE_cjs.loadKernelSessionAccount; }
|
|
56
58
|
});
|
|
57
59
|
Object.defineProperty(exports, "KERNEL_VERSION", {
|
|
58
60
|
enumerable: true,
|
|
59
|
-
get: function () { return
|
|
61
|
+
get: function () { return chunkUQH4ZAXD_cjs.KERNEL_VERSION; }
|
|
60
62
|
});
|
|
61
63
|
Object.defineProperty(exports, "getKernelAddress", {
|
|
62
64
|
enumerable: true,
|
|
63
|
-
get: function () { return
|
|
65
|
+
get: function () { return chunkUQH4ZAXD_cjs.getKernelAddress; }
|
|
64
66
|
});
|
|
65
67
|
Object.defineProperty(exports, "checkApproval", {
|
|
66
68
|
enumerable: true,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Generated by scripts/guard-peers.mjs. Used only under the "node" export condition.
|
|
2
|
+
const peers = ["@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/session/kernel needs peer packages that are not installed: @zerodev/sdk @zerodev/permissions @zerodev/ecdsa-validator. Install with: npm i @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("./kernel.js");
|
|
15
|
+
export const { CALL_POLICY_V0_0_4_ADDRESS, SESSION_GAS_RESERVATION_PEPU, TIMESTAMP_POLICY_ADDRESS, approveKernelSession, buildKernelSessionPolicies, createMemoryStore, expectedPermissionId, generateSessionKey, isLive, loadKernelSessionAccount, KERNEL_VERSION, getKernelAddress, checkApproval, describeKernelSessionScope, isCallInScope, parseApproval } = mod;
|
package/dist/session/kernel.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export { CALL_POLICY_V0_0_4_ADDRESS, SESSION_GAS_RESERVATION_PEPU, TIMESTAMP_POLICY_ADDRESS, approveKernelSession, buildKernelSessionPolicies, createMemoryStore, expectedPermissionId, generateSessionKey, isLive, loadKernelSessionAccount } from '../chunk-
|
|
2
|
-
export { KERNEL_VERSION, getKernelAddress } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { CALL_POLICY_V0_0_4_ADDRESS, SESSION_GAS_RESERVATION_PEPU, TIMESTAMP_POLICY_ADDRESS, approveKernelSession, buildKernelSessionPolicies, createMemoryStore, expectedPermissionId, generateSessionKey, isLive, loadKernelSessionAccount } from '../chunk-NHPWXIA2.js';
|
|
2
|
+
export { KERNEL_VERSION, getKernelAddress } from '../chunk-QIDMFFAQ.js';
|
|
3
|
+
import '../chunk-QZKUPCUD.js';
|
|
4
4
|
import '../chunk-VBH3JLQ5.js';
|
|
5
|
-
import '../chunk-
|
|
6
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-RSPAN44L.js';
|
|
6
|
+
import '../chunk-GFKIM7HT.js';
|
|
7
|
+
import '../chunk-GIZNH65Q.js';
|
|
7
8
|
export { checkApproval, describeKernelSessionScope, isCallInScope, parseApproval } from '../chunk-ESMNAXUI.js';
|
|
8
9
|
import '../chunk-J6UXXHBE.js';
|
|
9
10
|
import '../chunk-XC4IBCI2.js';
|
package/dist/session/react.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
+
/* @pepu-chain/peer-guard */(function(){var p=["react","@privy-io/react-auth"];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/session/react needs peer packages that are not installed: react @privy-io/react-auth. Install with: npm i react @privy-io/react-auth (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
|
require('../chunk-DH6BFNVJ.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"];
|
|
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/session/react needs peer packages that are not installed: react @privy-io/react-auth. Install with: npm i react @privy-io/react-auth (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 { deriveSessionState, errorFromResponse, useSessionAct, useSessionGrant, useSessionRevoke, useSessionStatus } = mod;
|
package/dist/session/server.cjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
+
/* @pepu-chain/peer-guard */(function(){var p=["@privy-io/node"];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/session/server needs a peer package that is not installed: @privy-io/node. Install with: npm i @privy-io/node (or let create-pepu-app scaffold everything).";var x=new Error(m);x.code="PEPU_MISSING_PEER";throw x}}}})();
|
|
2
3
|
|
|
3
4
|
var chunkC7IC36XS_cjs = require('../chunk-C7IC36XS.cjs');
|
|
4
5
|
var chunk4GINFJO6_cjs = require('../chunk-4GINFJO6.cjs');
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Generated by scripts/guard-peers.mjs. Used only under the "node" export condition.
|
|
2
|
+
const peers = ["@privy-io/node"];
|
|
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/session/server needs a peer package that is not installed: @privy-io/node. Install with: npm i @privy-io/node (or let create-pepu-app scaffold everything).");
|
|
9
|
+
err.code = "PEPU_MISSING_PEER";
|
|
10
|
+
throw err;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const mod = await import("./server.js");
|
|
15
|
+
export const { broadcastSignedTransaction, signAndBroadcast, withGasLimitBuffer, createSessionActionRoute, createSessionRoutes, privySessionSigner } = mod;
|
|
@@ -13,8 +13,15 @@ interface BundlerProbeResult {
|
|
|
13
13
|
ok: boolean;
|
|
14
14
|
chainId?: number;
|
|
15
15
|
entryPoints?: Address[];
|
|
16
|
-
/**
|
|
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
|
+
*/
|
|
17
22
|
supportedMethods?: Record<string, boolean>;
|
|
23
|
+
/** Required methods (see `REQUIRED_BUNDLER_METHODS`) the bundler lacks. Empty when all are present. */
|
|
24
|
+
missingRequiredMethods?: string[];
|
|
18
25
|
latencyMs: number;
|
|
19
26
|
error?: PepuBundlerError;
|
|
20
27
|
}
|
|
@@ -25,12 +32,19 @@ interface PaymasterProbeResult {
|
|
|
25
32
|
/** Body of `GET <origin>/v2/free-tier` when the service exposes it. */
|
|
26
33
|
freeTier?: unknown;
|
|
27
34
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* credential, so
|
|
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.
|
|
32
40
|
*/
|
|
33
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";
|
|
34
48
|
latencyMs: number;
|
|
35
49
|
error?: PepuBundlerError;
|
|
36
50
|
}
|
|
@@ -50,8 +64,10 @@ declare function probeBundler(url: string, o?: ProbeOptions): Promise<BundlerPro
|
|
|
50
64
|
* Probe a paymaster URL: the service base (`https://paymaster.pepeunchained.com`) or the ERC-7677 endpoint
|
|
51
65
|
* (`https://host/v2/paymaster/<token>`).
|
|
52
66
|
* Checks `GET <origin>/health`, `GET <origin>/v2/free-tier`, and whether the URL
|
|
53
|
-
* answers JSON-RPC `pm_getPaymasterStubData
|
|
54
|
-
*
|
|
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
|
|
55
71
|
* token) never appears in the returned error.
|
|
56
72
|
*
|
|
57
73
|
* @example
|
|
@@ -153,15 +169,31 @@ interface PepuAddressRow {
|
|
|
153
169
|
}
|
|
154
170
|
/**
|
|
155
171
|
* The full supporting-contract table for a chain, flattened for docs and
|
|
156
|
-
* MCP rendering.
|
|
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`.
|
|
157
177
|
*
|
|
158
178
|
* @example
|
|
159
179
|
* ```ts
|
|
160
|
-
* const rows = getPepuAddresses(); // mainnet by default
|
|
180
|
+
* const rows = getPepuAddresses(); // PepuAddressRow[], mainnet by default
|
|
161
181
|
* const live = rows.filter((r) => r.status === "deployed");
|
|
182
|
+
* const paymaster = rows.find((r) => r.key === "paymaster");
|
|
162
183
|
* ```
|
|
163
184
|
*/
|
|
164
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>>;
|
|
165
197
|
|
|
166
198
|
/**
|
|
167
199
|
* The account-abstraction contracts a Kernel v3 smart account needs,
|
|
@@ -292,4 +324,4 @@ interface CheckSponsorshipOptions {
|
|
|
292
324
|
*/
|
|
293
325
|
declare function checkSponsorship(options?: CheckSponsorshipOptions): Promise<SponsorshipReport>;
|
|
294
326
|
|
|
295
|
-
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,
|
|
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 };
|
|
@@ -13,8 +13,15 @@ interface BundlerProbeResult {
|
|
|
13
13
|
ok: boolean;
|
|
14
14
|
chainId?: number;
|
|
15
15
|
entryPoints?: Address[];
|
|
16
|
-
/**
|
|
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
|
+
*/
|
|
17
22
|
supportedMethods?: Record<string, boolean>;
|
|
23
|
+
/** Required methods (see `REQUIRED_BUNDLER_METHODS`) the bundler lacks. Empty when all are present. */
|
|
24
|
+
missingRequiredMethods?: string[];
|
|
18
25
|
latencyMs: number;
|
|
19
26
|
error?: PepuBundlerError;
|
|
20
27
|
}
|
|
@@ -25,12 +32,19 @@ interface PaymasterProbeResult {
|
|
|
25
32
|
/** Body of `GET <origin>/v2/free-tier` when the service exposes it. */
|
|
26
33
|
freeTier?: unknown;
|
|
27
34
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* credential, so
|
|
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.
|
|
32
40
|
*/
|
|
33
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";
|
|
34
48
|
latencyMs: number;
|
|
35
49
|
error?: PepuBundlerError;
|
|
36
50
|
}
|
|
@@ -50,8 +64,10 @@ declare function probeBundler(url: string, o?: ProbeOptions): Promise<BundlerPro
|
|
|
50
64
|
* Probe a paymaster URL: the service base (`https://paymaster.pepeunchained.com`) or the ERC-7677 endpoint
|
|
51
65
|
* (`https://host/v2/paymaster/<token>`).
|
|
52
66
|
* Checks `GET <origin>/health`, `GET <origin>/v2/free-tier`, and whether the URL
|
|
53
|
-
* answers JSON-RPC `pm_getPaymasterStubData
|
|
54
|
-
*
|
|
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
|
|
55
71
|
* token) never appears in the returned error.
|
|
56
72
|
*
|
|
57
73
|
* @example
|
|
@@ -153,15 +169,31 @@ interface PepuAddressRow {
|
|
|
153
169
|
}
|
|
154
170
|
/**
|
|
155
171
|
* The full supporting-contract table for a chain, flattened for docs and
|
|
156
|
-
* MCP rendering.
|
|
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`.
|
|
157
177
|
*
|
|
158
178
|
* @example
|
|
159
179
|
* ```ts
|
|
160
|
-
* const rows = getPepuAddresses(); // mainnet by default
|
|
180
|
+
* const rows = getPepuAddresses(); // PepuAddressRow[], mainnet by default
|
|
161
181
|
* const live = rows.filter((r) => r.status === "deployed");
|
|
182
|
+
* const paymaster = rows.find((r) => r.key === "paymaster");
|
|
162
183
|
* ```
|
|
163
184
|
*/
|
|
164
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>>;
|
|
165
197
|
|
|
166
198
|
/**
|
|
167
199
|
* The account-abstraction contracts a Kernel v3 smart account needs,
|
|
@@ -292,4 +324,4 @@ interface CheckSponsorshipOptions {
|
|
|
292
324
|
*/
|
|
293
325
|
declare function checkSponsorship(options?: CheckSponsorshipOptions): Promise<SponsorshipReport>;
|
|
294
326
|
|
|
295
|
-
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,
|
|
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pepu-chain/sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Chain definitions, contract registry, token list, and viem helpers for Pepe Unchained V2.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Pepe Unchained <contact@pepeunchained.com> (https://pepeunchained.com)",
|
|
@@ -26,6 +26,9 @@
|
|
|
26
26
|
},
|
|
27
27
|
"./react": {
|
|
28
28
|
"types": "./dist/react.d.ts",
|
|
29
|
+
"node": {
|
|
30
|
+
"import": "./dist/react.guard.js"
|
|
31
|
+
},
|
|
29
32
|
"import": "./dist/react.js",
|
|
30
33
|
"require": "./dist/react.cjs"
|
|
31
34
|
},
|
|
@@ -36,15 +39,24 @@
|
|
|
36
39
|
},
|
|
37
40
|
"./privy/react": {
|
|
38
41
|
"types": "./dist/privy/react.d.ts",
|
|
42
|
+
"node": {
|
|
43
|
+
"import": "./dist/privy/react.guard.js"
|
|
44
|
+
},
|
|
39
45
|
"import": "./dist/privy/react.js",
|
|
40
46
|
"require": "./dist/privy/react.cjs"
|
|
41
47
|
},
|
|
42
48
|
"./privy/wagmi": {
|
|
43
49
|
"types": "./dist/privy/wagmi.d.ts",
|
|
50
|
+
"node": {
|
|
51
|
+
"import": "./dist/privy/wagmi.guard.js"
|
|
52
|
+
},
|
|
44
53
|
"import": "./dist/privy/wagmi.js"
|
|
45
54
|
},
|
|
46
55
|
"./privy/server": {
|
|
47
56
|
"types": "./dist/privy/server.d.ts",
|
|
57
|
+
"node": {
|
|
58
|
+
"import": "./dist/privy/server.guard.js"
|
|
59
|
+
},
|
|
48
60
|
"import": "./dist/privy/server.js",
|
|
49
61
|
"require": "./dist/privy/server.cjs"
|
|
50
62
|
},
|
|
@@ -55,16 +67,25 @@
|
|
|
55
67
|
},
|
|
56
68
|
"./session/server": {
|
|
57
69
|
"types": "./dist/session/server.d.ts",
|
|
70
|
+
"node": {
|
|
71
|
+
"import": "./dist/session/server.guard.js"
|
|
72
|
+
},
|
|
58
73
|
"import": "./dist/session/server.js",
|
|
59
74
|
"require": "./dist/session/server.cjs"
|
|
60
75
|
},
|
|
61
76
|
"./session/react": {
|
|
62
77
|
"types": "./dist/session/react.d.ts",
|
|
78
|
+
"node": {
|
|
79
|
+
"import": "./dist/session/react.guard.js"
|
|
80
|
+
},
|
|
63
81
|
"import": "./dist/session/react.js",
|
|
64
82
|
"require": "./dist/session/react.cjs"
|
|
65
83
|
},
|
|
66
84
|
"./session/kernel": {
|
|
67
85
|
"types": "./dist/session/kernel.d.ts",
|
|
86
|
+
"node": {
|
|
87
|
+
"import": "./dist/session/kernel.guard.js"
|
|
88
|
+
},
|
|
68
89
|
"import": "./dist/session/kernel.js",
|
|
69
90
|
"require": "./dist/session/kernel.cjs"
|
|
70
91
|
},
|
|
@@ -75,16 +96,25 @@
|
|
|
75
96
|
},
|
|
76
97
|
"./aa/kernel": {
|
|
77
98
|
"types": "./dist/aa/kernel.d.ts",
|
|
99
|
+
"node": {
|
|
100
|
+
"import": "./dist/aa/kernel.guard.js"
|
|
101
|
+
},
|
|
78
102
|
"import": "./dist/aa/kernel.js",
|
|
79
103
|
"require": "./dist/aa/kernel.cjs"
|
|
80
104
|
},
|
|
81
105
|
"./aa/react": {
|
|
82
106
|
"types": "./dist/aa/react.d.ts",
|
|
107
|
+
"node": {
|
|
108
|
+
"import": "./dist/aa/react.guard.js"
|
|
109
|
+
},
|
|
83
110
|
"import": "./dist/aa/react.js",
|
|
84
111
|
"require": "./dist/aa/react.cjs"
|
|
85
112
|
},
|
|
86
113
|
"./aa/react-direct": {
|
|
87
114
|
"types": "./dist/aa/react-direct.d.ts",
|
|
115
|
+
"node": {
|
|
116
|
+
"import": "./dist/aa/react-direct.guard.js"
|
|
117
|
+
},
|
|
88
118
|
"import": "./dist/aa/react-direct.js",
|
|
89
119
|
"require": "./dist/aa/react-direct.cjs"
|
|
90
120
|
},
|
|
@@ -100,11 +130,17 @@
|
|
|
100
130
|
},
|
|
101
131
|
"./combo": {
|
|
102
132
|
"types": "./dist/combo.d.ts",
|
|
133
|
+
"node": {
|
|
134
|
+
"import": "./dist/combo.guard.js"
|
|
135
|
+
},
|
|
103
136
|
"import": "./dist/combo.js",
|
|
104
137
|
"require": "./dist/combo.cjs"
|
|
105
138
|
},
|
|
106
139
|
"./combo/react": {
|
|
107
140
|
"types": "./dist/combo/react.d.ts",
|
|
141
|
+
"node": {
|
|
142
|
+
"import": "./dist/combo/react.guard.js"
|
|
143
|
+
},
|
|
108
144
|
"import": "./dist/combo/react.js",
|
|
109
145
|
"require": "./dist/combo/react.cjs"
|
|
110
146
|
},
|
|
@@ -203,7 +239,7 @@
|
|
|
203
239
|
"access": "public"
|
|
204
240
|
},
|
|
205
241
|
"scripts": {
|
|
206
|
-
"build": "tsup && node scripts/prune-esm-only.mjs",
|
|
242
|
+
"build": "tsup && node scripts/prune-esm-only.mjs && node scripts/guard-peers.mjs",
|
|
207
243
|
"typecheck": "tsc --noEmit",
|
|
208
244
|
"test": "vitest run",
|
|
209
245
|
"live-check": "node scripts/live-check.mjs",
|