-
Notifications
You must be signed in to change notification settings - Fork 513
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
Document xrpToDrops, dropsToXrp, iso8601ToRippleTime, schemaValidator… #926
Conversation
Providing these docs as follow-up to #915 |
@@ -0,0 +1,34 @@ | |||
## createPaymentTransaction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing this is for #922
Should it be included yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, thanks
|
||
### Parameters | ||
|
||
`drops`: A string or BigNumber representing an amount of drops. If `drops` is a string, it may start with `-`, must contain at least one number, and must not contain `.`. This method throws a `ValidationError` for invalid input. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is fine as is, but if drops
is a string, it can contain .
https://github.com/ripple/ripple-lib/pull/892/files#diff-12042bcf08631e33198bb47382ee4813R176
docs/src/txFlags.md.ejs
Outdated
|
||
`txFlags.Payment.PartialPayment`: If the specified destination amount cannot be sent without spending more than the source maxAmount, reduce the received amount instead of failing outright. See [Partial Payments](https://developers.ripple.com/partial-payments.html) for more details. | ||
|
||
`txFlags.Payment.PartialPayment`: Only take paths where all the conversions have an input:output ratio that is equal or better than the ratio of `Amount`:`SendMax`. See [Limit Quality](https://developers.ripple.com/payment.html#limit-quality) for details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PartialPayment
-> LimitQuality
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"the ratio of Amount
:SendMax
"
Should this instead refer to ripple-lib's destination.amount
and source:maxAmount
?
https://github.com/ripple/ripple-lib/blob/develop/docs/index.md#payment
docs/src/txFlags.md.ejs
Outdated
|
||
`txFlags.OfferCreate.FillOrKill`: Treat the offer as a Fill or Kill order. Only try to match existing offers in the ledger, and only do so if the entire TakerPays quantity can be obtained. | ||
|
||
`txFlags.OfferCreate.Sell`: Exchange the entire TakerGets amount, even if it means obtaining more than the TakerPays amount in exchange. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to above, not sure if FillOrKill
/OfferCreate
should be described with rippled's TakerPays
and TabkerGets
or ripple-lib's quantity
/totalPrice
https://github.com/ripple/ripple-lib/blob/develop/docs/index.md#order
docs/src/txFlags.md.ejs
Outdated
|
||
### TrustSet Flags | ||
|
||
`txFlags.TrustSet.SetAuth`: Authorize the other party to hold issuances from this account. (No effect unless using the asfRequireAuth AccountSet flag.) Cannot be unset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
asfRequireAuth AccountSet flag
-> AccountSet.RequireAuth
?
docs/src/txFlags.md.ejs
Outdated
|
||
### AccountSet Flags | ||
|
||
Account Flags can be enabled and disabled with the SetFlag and ClearFlag parameters. See [AccountSet Flags](https://developers.ripple.com/accountset.html#accountset-flags). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if this should instead mention the prepareSettings
settings
parameter
https://github.com/ripple/ripple-lib/blob/develop/docs/index.md#preparesettings
* EscrowFinish | ||
* EscrowCancel | ||
* PaymentChannelCreate | ||
* PaymentChannelFund |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this list include SetRegularKey
and SignerListSet
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think they're already there, although the list is not ordered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤦♂️
docs/src/schemaValidator.md.ejs
Outdated
|
||
`RippleAPI.schemaValidator.isValidAddress(address: string): boolean` | ||
|
||
This method checks an address for validity. It does this by attempting to decoding the address. If decoding succeeds, this method returns `true`. Otherwise, it returns `false`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
attempting to decoding
-> attempting to decode
|
||
`RippleAPI.schemaValidator.schemaValidate(schemaName: string, object: any): void` | ||
|
||
This method checks an object for conformance to a specified schema. It does not return anything, but will throw a `ValidationError` if the object does not conform to the schema. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about including an example for schemaValidate
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea
docs/src/schemaValidator.md.ejs
Outdated
|
||
`RippleAPI.schemaValidator.isValidSecret(secret: string): boolean` | ||
|
||
This method checks a secret for validity. It does this by attempting to decoding the secret. If decoding succeeds, this method returns `true`. Otherwise, it returns `false`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
attempting to decoding
-> attempting to decode
@wilsonianb I think I've fixed everything. Have a second look whenever! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
I realized, when writing these docs, that it doesn't really make sense to have these methods under schemaValidator. I'd like to move them to be on the RippleAPI object directly. |
Awaiting #932 |
Is there a reverse of |
Merged via 5fed1f0 |
These docs are far from perfect, but this should help to clarify how these methods can be used.