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.
39 lines • 1.64 kB
TypeScript
/**
* Strictly decoded BOLT11 invoice fields used by the lnbtc scheme.
*/
export interface DecodedInvoice {
/** BOLT11 currency prefix (e.g. `bc`, `tb`). */
currency: string;
/** Invoice amount in millisatoshis. */
amountMsat: bigint;
/** Creation time, Unix seconds. */
timestamp: number;
/** Expiry in seconds (BOLT11 default 3600 when the `x` field is absent). */
expirySeconds: number;
/** Payment hash, 64 lowercase hex characters. */
paymentHash: string;
/** Every valid `h` (description hash) field, lowercase hex. */
descriptionHashes: string[];
/** Number of `d` (inline description) fields. */
inlineDescriptionCount: number;
/** Signing node public key (compressed, lowercase hex), from `n` or recovered. */
payee: string;
/** Whether the invoice carried an explicit `n` field. */
hasPayeeField: boolean;
}
/**
* Decodes a BOLT11 invoice and verifies its signature.
*
* Strict: rejects mixed case, a `lightning:` prefix, a missing or zero amount,
* sub-millisatoshi amounts, amounts with leading zeros, fixed-length fields of
* the wrong length or with non-zero padding, duplicated payment hash, payment
* secret, payee, expiry, CLTV, or feature fields, non-minimal integer fields,
* a missing payment secret, a high-S signature verified against an `n` field,
* and an invalid signature.
*
* @param invoice - BOLT11 invoice text
* @returns The decoded invoice
* @throws Error when the invoice is malformed or its signature is invalid
*/
export declare function decodeInvoice(invoice: string): DecodedInvoice;
//# sourceMappingURL=bolt11.d.ts.map