run402-mcp
Version:
MCP server for Run402 — full-stack backend infrastructure for AI agents: Postgres, auth, storage, serverless functions and atomic deploys. Paid with x402/MPP. Includes $0.03 image generation.
58 lines • 2.37 kB
TypeScript
import type { PaymentPayloadContext, PaymentPayloadResult, PaymentRequirements, SchemeClientHooks, SchemeNetworkClient } from "@x402/core/types";
import type { Clock, LightningPayer, RequestBindingProvider } from "../../types.js";
/**
* Options for the lnbtc client.
*/
export interface ExactLnbtcClientOptions {
/** Payer node adapter; must return the preimage for paid invoices. */
payer: LightningPayer;
/**
* Returns the binding of the request being paid for, computed by the
* application from the intended request (`httpRequestBinding` or
* `mcpToolCallBinding`), never from the payment challenge.
*/
requestBinding: RequestBindingProvider;
/** Clock-skew allowance in seconds (default 60). */
clockSkewSeconds?: number;
/** Clock returning Unix seconds. */
clock?: Clock;
/** Supported networks mapped to BOLT11 currency (default: mainnet and testnet). */
networks?: Readonly<Record<string, string>>;
}
/**
* Client for `exact` on `lnbtc`: validates the request-bound invoice, pays it,
* and returns the verified preimage.
*/
export declare class ExactLnbtcScheme implements SchemeNetworkClient {
readonly scheme = "exact";
readonly schemeHooks: SchemeClientHooks;
private readonly options;
private readonly skew;
private readonly clock;
private readonly networks;
/**
* Creates the client scheme.
*
* @param options - Payer adapter, request binding provider, clock, and skew
*/
constructor(options: ExactLnbtcClientOptions);
/**
* Validates the challenge against the intended request, pays the invoice,
* and verifies the returned preimage.
*
* @param x402Version - Protocol version
* @param requirements - Selected payment requirements
* @param context - Spend cap from the client's spend controls, if any
* @returns The payload carrying the preimage
*/
createPaymentPayload(x402Version: number, requirements: PaymentRequirements, context?: PaymentPayloadContext): Promise<PaymentPayloadResult>;
/**
* For `http:1`, requires `PaymentRequired.resource.url` to equal the
* intended request URL before any payment.
*
* @param ctx - Payment creation context
* @returns An abort result on mismatch
*/
private checkResource;
}
//# sourceMappingURL=scheme.d.ts.map