Replying to Avatar calle

If you want to do it right:

1) Base64-urlsafe decode the part after cashuA...

2) You will get a JSON, let's call it `cashu`.

3) Notice the proofs in `cashu.token[0].proofs`

4) Get the Mint URL in `cashu.token[0].mint`

5) Get the value of the token:

```

let totalAmount = 0;

cashu.token[0].proofs.forEach((proof) => {

totalAmount += proof.amount;

});

```

6) Create a Lightning invoice worth `totalAmount*0.98` but at least 2 sats less.

7) Make a POST request to the mint URL:

```

curl -X POST https://mint.host:3338/mint&payment_hash=67d1d9ea6ada225c115418671b64a -d \

{

"proofs" :

cashu.token[0].proofs,

"pr": "lnbc100n1p3kdrv5sp5lpdxzghe5j67q..."

}

```

https://github.com/cashubtc/nuts/blob/main/05.md

Avatar
calle 2y ago

#[1] ser

Reply to this note

Please Login to reply.

Discussion

No replies yet.