@belticlabs/agent-risk-sdk 0.3.0 → 0.5.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/dist/{adapter-BEpzr2R3.d.ts → adapter-DEdhsNt-.d.ts} +3 -10
- package/dist/ai/index.d.ts +2 -2
- package/dist/ai/index.js +6 -8
- package/dist/{chunk-46QN2KEZ.js → chunk-4BUUPU3O.js} +0 -9
- package/dist/chunk-GM4KEEZB.js +163 -0
- package/dist/chunk-JSE6JQJC.js +530 -0
- package/dist/index.d.ts +11 -33
- package/dist/index.js +40 -335
- package/dist/protocol/index.d.ts +2 -2
- package/dist/protocol/index.js +1 -5
- package/dist/{session-DsBWEP8d.d.ts → session-D9E-efc0.d.ts} +74 -97
- package/dist/{verdict-6vCyoAHE.d.ts → verdict-DMnbFuS5.d.ts} +1 -17
- package/dist/x402/hono.d.ts +16 -5
- package/dist/x402/hono.js +14 -8
- package/dist/x402/index.d.ts +15 -27
- package/dist/x402/index.js +15 -59
- package/package.json +2 -30
- package/dist/chunk-4MG6VNAU.js +0 -276
- package/dist/chunk-7G5EHNVW.js +0 -17
- package/dist/chunk-FAQ442YH.js +0 -24
- package/dist/chunk-LM4NIYE5.js +0 -92
- package/dist/chunk-NJVO2WIV.js +0 -17
- package/dist/chunk-OKC6VMFH.js +0 -84
- package/dist/mcp/index.d.ts +0 -58
- package/dist/mcp/index.js +0 -135
- package/dist/middleware-9gI0ou2i.d.ts +0 -15
- package/dist/seller/anti-fraud-gateway.d.ts +0 -40
- package/dist/seller/anti-fraud-gateway.js +0 -38
- package/dist/x402/express.d.ts +0 -13
- package/dist/x402/express.js +0 -27
package/dist/chunk-OKC6VMFH.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SESSION_HEADER,
|
|
3
|
-
decisionIdOf,
|
|
4
|
-
sessionIdOf
|
|
5
|
-
} from "./chunk-FAQ442YH.js";
|
|
6
|
-
import {
|
|
7
|
-
payloadDigest
|
|
8
|
-
} from "./chunk-X3W2Z5GC.js";
|
|
9
|
-
import {
|
|
10
|
-
x402Moments
|
|
11
|
-
} from "./chunk-LM4NIYE5.js";
|
|
12
|
-
|
|
13
|
-
// src/x402/adapter.ts
|
|
14
|
-
function attachX402(beltic, server, http, opts = {}) {
|
|
15
|
-
const inFlight = /* @__PURE__ */ new Map();
|
|
16
|
-
const resolveSession = async (bound, ctx) => {
|
|
17
|
-
const key = opts.correlate?.(ctx) ?? null;
|
|
18
|
-
return bound ?? (key ? await beltic.correlation.resolve(key) : null);
|
|
19
|
-
};
|
|
20
|
-
http?.onProtectedRequest(async (ctx, route) => {
|
|
21
|
-
if (ctx.paymentHeader) return;
|
|
22
|
-
const bound = ctx.adapter.getHeader(SESSION_HEADER) ?? ctx.adapter.getHeader(SESSION_HEADER.toLowerCase());
|
|
23
|
-
const sessionId = await resolveSession(bound ?? null, {
|
|
24
|
-
path: ctx.path,
|
|
25
|
-
method: ctx.method,
|
|
26
|
-
header: (n) => ctx.adapter.getHeader(n)
|
|
27
|
-
});
|
|
28
|
-
if (!sessionId) return;
|
|
29
|
-
const session = await beltic.sessions.ensure(sessionId);
|
|
30
|
-
const accepts = Array.isArray(route.accepts) ? route.accepts[0] : route.accepts;
|
|
31
|
-
await session.emit(
|
|
32
|
-
"payment.requested",
|
|
33
|
-
x402Moments.route(accepts, {
|
|
34
|
-
path: ctx.path,
|
|
35
|
-
method: ctx.method,
|
|
36
|
-
route: JSON.parse(JSON.stringify(route))
|
|
37
|
-
})
|
|
38
|
-
);
|
|
39
|
-
});
|
|
40
|
-
server.onBeforeVerify(async (ctx) => {
|
|
41
|
-
const payload = ctx.paymentPayload;
|
|
42
|
-
const requirements = ctx.requirements;
|
|
43
|
-
const sessionId = await resolveSession(sessionIdOf(payload.extensions), {
|
|
44
|
-
path: payload.resource?.url ?? "",
|
|
45
|
-
method: "PAY",
|
|
46
|
-
header: () => void 0
|
|
47
|
-
});
|
|
48
|
-
const session = await beltic.sessions.ensure(sessionId);
|
|
49
|
-
if (session.born === "seller")
|
|
50
|
-
await session.emit("payment.requested", x402Moments.requirements(requirements));
|
|
51
|
-
const presented = x402Moments.payload(payload);
|
|
52
|
-
await session.emit("payment.presented", presented);
|
|
53
|
-
inFlight.set(payloadDigest(payload), session);
|
|
54
|
-
const out = await beltic.evaluate(session.id, presented);
|
|
55
|
-
if (!out) return;
|
|
56
|
-
opts.onDecision?.({
|
|
57
|
-
sessionId: session.id,
|
|
58
|
-
decision: out.decision,
|
|
59
|
-
reasonCodes: out.reasonCodes,
|
|
60
|
-
born: session.born,
|
|
61
|
-
buyerDecisionId: decisionIdOf(payload.extensions)
|
|
62
|
-
});
|
|
63
|
-
if (out.verdict.blocks(beltic.onReview)) {
|
|
64
|
-
return {
|
|
65
|
-
abort: true,
|
|
66
|
-
reason: `BELTIC_${out.verdict.value}`,
|
|
67
|
-
message: out.reasonCodes.join(",")
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
return;
|
|
71
|
-
});
|
|
72
|
-
server.onAfterSettle(async (ctx) => {
|
|
73
|
-
const key = payloadDigest(ctx.paymentPayload);
|
|
74
|
-
const session = inFlight.get(key);
|
|
75
|
-
if (!session) return;
|
|
76
|
-
inFlight.delete(key);
|
|
77
|
-
if (ctx.result.success) await session.close("settled", { transaction: ctx.result.transaction });
|
|
78
|
-
});
|
|
79
|
-
return { inFlight };
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export {
|
|
83
|
-
attachX402
|
|
84
|
-
};
|
package/dist/mcp/index.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { a as PaymentSummary, P as PaymentMomentPayload } from '../verdict-6vCyoAHE.js';
|
|
2
|
-
import { B as Beltic, S as SessionSource } from '../session-DsBWEP8d.js';
|
|
3
|
-
import 'zod';
|
|
4
|
-
|
|
5
|
-
interface CallToolParams {
|
|
6
|
-
name: string;
|
|
7
|
-
arguments?: Record<string, unknown> | undefined;
|
|
8
|
-
_meta?: Record<string, unknown> | undefined;
|
|
9
|
-
}
|
|
10
|
-
/** Structural: `Client` from `@modelcontextprotocol/sdk/client` satisfies it. */
|
|
11
|
-
interface McpClientLike {
|
|
12
|
-
callTool(params: CallToolParams, ...rest: unknown[]): Promise<unknown>;
|
|
13
|
-
}
|
|
14
|
-
declare function wrapClient<C extends McpClientLike>(source: SessionSource, client: C, opts?: {
|
|
15
|
-
server?: string;
|
|
16
|
-
}): C;
|
|
17
|
-
/**
|
|
18
|
-
* An in-band payment ask: any object in the result carrying an x402-style
|
|
19
|
-
* `accepts` array (MRTR `input_required`, or a `_meta` envelope). One
|
|
20
|
-
* moment, two artifacts — either becomes the same `payment.requested`.
|
|
21
|
-
*/
|
|
22
|
-
declare function findPaymentAsk(result: unknown): PaymentMomentPayload | null;
|
|
23
|
-
interface ServerCallExtra {
|
|
24
|
-
_meta?: Record<string, unknown> | undefined;
|
|
25
|
-
sessionId?: string | undefined;
|
|
26
|
-
}
|
|
27
|
-
interface WithBelticOptions<Args> {
|
|
28
|
-
toolName: string;
|
|
29
|
-
/** Return the payment this call moves, or null when the call is not value-moving. */
|
|
30
|
-
valueMoving?: (args: Args) => PaymentSummary | null;
|
|
31
|
-
gateway?: string;
|
|
32
|
-
}
|
|
33
|
-
type ToolHandler<Args, R> = (args: Args, extra: ServerCallExtra) => Promise<R> | R;
|
|
34
|
-
interface McpErrorResult {
|
|
35
|
-
isError: true;
|
|
36
|
-
content: Array<{
|
|
37
|
-
type: 'text';
|
|
38
|
-
text: string;
|
|
39
|
-
}>;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Wraps a tool handler on the seller side. Value-moving calls are evaluated
|
|
43
|
-
* synchronously (DENY ⇒ isError result); every decided call is recorded
|
|
44
|
-
* as `gateway.decision` in the buyer's session, or a seller-born one.
|
|
45
|
-
*/
|
|
46
|
-
declare function withBeltic<Args, R>(beltic: Beltic, handler: ToolHandler<Args, R>, opts: WithBelticOptions<Args>): ToolHandler<Args, R | McpErrorResult>;
|
|
47
|
-
/** Structural: `McpServer` from `@modelcontextprotocol/sdk/server/mcp` satisfies it. */
|
|
48
|
-
interface McpServerLike {
|
|
49
|
-
registerTool(name: string, config: unknown, cb: (...a: never[]) => unknown): unknown;
|
|
50
|
-
}
|
|
51
|
-
interface WrapServerOptions {
|
|
52
|
-
valueMoving?: (toolName: string, args: unknown) => PaymentSummary | null;
|
|
53
|
-
gateway?: string;
|
|
54
|
-
}
|
|
55
|
-
/** Patches `registerTool` so every tool goes through `withBeltic`; `valueMoving` decides per tool. */
|
|
56
|
-
declare function wrapServer<S extends McpServerLike>(beltic: Beltic, server: S, opts?: WrapServerOptions): S;
|
|
57
|
-
|
|
58
|
-
export { type CallToolParams, type McpClientLike, type McpErrorResult, type McpServerLike, type ServerCallExtra, type ToolHandler, type WithBelticOptions, type WrapServerOptions, findPaymentAsk, withBeltic, wrapClient, wrapServer };
|
package/dist/mcp/index.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Sessions,
|
|
3
|
-
recordCall
|
|
4
|
-
} from "../chunk-4MG6VNAU.js";
|
|
5
|
-
import {
|
|
6
|
-
SESSION_EXTENSION
|
|
7
|
-
} from "../chunk-FAQ442YH.js";
|
|
8
|
-
import {
|
|
9
|
-
uuidv7
|
|
10
|
-
} from "../chunk-X3W2Z5GC.js";
|
|
11
|
-
import {
|
|
12
|
-
Verdict
|
|
13
|
-
} from "../chunk-46QN2KEZ.js";
|
|
14
|
-
import {
|
|
15
|
-
presentedFrom
|
|
16
|
-
} from "../chunk-7G5EHNVW.js";
|
|
17
|
-
import {
|
|
18
|
-
x402Moments
|
|
19
|
-
} from "../chunk-LM4NIYE5.js";
|
|
20
|
-
import {
|
|
21
|
-
toJson,
|
|
22
|
-
toJsonObject
|
|
23
|
-
} from "../chunk-FQDHFTVR.js";
|
|
24
|
-
|
|
25
|
-
// src/mcp/index.ts
|
|
26
|
-
function wrapClient(source, client, opts = {}) {
|
|
27
|
-
if (!source) return client;
|
|
28
|
-
const original = client.callTool.bind(client);
|
|
29
|
-
const callTool = async (params, ...rest) => {
|
|
30
|
-
const session = await Sessions.resolve(source);
|
|
31
|
-
if (!session) return original(params, ...rest);
|
|
32
|
-
return recordCall(
|
|
33
|
-
session,
|
|
34
|
-
"tool_call",
|
|
35
|
-
uuidv7(),
|
|
36
|
-
{
|
|
37
|
-
toolName: params.name,
|
|
38
|
-
input: toJson(params.arguments ?? {}),
|
|
39
|
-
transport: "mcp",
|
|
40
|
-
...opts.server ? { server: opts.server } : {}
|
|
41
|
-
},
|
|
42
|
-
async () => {
|
|
43
|
-
await session.flush();
|
|
44
|
-
return original(
|
|
45
|
-
{ ...params, _meta: { ...params._meta ?? {}, [SESSION_EXTENSION]: session.id } },
|
|
46
|
-
...rest
|
|
47
|
-
);
|
|
48
|
-
},
|
|
49
|
-
async (result) => {
|
|
50
|
-
const ask = findPaymentAsk(result);
|
|
51
|
-
if (ask) await session.emit("payment.requested", ask);
|
|
52
|
-
return { output: toJson(result) };
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
};
|
|
56
|
-
return new Proxy(client, {
|
|
57
|
-
get(target, prop, receiver) {
|
|
58
|
-
return prop === "callTool" ? callTool : Reflect.get(target, prop, receiver);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
function findPaymentAsk(result) {
|
|
63
|
-
const seen = /* @__PURE__ */ new Set();
|
|
64
|
-
const walk = (v, depth) => {
|
|
65
|
-
if (!v || typeof v !== "object" || seen.has(v) || depth > 6) return null;
|
|
66
|
-
seen.add(v);
|
|
67
|
-
const o = v;
|
|
68
|
-
const first = Array.isArray(o.accepts) ? o.accepts[0] : void 0;
|
|
69
|
-
if (typeof first?.payTo === "string") {
|
|
70
|
-
return x402Moments.ask(first, toJsonObject(o));
|
|
71
|
-
}
|
|
72
|
-
for (const child of Array.isArray(o) ? o : Object.values(o)) {
|
|
73
|
-
const hit = walk(child, depth + 1);
|
|
74
|
-
if (hit) return hit;
|
|
75
|
-
}
|
|
76
|
-
return null;
|
|
77
|
-
};
|
|
78
|
-
return walk(result, 0);
|
|
79
|
-
}
|
|
80
|
-
function withBeltic(beltic, handler, opts) {
|
|
81
|
-
const gateway = opts.gateway ?? "sdk-mcp";
|
|
82
|
-
return async (args, extra) => {
|
|
83
|
-
const bound = extra?._meta?.[SESSION_EXTENSION];
|
|
84
|
-
const session = await beltic.sessions.ensure(typeof bound === "string" ? bound : null);
|
|
85
|
-
const payment = opts.valueMoving?.(args) ?? null;
|
|
86
|
-
let verdict = Verdict.ALLOW;
|
|
87
|
-
let reasonCodes = [];
|
|
88
|
-
if (payment) {
|
|
89
|
-
await session.emit(
|
|
90
|
-
"payment.presented",
|
|
91
|
-
presentedFrom(payment, { tool: opts.toolName, args: toJson(args) })
|
|
92
|
-
);
|
|
93
|
-
const out = await beltic.evaluate(session.id, payment);
|
|
94
|
-
if (out) {
|
|
95
|
-
verdict = out.verdict;
|
|
96
|
-
reasonCodes = out.reasonCodes;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
await session.emit("gateway.decision", {
|
|
100
|
-
gateway,
|
|
101
|
-
call: { tool: opts.toolName, args: toJson(args) },
|
|
102
|
-
decision: verdict.effective(beltic.onReview),
|
|
103
|
-
reasonCodes,
|
|
104
|
-
record: { valueMoving: payment !== null, bound: typeof bound === "string" }
|
|
105
|
-
});
|
|
106
|
-
if (verdict.blocks(beltic.onReview)) {
|
|
107
|
-
return {
|
|
108
|
-
isError: true,
|
|
109
|
-
content: [
|
|
110
|
-
{ type: "text", text: `Beltic ${verdict.value}: ${reasonCodes.join(",") || "denied"}` }
|
|
111
|
-
]
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
return handler(args, extra);
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
function wrapServer(beltic, server, opts = {}) {
|
|
118
|
-
const original = server.registerTool.bind(server);
|
|
119
|
-
server.registerTool = ((name, config, cb) => original(
|
|
120
|
-
name,
|
|
121
|
-
config,
|
|
122
|
-
withBeltic(beltic, cb, {
|
|
123
|
-
toolName: name,
|
|
124
|
-
...opts.gateway ? { gateway: opts.gateway } : {},
|
|
125
|
-
valueMoving: (args) => opts.valueMoving?.(name, args) ?? null
|
|
126
|
-
})
|
|
127
|
-
));
|
|
128
|
-
return server;
|
|
129
|
-
}
|
|
130
|
-
export {
|
|
131
|
-
findPaymentAsk,
|
|
132
|
-
withBeltic,
|
|
133
|
-
wrapClient,
|
|
134
|
-
wrapServer
|
|
135
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { PaywallConfig } from '@x402/core/server';
|
|
2
|
-
import { A as AttachOptions } from './adapter-BEpzr2R3.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* The seller half as one middleware: the framework's `@x402/*` payment
|
|
6
|
-
* middleware over an `x402HTTPResourceServer` with the Beltic hooks
|
|
7
|
-
* attached. `@belticlabs/agent-risk-sdk/hono` and `@belticlabs/agent-risk-sdk/express` differ only in
|
|
8
|
-
* which `paymentMiddlewareFromHTTPServer` they hand in.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
type GuardedMiddlewareOptions = AttachOptions & {
|
|
12
|
-
paywall?: PaywallConfig | undefined;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export type { GuardedMiddlewareOptions as G };
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { B as Beltic } from '../session-DsBWEP8d.js';
|
|
2
|
-
import '../verdict-6vCyoAHE.js';
|
|
3
|
-
import 'zod';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Adapter for the anti-fraud port already in Beltic's `platform` monorepo
|
|
7
|
-
* (`x402-core/gateways/anti-fraud.gateway.interface.ts`), GAP-37. That
|
|
8
|
-
* port is binary and session-less; the mapping is lossy by construction:
|
|
9
|
-
* `REVIEW` becomes a deny unless `onReview` says otherwise, and reason
|
|
10
|
-
* codes travel joined in `reason`. The structural type is copied so this
|
|
11
|
-
* module needs no dependency on `platform`.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
interface PaymentRiskContext {
|
|
15
|
-
wallet: string;
|
|
16
|
-
resource: string;
|
|
17
|
-
amountAtomic: string;
|
|
18
|
-
asset: string;
|
|
19
|
-
network: string;
|
|
20
|
-
paymentIdentifier?: string;
|
|
21
|
-
/** Not in the platform port yet — pass it when you have it. */
|
|
22
|
-
sessionId?: string;
|
|
23
|
-
payTo?: string;
|
|
24
|
-
}
|
|
25
|
-
type RiskDecision = {
|
|
26
|
-
allow: true;
|
|
27
|
-
} | {
|
|
28
|
-
allow: false;
|
|
29
|
-
reason: string;
|
|
30
|
-
};
|
|
31
|
-
interface AntiFraudGateway {
|
|
32
|
-
assess(context: PaymentRiskContext): Promise<RiskDecision>;
|
|
33
|
-
}
|
|
34
|
-
declare class BelticAntiFraudGateway implements AntiFraudGateway {
|
|
35
|
-
private readonly beltic;
|
|
36
|
-
constructor(beltic: Beltic);
|
|
37
|
-
assess(ctx: PaymentRiskContext): Promise<RiskDecision>;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export { type AntiFraudGateway, BelticAntiFraudGateway, type PaymentRiskContext, type RiskDecision };
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
presentedFrom
|
|
3
|
-
} from "../chunk-7G5EHNVW.js";
|
|
4
|
-
import {
|
|
5
|
-
x402Summary
|
|
6
|
-
} from "../chunk-LM4NIYE5.js";
|
|
7
|
-
import "../chunk-FQDHFTVR.js";
|
|
8
|
-
|
|
9
|
-
// src/seller/anti-fraud-gateway.ts
|
|
10
|
-
var BelticAntiFraudGateway = class {
|
|
11
|
-
constructor(beltic) {
|
|
12
|
-
this.beltic = beltic;
|
|
13
|
-
}
|
|
14
|
-
async assess(ctx) {
|
|
15
|
-
const session = await this.beltic.sessions.ensure(ctx.sessionId ?? null);
|
|
16
|
-
const payment = x402Summary(
|
|
17
|
-
{
|
|
18
|
-
payTo: ctx.payTo ?? ctx.resource,
|
|
19
|
-
amount: ctx.amountAtomic,
|
|
20
|
-
network: ctx.network,
|
|
21
|
-
asset: ctx.asset
|
|
22
|
-
},
|
|
23
|
-
{ payer: ctx.wallet }
|
|
24
|
-
);
|
|
25
|
-
await session.emit(
|
|
26
|
-
"payment.presented",
|
|
27
|
-
presentedFrom(payment, {
|
|
28
|
-
resource: ctx.resource,
|
|
29
|
-
...ctx.paymentIdentifier ? { paymentIdentifier: ctx.paymentIdentifier } : {}
|
|
30
|
-
})
|
|
31
|
-
);
|
|
32
|
-
const out = await this.beltic.evaluate(session.id, payment);
|
|
33
|
-
return out?.verdict.blocks(this.beltic.onReview) ? { allow: false, reason: `${out.decision}:${out.reasonCodes.join(",")}` } : { allow: true };
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
export {
|
|
37
|
-
BelticAntiFraudGateway
|
|
38
|
-
};
|
package/dist/x402/express.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { RoutesConfig, x402ResourceServer } from '@x402/core/server';
|
|
2
|
-
import { RequestHandler } from 'express';
|
|
3
|
-
import { B as Beltic } from '../session-DsBWEP8d.js';
|
|
4
|
-
import { G as GuardedMiddlewareOptions } from '../middleware-9gI0ou2i.js';
|
|
5
|
-
export { a as attachX402 } from '../adapter-BEpzr2R3.js';
|
|
6
|
-
import '../verdict-6vCyoAHE.js';
|
|
7
|
-
import 'zod';
|
|
8
|
-
|
|
9
|
-
/** Seller half for express: `@x402/express`'s payment middleware with the Beltic hooks attached. */
|
|
10
|
-
|
|
11
|
-
declare function belticPaymentMiddleware(beltic: Beltic, routes: RoutesConfig, server: x402ResourceServer, opts?: GuardedMiddlewareOptions): RequestHandler;
|
|
12
|
-
|
|
13
|
-
export { belticPaymentMiddleware };
|
package/dist/x402/express.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
guardedPaymentMiddleware
|
|
3
|
-
} from "../chunk-NJVO2WIV.js";
|
|
4
|
-
import {
|
|
5
|
-
attachX402
|
|
6
|
-
} from "../chunk-OKC6VMFH.js";
|
|
7
|
-
import "../chunk-FAQ442YH.js";
|
|
8
|
-
import "../chunk-X3W2Z5GC.js";
|
|
9
|
-
import "../chunk-46QN2KEZ.js";
|
|
10
|
-
import "../chunk-LM4NIYE5.js";
|
|
11
|
-
import "../chunk-FQDHFTVR.js";
|
|
12
|
-
|
|
13
|
-
// src/x402/express.ts
|
|
14
|
-
import { paymentMiddlewareFromHTTPServer } from "@x402/express";
|
|
15
|
-
function belticPaymentMiddleware(beltic, routes, server, opts) {
|
|
16
|
-
return guardedPaymentMiddleware(
|
|
17
|
-
paymentMiddlewareFromHTTPServer,
|
|
18
|
-
beltic,
|
|
19
|
-
routes,
|
|
20
|
-
server,
|
|
21
|
-
opts
|
|
22
|
-
);
|
|
23
|
-
}
|
|
24
|
-
export {
|
|
25
|
-
attachX402,
|
|
26
|
-
belticPaymentMiddleware
|
|
27
|
-
};
|