@capxul/mcp 1.0.0-alpha.3 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -62
- package/dist/{_esm-CA4cvybV.mjs → _esm-CC5QpzeQ.mjs} +94 -328
- package/dist/alchemy-rpc-BuobS4-x.mjs +2 -0
- package/dist/{alchemy-rpc-DEpqt2Jx.mjs → alchemy-rpc-vGO5qErZ.mjs} +23 -3
- package/dist/{chunk-Dg0SBOkb.mjs → chunk-B5meny8j.mjs} +3 -1
- package/dist/esm-D2-zCfAo.mjs +4088 -0
- package/dist/eventemitter3-D-pLUuAN.mjs +238 -0
- package/dist/lib-B8hqwgiz.mjs +654 -0
- package/dist/lib-BGlYlc2Y.mjs +3 -0
- package/dist/lib-BRkcywUv.mjs +539 -0
- package/dist/lib-BSq2-y-R.mjs +3 -0
- package/dist/lib-CifIgXqP.mjs +12219 -0
- package/dist/lib-CnLS6gjn.mjs +6980 -0
- package/dist/lib-Dn7-RQTV.mjs +3635 -0
- package/dist/lib-YbuuWTqT.mjs +3 -0
- package/dist/lib-cc_08w0f.mjs +2148 -0
- package/dist/lib-hCYuvdcy.mjs +1764 -0
- package/dist/lib-yehPdjuB.mjs +3 -0
- package/dist/main.mjs +32772 -3624
- package/dist/{src-CJVATdCb.mjs → src-2B8HO-zu.mjs} +958 -752
- package/dist/src-HgvNZjX7.mjs +2 -0
- package/dist/{src-Cg8p_ZgR.mjs → src-Iv70gRG_.mjs} +1 -1
- package/package.json +15 -21
- package/dist/alchemy-rpc-BWwk_YTZ.mjs +0 -2
- package/dist/src-D4Y3802K.mjs +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { E as ENTRY_POINT_07_ADDRESS, U as CAPXUL_PAYMENTS_ADDRESS, W as CAPXUL_PAYMENTS_COMMITMENT_ABI, ft as Errors } from "./src-2B8HO-zu.mjs";
|
|
2
2
|
import { decodeFunctionResult, encodeFunctionData, isHex, toHex } from "viem";
|
|
3
3
|
//#region ../../packages/backend/convex/_shared/env.ts
|
|
4
4
|
function requireEnvOrThrow(name) {
|
|
@@ -41,6 +41,22 @@ function alchemyUrl(chainId) {
|
|
|
41
41
|
default: throw Errors.invalidInput("chainId", `unsupported chainId ${String(chainId)}`);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
|
+
function isRecord(value) {
|
|
45
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
46
|
+
}
|
|
47
|
+
function isValidJsonRpcEnvelope(value) {
|
|
48
|
+
if (!isRecord(value) || value.jsonrpc !== "2.0" || value.id !== 1) return false;
|
|
49
|
+
return Object.hasOwn(value, "result") !== Object.hasOwn(value, "error");
|
|
50
|
+
}
|
|
51
|
+
function isValidJsonRpcError(value) {
|
|
52
|
+
return isRecord(value) && typeof value.code === "number" && Number.isInteger(value.code) && typeof value.message === "string";
|
|
53
|
+
}
|
|
54
|
+
var DefinitiveAlchemyJsonRpcRejection = class extends Error {
|
|
55
|
+
constructor() {
|
|
56
|
+
super("Alchemy returned an explicit JSON-RPC rejection");
|
|
57
|
+
this.name = "DefinitiveAlchemyJsonRpcRejection";
|
|
58
|
+
}
|
|
59
|
+
};
|
|
44
60
|
async function alchemyRpc(chainId, method, params) {
|
|
45
61
|
const url = alchemyUrl(chainId);
|
|
46
62
|
const res = await fetch(url, {
|
|
@@ -63,7 +79,11 @@ async function alchemyRpc(chainId, method, params) {
|
|
|
63
79
|
} catch (cause) {
|
|
64
80
|
throw Errors.providerError("alchemy", `${method} json`, cause);
|
|
65
81
|
}
|
|
66
|
-
if (json
|
|
82
|
+
if (!isValidJsonRpcEnvelope(json)) throw Errors.providerError("alchemy", method, "malformed JSON-RPC envelope");
|
|
83
|
+
if (json.error !== void 0) {
|
|
84
|
+
if (!isValidJsonRpcError(json.error)) throw Errors.providerError("alchemy", method, "malformed JSON-RPC error");
|
|
85
|
+
throw Errors.providerError("alchemy", method, method === "eth_sendUserOperation" ? new DefinitiveAlchemyJsonRpcRejection() : json.error.message);
|
|
86
|
+
}
|
|
67
87
|
if (json.result === void 0) throw Errors.providerError("alchemy", method, "missing result");
|
|
68
88
|
return json.result;
|
|
69
89
|
}
|
|
@@ -95,7 +115,7 @@ async function fetchUserOperationReceipt(args) {
|
|
|
95
115
|
receipt: {
|
|
96
116
|
blockNumber: hexToSafeInteger(raw.receipt.blockNumber, "eth_getUserOperationReceipt"),
|
|
97
117
|
transactionHash: raw.receipt.transactionHash,
|
|
98
|
-
logs: parseReceiptLogs(raw.
|
|
118
|
+
logs: parseReceiptLogs(raw.logs)
|
|
99
119
|
}
|
|
100
120
|
};
|
|
101
121
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
1
2
|
//#region \0rolldown/runtime.js
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
@@ -30,5 +31,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
31
|
value: mod,
|
|
31
32
|
enumerable: true
|
|
32
33
|
}) : target, mod));
|
|
34
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
33
35
|
//#endregion
|
|
34
|
-
export { __toESM as i, __exportAll as n, __reExport as r, __commonJSMin as t };
|
|
36
|
+
export { __toESM as a, __require as i, __exportAll as n, __reExport as r, __commonJSMin as t };
|