Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add proposal for currencies on payRequest #251

Open
wants to merge 12 commits into
base: luds
Choose a base branch
from
Prev Previous commit
Next Next commit
Update spec adding separator to amount with currency
  • Loading branch information
lsunsi committed Dec 6, 2023
commit 7bf8f3afadc4b6b4e2ddd0f6b0acb2a4871b7e49
12 changes: 6 additions & 6 deletions 21.md
Original file line number Diff line number Diff line change
@@ -82,12 +82,12 @@ The most general case, when the user is denominating the amount in `CURRENCY1`,
`CURRENCY1` and `CURRENCY2` can be the same, which would the common use case for remittances.
```diff
- <callback><?|&>amount=<milliSatoshi>
+ <callback><?|&>amount=<AMOUNT><CURRENCY1>&convert=<CURRENCY2>
+ <callback><?|&>amount=<AMOUNT>.<CURRENCY1>&convert=<CURRENCY2>

In a more particular case, when user is denominating the amount in `CURRENCY`, but does not want to convert it or the service does not support conversion.
```diff
- <callback><?|&>amount=<milliSatoshi>
+ <callback><?|&>amount=<AMOUNT><CURRENCY>
+ <callback><?|&>amount=<AMOUNT>.<CURRENCY>
```

In another particular case, when the user is denominating the amount in millisatoshi, but wants it to be converted to `CURRENCY` on `SERVICE`.
@@ -174,30 +174,30 @@ These examples show all the possible uses of this extension by a supporting `WAL
```
#### Payer sends 1 BRL (100 cents of BRL) worth of BTC as BTC
```json
// GET bipa.app/callback?amount=100BRL
// GET bipa.app/callback?amount=100.BRL
{
"pr": "(invoice of 538 sats)"
}
```
#### Payer sends 1 BRL (100 cents of BRL) worth of BTC as BRL
```json
// GET bipa.app/callback?amount=100BRL&convert=BRL
// GET bipa.app/callback?amount=100.BRL&convert=BRL
{
"pr": "(invoice of 538 sats)",
"converted": 100
}
```
#### Payer sends 1 BRL (100 cents of BRL) worth of BTC as USDT (20 cents of USDT)
```json
// GET bipa.app/callback?amount=100BRL&convert=USDT
// GET bipa.app/callback?amount=100.BRL&convert=USDT
{
"pr": "(invoice of 538 sats)",
"converted": 200000
}
```
#### Payer sends 1 BRL (100 cents of BRL) worth of BTC to unsupported
```json
// GET bipa.app/callback?amount=100BRL
// GET bipa.app/callback?amount=100.BRL
// ERROR, because 100BRL is not a number and can't
// be interpret as milisatoshis by the unsupported service.
```