-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from uma-universal-money-address/feat/displayDe…
…cimals Add displayDecimals to the currency object.
- Loading branch information
Showing
4 changed files
with
34 additions
and
10 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
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,10 +1,30 @@ | ||
package uma | ||
|
||
type Currency struct { | ||
Code string `json:"code"` | ||
Name string `json:"name"` | ||
Symbol string `json:"symbol"` | ||
MillisatoshiPerUnit int64 `json:"multiplier"` | ||
MinSendable int64 `json:"minSendable"` | ||
MaxSendable int64 `json:"maxSendable"` | ||
// Code is the ISO 4217 currency code (eg. USD). | ||
Code string `json:"code"` | ||
|
||
// Name is the full display name of the currency (eg. US Dollars). | ||
Name string `json:"name"` | ||
|
||
// Symbol is the symbol of the currency (eg. $ for USD). | ||
Symbol string `json:"symbol"` | ||
|
||
// MillisatoshiPerUnit is the estimated millisats per smallest "unit" of this currency (eg. 1 cent in USD). | ||
MillisatoshiPerUnit int64 `json:"multiplier"` | ||
|
||
// MinSendable is the minimum amount of the currency that can be sent in a single transaction. This is in the | ||
// smallest unit of the currency (eg. cents for USD). | ||
MinSendable int64 `json:"minSendable"` | ||
|
||
// MaxSendable is the maximum amount of the currency that can be sent in a single transaction. This is in the | ||
// smallest unit of the currency (eg. cents for USD). | ||
MaxSendable int64 `json:"maxSendable"` | ||
|
||
// DisplayDecimals is the number of digits after the decimal point for display on the sender side. For example, | ||
// in USD, by convention, there are 2 digits for cents - $5.95. in this case, `displayDecimals` | ||
// would be 2. Note that the multiplier is still always in the smallest unit (cents). This field | ||
// is only for display purposes. The sender should assume zero if this field is omitted, unless | ||
// they know the proper display format of the target currency. | ||
DisplayDecimals *int `json:"displayDecimals,omitempty"` | ||
} |
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