Skip to content

Commit

Permalink
add convertible max/min sendable fields
Browse files Browse the repository at this point in the history
  • Loading branch information
lsunsi committed Dec 27, 2023
1 parent 8580e3c commit 7275242
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions 21.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ type Currency = {
symbol: string, // Symbol of the currency. E.g.: R$
decimals: number, // Integer; Number of decimal places. E.g.: 2
multiplier: number, // Double; Number of millisatoshis per smallest unit of currency. E.g.: 5405.405
convertible?: bool // Whether the payment can be converted into the currency
convertible?: { // Whether the payment can be converted into the currency
max: number, // Integer; Max converted amount of currency
min: number // Integer; Min converted amount of currency
}
}

type ExtendedResponse = BaseResponse & {
Expand All @@ -63,19 +66,23 @@ type ExtendedResponse = BaseResponse & {
+ "symbol": "R$",
+ "decimals": 2,
+ "multiplier": 5404.405,
+ "convertible": true
+ "convertible": {
+ "max": 100000,
+ "min": 1000
+ }
+ }
+ ]
}
```
- The inclusion of the `currencies` field implies the support of this extension
- The inclusion of a `currency` implies it can be used for denomination of an amount
- The inclusion of a `convertible currency` implies the `SERVICE` can quote and guarantee a price for a given currency
- The inclusion of a `convertible` field implies the `SERVICE` can quote and guarantee a price for a given `currency`
- The `multiplier` is not guaranteed by the `SERVICE` and is subject to change
- The `code` of a `currency` will be used as an identifier for the next request and must be unique
- The `code` must be according to [ISO-4217](https://en.wikipedia.org/wiki/ISO_4217) if possible
- The order of the `currencies` may be interpreted by the `WALLET` as the receiving user preference for a currency
- The `max` and `min` fields within `convertible` field must be respected by `WALLET` on `convertable` requests
### Wallet-side second request
Expand Down Expand Up @@ -140,7 +147,10 @@ These examples show all the possible uses of this extension by a supporting `WAL
"symbol": "R$",
"decimals": 2,
"multiplier": 5405.405,
"convertible": true
"convertible": {
"max": 100000,
"min": 100
}
},
{
"code": "USDT",
Expand Down

0 comments on commit 7275242

Please sign in to comment.