Janus Pay

v1.1.0
io.github.Sirbiscuits1/janus-pay Checked 2 days ago Published 26 days ago

Janus Pay for agents: take payments that settle in BSV, refund them, and pay x402 paywalls.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

janus_coins Coins Janus Pay takes now

Which coins a customer can pay with right now, the most each can pay in one payment (pool depth), and the limits. BSV is paid straight to the shop with no fee.

janus_rate BSV price

Janus's BSV price in US dollars, the one it uses to turn a dollar price into BSV.

janus_quote Price a checkout

How much of a coin pays a price: give priceUsd or sat (what the shop receives in BSV satoshis) and the coin the customer pays with.

ParameterTypeDescription
payWith *string
priceUsdnumber
satinteger

janus_swap_quote Price a swap

What an amount of one coin becomes in another; one side is always BSV.

ParameterTypeDescription
amount *number
from *string
to *

janus_create_checkout Start a payment

Start a payment to a BSV address. Returns where to send and the exact amount; the payer sends it from their own wallet. For SOL, HYPE or BELLS give fromAddress (the payer's address on that chain; refunds go there). Keep `secret`: it cancels the payment before it is paid.

ParameterTypeDescription
payWith *string
to *stringthe BSV address that gets paid
fromAddressstring
idempotencyKeystring
orderRefstring
priceUsdnumber
satinteger

janus_payment_status Check a payment

A payment's status now: waiting, seen, completed, underpaid, failed, expired or held, with what the shop received and the payout transaction.

ParameterTypeDescription
paymentId *string

janus_my_payments My payments

Your payments, newest first (needs JANUS_API_KEY). Filter by your order reference or status.

ParameterTypeDescription
limitinteger
refstring
statusstring

janus_refund Refund a payment

Start a refund of one of your completed SOL/HYPE/BELLS checkouts (needs JANUS_API_KEY). Returns the BSV amount and address YOU pay; once paid, Janus pays the customer back in their coin. Nothing moves until you pay it. BSV payments are refunded from your own wallet.

ParameterTypeDescription
paymentId *string
amountSatinteger

janus_x402_proof Proof of payment for an x402 paywall

For a site that answers 402 Payment Required and offers the "janus" scheme: once you've paid its Janus Pay checkout (janus_create_checkout with the details in that offer's extra.create) and it shows completed, this returns the PAYMENT-SIGNATURE header to send with your request to get the content. Each payment opens one request.

ParameterTypeDescription
paymentId *string