Closed mDuo13 closed 5 years ago
I believe that Payment Channels have the same problem. The response for PaymentChannelCreate could include a similar field. (The RippleAPI paymentChannelClaim and paymentChannelFund objects require the ID in the channel
field.)
Thank you for bringing this up!
The way I've been doing it so far is by sending the raw account_objects
command (mentioned by Fred here). Adding first-class support for account_objects is in progress.
I've also been able to calculate the CheckID "offline" according to the documented format. For the example you posted:
> hashes.addressToHex('rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za').toUpperCase()
'735FF88E5269C80CD7F7AF10530DAB840BBF6FDF'
> hashes.hash('0043735FF88E5269C80CD7F7AF10530DAB840BBF6FDF00000004')
'84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9'
I like the idea of also returning the value with getTransaction
.
0.21.0 (2018-04-11) added getAccountObjects
which includes Check IDs.
We can keep this issue open until I look into adding a method for generating CheckIDs offline.
There's not much demand for generating CheckIDs offline, but it's something that could be added fairly easily if anyone wants it (create a new issue if that's the case). Closing.
One of the most important things to know about a CheckCreate transaction is the ID of the Check object created in the ledger data as a result of the transaction. In fact, you need this value to cash or redeem the check. It appears there is not currently a documented way to get the checkID using RippleAPI.
The
getTransaction()
method of RippleAPI does not expose this information in a useful way when looking up a Check. For example, logging the response from agetTransaction()
request (for a CheckCreate transaction with hashC0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441
on the Test Net) returns this (with v0.19.0):I suggest the
outcome
object in the getTransaction response should add an optional field,checkID
with the ID of the created Check object if the transaction created one.To find this value, you'll have to page through the AffectedNodes to find a
CreatedNode
element with"LedgerEntryType": "Check"
and pull out theLedgerIndex
value from that element. Here's an example from the metadata of that same transaction: