Allow specifying amounts in drops (#892)

* Accept "drops" in lieu of "XRP"
* Export xrpToDrops() and dropsToXrp()
* Throw our own validation errors instead of BigNumber Errors
This commit is contained in:
Elliot Lee
2018-05-21 13:19:18 -07:00
committed by GitHub
parent 2e5b435b11
commit 1aa9feda71
14 changed files with 359 additions and 53 deletions

View File

@@ -1,7 +1,7 @@
{
"amount": {
"currency": "XRP",
"value": "1"
"currency": "drops",
"value": "1000000"
},
"checkID": "838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334"
}

View File

@@ -1,7 +1,7 @@
{
"destination": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
"sendMax": {
"currency": "XRP",
"value": "1"
"currency": "drops",
"value": "1000000"
}
}

View File

@@ -6,9 +6,9 @@
"value": "10.1"
},
"totalPrice": {
"currency": "XRP",
"value": "2"
"currency": "drops",
"value": "2000000"
},
"passive": true,
"passive": false,
"fillOrKill": true
}

View File

@@ -1,5 +1,5 @@
{
"txJSON": "{\"Flags\":2147811328,\"TransactionType\":\"OfferCreate\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"TakerGets\":\"2000000\",\"TakerPays\":{\"value\":\"10.1\",\"currency\":\"USD\",\"issuer\":\"rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM\"},\"LastLedgerSequence\":8819954,\"Fee\":\"12\",\"Sequence\":23}",
"txJSON": "{\"Flags\":2147745792,\"TransactionType\":\"OfferCreate\",\"Account\":\"r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59\",\"TakerGets\":\"2000000\",\"TakerPays\":{\"value\":\"10.1\",\"currency\":\"USD\",\"issuer\":\"rMH4UxPrbuMa1spCBR98hLLyNJp4d8p4tM\"},\"LastLedgerSequence\":8819954,\"Fee\":\"12\",\"Sequence\":23}",
"instructions": {
"fee": "0.000012",
"sequence": 23,