jan3_purchase_ln_username
Purchases or updates a JAN3 Lightning username via on-chain L-BTC or USDt payment, returning a price quote first and funding the order only after user confirmation.
Instructions
Purchase / update the Lightning username for a JAN3 account with an on-chain payment (fund in L-BTC or USDt). TWO-STEP, do NOT pass confirm=true first: (1) call with confirm=false (default) to get a price quote WITHOUT spending — the server locks the price on that order; it returns display_amount (already formatted for the user, e.g. '2000 Sats' for L-BTC or '1.50 USDT' for USDt), amount_base_units (technical), amount, asset_ticker, payment_id and expires_at; SHOW display_amount to the user and get explicit consent; (2) only then call with confirm=true — it funds exactly the quoted order (same payment_id and amount) and errors if the quote expired (re-quote and re-confirm). When telling the user the price, use display_amount verbatim — never surface the raw amount/amount_base_units. Check availability first with jan3_ln_check_username. Requires an active JAN3 session (either flow).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"email": "<email>",
"ln_username": "<ln_username>"
},
"name": "jan3_purchase_ln_username"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| asset | No | Funding asset — 'L-BTC' or 'USDt'. Ask the user which they prefer; the price is quoted in that asset. | L-BTC |
| Yes | |||
| confirm | No | False (default) returns a non-spending price quote; True funds the previously quoted order. Only set True after the user approves the quoted display_amount. | |
| password | No | Decrypts the wallet mnemonic if encrypted at rest (only needed when confirm=true). | |
| ln_username | Yes | Desired username (the local part, before the @domain). | |
| wallet_name | No | Liquid wallet used to fund the purchase. | default |
| password_file | No | Path to a local file containing the wallet password; keeps the password out of the conversation. Do not combine with password. | |
| expected_amount_base_units | No | With confirm=true and no prior quote, the amount_base_units the user approved; the purchase aborts (nothing spent) if the current price exceeds it. |