Last active
July 3, 2017 08:25
-
-
Save akirattii/04ea9f81f62adfc254f3eb9fbb2ce12b to your computer and use it in GitHub Desktop.
Ripple: How to get offers' status (filled/partially-filled/cancelled/created) by transaction data of account_tx response. Also curate payment transactions.
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
const RippleTxParser = require('../lib/RippleTxParser.js'); | |
// $ curl --data-binary '{"jsonrpc":"2.0","id":0,"method":"account_tx","params":[{"account":"rHDvn877ezKZokt9WWeVhjwfab53o4pjw1","binary":false,"count":false,"descending":true,"forward":false,"ledger_index_max":-1,"ledger_index_min":-1,"limit":3,"offset":0}]}' https://api.altnet.rippletest.net:51234 | |
const rpcResponse = { | |
"id": 0, | |
"jsonrpc": "2.0", | |
"result": { | |
"account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", | |
"ledger_index_max": 1978762, | |
"ledger_index_min": 1970015, | |
"limit": 10, | |
"offset": 0, | |
"status": "success", | |
"transactions": [{ "meta": { "AffectedNodes": [{ "CreatedNode": { "LedgerEntryType": "Offer", "LedgerIndex": "6DA2D04A4B67C06A0847FB761980179B42FA4BB0B20112CCAA01204A289F5DB3", "NewFields": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "BookDirectory": "F9DB9927CDCFBDB18FB37B77E49A3D0A5B613F90409E79CE5408E1BC9BF04000", "Sequence": 58, "TakerGets": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "8" }, "TakerPays": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "2" } } } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "YYY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "85.74" }, "Flags": 65536, "HighLimit": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "YYY", "issuer": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "value": "0" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "6DF5EE1976FF38B40DB8B046807EBE04FA5F1E4E31919397DC126FC12A9CC55E", "PreviousFields": { "Balance": { "currency": "YYY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "90.14" } }, "PreviousTxnID": "7F7CA4AF6A7D3EB7737DE1700D76E218B5EFC42EFF9DE7D4CB928552079827AE", "PreviousTxnLgrSeq": 1975404 } }, { "DeletedNode": { "FinalFields": { "ExchangeRate": "550E35FA931A0000", "Flags": 0, "RootIndex": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C550E35FA931A0000", "TakerGetsCurrency": "0000000000000000000000005858580000000000", "TakerGetsIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC", "TakerPaysCurrency": "0000000000000000000000005959590000000000", "TakerPaysIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C550E35FA931A0000" } }, { "ModifiedNode": { "FinalFields": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "Balance": "10007969408", "Flags": 8388608, "OwnerCount": 4, "Sequence": 59 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "84F79BFBB44AE1F016E710DC74B7D1C677BE9995546AD585D8BC05EF1399B06E", "PreviousFields": { "Balance": "10007969418", "OwnerCount": 3, "Sequence": 58 }, "PreviousTxnID": "7F7CA4AF6A7D3EB7737DE1700D76E218B5EFC42EFF9DE7D4CB928552079827AE", "PreviousTxnLgrSeq": 1975404 } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "28.68285714285715" }, "Flags": 65536, "HighLimit": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "XXX", "issuer": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "value": "100" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "861B8AAC3B75826723AE2AED95DFE8E185237A1A1A641EBE6A6D910F470F4738", "PreviousFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "29.78285714285715" } }, "PreviousTxnID": "7F7CA4AF6A7D3EB7737DE1700D76E218B5EFC42EFF9DE7D4CB928552079827AE", "PreviousTxnLgrSeq": 1975404 } }, { "ModifiedNode": { "FinalFields": { "Flags": 0, "Owner": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "RootIndex": "8D7B24212E5FB685A54FB40778B559140FC07EFFF376C29334B2BF97EC5B4BA9" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "8D7B24212E5FB685A54FB40778B559140FC07EFFF376C29334B2BF97EC5B4BA9" } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "34.84285714285714" }, "Flags": 65536, "HighLimit": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "XXX", "issuer": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "value": "100" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "B517AC298C47CF0734ED40149B6FBA38921952F1441EF149A045E8D9DCE9E9C3", "PreviousFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "33.84285714285714" } }, "PreviousTxnID": "7F7CA4AF6A7D3EB7737DE1700D76E218B5EFC42EFF9DE7D4CB928552079827AE", "PreviousTxnLgrSeq": 1975404 } }, { "ModifiedNode": { "FinalFields": { "Account": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "Balance": "9992032290", "Flags": 0, "OwnerCount": 3, "Sequence": 63 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "CD69A5B67A19C01AA680EED8295D53C72FA4B1BCA4FDCD9F9A6285954A3BBD8E", "PreviousFields": { "OwnerCount": 4 }, "PreviousTxnID": "2E793679D7B3A9C2E7207D23BEB0E39522AE41662E303A541FEF30BB14AF36D8", "PreviousTxnLgrSeq": 1975391 } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "YYY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "9900.1" }, "Flags": 65536, "HighLimit": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "YYY", "issuer": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "value": "10000" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "EA261DC41E410F4855E8D94C1699BE072AC78550100F840E0144A1871D50EE4C", "PreviousFields": { "Balance": { "currency": "YYY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "9896.1" } }, "PreviousTxnID": "7F7CA4AF6A7D3EB7737DE1700D76E218B5EFC42EFF9DE7D4CB928552079827AE", "PreviousTxnLgrSeq": 1975404 } }, { "DeletedNode": { "FinalFields": { "Account": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "BookDirectory": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C550E35FA931A0000", "BookNode": "0000000000000000", "Flags": 0, "OwnerNode": "0000000000000000", "PreviousTxnID": "7F7CA4AF6A7D3EB7737DE1700D76E218B5EFC42EFF9DE7D4CB928552079827AE", "PreviousTxnLgrSeq": 1975404, "Sequence": 62, "TakerGets": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "TakerPays": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" } }, "LedgerEntryType": "Offer", "LedgerIndex": "F907D67F51B0850619A3A4C4C9218A6BEFD2FCE5E3C0F366E8426A770FF7F825", "PreviousFields": { "TakerGets": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "1" }, "TakerPays": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "4" } } } }, { "CreatedNode": { "LedgerEntryType": "DirectoryNode", "LedgerIndex": "F9DB9927CDCFBDB18FB37B77E49A3D0A5B613F90409E79CE5408E1BC9BF04000", "NewFields": { "ExchangeRate": "5408E1BC9BF04000", "RootIndex": "F9DB9927CDCFBDB18FB37B77E49A3D0A5B613F90409E79CE5408E1BC9BF04000", "TakerGetsCurrency": "0000000000000000000000005959590000000000", "TakerGetsIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC", "TakerPaysCurrency": "0000000000000000000000005858580000000000", "TakerPaysIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC" } } }, { "ModifiedNode": { "FinalFields": { "Flags": 0, "Owner": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "RootIndex": "FE260BE617AE866816CE83489797A91AAFE70960F5799DCC6984C323DF46BF38" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "FE260BE617AE866816CE83489797A91AAFE70960F5799DCC6984C323DF46BF38" } }], "TransactionIndex": 0, "TransactionResult": "tesSUCCESS" }, "tx": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "Fee": "10", "Flags": 2147483648, "LastLedgerSequence": 1977112, "Sequence": 58, "SigningPubKey": "02C301D531D49A99D66E1FB8E8D101384436D0FA31E2D2F8E43DA1C538591096F7", "TakerGets": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "12" }, "TakerPays": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "3" }, "TransactionType": "OfferCreate", "TxnSignature": "3045022100851A8543671903021324E56CF6AC165D6B80EBAED2B7DC67F526A88BFDFB82060220604077A3B42A684B54A9C5368470F04A82A437EA916F2327E1AC7DE70CDC44FB", "date": 550809740, "hash": "089127676221833184FAD1B57D59F98CACA1C78D209A6AE78EECD644D8819788", "inLedger": 1977112, "ledger_index": 1977112 }, "validated": true }, { "meta": { "AffectedNodes": [{ "ModifiedNode": { "FinalFields": { "Balance": { "currency": "YYY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "90.14" }, "Flags": 65536, "HighLimit": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "YYY", "issuer": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "value": "0" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "6DF5EE1976FF38B40DB8B046807EBE04FA5F1E4E31919397DC126FC12A9CC55E", "PreviousFields": { "Balance": { "currency": "YYY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "98.94" } }, "PreviousTxnID": "A2F85479B0F6D9248537EB9367DEBB3C6697384FDF628CD46FDCFD25195108C4", "PreviousTxnLgrSeq": 1974931 } }, { "ModifiedNode": { "FinalFields": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "Balance": "10007969418", "Flags": 8388608, "OwnerCount": 3, "Sequence": 58 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "84F79BFBB44AE1F016E710DC74B7D1C677BE9995546AD585D8BC05EF1399B06E", "PreviousFields": { "Balance": "10007969428", "Sequence": 57 }, "PreviousTxnID": "A2F85479B0F6D9248537EB9367DEBB3C6697384FDF628CD46FDCFD25195108C4", "PreviousTxnLgrSeq": 1974931 } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "29.78285714285715" }, "Flags": 65536, "HighLimit": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "XXX", "issuer": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "value": "100" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "861B8AAC3B75826723AE2AED95DFE8E185237A1A1A641EBE6A6D910F470F4738", "PreviousFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "31.98285714285715" } }, "PreviousTxnID": "A2F85479B0F6D9248537EB9367DEBB3C6697384FDF628CD46FDCFD25195108C4", "PreviousTxnLgrSeq": 1974931 } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "33.84285714285714" }, "Flags": 65536, "HighLimit": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "XXX", "issuer": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "value": "100" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "B517AC298C47CF0734ED40149B6FBA38921952F1441EF149A045E8D9DCE9E9C3", "PreviousFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "31.84285714285714" } }, "PreviousTxnID": "A2F85479B0F6D9248537EB9367DEBB3C6697384FDF628CD46FDCFD25195108C4", "PreviousTxnLgrSeq": 1974931 } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "YYY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "9896.1" }, "Flags": 65536, "HighLimit": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "YYY", "issuer": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "value": "10000" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "EA261DC41E410F4855E8D94C1699BE072AC78550100F840E0144A1871D50EE4C", "PreviousFields": { "Balance": { "currency": "YYY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "9888.1" } }, "PreviousTxnID": "A2F85479B0F6D9248537EB9367DEBB3C6697384FDF628CD46FDCFD25195108C4", "PreviousTxnLgrSeq": 1974931 } }, { "ModifiedNode": { "FinalFields": { "Account": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "BookDirectory": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C550E35FA931A0000", "BookNode": "0000000000000000", "Flags": 0, "OwnerNode": "0000000000000000", "Sequence": 62, "TakerGets": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "1" }, "TakerPays": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "4" } }, "LedgerEntryType": "Offer", "LedgerIndex": "F907D67F51B0850619A3A4C4C9218A6BEFD2FCE5E3C0F366E8426A770FF7F825", "PreviousFields": { "TakerGets": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "3" }, "TakerPays": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "12" } }, "PreviousTxnID": "2E793679D7B3A9C2E7207D23BEB0E39522AE41662E303A541FEF30BB14AF36D8", "PreviousTxnLgrSeq": 1975391 } }], "TransactionIndex": 3, "TransactionResult": "tesSUCCESS" }, "tx": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "Fee": "10", "Flags": 2147483648, "LastLedgerSequence": 1975404, "Sequence": 57, "SigningPubKey": "02C301D531D49A99D66E1FB8E8D101384436D0FA31E2D2F8E43DA1C538591096F7", "TakerGets": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "8" }, "TakerPays": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "2" }, "TransactionType": "OfferCreate", "TxnSignature": "304402206CDF9701AA9E3E549671FCEFDC2A5D90C2546D8C16F7B5DDEDB10D37AC0500800220621BC87919CBDFE2113F516C58E0C00B8DDEDB5A0548783438EB03F54C626978", "date": 550804111, "hash": "7F7CA4AF6A7D3EB7737DE1700D76E218B5EFC42EFF9DE7D4CB928552079827AE", "inLedger": 1975404, "ledger_index": 1975404 }, "validated": true }, { "meta": { "AffectedNodes": [{ "ModifiedNode": { "FinalFields": { "Balance": { "currency": "YYY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "98.94" }, "Flags": 65536, "HighLimit": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "YYY", "issuer": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "value": "0" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "6DF5EE1976FF38B40DB8B046807EBE04FA5F1E4E31919397DC126FC12A9CC55E", "PreviousFields": { "Balance": { "currency": "YYY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "112.14" } }, "PreviousTxnID": "6F186328B34318B2CCFF117403300CEC6D3DEC1982914DDBE459721DCBB39CB5", "PreviousTxnLgrSeq": 1972887 } }, { "DeletedNode": { "FinalFields": { "ExchangeRate": "551550F7DCA70000", "Flags": 0, "RootIndex": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C551550F7DCA70000", "TakerGetsCurrency": "0000000000000000000000005858580000000000", "TakerGetsIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC", "TakerPaysCurrency": "0000000000000000000000005959590000000000", "TakerPaysIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C551550F7DCA70000" } }, { "ModifiedNode": { "FinalFields": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "Balance": "10007969428", "Flags": 8388608, "OwnerCount": 3, "Sequence": 57 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "84F79BFBB44AE1F016E710DC74B7D1C677BE9995546AD585D8BC05EF1399B06E", "PreviousFields": { "Balance": "10007969438", "Sequence": 56 }, "PreviousTxnID": "4C99BC341C4AE4783F3EDDFC7A78BA3DD084770D3220EF5623A08BE68ADDBFDF", "PreviousTxnLgrSeq": 1974505 } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "31.98285714285715" }, "Flags": 65536, "HighLimit": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "XXX", "issuer": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "value": "100" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "861B8AAC3B75826723AE2AED95DFE8E185237A1A1A641EBE6A6D910F470F4738", "PreviousFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "34.18285714285715" } }, "PreviousTxnID": "6F186328B34318B2CCFF117403300CEC6D3DEC1982914DDBE459721DCBB39CB5", "PreviousTxnLgrSeq": 1972887 } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "31.84285714285714" }, "Flags": 65536, "HighLimit": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "XXX", "issuer": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "value": "100" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "B517AC298C47CF0734ED40149B6FBA38921952F1441EF149A045E8D9DCE9E9C3", "PreviousFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "29.84285714285714" } }, "PreviousTxnID": "6F186328B34318B2CCFF117403300CEC6D3DEC1982914DDBE459721DCBB39CB5", "PreviousTxnLgrSeq": 1972887 } }, { "ModifiedNode": { "FinalFields": { "Account": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "Balance": "9992032300", "Flags": 0, "OwnerCount": 3, "Sequence": 62 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "CD69A5B67A19C01AA680EED8295D53C72FA4B1BCA4FDCD9F9A6285954A3BBD8E", "PreviousFields": { "OwnerCount": 4 }, "PreviousTxnID": "F3908AC488CD99A08F37D6B5E8B1967912026FEAA83DE3D20C9E039FC0EF04AB", "PreviousTxnLgrSeq": 1974900 } }, { "DeletedNode": { "FinalFields": { "Account": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "BookDirectory": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C551550F7DCA70000", "BookNode": "0000000000000000", "Flags": 0, "OwnerNode": "0000000000000000", "PreviousTxnID": "F3908AC488CD99A08F37D6B5E8B1967912026FEAA83DE3D20C9E039FC0EF04AB", "PreviousTxnLgrSeq": 1974900, "Sequence": 61, "TakerGets": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "TakerPays": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" } }, "LedgerEntryType": "Offer", "LedgerIndex": "E4B1F20AA8055D7D3BB76295DBF2D29104A15B2C83C1CD75D268CD67CC7EF54E", "PreviousFields": { "TakerGets": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "2" }, "TakerPays": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "12" } } } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "YYY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "9888.1" }, "Flags": 65536, "HighLimit": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "YYY", "issuer": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "value": "10000" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "EA261DC41E410F4855E8D94C1699BE072AC78550100F840E0144A1871D50EE4C", "PreviousFields": { "Balance": { "currency": "YYY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "9876.1" } }, "PreviousTxnID": "6F186328B34318B2CCFF117403300CEC6D3DEC1982914DDBE459721DCBB39CB5", "PreviousTxnLgrSeq": 1972887 } }, { "ModifiedNode": { "FinalFields": { "Flags": 0, "Owner": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "RootIndex": "FE260BE617AE866816CE83489797A91AAFE70960F5799DCC6984C323DF46BF38" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "FE260BE617AE866816CE83489797A91AAFE70960F5799DCC6984C323DF46BF38" } }], "TransactionIndex": 0, "TransactionResult": "tesSUCCESS" }, "tx": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "Fee": "10", "Flags": 2147483648, "LastLedgerSequence": 1974931, "Sequence": 56, "SigningPubKey": "02C301D531D49A99D66E1FB8E8D101384436D0FA31E2D2F8E43DA1C538591096F7", "TakerGets": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "12" }, "TakerPays": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "2" }, "TransactionType": "OfferCreate", "TxnSignature": "304402204C331BC3623FFA4CF73EB2CE8B19AE5AC1F11D5104140194252B679644B71EB2022016F5D9A3DB0DD1F0FE33C67D0B4FA0B788EED6E38B27A75771D62F8CB643694B", "date": 550802552, "hash": "A2F85479B0F6D9248537EB9367DEBB3C6697384FDF628CD46FDCFD25195108C4", "inLedger": 1974931, "ledger_index": 1974931 }, "validated": true }, { "meta": { "AffectedNodes": [{ "DeletedNode": { "FinalFields": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "BookDirectory": "F9DB9927CDCFBDB18FB37B77E49A3D0A5B613F90409E79CE540BD7A625405555", "BookNode": "0000000000000000", "Flags": 0, "OwnerNode": "0000000000000000", "PreviousTxnID": "CFA6808DCB3C1C39AD94DBC1223BFFFCBC7A64A72A123CA7FDAF00D01E491910", "PreviousTxnLgrSeq": 1902066, "Sequence": 41, "TakerGets": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "6" }, "TakerPays": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "2" } }, "LedgerEntryType": "Offer", "LedgerIndex": "03B489B98B73C47969EE5E3293AE8179B331FBB075AF79647F6B795CAA819345" } }, { "ModifiedNode": { "FinalFields": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "Balance": "10007969438", "Flags": 8388608, "OwnerCount": 3, "Sequence": 56 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "84F79BFBB44AE1F016E710DC74B7D1C677BE9995546AD585D8BC05EF1399B06E", "PreviousFields": { "Balance": "10007969448", "OwnerCount": 4, "Sequence": 55 }, "PreviousTxnID": "6F186328B34318B2CCFF117403300CEC6D3DEC1982914DDBE459721DCBB39CB5", "PreviousTxnLgrSeq": 1972887 } }, { "ModifiedNode": { "FinalFields": { "Flags": 0, "Owner": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "RootIndex": "8D7B24212E5FB685A54FB40778B559140FC07EFFF376C29334B2BF97EC5B4BA9" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "8D7B24212E5FB685A54FB40778B559140FC07EFFF376C29334B2BF97EC5B4BA9" } }, { "DeletedNode": { "FinalFields": { "ExchangeRate": "540BD7A625405555", "Flags": 0, "RootIndex": "F9DB9927CDCFBDB18FB37B77E49A3D0A5B613F90409E79CE540BD7A625405555", "TakerGetsCurrency": "0000000000000000000000005959590000000000", "TakerGetsIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC", "TakerPaysCurrency": "0000000000000000000000005858580000000000", "TakerPaysIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "F9DB9927CDCFBDB18FB37B77E49A3D0A5B613F90409E79CE540BD7A625405555" } }], "TransactionIndex": 3, "TransactionResult": "tesSUCCESS" }, "tx": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "Fee": "10", "Flags": 2147483648, "LastLedgerSequence": 1974505, "OfferSequence": 41, "Sequence": 55, "SigningPubKey": "02C301D531D49A99D66E1FB8E8D101384436D0FA31E2D2F8E43DA1C538591096F7", "TransactionType": "OfferCancel", "TxnSignature": "3045022100F1C80030E06433D74EAC52A38D3379AAA6515160411E7D85C13ACBB71205F27C022041B8FB466C88BD14C9B59652952909637AA6232F92D28DF4614CC386D205754A", "date": 550801170, "hash": "4C99BC341C4AE4783F3EDDFC7A78BA3DD084770D3220EF5623A08BE68ADDBFDF", "inLedger": 1974505, "ledger_index": 1974505 }, "validated": true }, { "meta": { "AffectedNodes": [{ "ModifiedNode": { "FinalFields": { "Balance": { "currency": "YYY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "112.14" }, "Flags": 65536, "HighLimit": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "YYY", "issuer": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "value": "0" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "6DF5EE1976FF38B40DB8B046807EBE04FA5F1E4E31919397DC126FC12A9CC55E", "PreviousFields": { "Balance": { "currency": "YYY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "88.14" } }, "PreviousTxnID": "00C7684A12C5465A9920525729124E1C429C3A19DAE5F1FA765C1C566328F4AF", "PreviousTxnLgrSeq": 1972324 } }, { "DeletedNode": { "FinalFields": { "ExchangeRate": "551C6BF526340000", "Flags": 0, "RootIndex": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C551C6BF526340000", "TakerGetsCurrency": "0000000000000000000000005858580000000000", "TakerGetsIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC", "TakerPaysCurrency": "0000000000000000000000005959590000000000", "TakerPaysIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C551C6BF526340000" } }, { "ModifiedNode": { "FinalFields": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "Balance": "10007969448", "Flags": 8388608, "OwnerCount": 4, "Sequence": 55 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "84F79BFBB44AE1F016E710DC74B7D1C677BE9995546AD585D8BC05EF1399B06E", "PreviousFields": { "OwnerCount": 5 }, "PreviousTxnID": "96F1331120F364820575558742DB3C077DEB4758B4D7537ABC4A6B11175D469F", "PreviousTxnLgrSeq": 1972744 } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "34.18285714285715" }, "Flags": 65536, "HighLimit": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "XXX", "issuer": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "value": "100" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "861B8AAC3B75826723AE2AED95DFE8E185237A1A1A641EBE6A6D910F470F4738", "PreviousFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "31.18285714285715" } }, "PreviousTxnID": "00C7684A12C5465A9920525729124E1C429C3A19DAE5F1FA765C1C566328F4AF", "PreviousTxnLgrSeq": 1972324 } }, { "DeletedNode": { "FinalFields": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "BookDirectory": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C551C6BF526340000", "BookNode": "0000000000000000", "Flags": 0, "OwnerNode": "0000000000000000", "PreviousTxnID": "96F1331120F364820575558742DB3C077DEB4758B4D7537ABC4A6B11175D469F", "PreviousTxnLgrSeq": 1972744, "Sequence": 54, "TakerGets": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "TakerPays": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" } }, "LedgerEntryType": "Offer", "LedgerIndex": "8B86D28B234B868D88C573C5D667C66CE9439190D5DA10415AB24CF79E29D533", "PreviousFields": { "TakerGets": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "3" }, "TakerPays": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "24" } } } }, { "ModifiedNode": { "FinalFields": { "Flags": 0, "Owner": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "RootIndex": "8D7B24212E5FB685A54FB40778B559140FC07EFFF376C29334B2BF97EC5B4BA9" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "8D7B24212E5FB685A54FB40778B559140FC07EFFF376C29334B2BF97EC5B4BA9" } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "29.84285714285714" }, "Flags": 65536, "HighLimit": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "XXX", "issuer": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "value": "100" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "B517AC298C47CF0734ED40149B6FBA38921952F1441EF149A045E8D9DCE9E9C3", "PreviousFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "33.14285714285714" } }, "PreviousTxnID": "00C7684A12C5465A9920525729124E1C429C3A19DAE5F1FA765C1C566328F4AF", "PreviousTxnLgrSeq": 1972324 } }, { "CreatedNode": { "LedgerEntryType": "Offer", "LedgerIndex": "CB269644281ACB54A8CE5274159911773A5D95F8D4FA2ADC7B22D414E03F625A", "NewFields": { "Account": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "BookDirectory": "F9DB9927CDCFBDB18FB37B77E49A3D0A5B613F90409E79CE540470DE4DF82000", "Sequence": 55, "TakerGets": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "16" }, "TakerPays": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "2" } } } }, { "ModifiedNode": { "FinalFields": { "Account": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "Balance": "9992032360", "Flags": 0, "OwnerCount": 6, "Sequence": 56 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "CD69A5B67A19C01AA680EED8295D53C72FA4B1BCA4FDCD9F9A6285954A3BBD8E", "PreviousFields": { "Balance": "9992032370", "OwnerCount": 5, "Sequence": 55 }, "PreviousTxnID": "00C7684A12C5465A9920525729124E1C429C3A19DAE5F1FA765C1C566328F4AF", "PreviousTxnLgrSeq": 1972324 } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "YYY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "9876.1" }, "Flags": 65536, "HighLimit": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "YYY", "issuer": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "value": "10000" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "EA261DC41E410F4855E8D94C1699BE072AC78550100F840E0144A1871D50EE4C", "PreviousFields": { "Balance": { "currency": "YYY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "9902.5" } }, "PreviousTxnID": "00C7684A12C5465A9920525729124E1C429C3A19DAE5F1FA765C1C566328F4AF", "PreviousTxnLgrSeq": 1972324 } }, { "CreatedNode": { "LedgerEntryType": "DirectoryNode", "LedgerIndex": "F9DB9927CDCFBDB18FB37B77E49A3D0A5B613F90409E79CE540470DE4DF82000", "NewFields": { "ExchangeRate": "540470DE4DF82000", "RootIndex": "F9DB9927CDCFBDB18FB37B77E49A3D0A5B613F90409E79CE540470DE4DF82000", "TakerGetsCurrency": "0000000000000000000000005959590000000000", "TakerGetsIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC", "TakerPaysCurrency": "0000000000000000000000005858580000000000", "TakerPaysIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC" } } }, { "ModifiedNode": { "FinalFields": { "Flags": 0, "Owner": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "RootIndex": "FE260BE617AE866816CE83489797A91AAFE70960F5799DCC6984C323DF46BF38" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "FE260BE617AE866816CE83489797A91AAFE70960F5799DCC6984C323DF46BF38" } }], "TransactionIndex": 1, "TransactionResult": "tesSUCCESS" }, "tx": { "Account": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "Fee": "10", "Flags": 2147483648, "LastLedgerSequence": 1972887, "Sequence": 55, "SigningPubKey": "03A9B661527E63BD344CE0C05C291B9669044819A6117D6DC241CB028F66E2D938", "TakerGets": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "40" }, "TakerPays": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "5" }, "TransactionType": "OfferCreate", "TxnSignature": "304402203AC2D853DC401D266D3D55DC63606EDA04104C485BD104C15DDD1F31FD96866602200D22918D912F9D90B388646489FB025A36B8AC08CB47A746977ED90E017E4CFA", "date": 550795812, "hash": "6F186328B34318B2CCFF117403300CEC6D3DEC1982914DDBE459721DCBB39CB5", "inLedger": 1972887, "ledger_index": 1972887 }, "validated": true }, { "meta": { "AffectedNodes": [{ "CreatedNode": { "LedgerEntryType": "DirectoryNode", "LedgerIndex": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C551C6BF526340000", "NewFields": { "ExchangeRate": "551C6BF526340000", "RootIndex": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C551C6BF526340000", "TakerGetsCurrency": "0000000000000000000000005858580000000000", "TakerGetsIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC", "TakerPaysCurrency": "0000000000000000000000005959590000000000", "TakerPaysIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC" } } }, { "ModifiedNode": { "FinalFields": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "Balance": "10007969448", "Flags": 8388608, "OwnerCount": 5, "Sequence": 55 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "84F79BFBB44AE1F016E710DC74B7D1C677BE9995546AD585D8BC05EF1399B06E", "PreviousFields": { "Balance": "10007969458", "OwnerCount": 4, "Sequence": 54 }, "PreviousTxnID": "BF74187BEAE84A6E8F092172CFC26CB2698C05039ED0B4978682C665A2E36275", "PreviousTxnLgrSeq": 1972726 } }, { "CreatedNode": { "LedgerEntryType": "Offer", "LedgerIndex": "8B86D28B234B868D88C573C5D667C66CE9439190D5DA10415AB24CF79E29D533", "NewFields": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "BookDirectory": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C551C6BF526340000", "Sequence": 54, "TakerGets": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "3" }, "TakerPays": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "24" } } } }, { "ModifiedNode": { "FinalFields": { "Flags": 0, "Owner": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "RootIndex": "8D7B24212E5FB685A54FB40778B559140FC07EFFF376C29334B2BF97EC5B4BA9" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "8D7B24212E5FB685A54FB40778B559140FC07EFFF376C29334B2BF97EC5B4BA9" } }], "TransactionIndex": 0, "TransactionResult": "tesSUCCESS" }, "tx": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "Fee": "10", "Flags": 2147483648, "LastLedgerSequence": 1972744, "Sequence": 54, "SigningPubKey": "02C301D531D49A99D66E1FB8E8D101384436D0FA31E2D2F8E43DA1C538591096F7", "TakerGets": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "3" }, "TakerPays": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "24" }, "TransactionType": "OfferCreate", "TxnSignature": "3045022100C33E853261191D88F65CC1528395086CF24005C6D0140BEFE3374860622FCD3902200519EF237500B4DC18950523F1B51D1F7D9867F77E8F1498EBBE39294CE2E9F1", "date": 550795291, "hash": "96F1331120F364820575558742DB3C077DEB4758B4D7537ABC4A6B11175D469F", "inLedger": 1972744, "ledger_index": 1972744 }, "validated": true }, { "meta": { "AffectedNodes": [{ "DeletedNode": { "FinalFields": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "BookDirectory": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C56071AFD498D0000", "BookNode": "0000000000000000", "Flags": 0, "OwnerNode": "0000000000000000", "PreviousTxnID": "5859430C8FFD862CDF482A974D10E1385E7C29260075A4EE63ADD304A77AC2AE", "PreviousTxnLgrSeq": 1902103, "Sequence": 43, "TakerGets": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "1" }, "TakerPays": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "20" } }, "LedgerEntryType": "Offer", "LedgerIndex": "5DA54CE9253D9B06E7E1B7B01E4C1FC92658BD57C4671DC1EA567251FAFC25AC" } }, { "DeletedNode": { "FinalFields": { "ExchangeRate": "56071AFD498D0000", "Flags": 0, "RootIndex": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C56071AFD498D0000", "TakerGetsCurrency": "0000000000000000000000005858580000000000", "TakerGetsIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC", "TakerPaysCurrency": "0000000000000000000000005959590000000000", "TakerPaysIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C56071AFD498D0000" } }, { "ModifiedNode": { "FinalFields": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "Balance": "10007969458", "Flags": 8388608, "OwnerCount": 4, "Sequence": 54 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "84F79BFBB44AE1F016E710DC74B7D1C677BE9995546AD585D8BC05EF1399B06E", "PreviousFields": { "Balance": "10007969468", "OwnerCount": 5, "Sequence": 53 }, "PreviousTxnID": "EEBA3161E8553E27573D44B12B75213333993053CC3701F09F54AEE51D6A5319", "PreviousTxnLgrSeq": 1972723 } }, { "ModifiedNode": { "FinalFields": { "Flags": 0, "Owner": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "RootIndex": "8D7B24212E5FB685A54FB40778B559140FC07EFFF376C29334B2BF97EC5B4BA9" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "8D7B24212E5FB685A54FB40778B559140FC07EFFF376C29334B2BF97EC5B4BA9" } }], "TransactionIndex": 3, "TransactionResult": "tesSUCCESS" }, "tx": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "Fee": "10", "Flags": 2147483648, "LastLedgerSequence": 1972726, "OfferSequence": 43, "Sequence": 53, "SigningPubKey": "02C301D531D49A99D66E1FB8E8D101384436D0FA31E2D2F8E43DA1C538591096F7", "TransactionType": "OfferCancel", "TxnSignature": "3044022018325FF8DED621506FDB2E8F00D0C4751ED7D86EC25A4CDF7671BFD1F047715702200D0517036D83AED781145C61B9387B584981A8193EF05EAD55C8BC9D3F03B6E8", "date": 550795222, "hash": "BF74187BEAE84A6E8F092172CFC26CB2698C05039ED0B4978682C665A2E36275", "inLedger": 1972726, "ledger_index": 1972726 }, "validated": true }, { "meta": { "AffectedNodes": [{ "DeletedNode": { "FinalFields": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "BookDirectory": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C551550F7DCA70000", "BookNode": "0000000000000000", "Flags": 0, "OwnerNode": "0000000000000000", "PreviousTxnID": "A625D29B4105B8513613FA1D6EAEE91B82E9338B89FBE18916A0FF6E420EEDDF", "PreviousTxnLgrSeq": 1952552, "Sequence": 48, "TakerGets": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "1" }, "TakerPays": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "6" } }, "LedgerEntryType": "Offer", "LedgerIndex": "6B8E8586BB5CCD5CA44A15EBD9B54942780532CC6B67B9F54559CBCD0AE37013" } }, { "DeletedNode": { "FinalFields": { "ExchangeRate": "551550F7DCA70000", "Flags": 0, "RootIndex": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C551550F7DCA70000", "TakerGetsCurrency": "0000000000000000000000005858580000000000", "TakerGetsIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC", "TakerPaysCurrency": "0000000000000000000000005959590000000000", "TakerPaysIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C551550F7DCA70000" } }, { "ModifiedNode": { "FinalFields": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "Balance": "10007969468", "Flags": 8388608, "OwnerCount": 5, "Sequence": 53 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "84F79BFBB44AE1F016E710DC74B7D1C677BE9995546AD585D8BC05EF1399B06E", "PreviousFields": { "Balance": "10007969478", "OwnerCount": 6, "Sequence": 52 }, "PreviousTxnID": "00C7684A12C5465A9920525729124E1C429C3A19DAE5F1FA765C1C566328F4AF", "PreviousTxnLgrSeq": 1972324 } }, { "ModifiedNode": { "FinalFields": { "Flags": 0, "Owner": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "RootIndex": "8D7B24212E5FB685A54FB40778B559140FC07EFFF376C29334B2BF97EC5B4BA9" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "8D7B24212E5FB685A54FB40778B559140FC07EFFF376C29334B2BF97EC5B4BA9" } }], "TransactionIndex": 3, "TransactionResult": "tesSUCCESS" }, "tx": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "Fee": "10", "Flags": 2147483648, "LastLedgerSequence": 1972723, "OfferSequence": 48, "Sequence": 52, "SigningPubKey": "02C301D531D49A99D66E1FB8E8D101384436D0FA31E2D2F8E43DA1C538591096F7", "TransactionType": "OfferCancel", "TxnSignature": "3045022100CC29598720179A4069BE3047ACCCD3B6B813A7D3E088D75EC9C2DF3B51A021740220710DDAADE2E397921B4D64070FC7F46C0073AFEA8A342C43BB0315F357C1A683", "date": 550795212, "hash": "EEBA3161E8553E27573D44B12B75213333993053CC3701F09F54AEE51D6A5319", "inLedger": 1972723, "ledger_index": 1972723 }, "validated": true }, { "meta": { "AffectedNodes": [{ "CreatedNode": { "LedgerEntryType": "Offer", "LedgerIndex": "0171F1CCDFA21B8675720A55070F941E733A8419D22222BC2A744779E2B7D385", "NewFields": { "Account": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "BookDirectory": "F9DB9927CDCFBDB18FB37B77E49A3D0A5B613F90409E79CE54071AFD498D0000", "Sequence": 54, "TakerGets": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "5" }, "TakerPays": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "1" } } } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "YYY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "88.14" }, "Flags": 65536, "HighLimit": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "YYY", "issuer": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "value": "0" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "6DF5EE1976FF38B40DB8B046807EBE04FA5F1E4E31919397DC126FC12A9CC55E", "PreviousFields": { "Balance": { "currency": "YYY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "43.14" } }, "PreviousTxnID": "B73FF3456D259BA4156A93AE4D91D2127724ADAC471C4E61F5651CB23CE454FC", "PreviousTxnLgrSeq": 1953618 } }, { "DeletedNode": { "FinalFields": { "ExchangeRate": "5511C37937E08000", "Flags": 0, "RootIndex": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C5511C37937E08000", "TakerGetsCurrency": "0000000000000000000000005858580000000000", "TakerGetsIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC", "TakerPaysCurrency": "0000000000000000000000005959590000000000", "TakerPaysIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C5511C37937E08000" } }, { "ModifiedNode": { "FinalFields": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "Balance": "10007969478", "Flags": 8388608, "OwnerCount": 6, "Sequence": 52 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "84F79BFBB44AE1F016E710DC74B7D1C677BE9995546AD585D8BC05EF1399B06E", "PreviousFields": { "OwnerCount": 7 }, "PreviousTxnID": "59FAC014959B4AB820BD3B7AD0CF557A97657E8884A5EA3E27236F287268C323", "PreviousTxnLgrSeq": 1953603 } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "31.18285714285715" }, "Flags": 65536, "HighLimit": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "XXX", "issuer": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "value": "100" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "861B8AAC3B75826723AE2AED95DFE8E185237A1A1A641EBE6A6D910F470F4738", "PreviousFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "22.18285714285715" } }, "PreviousTxnID": "B73FF3456D259BA4156A93AE4D91D2127724ADAC471C4E61F5651CB23CE454FC", "PreviousTxnLgrSeq": 1953618 } }, { "ModifiedNode": { "FinalFields": { "Flags": 0, "Owner": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "RootIndex": "8D7B24212E5FB685A54FB40778B559140FC07EFFF376C29334B2BF97EC5B4BA9" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "8D7B24212E5FB685A54FB40778B559140FC07EFFF376C29334B2BF97EC5B4BA9" } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "33.14285714285714" }, "Flags": 65536, "HighLimit": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "XXX", "issuer": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "value": "100" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "B517AC298C47CF0734ED40149B6FBA38921952F1441EF149A045E8D9DCE9E9C3", "PreviousFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "43.04285714285714" } }, "PreviousTxnID": "B73FF3456D259BA4156A93AE4D91D2127724ADAC471C4E61F5651CB23CE454FC", "PreviousTxnLgrSeq": 1953618 } }, { "ModifiedNode": { "FinalFields": { "Account": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "Balance": "9992032370", "Flags": 0, "OwnerCount": 5, "Sequence": 55 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "CD69A5B67A19C01AA680EED8295D53C72FA4B1BCA4FDCD9F9A6285954A3BBD8E", "PreviousFields": { "Balance": "9992032380", "OwnerCount": 4, "Sequence": 54 }, "PreviousTxnID": "B73FF3456D259BA4156A93AE4D91D2127724ADAC471C4E61F5651CB23CE454FC", "PreviousTxnLgrSeq": 1953618 } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "YYY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "9902.5" }, "Flags": 65536, "HighLimit": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "YYY", "issuer": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "value": "10000" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "EA261DC41E410F4855E8D94C1699BE072AC78550100F840E0144A1871D50EE4C", "PreviousFields": { "Balance": { "currency": "YYY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "9952" } }, "PreviousTxnID": "B73FF3456D259BA4156A93AE4D91D2127724ADAC471C4E61F5651CB23CE454FC", "PreviousTxnLgrSeq": 1953618 } }, { "DeletedNode": { "FinalFields": { "Account": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "BookDirectory": "800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C5511C37937E08000", "BookNode": "0000000000000000", "Flags": 0, "OwnerNode": "0000000000000000", "PreviousTxnID": "B73FF3456D259BA4156A93AE4D91D2127724ADAC471C4E61F5651CB23CE454FC", "PreviousTxnLgrSeq": 1953618, "Sequence": 51, "TakerGets": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "TakerPays": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" } }, "LedgerEntryType": "Offer", "LedgerIndex": "EBC50A4F332F2A8F9154DE3DC4C5D8C54E50B8D08FD825F1BBABC8F4B4482A6C", "PreviousFields": { "TakerGets": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "9" }, "TakerPays": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "45" } } } }, { "CreatedNode": { "LedgerEntryType": "DirectoryNode", "LedgerIndex": "F9DB9927CDCFBDB18FB37B77E49A3D0A5B613F90409E79CE54071AFD498D0000", "NewFields": { "ExchangeRate": "54071AFD498D0000", "RootIndex": "F9DB9927CDCFBDB18FB37B77E49A3D0A5B613F90409E79CE54071AFD498D0000", "TakerGetsCurrency": "0000000000000000000000005959590000000000", "TakerGetsIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC", "TakerPaysCurrency": "0000000000000000000000005858580000000000", "TakerPaysIssuer": "D943F8486CECA0A4B1C2096615D3B2DBDEB949CC" } } }, { "ModifiedNode": { "FinalFields": { "Flags": 0, "Owner": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "RootIndex": "FE260BE617AE866816CE83489797A91AAFE70960F5799DCC6984C323DF46BF38" }, "LedgerEntryType": "DirectoryNode", "LedgerIndex": "FE260BE617AE866816CE83489797A91AAFE70960F5799DCC6984C323DF46BF38" } }], "TransactionIndex": 2, "TransactionResult": "tesSUCCESS" }, "tx": { "Account": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "Fee": "10", "Flags": 2147483648, "LastLedgerSequence": 1972324, "Sequence": 54, "SigningPubKey": "03A9B661527E63BD344CE0C05C291B9669044819A6117D6DC241CB028F66E2D938", "TakerGets": { "currency": "YYY", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "50" }, "TakerPays": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "10" }, "TransactionType": "OfferCreate", "TxnSignature": "304402203B3E4279C1DAA6B524CD752141CDBDC1F7D1B6171AF4FF2856DAC4A2342F92A2022070579B92C14B627A9840C2229C9BE3CE53304BCCA7504DC51642E74263AABB1F", "date": 550793923, "hash": "00C7684A12C5465A9920525729124E1C429C3A19DAE5F1FA765C1C566328F4AF", "inLedger": 1972324, "ledger_index": 1972324 }, "validated": true }], | |
"validated": true | |
} | |
}; | |
const MY_ACCOUNT = "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah"; | |
// const MY_ACCOUNT = "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1"; | |
console.log("==========================================="); | |
console.log("Curating offer txs by address:", MY_ACCOUNT); | |
console.log("==========================================="); | |
const txs = rpcResponse.result.transactions; | |
var myOffers = RippleTxParser.getAccountOffers(MY_ACCOUNT, txs); | |
console.log("\n>>>>>>> RESULT: myOffers:"); | |
myOffers.forEach(x => { | |
console.log("-------------------------------------"); | |
console.log("[status]:", x.status); | |
console.log("[account]:", x.account); | |
console.log("[seq]:", x.sequence); | |
console.log("[first]:", x.firstFields); | |
console.log("[final]:", x.finalFields); | |
// console.log("x;", x); | |
}); | |
/* CONSOLE LOG: | |
=========================================== | |
Curating offer txs by address: rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah | |
=========================================== | |
>>>>>>> RESULT: myOffers: | |
------------------------------------- | |
[status]: partially-filled | |
[account]: rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah | |
[seq]: 58 | |
[first]: { TakerGets: | |
{ currency: 'YYY', | |
issuer: 'rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn', | |
value: '12' }, | |
TakerPays: | |
{ currency: 'XXX', | |
issuer: 'rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn', | |
value: '3' } } | |
[final]: { Account: 'rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah', | |
BookDirectory: 'F9DB9927CDCFBDB18FB37B77E49A3D0A5B613F90409E79CE5408E1BC9BF04000', | |
Sequence: 58, | |
TakerGets: | |
{ currency: 'YYY', | |
issuer: 'rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn', | |
value: '8' }, | |
TakerPays: | |
{ currency: 'XXX', | |
issuer: 'rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn', | |
value: '2' } } | |
------------------------------------- | |
[status]: filled | |
[account]: rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah | |
[seq]: 57 | |
[first]: { TakerGets: | |
{ currency: 'YYY', | |
issuer: 'rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn', | |
value: '8' }, | |
TakerPays: | |
{ currency: 'XXX', | |
issuer: 'rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn', | |
value: '2' } } | |
[final]: undefined | |
------------------------------------- | |
[status]: filled | |
[account]: rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah | |
[seq]: 56 | |
[first]: { TakerGets: | |
{ currency: 'YYY', | |
issuer: 'rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn', | |
value: '12' }, | |
TakerPays: | |
{ currency: 'XXX', | |
issuer: 'rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn', | |
value: '2' } } | |
[final]: undefined | |
------------------------------------- | |
[status]: cancelled | |
[account]: rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah | |
[seq]: 55 | |
[first]: { TakerGets: undefined, TakerPays: undefined } | |
[final]: undefined | |
------------------------------------- | |
[status]: filled | |
[account]: rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah | |
[seq]: 54 | |
[first]: { TakerGets: | |
{ currency: 'XXX', | |
issuer: 'rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn', | |
value: '3' }, | |
TakerPays: | |
{ currency: 'YYY', | |
issuer: 'rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn', | |
value: '24' } } | |
[final]: { Account: 'rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah', | |
BookDirectory: '800D05A10E27A12300ECCEA533F3483E5F7BFCABA53F1D0C551C6BF526340000', | |
BookNode: '0000000000000000', | |
Flags: 0, | |
OwnerNode: '0000000000000000', | |
PreviousTxnID: '96F1331120F364820575558742DB3C077DEB4758B4D7537ABC4A6B11175D469F', | |
PreviousTxnLgrSeq: 1972744, | |
Sequence: 54, | |
TakerGets: | |
{ currency: 'XXX', | |
issuer: 'rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn', | |
value: '0' }, | |
TakerPays: | |
{ currency: 'YYY', | |
issuer: 'rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn', | |
value: '0' } } | |
------------------------------------- | |
[status]: cancelled | |
[account]: rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah | |
[seq]: 53 | |
[first]: { TakerGets: undefined, TakerPays: undefined } | |
[final]: undefined | |
------------------------------------- | |
[status]: cancelled | |
[account]: rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah | |
[seq]: 52 | |
[first]: { TakerGets: undefined, TakerPays: undefined } | |
[final]: undefined | |
*/ |
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
const RippleTxParser = require('../lib/RippleTxParser.js'); | |
// $ curl --data-binary '{"jsonrpc":"2.0","id":0,"method":"account_tx","params":[{"account":"rHDvn877ezKZokt9WWeVhjwfab53o4pjw1","binary":false,"count":false,"descending":true,"forward":false,"ledger_index_max":-1,"ledger_index_min":-1,"limit":100,"offset":0}]}' https://api.altnet.rippletest.net:51234 | |
const rpcResponse = { | |
"id": 0, | |
"jsonrpc": "2.0", | |
"result": { | |
"account": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", | |
"ledger_index_max": 300032, | |
"ledger_index_min": 283259, | |
"limit": 100, | |
"offset": 0, | |
"status": "success", | |
"transactions": [{ "meta": { "AffectedNodes": [{ "ModifiedNode": { "FinalFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "18" }, "Flags": 1114112, "HighLimit": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "XXX", "issuer": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "value": "100000" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "861B8AAC3B75826723AE2AED95DFE8E185237A1A1A641EBE6A6D910F470F4738", "PreviousFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "19" } }, "PreviousTxnID": "164DC9A945C95F85D418FFD7DB1BF513E8DF140C80B7B61789D4F5FA7992F231", "PreviousTxnLgrSeq": 299060 } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "82" }, "Flags": 1114112, "HighLimit": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "XXX", "issuer": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "value": "1000000" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "B517AC298C47CF0734ED40149B6FBA38921952F1441EF149A045E8D9DCE9E9C3", "PreviousFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "81" } }, "PreviousTxnID": "164DC9A945C95F85D418FFD7DB1BF513E8DF140C80B7B61789D4F5FA7992F231", "PreviousTxnLgrSeq": 299060 } }, { "ModifiedNode": { "FinalFields": { "Account": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "Balance": "4241099680", "Flags": 0, "OwnerCount": 3, "Sequence": 33 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "CD69A5B67A19C01AA680EED8295D53C72FA4B1BCA4FDCD9F9A6285954A3BBD8E", "PreviousFields": { "Balance": "4241099690", "Sequence": 32 }, "PreviousTxnID": "164DC9A945C95F85D418FFD7DB1BF513E8DF140C80B7B61789D4F5FA7992F231", "PreviousTxnLgrSeq": 299060 } }], "TransactionIndex": 0, "TransactionResult": "tesSUCCESS", "delivered_amount": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "1" } }, "tx": { "Account": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "Amount": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "1" }, "Destination": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "Fee": "10", "Flags": 2147483648, "LastLedgerSequence": 299097, "Memos": [{ "Memo": { "MemoData": "476F253230326E642532303158585821", "MemoFormat": "746578742F68746D6C" } }], "SendMax": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "1" }, "Sequence": 32, "SigningPubKey": "03A9B661527E63BD344CE0C05C291B9669044819A6117D6DC241CB028F66E2D938", "TransactionType": "Payment", "TxnSignature": "3045022100A4E3124F0ABDAD90E98B1DA35B8E60A113A86759CE551B6914277A225170C17602202588237EEF2320615F2F62957FBF38BB474F32732597E9CCCE1A894621AF8FB9", "date": 552378741, "hash": "47265E1D45A9FAB14F980E61A9750006342994B019EF352A86A9B32EFC4B26CA", "inLedger": 299097, "ledger_index": 299097 }, "validated": true }, { "meta": { "AffectedNodes": [{ "ModifiedNode": { "FinalFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "19" }, "Flags": 1114112, "HighLimit": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "XXX", "issuer": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "value": "100000" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "861B8AAC3B75826723AE2AED95DFE8E185237A1A1A641EBE6A6D910F470F4738", "PreviousFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "20" } }, "PreviousTxnID": "4D3DE05B0DD51DDB42578990183ACE7840512D036CAF8F906C0AF4A7D1C01322", "PreviousTxnLgrSeq": 298502 } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "81" }, "Flags": 1114112, "HighLimit": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "XXX", "issuer": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "value": "1000000" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "B517AC298C47CF0734ED40149B6FBA38921952F1441EF149A045E8D9DCE9E9C3", "PreviousFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "80" } }, "PreviousTxnID": "4D3DE05B0DD51DDB42578990183ACE7840512D036CAF8F906C0AF4A7D1C01322", "PreviousTxnLgrSeq": 298502 } }, { "ModifiedNode": { "FinalFields": { "Account": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "Balance": "4241099690", "Flags": 0, "OwnerCount": 3, "Sequence": 32 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "CD69A5B67A19C01AA680EED8295D53C72FA4B1BCA4FDCD9F9A6285954A3BBD8E", "PreviousFields": { "Balance": "4241099700", "Sequence": 31 }, "PreviousTxnID": "4D3DE05B0DD51DDB42578990183ACE7840512D036CAF8F906C0AF4A7D1C01322", "PreviousTxnLgrSeq": 298502 } }], "TransactionIndex": 4, "TransactionResult": "tesSUCCESS", "delivered_amount": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "1" } }, "tx": { "Account": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "Amount": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "1" }, "Destination": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "Fee": "10", "Flags": 2147483648, "LastLedgerSequence": 299060, "Memos": [], "SendMax": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "1" }, "Sequence": 31, "SigningPubKey": "03A9B661527E63BD344CE0C05C291B9669044819A6117D6DC241CB028F66E2D938", "TransactionType": "Payment", "TxnSignature": "3044022023E37E5ADDC74C6E71AA74C00F3BEF7C194DED4F229EE2A3CCEC0E1E79A25D450220426237B46D6A8533CF8EC233B24B30A36EB2B78DC0FC18619A8093F66223570B", "date": 552378612, "hash": "164DC9A945C95F85D418FFD7DB1BF513E8DF140C80B7B61789D4F5FA7992F231", "inLedger": 299060, "ledger_index": 299060 }, "validated": true }, { "meta": { "AffectedNodes": [{ "ModifiedNode": { "FinalFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "20" }, "Flags": 1114112, "HighLimit": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "XXX", "issuer": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "value": "100000" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "861B8AAC3B75826723AE2AED95DFE8E185237A1A1A641EBE6A6D910F470F4738", "PreviousFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "30" } }, "PreviousTxnID": "5BF7F28ADB2F001730786D87ADBB70760BD129A875C0D22A8945149FAC593F1F", "PreviousTxnLgrSeq": 217954 } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "80" }, "Flags": 1114112, "HighLimit": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "XXX", "issuer": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "value": "1000000" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "B517AC298C47CF0734ED40149B6FBA38921952F1441EF149A045E8D9DCE9E9C3", "PreviousFields": { "Balance": { "currency": "XXX", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "70" } }, "PreviousTxnID": "5BF7F28ADB2F001730786D87ADBB70760BD129A875C0D22A8945149FAC593F1F", "PreviousTxnLgrSeq": 217954 } }, { "ModifiedNode": { "FinalFields": { "Account": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "Balance": "4241099700", "Flags": 0, "OwnerCount": 3, "Sequence": 31 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "CD69A5B67A19C01AA680EED8295D53C72FA4B1BCA4FDCD9F9A6285954A3BBD8E", "PreviousFields": { "Balance": "4241099710", "Sequence": 30 }, "PreviousTxnID": "A369460F1898803E7BB920E1B063DACD70BD47FFFD6F7871B20115590ED04D56", "PreviousTxnLgrSeq": 297487 } }], "TransactionIndex": 0, "TransactionResult": "tesSUCCESS", "delivered_amount": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "10" } }, "tx": { "Account": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "Amount": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "10" }, "Destination": "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah", "Fee": "10", "Flags": 2147483648, "LastLedgerSequence": 298502, "Memos": [], "SendMax": { "currency": "XXX", "issuer": "rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn", "value": "10" }, "Sequence": 30, "SigningPubKey": "03A9B661527E63BD344CE0C05C291B9669044819A6117D6DC241CB028F66E2D938", "TransactionType": "Payment", "TxnSignature": "304402207E56164DA0C1475D11E917C0C5FB2B96299E459200A2202A4538C6B6BD5A80E2022045B5D403B20F69A3414C5B744AD2793FF220FE59BE822265AB94D89144E3AB69", "date": 552376850, "hash": "4D3DE05B0DD51DDB42578990183ACE7840512D036CAF8F906C0AF4A7D1C01322", "inLedger": 298502, "ledger_index": 298502 }, "validated": true }, { "meta": { "AffectedNodes": [{ "ModifiedNode": { "FinalFields": { "Account": "rMANtzWhKjWcWP7v7L9VwJJeYgCcxm1eUa", "Balance": "4848899880", "Flags": 0, "OwnerCount": 1, "Sequence": 13 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "244B36A04E52A57149BE2D748034F7D88264C52EDB72C3E1C2FE9B713F8C049A", "PreviousFields": { "Balance": "4848899890", "Sequence": 12 }, "PreviousTxnID": "B164B3DA7776548606505422B49FD6533AA656105BE5D6B9AC9C3FCC5A246E9A", "PreviousTxnLgrSeq": 297935 } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "JPY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "10000" }, "Flags": 1114112, "HighLimit": { "currency": "JPY", "issuer": "rJPaaC1CCeqk7mUimTZh1x5SdnwKiytAhT", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "JPY", "issuer": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "value": "100000000" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "894F829780B12870936322670FD33FD5D60A1292B00BB09D3CAEA282AE63F632", "PreviousFields": { "Balance": { "currency": "JPY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "0" } }, "PreviousTxnID": "0762ED7B8E025E371BD3A932829F3FAC99638D2A62F961FA50E993CB9F3A84B1", "PreviousTxnLgrSeq": 295912 } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "JPY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "-990000" }, "Flags": 2228224, "HighLimit": { "currency": "JPY", "issuer": "rMANtzWhKjWcWP7v7L9VwJJeYgCcxm1eUa", "value": "1000000" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "JPY", "issuer": "rJPaaC1CCeqk7mUimTZh1x5SdnwKiytAhT", "value": "0" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "8F68DB8FD2E3E35E12BBB0DC27359FE66DFA3FDA349B67AE591EC501B277700C", "PreviousFields": { "Balance": { "currency": "JPY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "-1000000" } }, "PreviousTxnID": "E670E91275DE766BCEC97D48633A15DA6E9E708BB753EFE7C002962169090864", "PreviousTxnLgrSeq": 298006 } }], "TransactionIndex": 0, "TransactionResult": "tesSUCCESS", "delivered_amount": { "currency": "JPY", "issuer": "rJPaaC1CCeqk7mUimTZh1x5SdnwKiytAhT", "value": "10000" } }, "tx": { "Account": "rMANtzWhKjWcWP7v7L9VwJJeYgCcxm1eUa", "Amount": { "currency": "JPY", "issuer": "rJPaaC1CCeqk7mUimTZh1x5SdnwKiytAhT", "value": "10000" }, "Destination": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "Fee": "10", "Flags": 2147483648, "LastLedgerSequence": 298048, "Memos": [], "SendMax": { "currency": "JPY", "issuer": "rJPaaC1CCeqk7mUimTZh1x5SdnwKiytAhT", "value": "10000" }, "Sequence": 12, "SigningPubKey": "032C2DC08A9A2EA70C423FB991AE92E66B3242384390A2F793AA68DFF99CF4F5E8", "TransactionType": "Payment", "TxnSignature": "30440220637D649327CC775B9AF7E09E6327F6481916ABB55097076FE92478105AB63A2802206BC3C9E97221D7CC6FB61744BE2B2F1822565680B2ECD2C8AD90BF2F70FCC987", "date": 552375441, "hash": "80BBAF53BDE5D78FE6D9C2C7280EE07A854AAF7596627A4323D68FB4802297CE", "inLedger": 298048, "ledger_index": 298048 }, "validated": true }, { "meta": { "AffectedNodes": [{ "ModifiedNode": { "FinalFields": { "Account": "rMANtzWhKjWcWP7v7L9VwJJeYgCcxm1eUa", "Balance": "4848899900", "Flags": 0, "OwnerCount": 0, "Sequence": 11 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "244B36A04E52A57149BE2D748034F7D88264C52EDB72C3E1C2FE9B713F8C049A", "PreviousFields": { "Balance": "4849899910", "Sequence": 10 }, "PreviousTxnID": "D5B34D12A0DE937988316AEE9DECD41DBF9DD991F113C690818D9B9818EB5CF7", "PreviousTxnLgrSeq": 297396 } }, { "ModifiedNode": { "FinalFields": { "Account": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "Balance": "4241099710", "Flags": 0, "OwnerCount": 3, "Sequence": 30 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "CD69A5B67A19C01AA680EED8295D53C72FA4B1BCA4FDCD9F9A6285954A3BBD8E", "PreviousFields": { "Balance": "4240099710" }, "PreviousTxnID": "D5B34D12A0DE937988316AEE9DECD41DBF9DD991F113C690818D9B9818EB5CF7", "PreviousTxnLgrSeq": 297396 } }], "TransactionIndex": 0, "TransactionResult": "tesSUCCESS", "delivered_amount": "1000000" }, "tx": { "Account": "rMANtzWhKjWcWP7v7L9VwJJeYgCcxm1eUa", "Amount": "1000000", "Destination": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "Fee": "10", "Flags": 2147483648, "LastLedgerSequence": 297487, "Sequence": 10, "SigningPubKey": "032C2DC08A9A2EA70C423FB991AE92E66B3242384390A2F793AA68DFF99CF4F5E8", "TransactionType": "Payment", "TxnSignature": "30440220554E98486A4AD81FEFD2E7872D52452EDD59D04C453590F919125A3C036E6CBB022040C251207B9726737A0BFFF37256C91EF3109D83ADAF7598F40AA293D9B026BB", "date": 552373701, "hash": "A369460F1898803E7BB920E1B063DACD70BD47FFFD6F7871B20115590ED04D56", "inLedger": 297487, "ledger_index": 297487 }, "validated": true }, { "meta": { "AffectedNodes": [{ "ModifiedNode": { "FinalFields": { "Account": "rMANtzWhKjWcWP7v7L9VwJJeYgCcxm1eUa", "Balance": "4849899910", "Flags": 0, "OwnerCount": 0, "Sequence": 10 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "244B36A04E52A57149BE2D748034F7D88264C52EDB72C3E1C2FE9B713F8C049A", "PreviousFields": { "Balance": "4849999920", "Sequence": 9 }, "PreviousTxnID": "5E8876D86293AD61E36F8B6BAADDF99922D0CBB762C2ACACA7FEF1FB6330D8C4", "PreviousTxnLgrSeq": 162858 } }, { "ModifiedNode": { "FinalFields": { "Account": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "Balance": "4240099710", "Flags": 0, "OwnerCount": 3, "Sequence": 30 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "CD69A5B67A19C01AA680EED8295D53C72FA4B1BCA4FDCD9F9A6285954A3BBD8E", "PreviousFields": { "Balance": "4239999710" }, "PreviousTxnID": "BFBBAB1CD8BABB3A6B3BA2DE3BFB1D6A636E33D499FCCC37D6AC0205B80D4060", "PreviousTxnLgrSeq": 219108 } }], "TransactionIndex": 5, "TransactionResult": "tesSUCCESS", "delivered_amount": "100000" }, "tx": { "Account": "rMANtzWhKjWcWP7v7L9VwJJeYgCcxm1eUa", "Amount": "100000", "Destination": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "Fee": "10", "Flags": 2147483648, "LastLedgerSequence": 297397, "Sequence": 9, "SigningPubKey": "032C2DC08A9A2EA70C423FB991AE92E66B3242384390A2F793AA68DFF99CF4F5E8", "TransactionType": "Payment", "TxnSignature": "3045022100F75D6E2740AE86EC6665602E69F216F6857A3E499C189B1B419E35676AFA0A850220599B85279802E8B7815C57BA910B9653CF1918EB52180F152C5F30552FB8E965", "date": 552373421, "hash": "D5B34D12A0DE937988316AEE9DECD41DBF9DD991F113C690818D9B9818EB5CF7", "inLedger": 297396, "ledger_index": 297396 }, "validated": true }, { "meta": { "AffectedNodes": [{ "ModifiedNode": { "FinalFields": { "Balance": { "currency": "JPY", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "0" }, "Flags": 1114112, "HighLimit": { "currency": "JPY", "issuer": "rJPaaC1CCeqk7mUimTZh1x5SdnwKiytAhT", "value": "0" }, "HighNode": "0000000000000000", "LowLimit": { "currency": "JPY", "issuer": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "value": "100000000" }, "LowNode": "0000000000000000" }, "LedgerEntryType": "RippleState", "LedgerIndex": "894F829780B12870936322670FD33FD5D60A1292B00BB09D3CAEA282AE63F632", "PreviousFields": { "Flags": 3211264 }, "PreviousTxnID": "BFBBAB1CD8BABB3A6B3BA2DE3BFB1D6A636E33D499FCCC37D6AC0205B80D4060", "PreviousTxnLgrSeq": 219108 } }, { "ModifiedNode": { "FinalFields": { "Account": "rJPaaC1CCeqk7mUimTZh1x5SdnwKiytAhT", "Balance": "999999930", "Flags": 8388608, "OwnerCount": 0, "Sequence": 8 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "A5885A9EDCF26DA635FFB3351FB11196F1F8BFA3F49C0BB5706E995A9CA9BC70", "PreviousFields": { "Balance": "999999940", "Sequence": 7 }, "PreviousTxnID": "F3641F9B9A537E79CF9A4854D74854492278A34832701B9BA90E4945EF6A9CD4", "PreviousTxnLgrSeq": 295632 } }], "TransactionIndex": 0, "TransactionResult": "tesSUCCESS" }, "tx": { "Account": "rJPaaC1CCeqk7mUimTZh1x5SdnwKiytAhT", "Fee": "10", "Flags": 262144, "LastLedgerSequence": 295912, "LimitAmount": { "currency": "JPY", "issuer": "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1", "value": "0" }, "Sequence": 7, "SigningPubKey": "03CD2DA958F1206877A4FBAC731AC19F87E88989B6E79D0C0EB5A36D01D383A8F7", "TransactionType": "TrustSet", "TxnSignature": "3045022100C6B54C2F03B85F4C93EFC2360AB9967759C16009343CD1BB755DBE9ED666E56F02206F7A8A3E7C083C2A4196228EAC846C0EF36229D13A48C456F3529A63EC06B733", "date": 552368961, "hash": "0762ED7B8E025E371BD3A932829F3FAC99638D2A62F961FA50E993CB9F3A84B1", "inLedger": 295912, "ledger_index": 295912 }, "validated": true }], | |
"validated": true | |
} | |
}; | |
// const MY_ACCOUNT = "rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah"; | |
const MY_ACCOUNT = "rHDvn877ezKZokt9WWeVhjwfab53o4pjw1"; | |
console.log("==========================================="); | |
console.log("Curating payment txs by address:", MY_ACCOUNT); | |
console.log("==========================================="); | |
const txs = rpcResponse.result.transactions; | |
var myPayments = RippleTxParser.getAccountPayments(MY_ACCOUNT, txs); | |
console.log("\n>>>>>>> RESULT: myPayments:"); | |
myPayments.forEach(x => { | |
console.log("-------------------------------------"); | |
console.log("** dump **:", x); | |
}); | |
/* CONSOLE LOG: | |
$ node test/test-parse-payments-tx.js | |
=========================================== | |
Curating payment txs by address: rHDvn877ezKZokt9WWeVhjwfab53o4pjw1 | |
=========================================== | |
>>>>>>> RESULT: myPayments: | |
------------------------------------- | |
** dump **: { sequence: 32, | |
validated: true, | |
transactionType: 'Payment', | |
transactionResult: 'tesSUCCESS', | |
ledgerIndex: 299097, | |
hash: '47265E1D45A9FAB14F980E61A9750006342994B019EF352A86A9B32EFC4B26CA', | |
source: 'rHDvn877ezKZokt9WWeVhjwfab53o4pjw1', | |
destination: 'rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah', | |
amount: | |
{ currency: 'XXX', | |
issuer: 'rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn', | |
value: '1' }, | |
deliveredAmount: | |
{ currency: 'XXX', | |
issuer: 'rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn', | |
value: '1' }, | |
direction: 'send', | |
fee: '10', | |
memos: | |
[ { memoType: undefined, | |
memoFormat: 'text/html', | |
memoData: 'Go%202nd%201XXX!' } ], | |
date: 1499063541 } | |
------------------------------------- | |
** dump **: { sequence: 31, | |
validated: true, | |
transactionType: 'Payment', | |
transactionResult: 'tesSUCCESS', | |
ledgerIndex: 299060, | |
hash: '164DC9A945C95F85D418FFD7DB1BF513E8DF140C80B7B61789D4F5FA7992F231', | |
source: 'rHDvn877ezKZokt9WWeVhjwfab53o4pjw1', | |
destination: 'rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah', | |
amount: | |
{ currency: 'XXX', | |
issuer: 'rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn', | |
value: '1' }, | |
deliveredAmount: | |
{ currency: 'XXX', | |
issuer: 'rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn', | |
value: '1' }, | |
direction: 'send', | |
fee: '10', | |
memos: [], | |
date: 1499063412 } | |
------------------------------------- | |
** dump **: { sequence: 30, | |
validated: true, | |
transactionType: 'Payment', | |
transactionResult: 'tesSUCCESS', | |
ledgerIndex: 298502, | |
hash: '4D3DE05B0DD51DDB42578990183ACE7840512D036CAF8F906C0AF4A7D1C01322', | |
source: 'rHDvn877ezKZokt9WWeVhjwfab53o4pjw1', | |
destination: 'rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah', | |
amount: | |
{ currency: 'XXX', | |
issuer: 'rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn', | |
value: '10' }, | |
deliveredAmount: | |
{ currency: 'XXX', | |
issuer: 'rLoohEFbCnV9tgtAxcuzhxA2uUu7N77jbn', | |
value: '10' }, | |
direction: 'send', | |
fee: '10', | |
memos: [], | |
date: 1499061650 } | |
------------------------------------- | |
** dump **: { sequence: 12, | |
validated: true, | |
transactionType: 'Payment', | |
transactionResult: 'tesSUCCESS', | |
ledgerIndex: 298048, | |
hash: '80BBAF53BDE5D78FE6D9C2C7280EE07A854AAF7596627A4323D68FB4802297CE', | |
source: 'rMANtzWhKjWcWP7v7L9VwJJeYgCcxm1eUa', | |
destination: 'rHDvn877ezKZokt9WWeVhjwfab53o4pjw1', | |
amount: | |
{ currency: 'JPY', | |
issuer: 'rJPaaC1CCeqk7mUimTZh1x5SdnwKiytAhT', | |
value: '10000' }, | |
deliveredAmount: | |
{ currency: 'JPY', | |
issuer: 'rJPaaC1CCeqk7mUimTZh1x5SdnwKiytAhT', | |
value: '10000' }, | |
direction: 'receive', | |
fee: '10', | |
memos: [], | |
date: 1499060241 } | |
------------------------------------- | |
** dump **: { sequence: 10, | |
validated: true, | |
transactionType: 'Payment', | |
transactionResult: 'tesSUCCESS', | |
ledgerIndex: 297487, | |
hash: 'A369460F1898803E7BB920E1B063DACD70BD47FFFD6F7871B20115590ED04D56', | |
source: 'rMANtzWhKjWcWP7v7L9VwJJeYgCcxm1eUa', | |
destination: 'rHDvn877ezKZokt9WWeVhjwfab53o4pjw1', | |
amount: { currency: 'XRP', issuer: null, value: '1000000' }, | |
deliveredAmount: { currency: 'XRP', issuer: null, value: '1000000' }, | |
direction: 'receive', | |
fee: '10', | |
memos: [], | |
date: 1499058501 } | |
------------------------------------- | |
** dump **: { sequence: 9, | |
validated: true, | |
transactionType: 'Payment', | |
transactionResult: 'tesSUCCESS', | |
ledgerIndex: 297396, | |
hash: 'D5B34D12A0DE937988316AEE9DECD41DBF9DD991F113C690818D9B9818EB5CF7', | |
source: 'rMANtzWhKjWcWP7v7L9VwJJeYgCcxm1eUa', | |
destination: 'rHDvn877ezKZokt9WWeVhjwfab53o4pjw1', | |
amount: { currency: 'XRP', issuer: null, value: '100000' }, | |
deliveredAmount: { currency: 'XRP', issuer: null, value: '100000' }, | |
direction: 'receive', | |
fee: '10', | |
memos: [], | |
date: 1499058221 } | |
*/ |
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
/** | |
* Ripple Transaction Parser | |
* | |
* Usage: | |
* | |
* 1) You get Ripple `transaction` data by any way. | |
* for example, below gets RPC response data of such as `account_tx`: | |
* ``` | |
* $ curl --data-binary '{"jsonrpc":"2.0","id":0,"method":"account_tx","params":[{"account":"rHDvn877ezKZokt9WWeVhjwfab53o4pjw1","binary":false,"count":false,"descending":true,"forward":false,"ledger_index_max":-1,"ledger_index_min":-1,"limit":3,"offset":0}]}' https://api.altnet.rippletest.net:51234 | |
* ``` | |
* 2) Code: | |
* ``` | |
* const TxParser = require('../lib/RippleTxParser.js'); | |
* const myAccount = 'rHDvn877ezKZokt9WWeVhjwfab53o4pjw1'; | |
* var rpcResp = {...}; | |
* var txs = rpcResp.result.transactions; | |
* // for offers: | |
* var myOffers = TxParser.getAccountOffers(myAccount, txs); | |
* // for payments: | |
* var myPayments = TxParser.getAccountPayments(myAccount, txs); | |
* | |
* // myOffers is an array of curated offer data. | |
* // an element of myOffers contains some properties such as `account`, | |
* // `sequence`, `status`, `firstFields`, `finalFields`, `txObj` etc. | |
* // Typically you check `status` for detecting its offer's status, | |
* // for example, it may return "filled" when its offer has been filled. | |
* | |
* ``` | |
* @author akirattii <tanaka.akira.2006@gmail.com> (http://mint.pepper.jp) | |
*/ | |
const MODULENAME = "RippleTxParser"; | |
/** | |
* Create an account's payment txs curated to be simple. | |
* @param account {String} - ripple address whose offers you want to get | |
* @param txs {Object} - `result.transactions` which is RPC API response such as `account_tx` | |
* @param debug {boolean} - Optional: dumps console log for debugging | |
* @return {Array} - curated txs array like this: | |
* [{ | |
* sequence: 54, | |
* ledgerIndex: 297397, | |
* source: 'rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah', | |
* destination: 'rHDvn877ezKZokt9WWeVhjwfab53o4pjw1', | |
* amount: { | |
* currency: 'JPY', | |
* issuer: 'rJPaaC1CCeqk7mUimTZh1x5SdnwKiytAhT', | |
* value: '10000' } }, // or '10000' for XRP | |
* deliveredAmount: { | |
* currency: 'JPY', | |
* issuer: 'rJPaaC1CCeqk7mUimTZh1x5SdnwKiytAhT', | |
* value: '10000' } }, // or '10000' for XRP | |
* fee: '10', | |
* memos:[{...}], | |
* hash: '164DC9A945C95F85D418FFD7DB1BF513E8DF140C80B7B61789D4F5FA7992F231', | |
* date: 552373421, | |
* }, ...] | |
*/ | |
exports.getAccountPayments = function(account, txs, debug = false) { | |
let ret = []; | |
let o, tx, meta; | |
for (let len = txs.length, i = 0; i < len; i++) { | |
o = txs[i]; | |
tx = o["tx"]; | |
meta = o["meta"]; | |
if (o["validated"] === true && | |
meta["TransactionResult"] == "tesSUCCESS" && | |
tx["TransactionType"] == "Payment") { | |
pushParsedData(o, ret); | |
} else { | |
continue; | |
} | |
} | |
return ret; | |
function pushParsedData(obj, arr) { | |
let sequence, | |
validated, | |
transactionType, | |
transactionResult, | |
ledgerIndex, | |
hash, | |
source, | |
destination, | |
amount, | |
deliveredAmount, | |
direction, | |
fee, | |
memos, | |
date; | |
sequence = obj["tx"]["Sequence"]; | |
validated = obj["validated"]; | |
transactionType = obj["tx"]["TransactionType"]; | |
transactionResult = obj["meta"]["TransactionResult"]; | |
ledgerIndex = obj["tx"]["ledger_index"]; | |
hash = obj["tx"]["hash"]; | |
source = obj["tx"]["Account"]; | |
destination = obj["tx"]["Destination"]; | |
amount = formatAmount(obj["tx"]["Amount"]); | |
deliveredAmount = formatAmount(obj["meta"]["delivered_amount"]); | |
direction = getDirection(account, obj["tx"]); | |
fee = obj["tx"]["Fee"]; | |
memos = parseMemos(obj["tx"]["Memos"]); | |
date = rippleToUnixTs(obj["tx"]["date"]); | |
arr.push({ | |
sequence, | |
validated, | |
transactionType, | |
transactionResult, | |
ledgerIndex, | |
hash, | |
source, | |
destination, | |
amount, | |
deliveredAmount, | |
direction, | |
fee, | |
memos, | |
date, | |
}); | |
} | |
function formatAmount(amt) { | |
let amount = amt; | |
if (typeof amt == "string") { | |
amount = { | |
currency: "XRP", | |
issuer: null, | |
value: amt, | |
}; | |
} | |
return amount; | |
} | |
function parseMemos(memos) { | |
let ret = []; | |
if (!memos || !Array.isArray(memos)) return ret; | |
let m, memoType, memoFormat, memoData; | |
for (let len = memos.length, i = 0; i < len; i++) { | |
m = memos[i]["Memo"]; | |
memoType = hex2a(m["MemoType"]); | |
memoFormat = hex2a(m["MemoFormat"]); | |
memoData = hex2a(m["MemoData"]); | |
ret.push({ | |
memoType, | |
memoFormat, | |
memoData, | |
}); | |
} | |
return ret; | |
} | |
function getDirection(subject, { Account, Destination }) { | |
if (subject == Account) { | |
return "send"; | |
} else if (subject == Destination) { | |
return "receive"; | |
} else { | |
return null; | |
} | |
} | |
function rippleToUnixTs(rippleTs) { | |
return (rippleTs + 0x386D4380); | |
}; | |
function a2hex(str) { | |
return str ? (new Buffer(str, 'utf8')).toString('hex').toUpperCase() : undefined; | |
}; | |
function hex2a(hex) { | |
return (hex) ? new Buffer(hex, 'hex').toString('utf-8') : undefined; | |
}; | |
}; | |
/** | |
* Create an account's offers curated to be simple. | |
* @param account {String} - ripple address whose offers you want to get | |
* @param txs {Object} - `result.transactions` which is RPC API response such as `account_tx` | |
* @param debug {boolean} - Optional: dumps console log for debugging | |
* @return {Array} - curated offers array like this: | |
* [{ | |
* sequence: 54, | |
* account: 'rcSFxB5UoDKFjfoa5HtQqgqKcjkd2N4ah', | |
* status: 'filled', | |
* txObj: { meta, tx }, | |
* firstFields: { TakerGets, TakerPays, }, | |
* finalFields: { TakerGets, TakerPays, ...more }, | |
* }, ...] | |
*/ | |
exports.getAccountOffers = function(account, txs, debug = false) { | |
let myOffers = collectMyOffers(account, txs); | |
if (debug) console.log("# collected myOffers:", myOffers); | |
let seqs = getMySeqs(myOffers); | |
for (let len = seqs.length, i = 0; i < len; i++) { | |
affectMyOffers(account, seqs[i], myOffers, txs); | |
} | |
return myOffers; | |
// | |
// below is inner functions | |
// | |
function getMySeqs(myOffers) { | |
let o; | |
let ret = []; | |
for (let len = myOffers.length, i = 0; i < len; i++) { | |
o = myOffers[i]; | |
ret.push(o.sequence); | |
} | |
return ret; | |
} | |
function affectMyOffers(account, seq, myOffers, txs) { | |
if (debug) console.log(`# affectMyOffers account:${account} seq:${seq}`); | |
let txObj, analyzed, affnodes, creNode, modNode, delNode, sequence, offer, takerPaysVal; | |
for (let len = txs.length, i = 0; i < len; i++) { | |
txObj = txs[i]; | |
affnodes = txObj.meta.AffectedNodes; | |
creNode = getSpecificNode(account, seq, "CreatedNode", affnodes); | |
modNode = getSpecificNode(account, seq, "ModifiedNode", affnodes); | |
delNode = getSpecificNode(account, seq, "DeletedNode", affnodes); | |
if (delNode || modNode) { | |
// **** DeletedNode or ModifiedNode: | |
let node = delNode || modNode; | |
let fields = node["FinalFields"]; | |
sequence = fields["Sequence"]; | |
if (debug) console.log(" DeletedNode or ModifiedNode:", node); | |
if (debug) console.log(" findBySeq in myOffers:", sequence); | |
offer = findBySeq(myOffers, sequence); | |
if (!offer) { | |
if (debug) console.log(" Not found in myOffers.") | |
continue; | |
} | |
offer.finalFields = fields; | |
takerPaysVal = fields["TakerPays"]["value"]; | |
if (takerPaysVal == "0") { | |
offer.status = "filled"; | |
} else { | |
offer.status = "partially-filled"; | |
} | |
if (debug) console.log(" status==", offer.status); | |
} else if (creNode) { | |
// *** CreatedNode: | |
node = creNode; | |
let fields = node["NewFields"]; | |
sequence = fields["Sequence"]; | |
if (debug) console.log(" CreatedNode:", node); | |
if (debug) console.log(" findBySeq in myOffers:", sequence); | |
offer = findBySeq(myOffers, sequence); | |
if (!offer) { | |
if (debug) console.log(" Not found in myOffers.") | |
continue; | |
} | |
if (!offer.status) { | |
offer.finalFields = fields; | |
if (offer.firstFields.TakerPays.value == fields.TakerPays.value) | |
offer.status = "created"; | |
else | |
offer.status = "partially-filled"; | |
if (debug) console.log(" status==", offer.status); | |
} | |
} else { | |
// throw Error('No node of any types'); | |
continue; | |
} | |
} | |
} | |
function findBySeq(myOffer, seq) { | |
let idx = myOffer.findIndex(x => x.sequence == seq); | |
if (idx >= 0) | |
return myOffer[idx]; | |
return null; | |
} | |
function collectMyOffers(account, txs) { | |
let txObj, analyzed; | |
let myOffers = []; | |
for (let len = txs.length, i = 0; i < len; i++) { | |
txObj = txs[i]; | |
analyzed = createMyOfferTx(account, txObj); | |
if (!analyzed) continue; | |
myOffers.push(analyzed); | |
} | |
return myOffers; | |
} | |
function createMyOfferTx(account, txObj) { | |
if (debug) console.log("# createMyOfferTx"); | |
let ownTxObj = getOwnTxObj(account, txObj); | |
if (!ownTxObj) { | |
if (debug) console.log(" unrelated tx"); | |
return null; | |
} | |
let filledImmediately = isFilledImmediately(account, ownTxObj); | |
let status, firstFields, finalFields; | |
if (filledImmediately === true) { | |
status = "filled"; // filled immediately | |
} | |
if (ownTxObj.tx.TransactionType == "OfferCancel") { | |
status = "cancelled"; | |
if (debug) console.log(" cancelled tx:", ownTxObj.tx); | |
} | |
firstFields = { | |
TakerGets: ownTxObj.tx.TakerGets, | |
TakerPays: ownTxObj.tx.TakerPays, | |
}; | |
return { | |
sequence: ownTxObj.tx.Sequence, | |
account: ownTxObj.tx.Account, | |
status, | |
txObj: ownTxObj, | |
firstFields, | |
finalFields, | |
}; | |
}; | |
function getOwnTxObj(account, txObj) { | |
const tx = txObj.tx; | |
if (tx.Account == account) { | |
return txObj; | |
} | |
return null; | |
} | |
function isFilledImmediately(account, txObj) { | |
if (debug) console.log(" # Searching filledImmediately:", account, txObj.tx.TransactionType); | |
if (txObj.tx.TransactionType != "OfferCreate") return false; | |
const affnodes = txObj.meta.AffectedNodes; | |
const seq = txObj.tx.Sequence; | |
if (debug) console.log(" seq:", seq); | |
let creNode = getSpecificNode(account, seq, "CreatedNode", affnodes); | |
if (debug) console.log(" creNode:", creNode); | |
if (!creNode) { | |
if (debug) console.log(" Found! immediately-filled offer:", seq); | |
return true; | |
} | |
return false; | |
} | |
// nodeType - "CreatedNode", "ModifiedNode", or "DeletedNode" | |
function getSpecificNode(account, seq, nodeType, affnodes) { | |
let an, n; | |
// 後ろから回す | |
for (let len = affnodes.length, i = len - 1; i >= 0; i--) { | |
an = affnodes[i]; | |
n = an[nodeType]; | |
if (!n) continue; | |
if (n["LedgerEntryType"] != "Offer") continue; | |
let fields = n["NewFields"] || n["FinalFields"]; | |
if (fields["Account"] != account) continue; | |
if (fields["Sequence"] != seq) continue; | |
return n; | |
} | |
// console.log("SPEC:", account, n); | |
return null; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment