Repository navigation
v4.117.0
Sell for sats on priced routes
A function route's pricing.networks accepts lightning and lightning-testnet. The 402 challenge then carries an x402 exact entry on Bitcoin Lightning (lnbtc) whose invoice is bound to the request, and the sats settle straight to the organization's own receive-only Lightning node. An optional amount_msat pins the Lightning price in millisatoshis; without it each challenge quotes amount_usd_micros into whole satoshis. receipt cannot be combined with a Lightning network, and a Lightning-only route needs no EVM payout wallet.
CLI
run402 orgs lightning-receiver set <nwc-uri | ->registers the organization's receive-only NWC pairing (read from the argument or stdin, never printed),statusshows the probed node and health,removedetaches it.
SDK
r.orgs.lightningReceiver.set/get/removewith theOrgLightningReceiver,LightningReceiver,SetLightningReceiverInput, andLightningReceiverRemovedtypes.setconsumes a one-time secret, so on the MCP sandbox it answersSECRET_REQUIRES_CLIand points at the CLI command.RoutePricingSpecvalidates the new networks andamount_msatlocally before planning.
Docs
- The routed payment context documents
amountMsatand thenullpayer of a Lightning payment (@run402/functions4.10+). - Error catalog refreshed from the gateway:
LIGHTNING_RECEIVER_REQUIRED,LIGHTNING_RECEIVER_UNAVAILABLE,LIGHTNING_RECEIVER_PROBE_FAILED,LIGHTNING_RECEIVER_NOT_FOUND,RECIPIENT_LIGHTNING_RECEIVER_REQUIRED, plus sixteen codes from earlier gateway releases that were missing from the catalog.
Requires Run402 Cloud at or after gateway b57473a69 for the Lightning receiver routes.