Magma buy
magma_buyGet the user's confirmation before paying. This call costs 1 sat ≈ $0.0008 from the credit balance. Amboss Magma issues the Lightning invoice and handles the order. Amazap does not pay the invoice or return that payment. A retry of the same node, amount, and flags returns the same invoice.
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": {
"connection_uri": "<connection_uri>",
"usd_cents": "<usd_cents>"
},
"name": "magma_buy"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| usd_cents | Yes | Liquidity amount in US cents. At least 500. | |
| connection_uri | Yes | Node pubkey or pubkey@host:port. The node that will receive the channel. | |
| private_channel | No | Ask Magma for an unannounced channel. | |
| rails_cluster_only | No | Ask Magma to use Rails cluster sellers only. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | approval_required, limit_exceeded, or insufficient_balance. | |
| paid | No | ||
| which | No | per_call, per_day, per_session, per_hour_buys, per_minute_calls, or per_minute_sats. | |
| status | No | ||
| message | No | ||
| quoteId | No | ||
| results | No | Search rows when this is a search result. | |
| totalCost | No | ||
| totalSats | No | ||
| approvalUrl | No | Page where the person approves this exact price. |