Crates.io | fedimint-http |
lib.rs | fedimint-http |
version | 0.1.5 |
source | src |
created_at | 2024-01-03 03:51:01.141082 |
updated_at | 2024-02-15 19:00:26.794172 |
description | HTTP server for Fedimint Client, exposing REST and Websocket APIs for default modules. |
homepage | |
repository | |
max_upload_size | |
id | 1086978 |
size | 504,253 |
fedimint-http exposes a REST API to interact with the Fedimint client.
Set the variables in .env
by copying example.env
, then run cargo run
. It's also set up as a clap app so you can start the server with command line args as well.
The Fedimint client supports the following endpoints (and has naive websocket support at /fedimint/v2/ws
, see code for details until I improve the interface. PRs welcome!)
/fedimint/v2/admin/info
: Display wallet info (holdings, tiers)./fedimint/v2/admin/backup
: Upload the (encrypted) snapshot of mint notes to federation./fedimint/v2/admin/discover-version
: Discover the common api version to use to communicate with the federation./fedimint/v2/admin/restore
: Restore the previously created backup of mint notes (with backup
command)./fedimint/v2/admin/list-operations
: List operations./fedimint/v2/admin/module
: Call a module subcommand./fedimint/v2/admin/config
: Returns the client config./fedimint/v2/mint/reissue
: Reissue notes received from a third party to avoid double spends./fedimint/v2/mint/spend
: Prepare notes to send to a third party as a payment./fedimint/v2/mint/validate
: Verifies the signatures of e-cash notes, but not if they have been spent already./fedimint/v2/mint/split
: Splits a string containing multiple e-cash notes (e.g. from the spend
command) into ones that contain exactly one./fedimint/v2/mint/combine
: Combines two or more serialized e-cash notes strings./fedimint/v2/ln/invoice
: Create a lightning invoice to receive payment via gateway./fedimint/v2/ln/await-invoice
: Wait for incoming invoice to be paid./fedimint/v2/ln/pay
: Pay a lightning invoice or lnurl via a gateway./fedimint/v2/ln/await-pay
: Wait for a lightning payment to complete./fedimint/v2/ln/list-gateways
: List registered gateways./fedimint/v2/ln/switch-gateway
: Switch active gateway./fedimint/v2/onchain/deposit-address
: Generate a new deposit address, funds sent to it can later be claimed./fedimint/v2/onchain/await-deposit
: Wait for deposit on previously generated address./fedimint/v2/onchain/withdraw
: Withdraw funds from the federation.Soon(TM): maps Cashu NUT endpoints to fedimint client.
/v1/keys
: supportable/v1/keys/{keyset-id}
: supportable (fedimint only maintains 1 keyset)/v1/keysets
: supportable/v1/swap
: supportable/v1/mint/quote/{method}
: supportable
/v1/mint/quote/{method}/{quote_id}
: supportable/v1/mint/{method}
: supportable
/v1/melt/quote/{method}
: supportable
/v1/melt/quote/{method}/{quote_id}
: supportable/v1/info
: supportable