-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
116 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Fedimint Clientd Curl Examples | ||
|
||
## Admin | ||
|
||
Info: | ||
|
||
``` | ||
curl http://localhost:3333/v2/admin/info -H "Authorization: Bearer password" | jq | ||
``` | ||
|
||
List Connected Fedimints and their balances: | ||
|
||
``` | ||
curl http://localhost:3333/v2/admin/info -H "Authorization: Bearer password" | jq 'to_entries | map({id: .key, name: .value.meta.federation_name, totalAmountMsat: .value.totalAmountMsat})' | ||
``` | ||
|
||
## Mint | ||
|
||
## Lightning | ||
|
||
Get a gateway ID for a federation: | ||
|
||
``` | ||
curl -v -X POST http://localhost:3333/v2/ln/list-gateways -H "Authorization: Bearer password" -H "Content-type: application/json" -d '{"federationId" : | ||
"15db8cb4f1ec8e484d73b889372bec94812580f929e8148b7437d359af422cd3"}' | ||
``` | ||
|
||
Create an invoice for a federation (using the gateway ID above): | ||
|
||
``` | ||
curl -v -X POST http://localhost:3333/v2/ln/invoice -H "Authorization: Bearer password" -H "Content-Type: application/json" -d '{"amountMsat": 1000000, "description": "test", "gatewayId": "035f2f7912e0f570841d5c0d8976a40af0dcca5609198436f596e78d2c851ee58a", "federationId": "15db8cb4f1ec8e484d73b889372bec94812580f929e8148b7437d359af422cd3"}' | ||
``` | ||
|
||
## Onchain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import "justfile.local.just" | ||
# THIS FILE IS AUTOGENERATED FROM FLAKEBOX CONFIGURATION | ||
|
||
alias b := build | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
# Check if amount is provided | ||
if [ "$#" -ne 1 ]; then | ||
echo "Usage: $0 <amountMsat>" | ||
exit 1 | ||
fi | ||
|
||
AMOUNT_MSAT=$1 | ||
FEDERATION_ID="15db8cb4f1ec8e484d73b889372bec94812580f929e8148b7437d359af422cd3" | ||
GATEWAY_ID="035f2f7912e0f570841d5c0d8976a40af0dcca5609198436f596e78d2c851ee58a" | ||
|
||
# Create an invoice and capture the response | ||
INVOICE_RESPONSE=$(curl -s -X POST http://localhost:3333/v2/ln/invoice \ | ||
-H "Authorization: Bearer password" \ | ||
-H "Content-Type: application/json" \ | ||
-d "{\"amountMsat\": $AMOUNT_MSAT, \"description\": \"Invoice for amount $AMOUNT_MSAT msat\", \"gatewayId\": \"$GATEWAY_ID\", \"federationId\": \"$FEDERATION_ID\"}") | ||
|
||
# Extract and print just the invoice from the response | ||
INVOICE=$(echo "$INVOICE_RESPONSE" | jq -r '.invoice') | ||
echo "$INVOICE" |