mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-20 19:55:54 +00:00
100
content/code_samples/checks/cli/account_objects-resp-clean.txt
Normal file
100
content/code_samples/checks/cli/account_objects-resp-clean.txt
Normal file
@@ -0,0 +1,100 @@
|
||||
{
|
||||
"result": {
|
||||
"account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"account_objects": [
|
||||
{
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Check",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "37D90463CDE0497DB12F18099296DA0E1E52334A785710B5F56BC9637F62429C",
|
||||
"PreviousTxnLgrSeq": 8003261,
|
||||
"SendMax": "999999000000",
|
||||
"Sequence": 5,
|
||||
"index": "2E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C2"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "BAR",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "0"
|
||||
},
|
||||
"Flags": 1179648,
|
||||
"HighLimit": {
|
||||
"currency": "BAR",
|
||||
"issuer": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"value": "1234567890123450e79"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "BAR",
|
||||
"issuer": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"value": "0"
|
||||
},
|
||||
"LowNode": "0000000000000000",
|
||||
"PreviousTxnID": "D7687E275546322995764632799040CF5BDB597691683DE7C532A60BA64E5414",
|
||||
"PreviousTxnLgrSeq": 8003321,
|
||||
"index": "5A157543E6A19F14E559A3BE14876B48103502F3258893D4F6DF83E61884F20E"
|
||||
},
|
||||
{
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationNode": "0000000000000000",
|
||||
"DestinationTag": 1,
|
||||
"Flags": 0,
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"LedgerEntryType": "Check",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB",
|
||||
"PreviousTxnLgrSeq": 7841263,
|
||||
"SendMax": "100000000",
|
||||
"Sequence": 4,
|
||||
"index": "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9"
|
||||
},
|
||||
{
|
||||
"Balance": {
|
||||
"currency": "FOO",
|
||||
"issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value": "0"
|
||||
},
|
||||
"Flags": 2162688,
|
||||
"HighLimit": {
|
||||
"currency": "FOO",
|
||||
"issuer": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"value": "0"
|
||||
},
|
||||
"HighNode": "0000000000000000",
|
||||
"LedgerEntryType": "RippleState",
|
||||
"LowLimit": {
|
||||
"currency": "FOO",
|
||||
"issuer": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"value": "10000"
|
||||
},
|
||||
"LowNode": "0000000000000000",
|
||||
"PreviousTxnID": "119400AC7A5B8BD3CC98265D0AB89FC59E6469ED64917425AEA52D40D83164A7",
|
||||
"PreviousTxnLgrSeq": 8003297,
|
||||
"index": "88003CF8348313E5CD720FBCCFADF4C4CE6C2C7F4093C943A3E01E8F547DBCAF"
|
||||
},
|
||||
{
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Check",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "C0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441",
|
||||
"PreviousTxnLgrSeq": 7835887,
|
||||
"SendMax": "100000000",
|
||||
"Sequence": 2,
|
||||
"index": "CEA5F0BD7B2B5C85A70AE735E4CE722C43C86410A79AB87C11938AA13A11DBF9"
|
||||
}
|
||||
],
|
||||
"ledger_hash": "386FE87ED505E28134AC7171A0B690BA87112334B22DD83194A4C7C3C9810E84",
|
||||
"ledger_index": 8003351,
|
||||
"status": "success",
|
||||
"validated": true
|
||||
}
|
||||
}
|
||||
100
content/code_samples/checks/cli/account_objects-resp.txt
Normal file
100
content/code_samples/checks/cli/account_objects-resp.txt
Normal file
@@ -0,0 +1,100 @@
|
||||
{
|
||||
"result" : {
|
||||
"account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"account_objects" : [
|
||||
{
|
||||
"Account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationNode" : "0000000000000000",
|
||||
"Flags" : 0,
|
||||
"LedgerEntryType" : "Check",
|
||||
"OwnerNode" : "0000000000000000",
|
||||
"PreviousTxnID" : "37D90463CDE0497DB12F18099296DA0E1E52334A785710B5F56BC9637F62429C",
|
||||
"PreviousTxnLgrSeq" : 8003261,
|
||||
"SendMax" : "999999000000",
|
||||
"Sequence" : 5,
|
||||
"index" : "2E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C2"
|
||||
},
|
||||
{
|
||||
"Balance" : {
|
||||
"currency" : "BAR",
|
||||
"issuer" : "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value" : "0"
|
||||
},
|
||||
"Flags" : 1179648,
|
||||
"HighLimit" : {
|
||||
"currency" : "BAR",
|
||||
"issuer" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"value" : "1234567890123450e79"
|
||||
},
|
||||
"HighNode" : "0000000000000000",
|
||||
"LedgerEntryType" : "RippleState",
|
||||
"LowLimit" : {
|
||||
"currency" : "BAR",
|
||||
"issuer" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"value" : "0"
|
||||
},
|
||||
"LowNode" : "0000000000000000",
|
||||
"PreviousTxnID" : "D7687E275546322995764632799040CF5BDB597691683DE7C532A60BA64E5414",
|
||||
"PreviousTxnLgrSeq" : 8003321,
|
||||
"index" : "5A157543E6A19F14E559A3BE14876B48103502F3258893D4F6DF83E61884F20E"
|
||||
},
|
||||
{
|
||||
"Account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationNode" : "0000000000000000",
|
||||
"DestinationTag" : 1,
|
||||
"Flags" : 0,
|
||||
"InvoiceID" : "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"LedgerEntryType" : "Check",
|
||||
"OwnerNode" : "0000000000000000",
|
||||
"PreviousTxnID" : "09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB",
|
||||
"PreviousTxnLgrSeq" : 7841263,
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 4,
|
||||
"index" : "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9"
|
||||
},
|
||||
{
|
||||
"Balance" : {
|
||||
"currency" : "FOO",
|
||||
"issuer" : "rrrrrrrrrrrrrrrrrrrrBZbvji",
|
||||
"value" : "0"
|
||||
},
|
||||
"Flags" : 2162688,
|
||||
"HighLimit" : {
|
||||
"currency" : "FOO",
|
||||
"issuer" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"value" : "0"
|
||||
},
|
||||
"HighNode" : "0000000000000000",
|
||||
"LedgerEntryType" : "RippleState",
|
||||
"LowLimit" : {
|
||||
"currency" : "FOO",
|
||||
"issuer" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"value" : "10000"
|
||||
},
|
||||
"LowNode" : "0000000000000000",
|
||||
"PreviousTxnID" : "119400AC7A5B8BD3CC98265D0AB89FC59E6469ED64917425AEA52D40D83164A7",
|
||||
"PreviousTxnLgrSeq" : 8003297,
|
||||
"index" : "88003CF8348313E5CD720FBCCFADF4C4CE6C2C7F4093C943A3E01E8F547DBCAF"
|
||||
},
|
||||
{
|
||||
"Account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationNode" : "0000000000000000",
|
||||
"Flags" : 0,
|
||||
"LedgerEntryType" : "Check",
|
||||
"OwnerNode" : "0000000000000000",
|
||||
"PreviousTxnID" : "C0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441",
|
||||
"PreviousTxnLgrSeq" : 7835887,
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 2,
|
||||
"index" : "CEA5F0BD7B2B5C85A70AE735E4CE722C43C86410A79AB87C11938AA13A11DBF9"
|
||||
}
|
||||
],
|
||||
"ledger_hash" : "386FE87ED505E28134AC7171A0B690BA87112334B22DD83194A4C7C3C9810E84",
|
||||
"ledger_index" : 8003351,
|
||||
"status" : "success",
|
||||
"validated" : true
|
||||
}
|
||||
}
|
||||
6
content/code_samples/checks/cli/sign-cancel-req.sh
Normal file
6
content/code_samples/checks/cli/sign-cancel-req.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
rippled sign s████████████████████████████ '{
|
||||
"TransactionType": "CheckCancel",
|
||||
"Account": "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"CheckID": "49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0",
|
||||
"Fee": "12"
|
||||
}'
|
||||
20
content/code_samples/checks/cli/sign-cancel-resp.txt
Normal file
20
content/code_samples/checks/cli/sign-cancel-resp.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Jan-24 01:11:07 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"status" : "success",
|
||||
"tx_blob" : "12001222800000002400000003501849647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB068400000000000000C7321022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF78744630440220615F9D19FA182F08530CD978A4C216C8676D0BA9EDB53A620AC909AA0EF0FE7E02203A09CC34C3DB85CCCB3137E78081F8F2B441FB0A3B9E40901F312D3CBA0A67A181147990EC5D1D8DF69E070A968D4B186986FDF06ED0",
|
||||
"tx_json" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"CheckID" : "49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0",
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 3,
|
||||
"SigningPubKey" : "022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF78",
|
||||
"TransactionType" : "CheckCancel",
|
||||
"TxnSignature" : "30440220615F9D19FA182F08530CD978A4C216C8676D0BA9EDB53A620AC909AA0EF0FE7E02203A09CC34C3DB85CCCB3137E78081F8F2B441FB0A3B9E40901F312D3CBA0A67A1",
|
||||
"hash" : "414558223CA8595916BB1FEF238B3BB601B7C0E52659292251CE613E6B4370F9"
|
||||
}
|
||||
}
|
||||
}
|
||||
7
content/code_samples/checks/cli/sign-cash-exact-req.sh
Normal file
7
content/code_samples/checks/cli/sign-cash-exact-req.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
rippled sign s████████████████████████████ '{
|
||||
"Account": "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"TransactionType": "CheckCash",
|
||||
"Amount": "100000000",
|
||||
"CheckID": "838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334",
|
||||
"Fee": "12"
|
||||
}'
|
||||
21
content/code_samples/checks/cli/sign-cash-exact-resp.txt
Normal file
21
content/code_samples/checks/cli/sign-cash-exact-resp.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Jan-24 01:17:54 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"status" : "success",
|
||||
"tx_blob" : "120011228000000024000000015018838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334614000000005F5E10068400000000000000C732102F135B14C552968B0ABE8493CC4C5795A7484D73F6BFD01379F73456F725F66ED74473045022100C64278AC90B841CD3EA9889A4847CAB3AC9927057A34130810FAA7FAC0C6E3290220347260A4C0A6DC9B699DA12510795B2B3414E1FA222AF743226345FBAAEF937C811449FF0C73CA6AF9733DA805F76CA2C37776B7C46B",
|
||||
"tx_json" : {
|
||||
"Account" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"Amount" : "100000000",
|
||||
"CheckID" : "838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334",
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 1,
|
||||
"SigningPubKey" : "02F135B14C552968B0ABE8493CC4C5795A7484D73F6BFD01379F73456F725F66ED",
|
||||
"TransactionType" : "CheckCash",
|
||||
"TxnSignature" : "3045022100C64278AC90B841CD3EA9889A4847CAB3AC9927057A34130810FAA7FAC0C6E3290220347260A4C0A6DC9B699DA12510795B2B3414E1FA222AF743226345FBAAEF937C",
|
||||
"hash" : "0521707D510858BC8AF69D2227E1D1ADA7DB7C5B4B74115BCD0D91B62AFA8EDC"
|
||||
}
|
||||
}
|
||||
}
|
||||
6
content/code_samples/checks/cli/sign-cash-flex-req.sh
Normal file
6
content/code_samples/checks/cli/sign-cash-flex-req.sh
Normal file
@@ -0,0 +1,6 @@
|
||||
rippled sign s████████████████████████████ '{
|
||||
"Account": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"TransactionType": "CheckCash",
|
||||
"DeliverMin": "95000000",
|
||||
"CheckID": "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9"
|
||||
}'
|
||||
21
content/code_samples/checks/cli/sign-cash-flex-resp.txt
Normal file
21
content/code_samples/checks/cli/sign-cash-flex-resp.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Apr-03 00:09:53 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"status" : "success",
|
||||
"tx_blob" : "12001122800000002400000004501884C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD968400000000000000A6A4000000005A995C073210361ACFCB478BCAE01451F95060AF94F70365BF00D7B4661EC2C69EA383762516C7446304402203D7EC220D48AA040D6915C160275D202F7F808E2B58F11B1AB05FB5E5CFCC6C00220304BBD3AD32E13150E0ED7247F2ADFAE83D0ECE329E20CFE0F8DF352934DD2FC8114A8B6B9FF3246856CADC4A0106198C066EA1F9C39",
|
||||
"tx_json" : {
|
||||
"Account" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"CheckID" : "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9",
|
||||
"DeliverMin" : "95000000",
|
||||
"Fee" : "10",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 4,
|
||||
"SigningPubKey" : "0361ACFCB478BCAE01451F95060AF94F70365BF00D7B4661EC2C69EA383762516C",
|
||||
"TransactionType" : "CheckCash",
|
||||
"TxnSignature" : "304402203D7EC220D48AA040D6915C160275D202F7F808E2B58F11B1AB05FB5E5CFCC6C00220304BBD3AD32E13150E0ED7247F2ADFAE83D0ECE329E20CFE0F8DF352934DD2FC",
|
||||
"hash" : "A0AFE572E4736CBF49FF4D0D3FF8FDB0C4D31BD10CB4EB542230F85F0F2DD222"
|
||||
}
|
||||
}
|
||||
}
|
||||
10
content/code_samples/checks/cli/sign-create-req.sh
Normal file
10
content/code_samples/checks/cli/sign-create-req.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
rippled sign s████████████████████████████ '{
|
||||
"TransactionType": "CheckCreate",
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"SendMax": "100000000",
|
||||
"Expiration": 570113521,
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"DestinationTag": 1,
|
||||
"Fee": "12"
|
||||
}'
|
||||
24
content/code_samples/checks/cli/sign-create-resp.txt
Normal file
24
content/code_samples/checks/cli/sign-create-resp.txt
Normal file
@@ -0,0 +1,24 @@
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Mar-21 21:00:05 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"status" : "success",
|
||||
"tx_blob" : "120010228000000024000000012A21FB3DF12E00000001501146060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE29168400000000000000C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB40074473045022100EB5A9001E14FC7304C4C2DF66507F9FC59D17FDCF98B43A4E30356658AB2A7CF02207127187EE0F287665D9552D15BEE6B00D3C6691C6773CE416E8A714B853F44FC8114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39",
|
||||
"tx_json" : {
|
||||
"Account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationTag" : 1,
|
||||
"Expiration" : 570113521,
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"InvoiceID" : "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 1,
|
||||
"SigningPubKey" : "03B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB400",
|
||||
"TransactionType" : "CheckCreate",
|
||||
"TxnSignature" : "3045022100EB5A9001E14FC7304C4C2DF66507F9FC59D17FDCF98B43A4E30356658AB2A7CF02207127187EE0F287665D9552D15BEE6B00D3C6691C6773CE416E8A714B853F44FC",
|
||||
"hash" : "07C3B2878B6941FED97BA647244531B7E2203268B05C71C3A1A014045ADDF408"
|
||||
}
|
||||
}
|
||||
}
|
||||
1
content/code_samples/checks/cli/submit-cancel-req.sh
Normal file
1
content/code_samples/checks/cli/submit-cancel-req.sh
Normal file
@@ -0,0 +1 @@
|
||||
rippled submit 12001222800000002400000003501849647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB068400000000000000C7321022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF78744630440220615F9D19FA182F08530CD978A4C216C8676D0BA9EDB53A620AC909AA0EF0FE7E02203A09CC34C3DB85CCCB3137E78081F8F2B441FB0A3B9E40901F312D3CBA0A67A181147990EC5D1D8DF69E070A968D4B186986FDF06ED0
|
||||
23
content/code_samples/checks/cli/submit-cancel-resp.txt
Normal file
23
content/code_samples/checks/cli/submit-cancel-resp.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Jan-24 01:11:07 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"engine_result" : "tesSUCCESS",
|
||||
"engine_result_code" : 0,
|
||||
"engine_result_message" : "The transaction was applied. Only final in a validated ledger.",
|
||||
"status" : "success",
|
||||
"tx_blob" : "12001222800000002400000003501849647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB068400000000000000C7321022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF78744630440220615F9D19FA182F08530CD978A4C216C8676D0BA9EDB53A620AC909AA0EF0FE7E02203A09CC34C3DB85CCCB3137E78081F8F2B441FB0A3B9E40901F312D3CBA0A67A181147990EC5D1D8DF69E070A968D4B186986FDF06ED0",
|
||||
"tx_json" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"CheckID" : "49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0",
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 3,
|
||||
"SigningPubKey" : "022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF78",
|
||||
"TransactionType" : "CheckCancel",
|
||||
"TxnSignature" : "30440220615F9D19FA182F08530CD978A4C216C8676D0BA9EDB53A620AC909AA0EF0FE7E02203A09CC34C3DB85CCCB3137E78081F8F2B441FB0A3B9E40901F312D3CBA0A67A1",
|
||||
"hash" : "414558223CA8595916BB1FEF238B3BB601B7C0E52659292251CE613E6B4370F9"
|
||||
}
|
||||
}
|
||||
}
|
||||
1
content/code_samples/checks/cli/submit-cash-exact-req.sh
Normal file
1
content/code_samples/checks/cli/submit-cash-exact-req.sh
Normal file
@@ -0,0 +1 @@
|
||||
rippled submit 120011228000000024000000015018838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334614000000005F5E10068400000000000000C732102F135B14C552968B0ABE8493CC4C5795A7484D73F6BFD01379F73456F725F66ED74473045022100C64278AC90B841CD3EA9889A4847CAB3AC9927057A34130810FAA7FAC0C6E3290220347260A4C0A6DC9B699DA12510795B2B3414E1FA222AF743226345FBAAEF937C811449FF0C73CA6AF9733DA805F76CA2C37776B7C46B
|
||||
24
content/code_samples/checks/cli/submit-cash-exact-resp.txt
Normal file
24
content/code_samples/checks/cli/submit-cash-exact-resp.txt
Normal file
@@ -0,0 +1,24 @@
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Jan-24 01:17:54 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"engine_result" : "tesSUCCESS",
|
||||
"engine_result_code" : 0,
|
||||
"engine_result_message" : "The transaction was applied. Only final in a validated ledger.",
|
||||
"status" : "success",
|
||||
"tx_blob" : "120011228000000024000000015018838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334614000000005F5E10068400000000000000C732102F135B14C552968B0ABE8493CC4C5795A7484D73F6BFD01379F73456F725F66ED74473045022100C64278AC90B841CD3EA9889A4847CAB3AC9927057A34130810FAA7FAC0C6E3290220347260A4C0A6DC9B699DA12510795B2B3414E1FA222AF743226345FBAAEF937C811449FF0C73CA6AF9733DA805F76CA2C37776B7C46B",
|
||||
"tx_json" : {
|
||||
"Account" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"Amount" : "100000000",
|
||||
"CheckID" : "838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334",
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 1,
|
||||
"SigningPubKey" : "02F135B14C552968B0ABE8493CC4C5795A7484D73F6BFD01379F73456F725F66ED",
|
||||
"TransactionType" : "CheckCash",
|
||||
"TxnSignature" : "3045022100C64278AC90B841CD3EA9889A4847CAB3AC9927057A34130810FAA7FAC0C6E3290220347260A4C0A6DC9B699DA12510795B2B3414E1FA222AF743226345FBAAEF937C",
|
||||
"hash" : "0521707D510858BC8AF69D2227E1D1ADA7DB7C5B4B74115BCD0D91B62AFA8EDC"
|
||||
}
|
||||
}
|
||||
}
|
||||
1
content/code_samples/checks/cli/submit-cash-flex-req.sh
Normal file
1
content/code_samples/checks/cli/submit-cash-flex-req.sh
Normal file
@@ -0,0 +1 @@
|
||||
rippled submit 12001122800000002400000004501884C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD968400000000000000A6A4000000005A995C073210361ACFCB478BCAE01451F95060AF94F70365BF00D7B4661EC2C69EA383762516C7446304402203D7EC220D48AA040D6915C160275D202F7F808E2B58F11B1AB05FB5E5CFCC6C00220304BBD3AD32E13150E0ED7247F2ADFAE83D0ECE329E20CFE0F8DF352934DD2FC8114A8B6B9FF3246856CADC4A0106198C066EA1F9C39
|
||||
24
content/code_samples/checks/cli/submit-cash-flex-resp.txt
Normal file
24
content/code_samples/checks/cli/submit-cash-flex-resp.txt
Normal file
@@ -0,0 +1,24 @@
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Apr-03 00:10:30 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"engine_result" : "tesSUCCESS",
|
||||
"engine_result_code" : 0,
|
||||
"engine_result_message" : "The transaction was applied. Only final in a validated ledger.",
|
||||
"status" : "success",
|
||||
"tx_blob" : "12001122800000002400000004501884C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD968400000000000000A6A4000000005A995C073210361ACFCB478BCAE01451F95060AF94F70365BF00D7B4661EC2C69EA383762516C7446304402203D7EC220D48AA040D6915C160275D202F7F808E2B58F11B1AB05FB5E5CFCC6C00220304BBD3AD32E13150E0ED7247F2ADFAE83D0ECE329E20CFE0F8DF352934DD2FC8114A8B6B9FF3246856CADC4A0106198C066EA1F9C39",
|
||||
"tx_json" : {
|
||||
"Account" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"CheckID" : "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9",
|
||||
"DeliverMin" : "95000000",
|
||||
"Fee" : "10",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 4,
|
||||
"SigningPubKey" : "0361ACFCB478BCAE01451F95060AF94F70365BF00D7B4661EC2C69EA383762516C",
|
||||
"TransactionType" : "CheckCash",
|
||||
"TxnSignature" : "304402203D7EC220D48AA040D6915C160275D202F7F808E2B58F11B1AB05FB5E5CFCC6C00220304BBD3AD32E13150E0ED7247F2ADFAE83D0ECE329E20CFE0F8DF352934DD2FC",
|
||||
"hash" : "A0AFE572E4736CBF49FF4D0D3FF8FDB0C4D31BD10CB4EB542230F85F0F2DD222"
|
||||
}
|
||||
}
|
||||
}
|
||||
1
content/code_samples/checks/cli/submit-create-req.sh
Normal file
1
content/code_samples/checks/cli/submit-create-req.sh
Normal file
@@ -0,0 +1 @@
|
||||
rippled submit 120010228000000024000000042E00000001501146060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE29168400000000000000C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB40074463044022071A341F911A8EF3B68399487CAF5BA3B59C6FE476B626698AEF044B8183721BC0220166053A859BD907251DFCCF34DD71202180EBABAE7098BB5903D16EBFC993C408114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39
|
||||
26
content/code_samples/checks/cli/submit-create-resp.txt
Normal file
26
content/code_samples/checks/cli/submit-create-resp.txt
Normal file
@@ -0,0 +1,26 @@
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Mar-28 01:52:49 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result": {
|
||||
"engine_result": "terQUEUED",
|
||||
"engine_result_code": -89,
|
||||
"engine_result_message": "Held until escalated fee drops.",
|
||||
"status" : "success",
|
||||
"tx_blob": "120010228000000024000000042E00000001501146060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE29168400000000000000C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB40074463044022071A341F911A8EF3B68399487CAF5BA3B59C6FE476B626698AEF044B8183721BC0220166053A859BD907251DFCCF34DD71202180EBABAE7098BB5903D16EBFC993C408114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39",
|
||||
"tx_json": {
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationTag": 1,
|
||||
"Fee": "12",
|
||||
"Flags": 2147483648,
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"SendMax": "100000000",
|
||||
"Sequence": 4,
|
||||
"SigningPubKey": "03B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB400",
|
||||
"TransactionType": "CheckCreate",
|
||||
"TxnSignature": "3044022071A341F911A8EF3B68399487CAF5BA3B59C6FE476B626698AEF044B8183721BC0220166053A859BD907251DFCCF34DD71202180EBABAE7098BB5903D16EBFC993C40",
|
||||
"hash": "09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB"
|
||||
}
|
||||
}
|
||||
}
|
||||
1
content/code_samples/checks/cli/tx-cancel-req.sh
Normal file
1
content/code_samples/checks/cli/tx-cancel-req.sh
Normal file
@@ -0,0 +1 @@
|
||||
rippled tx 414558223CA8595916BB1FEF238B3BB601B7C0E52659292251CE613E6B4370F9
|
||||
89
content/code_samples/checks/cli/tx-cancel-resp.txt
Normal file
89
content/code_samples/checks/cli/tx-cancel-resp.txt
Normal file
@@ -0,0 +1,89 @@
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Jan-24 01:11:53 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"CheckID" : "49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0",
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 3,
|
||||
"SigningPubKey" : "022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF78",
|
||||
"TransactionType" : "CheckCancel",
|
||||
"TxnSignature" : "30440220615F9D19FA182F08530CD978A4C216C8676D0BA9EDB53A620AC909AA0EF0FE7E02203A09CC34C3DB85CCCB3137E78081F8F2B441FB0A3B9E40901F312D3CBA0A67A1",
|
||||
"date" : 570071520,
|
||||
"hash" : "414558223CA8595916BB1FEF238B3BB601B7C0E52659292251CE613E6B4370F9",
|
||||
"inLedger" : 7,
|
||||
"ledger_index" : 7,
|
||||
"meta" : {
|
||||
"AffectedNodes" : [
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"RootIndex" : "032D861D151E38E86F46805ED1896D1A50144F65459717B6D12470A9E6E3B66E"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "032D861D151E38E86F46805ED1896D1A50144F65459717B6D12470A9E6E3B66E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"DeletedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Destination" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"DestinationNode" : "0000000000000000",
|
||||
"DestinationTag" : 1,
|
||||
"Expiration" : 570113521,
|
||||
"Flags" : 0,
|
||||
"InvoiceID" : "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"OwnerNode" : "0000000000000000",
|
||||
"PreviousTxnID" : "5463C6E08862A1FAE5EDAC12D70ADB16546A1F674930521295BC082494B62924",
|
||||
"PreviousTxnLgrSeq" : 6,
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 2
|
||||
},
|
||||
"LedgerEntryType" : "Check",
|
||||
"LedgerIndex" : "49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"RootIndex" : "AD136EC2A266027D8F202C97D294BBE32F6FC2AD5501D9853F785FE77AB94C94"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "AD136EC2A266027D8F202C97D294BBE32F6FC2AD5501D9853F785FE77AB94C94"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Balance" : "4999999999964",
|
||||
"Flags" : 0,
|
||||
"OwnerCount" : 1,
|
||||
"Sequence" : 4
|
||||
},
|
||||
"LedgerEntryType" : "AccountRoot",
|
||||
"LedgerIndex" : "D3A1DBAA28717975A9119EC4CBC891BA9A66236C484F03C9911F463AD3B66DE0",
|
||||
"PreviousFields" : {
|
||||
"Balance" : "4999999999976",
|
||||
"OwnerCount" : 2,
|
||||
"Sequence" : 3
|
||||
},
|
||||
"PreviousTxnID" : "5463C6E08862A1FAE5EDAC12D70ADB16546A1F674930521295BC082494B62924",
|
||||
"PreviousTxnLgrSeq" : 6
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex" : 0,
|
||||
"TransactionResult" : "tesSUCCESS"
|
||||
},
|
||||
"status" : "success",
|
||||
"validated" : true
|
||||
}
|
||||
}
|
||||
1
content/code_samples/checks/cli/tx-cash-exact-req.sh
Normal file
1
content/code_samples/checks/cli/tx-cash-exact-req.sh
Normal file
@@ -0,0 +1 @@
|
||||
rippled tx 0521707D510858BC8AF69D2227E1D1ADA7DB7C5B4B74115BCD0D91B62AFA8EDC
|
||||
108
content/code_samples/checks/cli/tx-cash-exact-resp.txt
Normal file
108
content/code_samples/checks/cli/tx-cash-exact-resp.txt
Normal file
@@ -0,0 +1,108 @@
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Jan-24 01:18:39 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"Account" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"Amount" : "100000000",
|
||||
"CheckID" : "838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334",
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 1,
|
||||
"SigningPubKey" : "02F135B14C552968B0ABE8493CC4C5795A7484D73F6BFD01379F73456F725F66ED",
|
||||
"TransactionType" : "CheckCash",
|
||||
"TxnSignature" : "3045022100C64278AC90B841CD3EA9889A4847CAB3AC9927057A34130810FAA7FAC0C6E3290220347260A4C0A6DC9B699DA12510795B2B3414E1FA222AF743226345FBAAEF937C",
|
||||
"date" : 570071920,
|
||||
"hash" : "0521707D510858BC8AF69D2227E1D1ADA7DB7C5B4B74115BCD0D91B62AFA8EDC",
|
||||
"inLedger" : 9,
|
||||
"ledger_index" : 9,
|
||||
"meta" : {
|
||||
"AffectedNodes" : [
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"RootIndex" : "032D861D151E38E86F46805ED1896D1A50144F65459717B6D12470A9E6E3B66E"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "032D861D151E38E86F46805ED1896D1A50144F65459717B6D12470A9E6E3B66E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"Balance" : "1000099999988",
|
||||
"Flags" : 0,
|
||||
"OwnerCount" : 0,
|
||||
"Sequence" : 2
|
||||
},
|
||||
"LedgerEntryType" : "AccountRoot",
|
||||
"LedgerIndex" : "38E1EF3284A45B090D549EFFB014ACF68927FE0884CDAF01CE3629DF90542D66",
|
||||
"PreviousFields" : {
|
||||
"Balance" : "1000000000000",
|
||||
"Sequence" : 1
|
||||
},
|
||||
"PreviousTxnID" : "3E14D859F6B4BE923323EFC94571606455921E65173147A89BC6EDDA4374B294",
|
||||
"PreviousTxnLgrSeq" : 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"DeletedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Destination" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"DestinationNode" : "0000000000000000",
|
||||
"DestinationTag" : 1,
|
||||
"Expiration" : 570113521,
|
||||
"Flags" : 0,
|
||||
"InvoiceID" : "6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B",
|
||||
"OwnerNode" : "0000000000000000",
|
||||
"PreviousTxnID" : "0FD9F719CDE29E6F6DF752B93EB9AC6FBB493BF989F2CB63B8C0E73A8DCDF61A",
|
||||
"PreviousTxnLgrSeq" : 8,
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 4
|
||||
},
|
||||
"LedgerEntryType" : "Check",
|
||||
"LedgerIndex" : "838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"RootIndex" : "AD136EC2A266027D8F202C97D294BBE32F6FC2AD5501D9853F785FE77AB94C94"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "AD136EC2A266027D8F202C97D294BBE32F6FC2AD5501D9853F785FE77AB94C94"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Balance" : "4999899999952",
|
||||
"Flags" : 0,
|
||||
"OwnerCount" : 1,
|
||||
"Sequence" : 5
|
||||
},
|
||||
"LedgerEntryType" : "AccountRoot",
|
||||
"LedgerIndex" : "D3A1DBAA28717975A9119EC4CBC891BA9A66236C484F03C9911F463AD3B66DE0",
|
||||
"PreviousFields" : {
|
||||
"Balance" : "4999999999952",
|
||||
"OwnerCount" : 2
|
||||
},
|
||||
"PreviousTxnID" : "0FD9F719CDE29E6F6DF752B93EB9AC6FBB493BF989F2CB63B8C0E73A8DCDF61A",
|
||||
"PreviousTxnLgrSeq" : 8
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex" : 0,
|
||||
"TransactionResult" : "tesSUCCESS"
|
||||
},
|
||||
"status" : "success",
|
||||
"validated" : true
|
||||
}
|
||||
}
|
||||
1
content/code_samples/checks/cli/tx-cash-flex-req.sh
Normal file
1
content/code_samples/checks/cli/tx-cash-flex-req.sh
Normal file
@@ -0,0 +1 @@
|
||||
rippled tx A0AFE572E4736CBF49FF4D0D3FF8FDB0C4D31BD10CB4EB542230F85F0F2DD222
|
||||
107
content/code_samples/checks/cli/tx-cash-flex-resp.txt
Normal file
107
content/code_samples/checks/cli/tx-cash-flex-resp.txt
Normal file
@@ -0,0 +1,107 @@
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Apr-03 00:11:17 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"Account" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"CheckID" : "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9",
|
||||
"DeliverMin" : "95000000",
|
||||
"Fee" : "10",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 4,
|
||||
"SigningPubKey" : "0361ACFCB478BCAE01451F95060AF94F70365BF00D7B4661EC2C69EA383762516C",
|
||||
"TransactionType" : "CheckCash",
|
||||
"TxnSignature" : "304402203D7EC220D48AA040D6915C160275D202F7F808E2B58F11B1AB05FB5E5CFCC6C00220304BBD3AD32E13150E0ED7247F2ADFAE83D0ECE329E20CFE0F8DF352934DD2FC",
|
||||
"date" : 576029432,
|
||||
"hash" : "A0AFE572E4736CBF49FF4D0D3FF8FDB0C4D31BD10CB4EB542230F85F0F2DD222",
|
||||
"inLedger" : 8005386,
|
||||
"ledger_index" : 8005386,
|
||||
"meta" : {
|
||||
"AffectedNodes" : [
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"RootIndex" : "3F248A0715ECCAFC3BEE0C63C8F429ACE54ABC403AAF5F2885C2B65D62D1FAC1"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "3F248A0715ECCAFC3BEE0C63C8F429ACE54ABC403AAF5F2885C2B65D62D1FAC1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"Balance" : "10099999960",
|
||||
"Flags" : 0,
|
||||
"OwnerCount" : 2,
|
||||
"Sequence" : 5
|
||||
},
|
||||
"LedgerEntryType" : "AccountRoot",
|
||||
"LedgerIndex" : "7939126A732EBBDEC715FD3CCB056EB31E65228CA17E3B2901E7D30B90FD03D3",
|
||||
"PreviousFields" : {
|
||||
"Balance" : "9999999970",
|
||||
"Sequence" : 4
|
||||
},
|
||||
"PreviousTxnID" : "0283465F0D21BE6B1E91ABDE17266C24C1B4915BAAA9A88CC098A98D5ECD3E9E",
|
||||
"PreviousTxnLgrSeq" : 8005334
|
||||
}
|
||||
},
|
||||
{
|
||||
"DeletedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationNode" : "0000000000000000",
|
||||
"DestinationTag" : 1,
|
||||
"Flags" : 0,
|
||||
"InvoiceID" : "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"OwnerNode" : "0000000000000000",
|
||||
"PreviousTxnID" : "09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB",
|
||||
"PreviousTxnLgrSeq" : 7841263,
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 4
|
||||
},
|
||||
"LedgerEntryType" : "Check",
|
||||
"LedgerIndex" : "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Balance" : "9899999920",
|
||||
"Flags" : 0,
|
||||
"OwnerCount" : 2,
|
||||
"Sequence" : 8
|
||||
},
|
||||
"LedgerEntryType" : "AccountRoot",
|
||||
"LedgerIndex" : "A9A591BA661F69433D5BEAA49F10BA2B8DEA5183EF414B9130BFE5E0328FE875",
|
||||
"PreviousFields" : {
|
||||
"Balance" : "9999999920",
|
||||
"OwnerCount" : 3
|
||||
},
|
||||
"PreviousTxnID" : "54A7A917BE9AC13962251BCF1D09803C7BBE75882B8BFC987B5933A566A48215",
|
||||
"PreviousTxnLgrSeq" : 8004870
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"RootIndex" : "C6A30AD85346718C7148D161663F84A96A4F0CE7F4D68C3C74D176A6C50BA6B9"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "C6A30AD85346718C7148D161663F84A96A4F0CE7F4D68C3C74D176A6C50BA6B9"
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex" : 4,
|
||||
"TransactionResult" : "tesSUCCESS"
|
||||
},
|
||||
"status" : "success",
|
||||
"validated" : true
|
||||
}
|
||||
}
|
||||
1
content/code_samples/checks/cli/tx-create-req.sh
Normal file
1
content/code_samples/checks/cli/tx-create-req.sh
Normal file
@@ -0,0 +1 @@
|
||||
rippled tx 09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB
|
||||
86
content/code_samples/checks/cli/tx-create-resp.txt
Normal file
86
content/code_samples/checks/cli/tx-create-resp.txt
Normal file
@@ -0,0 +1,86 @@
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Mar-28 02:17:55 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"Account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationTag" : 1,
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"InvoiceID" : "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 4,
|
||||
"SigningPubKey" : "03B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB400",
|
||||
"TransactionType" : "CheckCreate",
|
||||
"TxnSignature" : "3044022071A341F911A8EF3B68399487CAF5BA3B59C6FE476B626698AEF044B8183721BC0220166053A859BD907251DFCCF34DD71202180EBABAE7098BB5903D16EBFC993C40",
|
||||
"date" : 575516100,
|
||||
"hash" : "09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB",
|
||||
"inLedger" : 7841263,
|
||||
"ledger_index" : 7841263,
|
||||
"meta" : {
|
||||
"AffectedNodes" : [
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"RootIndex" : "3F248A0715ECCAFC3BEE0C63C8F429ACE54ABC403AAF5F2885C2B65D62D1FAC1"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "3F248A0715ECCAFC3BEE0C63C8F429ACE54ABC403AAF5F2885C2B65D62D1FAC1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CreatedNode" : {
|
||||
"LedgerEntryType" : "Check",
|
||||
"LedgerIndex" : "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9",
|
||||
"NewFields" : {
|
||||
"Account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationTag" : 1,
|
||||
"InvoiceID" : "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 4
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Balance" : "9999999952",
|
||||
"Flags" : 0,
|
||||
"OwnerCount" : 2,
|
||||
"Sequence" : 5
|
||||
},
|
||||
"LedgerEntryType" : "AccountRoot",
|
||||
"LedgerIndex" : "A9A591BA661F69433D5BEAA49F10BA2B8DEA5183EF414B9130BFE5E0328FE875",
|
||||
"PreviousFields" : {
|
||||
"Balance" : "9999999964",
|
||||
"OwnerCount" : 1,
|
||||
"Sequence" : 4
|
||||
},
|
||||
"PreviousTxnID" : "45AF36CF7A810D0054C38C82C898EFC7E4898DF94FA7A3AAF80CB868708F7CE0",
|
||||
"PreviousTxnLgrSeq" : 7841237
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"RootIndex" : "C6A30AD85346718C7148D161663F84A96A4F0CE7F4D68C3C74D176A6C50BA6B9"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "C6A30AD85346718C7148D161663F84A96A4F0CE7F4D68C3C74D176A6C50BA6B9"
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex" : 0,
|
||||
"TransactionResult" : "tesSUCCESS"
|
||||
},
|
||||
"status" : "success",
|
||||
"validated" : true
|
||||
}
|
||||
}
|
||||
16
content/code_samples/checks/js/get-cancel-tx-resp.txt
Normal file
16
content/code_samples/checks/js/get-cancel-tx-resp.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
Connected
|
||||
Final transaction result: { type: 'checkCancel',
|
||||
address: 'rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za',
|
||||
sequence: 7,
|
||||
id: '54A7A917BE9AC13962251BCF1D09803C7BBE75882B8BFC987B5933A566A48215',
|
||||
specification:
|
||||
{ checkID: '2E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C2' },
|
||||
outcome:
|
||||
{ result: 'tesSUCCESS',
|
||||
timestamp: '2018-04-02T23:42:22.000Z',
|
||||
fee: '0.000012',
|
||||
balanceChanges: { rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za: [Array] },
|
||||
orderbookChanges: {},
|
||||
ledgerVersion: 8004870,
|
||||
indexInLedger: 3 } }
|
||||
Disconnected
|
||||
53
content/code_samples/checks/js/get-checks-resp.txt
Normal file
53
content/code_samples/checks/js/get-checks-resp.txt
Normal file
@@ -0,0 +1,53 @@
|
||||
Connected
|
||||
account_objects response: { account: 'rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za',
|
||||
account_objects:
|
||||
[ { Account: 'rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za',
|
||||
Destination: 'rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis',
|
||||
DestinationNode: '0000000000000000',
|
||||
Flags: 0,
|
||||
LedgerEntryType: 'Check',
|
||||
OwnerNode: '0000000000000000',
|
||||
PreviousTxnID: '37D90463CDE0497DB12F18099296DA0E1E52334A785710B5F56BC9637F62429C',
|
||||
PreviousTxnLgrSeq: 8003261,
|
||||
SendMax: '999999000000',
|
||||
Sequence: 5,
|
||||
index: '2E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C2' },
|
||||
{ Account: 'rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis',
|
||||
Destination: 'rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za',
|
||||
DestinationNode: '0000000000000000',
|
||||
Flags: 0,
|
||||
LedgerEntryType: 'Check',
|
||||
OwnerNode: '0000000000000000',
|
||||
PreviousTxnID: 'EF462F1D004E97850AECFB8EC4836DA57706FAFADF8E0914010853C1EC7F2055',
|
||||
PreviousTxnLgrSeq: 8003480,
|
||||
SendMax: [Object],
|
||||
Sequence: 2,
|
||||
index: '323CE1D169135513085268EF81ED40775725C97E7922DBABCCE48FE3FD138861' },
|
||||
{ Account: 'rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za',
|
||||
Destination: 'rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis',
|
||||
DestinationNode: '0000000000000000',
|
||||
DestinationTag: 1,
|
||||
Flags: 0,
|
||||
InvoiceID: '46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291',
|
||||
LedgerEntryType: 'Check',
|
||||
OwnerNode: '0000000000000000',
|
||||
PreviousTxnID: '09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB',
|
||||
PreviousTxnLgrSeq: 7841263,
|
||||
SendMax: '100000000',
|
||||
Sequence: 4,
|
||||
index: '84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9' },
|
||||
{ Account: 'rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za',
|
||||
Destination: 'rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis',
|
||||
DestinationNode: '0000000000000000',
|
||||
Flags: 0,
|
||||
LedgerEntryType: 'Check',
|
||||
OwnerNode: '0000000000000000',
|
||||
PreviousTxnID: 'C0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441',
|
||||
PreviousTxnLgrSeq: 7835887,
|
||||
SendMax: '100000000',
|
||||
Sequence: 2,
|
||||
index: 'CEA5F0BD7B2B5C85A70AE735E4CE722C43C86410A79AB87C11938AA13A11DBF9' } ],
|
||||
ledger_hash: 'DD577D96A1064E16A5DB64C3C25BFF5EF0D8E36A18E4540B162731FA6320C46D',
|
||||
ledger_index: 8004101,
|
||||
validated: true }
|
||||
Disconnected
|
||||
18
content/code_samples/checks/js/get-create-tx-resp.txt
Normal file
18
content/code_samples/checks/js/get-create-tx-resp.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
Connected
|
||||
Final transaction result: { type: 'checkCreate',
|
||||
address: 'rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za',
|
||||
sequence: 2,
|
||||
id: 'C0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441',
|
||||
specification:
|
||||
{ destination: 'rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis',
|
||||
sendMax: { currency: 'XRP', value: '100' } },
|
||||
outcome:
|
||||
{ result: 'tesSUCCESS',
|
||||
timestamp: '2018-03-27T20:47:40.000Z',
|
||||
fee: '0.000012',
|
||||
balanceChanges: { rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za: [Array] },
|
||||
orderbookChanges: {},
|
||||
ledgerVersion: 7835887,
|
||||
indexInLedger: 0 } }
|
||||
Calculated checkID: CEA5F0BD7B2B5C85A70AE735E4CE722C43C86410A79AB87C11938AA13A11DBF9
|
||||
Disconnected
|
||||
21
content/code_samples/checks/js/getCancelTx.js
Normal file
21
content/code_samples/checks/js/getCancelTx.js
Normal file
@@ -0,0 +1,21 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
|
||||
// This example connects to a public Test Net server
|
||||
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||
api.connect().then(() => {
|
||||
console.log('Connected')
|
||||
|
||||
const tx_hash = "54A7A917BE9AC13962251BCF1D09803C7BBE75882B8BFC987B5933A566A48215"
|
||||
|
||||
return api.getTransaction(tx_hash)
|
||||
}).then(response => {
|
||||
console.log("Final transaction result:", response)
|
||||
|
||||
// Disconnect and return
|
||||
}).then(() => {
|
||||
api.disconnect().then(() => {
|
||||
console.log('Disconnected')
|
||||
process.exit()
|
||||
})
|
||||
}).catch(console.error)
|
||||
26
content/code_samples/checks/js/getChecks.js
Normal file
26
content/code_samples/checks/js/getChecks.js
Normal file
@@ -0,0 +1,26 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
|
||||
// This example connects to a public Test Net server
|
||||
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||
api.connect().then(() => {
|
||||
console.log('Connected')
|
||||
|
||||
const account_objects_request = {
|
||||
command: "account_objects",
|
||||
account: "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
ledger_index: "validated",
|
||||
type: "check"
|
||||
}
|
||||
|
||||
return api.connection.request(account_objects_request)
|
||||
}).then(response => {
|
||||
console.log("account_objects response:", response)
|
||||
|
||||
// Disconnect and return
|
||||
}).then(() => {
|
||||
api.disconnect().then(() => {
|
||||
console.log('Disconnected')
|
||||
process.exit()
|
||||
})
|
||||
}).catch(console.error)
|
||||
33
content/code_samples/checks/js/getCreateTx.js
Normal file
33
content/code_samples/checks/js/getCreateTx.js
Normal file
@@ -0,0 +1,33 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
const decodeAddress = require('ripple-address-codec').decodeAddress;
|
||||
const createHash = require('crypto').createHash;
|
||||
|
||||
// This example connects to a public Test Net server
|
||||
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||
api.connect().then(() => {
|
||||
console.log('Connected')
|
||||
|
||||
const tx_hash = "C0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441"
|
||||
|
||||
return api.getTransaction(tx_hash)
|
||||
}).then(response => {
|
||||
console.log("Final transaction result:", response)
|
||||
|
||||
// Re-calculate checkID to work around issue ripple-lib#876
|
||||
const checkIDhasher = createHash('sha512')
|
||||
checkIDhasher.update(Buffer.from('0043', 'hex'))
|
||||
checkIDhasher.update(new Buffer(decodeAddress(response.address)))
|
||||
const seqBuf = Buffer.alloc(4)
|
||||
seqBuf.writeUInt32BE(response.sequence, 0)
|
||||
checkIDhasher.update(seqBuf)
|
||||
const checkID = checkIDhasher.digest('hex').slice(0,64).toUpperCase()
|
||||
console.log("Calculated checkID:", checkID)
|
||||
|
||||
// Disconnect and return
|
||||
}).then(() => {
|
||||
api.disconnect().then(() => {
|
||||
console.log('Disconnected')
|
||||
process.exit()
|
||||
})
|
||||
}).catch(console.error)
|
||||
9
content/code_samples/checks/js/package.json
Normal file
9
content/code_samples/checks/js/package.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"name": "checks-examples",
|
||||
"description": "Example code for signing and submitting Checks with RippleAPI",
|
||||
"version": "0.0.1",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ripple-lib": "^0.19.0"
|
||||
}
|
||||
}
|
||||
41
content/code_samples/checks/js/prepareCancel.js
Normal file
41
content/code_samples/checks/js/prepareCancel.js
Normal file
@@ -0,0 +1,41 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
|
||||
// This example connects to a public Test Net server
|
||||
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||
api.connect().then(() => {
|
||||
console.log('Connected')
|
||||
|
||||
const sender = 'rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za'
|
||||
const options = {
|
||||
// Allow up to 60 ledger versions (~5 min) instead of the default 3 versions
|
||||
// before this transaction fails permanently.
|
||||
"maxLedgerVersionOffset": 60
|
||||
}
|
||||
return api.prepareCheckCancel(sender, {
|
||||
"checkID": "2E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C2"
|
||||
}, options)
|
||||
|
||||
}).then(prepared => {
|
||||
console.log("txJSON:", prepared.txJSON);
|
||||
|
||||
// Disconnect and return
|
||||
}).then(() => {
|
||||
api.disconnect().then(() => {
|
||||
console.log('Disconnected')
|
||||
process.exit()
|
||||
})
|
||||
}).catch(console.error)
|
||||
|
||||
|
||||
// Example output:
|
||||
//
|
||||
// Connected
|
||||
// txJSON: {"Account":"rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
// "TransactionType":"CheckCancel",
|
||||
// "CheckID":"2E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C2",
|
||||
// "Flags":2147483648,
|
||||
// "LastLedgerSequence":8004884,
|
||||
// "Fee":"12",
|
||||
// "Sequence":7}
|
||||
// Disconnected
|
||||
46
content/code_samples/checks/js/prepareCashExact.js
Normal file
46
content/code_samples/checks/js/prepareCashExact.js
Normal file
@@ -0,0 +1,46 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
|
||||
// This example connects to a public Test Net server
|
||||
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||
api.connect().then(() => {
|
||||
console.log('Connected')
|
||||
|
||||
const sender = 'rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis'
|
||||
const options = {
|
||||
// Allow up to 60 ledger versions (~5 min) instead of the default 3 versions
|
||||
// before this transaction fails permanently.
|
||||
"maxLedgerVersionOffset": 60
|
||||
}
|
||||
return api.prepareCheckCash(sender, {
|
||||
"checkID": "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9",
|
||||
"amount": {
|
||||
"currency": "XRP",
|
||||
"value": "95" // Cash for exactly 95 XRP
|
||||
}
|
||||
}, options)
|
||||
|
||||
}).then(prepared => {
|
||||
console.log("txJSON:", prepared.txJSON);
|
||||
|
||||
// Disconnect and return
|
||||
}).then(() => {
|
||||
api.disconnect().then(() => {
|
||||
console.log('Disconnected')
|
||||
process.exit()
|
||||
})
|
||||
}).catch(console.error)
|
||||
|
||||
|
||||
// Example output:
|
||||
//
|
||||
// Connected
|
||||
// txJSON: {"Account":"rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
// "TransactionType":"CheckCash",
|
||||
// "CheckID":"84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9",
|
||||
// "Amount":"95000000",
|
||||
// "Flags":2147483648,
|
||||
// "LastLedgerSequence":8006841,
|
||||
// "Fee":"12",
|
||||
// "Sequence":5}
|
||||
// Disconnected
|
||||
46
content/code_samples/checks/js/prepareCashFlex.js
Normal file
46
content/code_samples/checks/js/prepareCashFlex.js
Normal file
@@ -0,0 +1,46 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
|
||||
// This example connects to a public Test Net server
|
||||
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||
api.connect().then(() => {
|
||||
console.log('Connected')
|
||||
|
||||
const sender = 'rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis'
|
||||
const options = {
|
||||
// Allow up to 60 ledger versions (~5 min) instead of the default 3 versions
|
||||
// before this transaction fails permanently.
|
||||
"maxLedgerVersionOffset": 60
|
||||
}
|
||||
return api.prepareCheckCash(sender, {
|
||||
"checkID": "C0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441",
|
||||
"deliverMin": {
|
||||
"currency": "XRP",
|
||||
"value": "95" // Cash for at least 95 XRP
|
||||
}
|
||||
}, options)
|
||||
|
||||
}).then(prepared => {
|
||||
console.log("txJSON:", prepared.txJSON);
|
||||
|
||||
// Disconnect and return
|
||||
}).then(() => {
|
||||
api.disconnect().then(() => {
|
||||
console.log('Disconnected')
|
||||
process.exit()
|
||||
})
|
||||
}).catch(console.error)
|
||||
|
||||
|
||||
// Example output:
|
||||
//
|
||||
// Connected
|
||||
// txJSON: {"Account":"rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
// "TransactionType":"CheckCash",
|
||||
// "CheckID":"C0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441",
|
||||
// "DeliverMin":"95000000",
|
||||
// "Flags":2147483648,
|
||||
// "LastLedgerSequence":8006858,
|
||||
// "Fee":"12",
|
||||
// "Sequence":5}
|
||||
// Disconnected
|
||||
47
content/code_samples/checks/js/prepareCreate.js
Normal file
47
content/code_samples/checks/js/prepareCreate.js
Normal file
@@ -0,0 +1,47 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
|
||||
// This example connects to a public Test Net server
|
||||
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||
api.connect().then(() => {
|
||||
console.log('Connected')
|
||||
|
||||
const sender = 'rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za'
|
||||
const receiver = 'rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis'
|
||||
const options = {
|
||||
// Allow up to 60 ledger versions (~5 min) instead of the default 3 versions
|
||||
// before this transaction fails permanently.
|
||||
"maxLedgerVersionOffset": 60
|
||||
}
|
||||
return api.prepareCheckCreate(sender, {
|
||||
"destination": receiver,
|
||||
"sendMax": {
|
||||
"currency": "XRP",
|
||||
"value": "100" // RippleAPI uses decimal XRP, not integer drops
|
||||
}
|
||||
"invoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291"
|
||||
}, options)
|
||||
|
||||
}).then(prepared => {
|
||||
console.log("txJSON:", prepared.txJSON);
|
||||
|
||||
// Disconnect and return
|
||||
}).then(() => {
|
||||
api.disconnect().then(() => {
|
||||
console.log('Disconnected')
|
||||
process.exit()
|
||||
})
|
||||
}).catch(console.error)
|
||||
|
||||
|
||||
// Example output:
|
||||
//
|
||||
// Connected
|
||||
// txJSON: {"Account":"rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
// "TransactionType":"CheckCreate",
|
||||
// "Destination":"rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
// "SendMax":"100000000",
|
||||
// "Flags":2147483648,
|
||||
// "InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
// "LastLedgerSequence":7835917,"Fee":"12","Sequence":2}
|
||||
// Disconnected
|
||||
2
content/code_samples/checks/js/sign-cancel-resp.txt
Normal file
2
content/code_samples/checks/js/sign-cancel-resp.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
tx_blob is: 12001222800000002400000007201B007A251450182E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C268400000000000000C732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB4007446304402205D77451B0D7BCDA1FE5B98763C5B3B2837453371FE93C2B86157C44B1867AE36022003800273848BC2F8E1C6EC7EE4B0CB2425A888AE80E586886C306C796B25678B8114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF
|
||||
tx hash is: 54A7A917BE9AC13962251BCF1D09803C7BBE75882B8BFC987B5933A566A48215
|
||||
2
content/code_samples/checks/js/sign-create-resp.txt
Normal file
2
content/code_samples/checks/js/sign-create-resp.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
tx_blob is: 12001022800000002400000002201B0077911368400000000000000C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB400744630440220181FE2F945EBEE632966D5FB03114611E3047ACD155AA1BDB9DF8545C7A2431502201E873A4B0D177AB250AF790CE80621E16F141506CF507586038FC4A8E95887358114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39
|
||||
tx hash is: C0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441
|
||||
15
content/code_samples/checks/js/signCancel.js
Normal file
15
content/code_samples/checks/js/signCancel.js
Normal file
@@ -0,0 +1,15 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
|
||||
// Can sign offline if the txJSON has all required fields
|
||||
const api = new RippleAPI()
|
||||
|
||||
const txJSON = '{"Account":"rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za","TransactionType":"CheckCancel","CheckID":"2E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C2","Flags":2147483648,"LastLedgerSequence":8004884,"Fee":"12","Sequence":7}'
|
||||
|
||||
// Be careful where you store your real secret.
|
||||
const secret = 's████████████████████████████'
|
||||
|
||||
const signed = api.sign(txJSON, secret)
|
||||
|
||||
console.log("tx_blob is:", signed.signedTransaction)
|
||||
console.log("tx hash is:", signed.id)
|
||||
22
content/code_samples/checks/js/signCreate.js
Normal file
22
content/code_samples/checks/js/signCreate.js
Normal file
@@ -0,0 +1,22 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
|
||||
// Can sign offline if the txJSON has all required fields
|
||||
const api = new RippleAPI()
|
||||
|
||||
const txJSON = '{"Account":"rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za", \
|
||||
"TransactionType":"CheckCreate", \
|
||||
"Destination":"rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis", \
|
||||
"SendMax":"100000000", \
|
||||
"Flags":2147483648, \
|
||||
"LastLedgerSequence":7835923, \
|
||||
"Fee":"12", \
|
||||
"Sequence":2}'
|
||||
|
||||
// Be careful where you store your real secret.
|
||||
const secret = 's████████████████████████████'
|
||||
|
||||
const signed = api.sign(txJSON, secret)
|
||||
|
||||
console.log("tx_blob is:", signed.signedTransaction)
|
||||
console.log("tx hash is:", signed.id)
|
||||
3
content/code_samples/checks/js/submit-cancel-resp.txt
Normal file
3
content/code_samples/checks/js/submit-cancel-resp.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
Connected
|
||||
Preliminary transaction result: tesSUCCESS
|
||||
Disconnected
|
||||
3
content/code_samples/checks/js/submit-create-resp.txt
Normal file
3
content/code_samples/checks/js/submit-create-resp.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
Connected
|
||||
Preliminary transaction result: tesSUCCESS
|
||||
Disconnected
|
||||
21
content/code_samples/checks/js/submitCancel.js
Normal file
21
content/code_samples/checks/js/submitCancel.js
Normal file
@@ -0,0 +1,21 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
|
||||
// This example connects to a public Test Net server
|
||||
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||
api.connect().then(() => {
|
||||
console.log('Connected')
|
||||
|
||||
const tx_blob = "12001222800000002400000007201B007A251450182E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C268400000000000000C732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB4007446304402205D77451B0D7BCDA1FE5B98763C5B3B2837453371FE93C2B86157C44B1867AE36022003800273848BC2F8E1C6EC7EE4B0CB2425A888AE80E586886C306C796B25678B8114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF"
|
||||
|
||||
return api.submit(tx_blob)
|
||||
}).then(response => {
|
||||
console.log("Preliminary transaction result:", response.resultCode)
|
||||
|
||||
// Disconnect and return
|
||||
}).then(() => {
|
||||
api.disconnect().then(() => {
|
||||
console.log('Disconnected')
|
||||
process.exit()
|
||||
})
|
||||
}).catch(console.error)
|
||||
26
content/code_samples/checks/js/submitCreate.js
Normal file
26
content/code_samples/checks/js/submitCreate.js
Normal file
@@ -0,0 +1,26 @@
|
||||
'use strict'
|
||||
const RippleAPI = require('ripple-lib').RippleAPI
|
||||
|
||||
// This example connects to a public Test Net server
|
||||
const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||
api.connect().then(() => {
|
||||
console.log('Connected')
|
||||
|
||||
const tx_blob = "12001022800000002400000002201B0077911368400000000000000"+
|
||||
"C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6"+
|
||||
"CFCF2E359045FF4BB400744630440220181FE2F945EBEE632966D5FB03114611E3047"+
|
||||
"ACD155AA1BDB9DF8545C7A2431502201E873A4B0D177AB250AF790CE80621E16F1415"+
|
||||
"06CF507586038FC4A8E95887358114735FF88E5269C80CD7F7AF10530DAB840BBF6FD"+
|
||||
"F8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39"
|
||||
|
||||
return api.submit(tx_blob)
|
||||
}).then(response => {
|
||||
console.log("Preliminary transaction result:", response.resultCode)
|
||||
|
||||
// Disconnect and return
|
||||
}).then(() => {
|
||||
api.disconnect().then(() => {
|
||||
console.log('Disconnected')
|
||||
process.exit()
|
||||
})
|
||||
}).catch(console.error)
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"method": "account_objects",
|
||||
"params": [
|
||||
{
|
||||
"account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"ledger_index": "validated",
|
||||
"type": "check"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
{
|
||||
"result": {
|
||||
"account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"account_objects": [
|
||||
{
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Check",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "37D90463CDE0497DB12F18099296DA0E1E52334A785710B5F56BC9637F62429C",
|
||||
"PreviousTxnLgrSeq": 8003261,
|
||||
"SendMax": "999999000000",
|
||||
"Sequence": 5,
|
||||
"index": "2E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C2"
|
||||
},
|
||||
{
|
||||
"Account": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"Destination": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"DestinationNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Check",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "EF462F1D004E97850AECFB8EC4836DA57706FAFADF8E0914010853C1EC7F2055",
|
||||
"PreviousTxnLgrSeq": 8003480,
|
||||
"SendMax": {
|
||||
"currency": "BAR",
|
||||
"issuer": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"value": "1000000000000000e-66"
|
||||
},
|
||||
"Sequence": 2,
|
||||
"index": "323CE1D169135513085268EF81ED40775725C97E7922DBABCCE48FE3FD138861"
|
||||
},
|
||||
{
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationNode": "0000000000000000",
|
||||
"DestinationTag": 1,
|
||||
"Flags": 0,
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"LedgerEntryType": "Check",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB",
|
||||
"PreviousTxnLgrSeq": 7841263,
|
||||
"SendMax": "100000000",
|
||||
"Sequence": 4,
|
||||
"index": "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9"
|
||||
},
|
||||
{
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationNode": "0000000000000000",
|
||||
"Flags": 0,
|
||||
"LedgerEntryType": "Check",
|
||||
"OwnerNode": "0000000000000000",
|
||||
"PreviousTxnID": "C0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441",
|
||||
"PreviousTxnLgrSeq": 7835887,
|
||||
"SendMax": "100000000",
|
||||
"Sequence": 2,
|
||||
"index": "CEA5F0BD7B2B5C85A70AE735E4CE722C43C86410A79AB87C11938AA13A11DBF9"
|
||||
}
|
||||
],
|
||||
"ledger_hash": "4002E4E84CABAAF1BDD5636097F3042547EBAE2DEE647E1036E64AA9FDA2A10C",
|
||||
"ledger_index": 8004173,
|
||||
"status": "success",
|
||||
"validated": true
|
||||
}
|
||||
}
|
||||
14
content/code_samples/checks/websocket/sign-create-req.json
Normal file
14
content/code_samples/checks/websocket/sign-create-req.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"id": "sign_req_1",
|
||||
"command": "sign",
|
||||
"tx_json": {
|
||||
"TransactionType": "CheckCreate",
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"SendMax": "100000000",
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"DestinationTag": 1,
|
||||
"Fee": "12"
|
||||
},
|
||||
"secret" : "s████████████████████████████"
|
||||
}
|
||||
22
content/code_samples/checks/websocket/sign-create-resp.json
Normal file
22
content/code_samples/checks/websocket/sign-create-resp.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"id": "sign_req_1",
|
||||
"result": {
|
||||
"tx_blob": "120010228000000024000000042E00000001501146060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE29168400000000000000C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB40074463044022071A341F911A8EF3B68399487CAF5BA3B59C6FE476B626698AEF044B8183721BC0220166053A859BD907251DFCCF34DD71202180EBABAE7098BB5903D16EBFC993C408114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39",
|
||||
"tx_json": {
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationTag": 1,
|
||||
"Fee": "12",
|
||||
"Flags": 2147483648,
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"SendMax": "100000000",
|
||||
"Sequence": 4,
|
||||
"SigningPubKey": "03B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB400",
|
||||
"TransactionType": "CheckCreate",
|
||||
"TxnSignature": "3044022071A341F911A8EF3B68399487CAF5BA3B59C6FE476B626698AEF044B8183721BC0220166053A859BD907251DFCCF34DD71202180EBABAE7098BB5903D16EBFC993C40",
|
||||
"hash": "09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB"
|
||||
}
|
||||
},
|
||||
"status": "success",
|
||||
"type": "response"
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"id": "submit_req_1",
|
||||
"command": "submit",
|
||||
"tx_blob": "120010228000000024000000042E00000001501146060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE29168400000000000000C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB40074463044022071A341F911A8EF3B68399487CAF5BA3B59C6FE476B626698AEF044B8183721BC0220166053A859BD907251DFCCF34DD71202180EBABAE7098BB5903D16EBFC993C408114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39"
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"id": "submit_req_1",
|
||||
"result": {
|
||||
"engine_result": "terQUEUED",
|
||||
"engine_result_code": -89,
|
||||
"engine_result_message": "Held until escalated fee drops.",
|
||||
"tx_blob": "120010228000000024000000042E00000001501146060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE29168400000000000000C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB40074463044022071A341F911A8EF3B68399487CAF5BA3B59C6FE476B626698AEF044B8183721BC0220166053A859BD907251DFCCF34DD71202180EBABAE7098BB5903D16EBFC993C408114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39",
|
||||
"tx_json": {
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationTag": 1,
|
||||
"Fee": "12",
|
||||
"Flags": 2147483648,
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"SendMax": "100000000",
|
||||
"Sequence": 4,
|
||||
"SigningPubKey": "03B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB400",
|
||||
"TransactionType": "CheckCreate",
|
||||
"TxnSignature": "3044022071A341F911A8EF3B68399487CAF5BA3B59C6FE476B626698AEF044B8183721BC0220166053A859BD907251DFCCF34DD71202180EBABAE7098BB5903D16EBFC993C40",
|
||||
"hash": "09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB"
|
||||
}
|
||||
},
|
||||
"status": "success",
|
||||
"type": "response"
|
||||
}
|
||||
5
content/code_samples/checks/websocket/tx-create-req.json
Normal file
5
content/code_samples/checks/websocket/tx-create-req.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"id": "tx_req_1",
|
||||
"command": "tx",
|
||||
"transaction": "09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB"
|
||||
}
|
||||
85
content/code_samples/checks/websocket/tx-create-resp.json
Normal file
85
content/code_samples/checks/websocket/tx-create-resp.json
Normal file
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"id": "tx_req_1",
|
||||
"result": {
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationTag": 1,
|
||||
"Fee": "12",
|
||||
"Flags": 2147483648,
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"SendMax": "100000000",
|
||||
"Sequence": 4,
|
||||
"SigningPubKey": "03B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB400",
|
||||
"TransactionType": "CheckCreate",
|
||||
"TxnSignature": "3044022071A341F911A8EF3B68399487CAF5BA3B59C6FE476B626698AEF044B8183721BC0220166053A859BD907251DFCCF34DD71202180EBABAE7098BB5903D16EBFC993C40",
|
||||
"date": 575516100,
|
||||
"hash": "09D992D4C89E2A24D4BA9BB57ED81C7003815940F39B7C87ADBF2E49034380BB",
|
||||
"inLedger": 7841263,
|
||||
"ledger_index": 7841263,
|
||||
"meta": {
|
||||
"AffectedNodes": [
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Flags": 0,
|
||||
"Owner": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"RootIndex": "3F248A0715ECCAFC3BEE0C63C8F429ACE54ABC403AAF5F2885C2B65D62D1FAC1"
|
||||
},
|
||||
"LedgerEntryType": "DirectoryNode",
|
||||
"LedgerIndex": "3F248A0715ECCAFC3BEE0C63C8F429ACE54ABC403AAF5F2885C2B65D62D1FAC1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CreatedNode": {
|
||||
"LedgerEntryType": "Check",
|
||||
"LedgerIndex": "84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9",
|
||||
"NewFields": {
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"DestinationTag": 1,
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"SendMax": "100000000",
|
||||
"Sequence": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Balance": "9999999952",
|
||||
"Flags": 0,
|
||||
"OwnerCount": 2,
|
||||
"Sequence": 5
|
||||
},
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"LedgerIndex": "A9A591BA661F69433D5BEAA49F10BA2B8DEA5183EF414B9130BFE5E0328FE875",
|
||||
"PreviousFields": {
|
||||
"Balance": "9999999964",
|
||||
"OwnerCount": 1,
|
||||
"Sequence": 4
|
||||
},
|
||||
"PreviousTxnID": "45AF36CF7A810D0054C38C82C898EFC7E4898DF94FA7A3AAF80CB868708F7CE0",
|
||||
"PreviousTxnLgrSeq": 7841237
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Flags": 0,
|
||||
"Owner": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"RootIndex": "C6A30AD85346718C7148D161663F84A96A4F0CE7F4D68C3C74D176A6C50BA6B9"
|
||||
},
|
||||
"LedgerEntryType": "DirectoryNode",
|
||||
"LedgerIndex": "C6A30AD85346718C7148D161663F84A96A4F0CE7F4D68C3C74D176A6C50BA6B9"
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex": 0,
|
||||
"TransactionResult": "tesSUCCESS"
|
||||
},
|
||||
"validated": true
|
||||
},
|
||||
"status": "success",
|
||||
"type": "response"
|
||||
}
|
||||
@@ -88,13 +88,18 @@ When not using the production XRP Ledger, you can check the status of the Checks
|
||||
|
||||
For more information about Checks in the XRP Ledger, see:
|
||||
|
||||
<!--{#TODO: add link to Checks tutorial#}-->
|
||||
|
||||
* [Transaction Reference](reference-transaction-format.html#transaction-types)
|
||||
* [Checks amendment](reference-amendments.html#checks)
|
||||
* [CheckCreate][]
|
||||
* [CheckCash][]
|
||||
* [CheckCancel][]
|
||||
- [Transaction Reference](reference-transaction-format.html#transaction-types)
|
||||
- [Checks amendment](reference-amendments.html#checks)
|
||||
- [CheckCreate][]
|
||||
- [CheckCash][]
|
||||
- [CheckCancel][]
|
||||
- Checks Tutorials
|
||||
- [Send a Check](tutorial-checks-send.html)
|
||||
- [Look up Checks by sender address](tutorial-checks-lookup-by-sender.html)
|
||||
- [Look up Checks by recipient address](tutorial-checks-lookup-by-recipient.html)
|
||||
- [Cash a Check for an exact amount](tutorial-checks-cash-exact.html)
|
||||
- [Cash a Check for a flexible amount](tutorial-checks-cash-flex.html)
|
||||
- [Cancel a Check](tutorial-checks-cancel.html)
|
||||
|
||||
For more information about related features, see:
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ Many objects in the ledger are owned by a particular address, and count toward t
|
||||
- [Held Payments (Escrow)](reference-ledger-format.html#escrow) are owned by the address that placed them.
|
||||
- [Payment Channels](tutorial-paychan.html) are owned by the address that created them.
|
||||
- [Owner directories](reference-ledger-format.html#directorynode) list all the ledger objects that contribute to an address's owner reserve. However, the owner directory itself does not count towards the reserve.
|
||||
- Checks are owned by the address that created them (the sender, not the destination). <!--{# TODO: link the concept or tutorial when one exists #}-->
|
||||
- [Checks](concept-checks.html) are owned by the address that created them (the sender, not the destination).
|
||||
|
||||
#### Owner Reserve Edge Cases
|
||||
|
||||
|
||||
10
content/snippets/checkcash-prereqs.md
Normal file
10
content/snippets/checkcash-prereqs.md
Normal file
@@ -0,0 +1,10 @@
|
||||
The prerequisites for cashing a check are the same whether you are cashing it for an exact amount or a flexible amount.
|
||||
|
||||
- You need the ID of a Check object currently in the ledger.
|
||||
- For example, the ID of one Check in these examples is `838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334`, although you must use a different ID to go through these steps yourself.
|
||||
- The **address** and **secret key** of the Check's stated recipient. The address must match the `Destination` address in the Check object.
|
||||
- If the Check is for an issued currency, you (the recipient) must have a trust line to the issuer. Your limit on that trust line must be enough higher than the balance to add the amount you would receive.
|
||||
- For more information on trust lines and limits, see [Issued Currencies](concept-money.html#issued-currencies) and [Trust Limits](reference-transaction-format.html#trust-limits).
|
||||
- A secure way to sign transactions, such as [RippleAPI][] or your own [`rippled` server](tutorial-rippled-setup.html).
|
||||
- A client library that can connect to a `rippled` server, such as [RippleAPI][] or any HTTP or WebSocket library.
|
||||
- For more information, see [Connecting to `rippled`](reference-rippled.html#connecting-to-rippled).
|
||||
3
content/snippets/tutorial-sign-step.md
Normal file
3
content/snippets/tutorial-sign-step.md
Normal file
@@ -0,0 +1,3 @@
|
||||
The most secure way to sign a transaction is to do it locally with a signing library, such as [RippleAPI](reference-rippleapi.html). Alternatively, you can sign the transaction using the [`sign`](reference-rippled.html#sign) command, but this must be done through a trusted and encrypted connection, or through a local connection, and only to a server you control.
|
||||
|
||||
In all cases, note the signed transaction's identifying hash for later.
|
||||
3
content/snippets/tutorial-submit-step.md
Normal file
3
content/snippets/tutorial-submit-step.md
Normal file
@@ -0,0 +1,3 @@
|
||||
Take the signed transaction blob from the previous step and submit it to a `rippled` server. You can do this safely even if you do not operate the `rippled` server. The response contains a provisional result, which should be `tesSUCCESS`, but this result is [usually not final](reference-transaction-format.html#finality-of-results). A provisional response of `terQUEUED` is also OK, since [queued transactions](concept-transaction-cost.html#queued-transactions) are generally included in the next open ledger version (usually about 10 seconds after submission).
|
||||
|
||||
**Tip:** If the preliminary result is `tefMAX_LEDGER`, the transaction has failed permanently because its `LastLedgerSequence` parameter is lower than the current ledger. This happens when you take longer than the expected number of ledger versions between preparing and submitting the transaction. If this occurs, [start over from step 1]({{step_1_link}}) with a higher `LastLedgerSequence` value.
|
||||
194
content/tutorial-checks-cancel.md
Normal file
194
content/tutorial-checks-cancel.md
Normal file
@@ -0,0 +1,194 @@
|
||||
# Cancel a Check
|
||||
|
||||
This tutorial shows how to cancel a [Check](concept-checks.html), which removes the [Check object from the ledger](reference-ledger-format.html#check) without sending money.
|
||||
|
||||
You may want to cancel an incoming Check if you do not want it. You might cancel an outgoing Check if you made a mistake when sending it or if circumstances have changed. If a Check expires, it's also necessary to cancel it to remove it from the ledger so the sender gets their [owner reserve](concept-reserves.html#owner-reserves) back.
|
||||
|
||||
{% set cancel_n = cycler(* range(1,99)) %}
|
||||
|
||||
## Prerequisites
|
||||
|
||||
To cancel a Check with this tutorial, you need the following:
|
||||
|
||||
- You need the ID of a Check object currently in the ledger.
|
||||
- For example, this tutorial includes examples that cancel a Check with the ID `49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0`, although you must use a different ID to go through these steps yourself.
|
||||
- The **address** and **secret key** of a funded account to send the CheckCancel transaction. This address must be either the sender or the recipient of the Check, unless the Check is expired.
|
||||
- A secure way to sign transactions, such as [RippleAPI][] or your own [`rippled` server](tutorial-rippled-setup.html).
|
||||
- A client library that can connect to a `rippled` server, such as [RippleAPI][] or any HTTP or WebSocket library.
|
||||
- For more information, see [Connecting to `rippled`](reference-rippled.html#connecting-to-rippled).
|
||||
|
||||
|
||||
## {{cancel_n.next()}}. Prepare the CheckCancel transaction
|
||||
|
||||
Figure out the values of the [CheckCancel transaction][] fields. The following fields are the bare minimum; everything else is either optional or can be [auto-filled](reference-transaction-format.html#auto-fillable-fields) when signing:
|
||||
|
||||
| Field | Value | Description |
|
||||
|:------------------|:-----------------|:--------------------------------------|
|
||||
| `TransactionType` | String | Use the string `CheckCancel` when canceling a Check. |
|
||||
| `Account` | String (Address) | The address of the sender who is canceling the Check. (In other words, your address.) |
|
||||
| `CheckID` | String | The ID of the Check object in the ledger to cancel. You can get this information by looking up the metadata of the CheckCreate transaction using the [`tx` method](reference-rippled.html#tx) or by looking for Checks using the [`account_objects` method](reference-rippled.html#account-objects). |
|
||||
|
||||
If you are using [RippleAPI](reference-rippleapi.html), you can use the `prepareCheckCancel()` helper method.
|
||||
|
||||
**Note:** RippleAPI supports Checks in versions 0.19.0 and up.
|
||||
|
||||
### Example CheckCancel Preparation
|
||||
|
||||
The following examples demonstrate how to cancel a Check.
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*JSON-RPC, WebSocket, or Commandline*
|
||||
|
||||
```
|
||||
{
|
||||
"TransactionType": "CheckCancel",
|
||||
"Account": "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"CheckID": "49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0",
|
||||
"Fee": "12"
|
||||
}
|
||||
```
|
||||
|
||||
*RippleAPI*
|
||||
|
||||
```js
|
||||
{% include 'code_samples/checks/js/prepareCancel.js' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
## {{cancel_n.next()}}. Sign the CheckCancel transaction
|
||||
|
||||
{% include 'snippets/tutorial-sign-step.md' %}
|
||||
|
||||
### Example Request
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
|
||||
```js
|
||||
{% include 'code_samples/checks/js/signCancel.js' %}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```bash
|
||||
{% include 'code_samples/checks/cli/sign-cancel-req.sh' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
|
||||
### Example Response
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
|
||||
```
|
||||
{% include 'code_samples/checks/js/sign-cancel-resp.txt' %}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/cli/sign-cancel-resp.txt' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
|
||||
## {{cancel_n.next()}}. Submit the signed CheckCancel transaction
|
||||
|
||||
{% set step_1_link = "#1-prepare-the-checkcancel-transaction" %}
|
||||
{% include 'snippets/tutorial-submit-step.md' %}
|
||||
|
||||
### Example Request
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
|
||||
```js
|
||||
{% include 'code_samples/checks/js/submitCancel.js' %}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```bash
|
||||
{% include 'code_samples/checks/cli/submit-cancel-req.sh' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
|
||||
### Example Response
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
|
||||
```js
|
||||
{% include 'code_samples/checks/js/submit-cancel-resp.txt' %}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/cli/submit-cancel-resp.txt' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
## {{cancel_n.next()}}. Wait for validation
|
||||
|
||||
{% include 'snippets/wait-for-validation.md' %}
|
||||
|
||||
## {{cancel_n.next()}}. Confirm final result
|
||||
|
||||
Use the [`tx` method](reference-rippled.html#tx) with the CheckCancel transaction's identifying hash to check its status. Look for a `"TransactionResult": "tesSUCCESS"` field in the transaction's metadata, indicating that the transaction succeeded, and the field `"validated": true` in the result, indicating that this result is final.
|
||||
|
||||
Look for a `DeletedNode` object in the transaction metadata with `"LedgerEntryType": "Check"` to indicate that the transaction removed a [Check ledger object](reference-ledger-format.html#check). The `LedgerIndex` of this object should match the ID of the Check.
|
||||
|
||||
### Example Request
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
|
||||
```js
|
||||
{% include 'code_samples/checks/js/getCancelTx.js' %}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```bash
|
||||
{% include 'code_samples/checks/cli/tx-cancel-req.sh' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
|
||||
### Example Response
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/js/get-cancel-tx-resp.txt' %}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/cli/tx-cancel-resp.txt' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
<!--{# common links #}-->
|
||||
[Specifying Currency Amounts]: reference-rippled.html#specifying-currency-amounts
|
||||
[RippleAPI]: reference-rippleapi.html
|
||||
{% include 'snippets/tx-type-links.md' %}
|
||||
151
content/tutorial-checks-cash-exact.md
Normal file
151
content/tutorial-checks-cash-exact.md
Normal file
@@ -0,0 +1,151 @@
|
||||
# Cash a Check for an exact amount
|
||||
|
||||
As long as the Check is in the ledger and not expired, the specified recipient can cash it to receive any exact amount up to the amount specified in the Check by sending a [CheckCash transaction][] with an `Amount` field. You would cash a Check this way if you want to receive a specific amount, for example to pay off an invoice or bill exactly.
|
||||
|
||||
The specified recipient can also [cash the check for a flexible amount](tutorial-checks-cash-flex.html).
|
||||
|
||||
{% set cash_exact_n = cycler(* range(1,99)) %}
|
||||
|
||||
## Prerequisites
|
||||
|
||||
{% include 'snippets/checkcash-prereqs.md' %}
|
||||
|
||||
## {{cash_exact_n.next()}}. Prepare the CheckCash transaction
|
||||
|
||||
Figure out the values of the [CheckCash transaction][] fields. To cash a check for an exact amount, the following fields are the bare minimum; everything else is either optional or can be [auto-filled](reference-transaction-format.html#auto-fillable-fields) when signing:
|
||||
|
||||
| Field | Value | Description |
|
||||
|:------------------|:--------------------------|:-----------------------------|
|
||||
| `TransactionType` | String | The value `CheckCash` indicates this is a CheckCash transaction. |
|
||||
| `Account` | String (Address) | The address of the sender who is cashing the Check. (In other words, your address.) |
|
||||
| `CheckID` | String | The ID of the Check object in the ledger to cash. You can get this information by looking up the metadata of the CheckCreate transaction using the [`tx` method](reference-rippled.html#tx) or by looking for Checks using the [`account_objects` method](reference-rippled.html#account-objects). |
|
||||
| `Amount` | String or Object (Amount) | The amount to redeem from the Check. For XRP, this must be a string specifying drops of XRP. For issued currencies, this is an object with `currency`, `issuer`, and `value` fields. The `currency` and `issuer` fields must match the corresponding fields in the Check object, and the `value` must be less than or equal to the amount in the Check object. (For currencies with transfer fees, you must cash the Check for less than its `SendMax` so the transfer fee can be paid by the `SendMax`.) If you cannot receive this much, cashing the Check fails, leaving the Check in the ledger so you can try again. For more information on specifying currency amounts, see [Specifying Currency Amounts][]. |
|
||||
|
||||
|
||||
### Example CheckCash Preparation for an exact amount
|
||||
|
||||
The following examples show how to prepare a transaction to cash a Check for a fixed amount.
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*JSON-RPC, WebSocket, or Commandline*
|
||||
|
||||
```
|
||||
{
|
||||
"Account": "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"TransactionType": "CheckCash",
|
||||
"Amount": "100000000",
|
||||
"CheckID": "838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334",
|
||||
"Fee": "12"
|
||||
}
|
||||
```
|
||||
|
||||
*RippleAPI*
|
||||
|
||||
```js
|
||||
{% include 'code_samples/checks/js/prepareCashExact.js' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
## {{cash_exact_n.next()}}. Sign the CheckCash transaction
|
||||
|
||||
{% include 'snippets/tutorial-sign-step.md' %}
|
||||
|
||||
### Example Request
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*Commandline*
|
||||
|
||||
```bash
|
||||
{% include 'code_samples/checks/cli/sign-cash-exact-req.sh' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
|
||||
### Example Response
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*Commandline*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/cli/sign-cash-exact-resp.txt' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
|
||||
## {{cash_exact_n.next()}}. Submit the signed CheckCash transaction
|
||||
|
||||
{% set step_1_link = "#1-prepare-the-checkcash-transaction" %}
|
||||
{% include 'snippets/tutorial-submit-step.md' %}
|
||||
|
||||
### Example Request
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*Commandline*
|
||||
|
||||
```bash
|
||||
{% include 'code_samples/checks/cli/submit-cash-exact-req.sh' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
|
||||
### Example Response
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*Commandline*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/cli/submit-cash-exact-resp.txt' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
## {{cash_exact_n.next()}}. Wait for validation
|
||||
|
||||
{% include 'snippets/wait-for-validation.md' %}
|
||||
|
||||
## {{cash_exact_n.next()}}. Confirm final result
|
||||
|
||||
Use the [`tx` method](reference-rippled.html#tx) with the CheckCash transaction's identifying hash to check its status. Look for a `"TransactionResult": "tesSUCCESS"` field in the transaction's metadata, indicating that the transaction succeeded, and the field `"validated": true` in the result, indicating that this result is final.
|
||||
|
||||
If the check was cashed for an exact `Amount` and succeeded, you can assume that the recipient was credited for exactly that amount (with possible rounding for very large or very small amounts of issued currencies).
|
||||
|
||||
If cashing the Check failed, the Check remains in the ledger so you can try cashing again later. You may want to [cash the Check for a flexible amount](tutorial-checks-cash-flex.html) instead.
|
||||
|
||||
### Example Request
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*Commandline*
|
||||
|
||||
```bash
|
||||
{% include 'code_samples/checks/cli/tx-cash-exact-req.sh' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
|
||||
### Example Response
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*Commandline*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/cli/tx-cash-exact-resp.txt' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
<!--{# common links #}-->
|
||||
[Specifying Currency Amounts]: reference-rippled.html#specifying-currency-amounts
|
||||
[RippleAPI]: reference-rippleapi.html
|
||||
{% include 'snippets/tx-type-links.md' %}
|
||||
207
content/tutorial-checks-cash-flex.md
Normal file
207
content/tutorial-checks-cash-flex.md
Normal file
@@ -0,0 +1,207 @@
|
||||
# Cash a Check for a flexible amount
|
||||
|
||||
As long as the Check is in the ledger and not expired, the specified recipient can cash it to receive a flexible amount by sending a [CheckCash transaction][] with a `DeliverMin` field. When cashing a Check in this way, the receiver gets as much as is possible to deliver, debiting the Check's sender for the Check's full `SendMax` amount or as much as is available. Cashing fails if it doesn't deliver at least the `DeliverMin` amount to the Check's recipient.
|
||||
|
||||
You might cash a Check for a flexible amount if you just want to get as much as possible from the Check.
|
||||
|
||||
The specified recipient can also [cash the check for an exact amount](tutorial-checks-cash-flex.html).
|
||||
|
||||
{% set cash_flex_n = cycler(* range(1,99)) %}
|
||||
|
||||
|
||||
## Prerequisites
|
||||
|
||||
{% include 'snippets/checkcash-prereqs.md' %}
|
||||
|
||||
## {{cash_flex_n.next()}}. Prepare the CheckCash transaction
|
||||
|
||||
Figure out the values of the [CheckCash transaction][] fields. To cash a check for a flexible amount, the following fields are the bare minimum; everything else is either optional or can be [auto-filled](reference-transaction-format.html#auto-fillable-fields) when signing:
|
||||
|
||||
| Field | Value | Description |
|
||||
|:------------------|:--------------------------|:-----------------------------|
|
||||
| `TransactionType` | String | The value `CheckCash` indicates this is a CheckCash transaction. |
|
||||
| `Account` | String (Address) | The address of the sender who is cashing the Check. (In other words, your address.) |
|
||||
| `CheckID` | String | The ID of the Check object in the ledger to cash. You can get this information by looking up the metadata of the CheckCreate transaction using the [`tx` method](reference-rippled.html#tx) or by looking for Checks using the [`account_objects` method](reference-rippled.html#account-objects). |
|
||||
| `DeliverMin` | String or Object (Amount) | A minimum amount to receive from the Check. If you cannot receive at least this much, cashing the Check fails, leaving the Check in the ledger so you can try again. For XRP, this must be a string specifying drops of XRP. For issued currencies, this is an object with `currency`, `issuer`, and `value` fields. The `currency` and `issuer` fields must match the corresponding fields in the Check object, and the `value` must be less than or equal to the amount in the Check object. For more information on specifying currency amounts, see [Specifying Currency Amounts][]. |
|
||||
|
||||
### Example CheckCash Preparation for a flexible amount
|
||||
|
||||
The following examples show how to prepare a transaction to cash a Check for a flexible amount.
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*JSON-RPC, WebSocket, or Commandline*
|
||||
|
||||
```
|
||||
{
|
||||
"Account": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"TransactionType": "CheckCash",
|
||||
"DeliverMin": "95000000",
|
||||
"CheckID": "2E0AD0740B79BE0AAE5EDD1D5FC79E3C5C221D23C6A7F771D85569B5B91195C2"
|
||||
}
|
||||
```
|
||||
|
||||
*RippleAPI*
|
||||
|
||||
```js
|
||||
{% include 'code_samples/checks/js/prepareCashFlex.js' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
## {{cash_flex_n.next()}}. Sign the CheckCash transaction
|
||||
|
||||
{% include 'snippets/tutorial-sign-step.md' %}
|
||||
|
||||
### Example Request
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*Commandline*
|
||||
|
||||
```bash
|
||||
{% include 'code_samples/checks/cli/sign-cash-flex-req.sh' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
|
||||
### Example Response
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*Commandline*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/cli/sign-cash-flex-resp.txt' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
|
||||
## {{cash_flex_n.next()}}. Submit the signed CheckCash transaction
|
||||
|
||||
{% set step_1_link = "#1-prepare-the-checkcash-transaction" %}
|
||||
{% include 'snippets/tutorial-submit-step.md' %}
|
||||
|
||||
### Example Request
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*Commandline*
|
||||
|
||||
```bash
|
||||
{% include 'code_samples/checks/cli/submit-cash-flex-req.sh' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
|
||||
### Example Response
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*Commandline*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/cli/submit-cash-flex-resp.txt' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
## {{cash_flex_n.next()}}. Wait for validation
|
||||
|
||||
{% include 'snippets/wait-for-validation.md' %}
|
||||
|
||||
## {{cash_flex_n.next()}}. Confirm final result
|
||||
|
||||
Use the [`tx` method](reference-rippled.html#tx) with the CheckCash transaction's identifying hash to check its status. Look for a `"TransactionResult": "tesSUCCESS"` field in the transaction's metadata, indicating that the transaction succeeded, and the field `"validated": true` in the result, indicating that this result is final.
|
||||
|
||||
### Example Request
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*Commandline*
|
||||
|
||||
```bash
|
||||
{% include 'code_samples/checks/cli/tx-cash-flex-req.sh' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
|
||||
### Example Response
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*Commandline*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/cli/tx-cash-flex-resp.txt' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
### Handling Errors
|
||||
|
||||
If cashing the Check failed with a `tec`-class code, look up the code in the [Full Transaction Response List](reference-transaction-format.html#full-transaction-response-list) and respond accordingly. Some common possibilities for CheckCash transactions:
|
||||
|
||||
| Result Code | Meaning | How to Respond |
|
||||
|-------------|---------|----------------|
|
||||
| `tecEXPIRED` | The Check has expired. | Cancel the Check and ask the sender to create a new Check with a later Expiration time. |
|
||||
| `tecNO_ENTRY` | The Check ID doesn't exist. | Confirm that the `CheckID` from the CheckCash transaction is correct. Confirm that the Check has not already been canceled or successfully cashed. |
|
||||
| `tecNO_LINE` | The recipient doesn't have a trust line for the Check's currency. | If you want to hold this currency from this issuer, create a trust line for the specified currency and issuer with a reasonable limit using a [TrustSet transaction][], then try to cash the check again. |
|
||||
| `tecNO_PERMISSION` | The sender of the CheckCash transaction isn't the `Destination` of the Check. | Double-check the `Destination` of the Check. |
|
||||
| `tecNO_AUTH` | The issuer of the currency from the check is using [Authorized Trust Lines](concept-authorized-trust-lines.html) but the recipient's trust line to the issuer is not approved. | Ask the issuer to authorize this trust line, then try again to cash the Check after they do. |
|
||||
| `tecPATH_PARTIAL` | The Check could not deliver enough issued currency, either due to trust line limits or because the sender does not have enough balance of the currency to send (after including the issuer's [transfer fee](concept-transfer-fees.html), if there is one). | If the problem is the trust line limit, send a [TrustSet transaction][] to increase your limit (if desired) or lower your balance by spending some of the currency, then try to cash the Check again. If the problem is the sender's balance, wait for the sender to have more of the Check's currency, or try again to cash the Check for a lesser amount. |
|
||||
| `tecUNFUNDED_PAYMENT` | The Check could not deliver enough XRP. | Wait for the sender to have more XRP, or try again to cash the Check for a lesser amount. |
|
||||
|
||||
## {{cash_flex_n.next()}}. Confirm delivered amount
|
||||
|
||||
If the Check was cashed for a flexible `DeliverMin` amount and succeeded, you can assume that the Check was cashed for at least the `DeliverMin` amount. To get the exact amount delivered, check the transaction metadata. <!--{# TODO: Update if RIPD-1623 adds a delivered_amount field. #}--> The metadata's `AffectedNodes` array contains one or two objects that reflect the change in balances from cashing the Check, depending on the type of currency.
|
||||
|
||||
- For XRP, the `AccountRoot` object of the Check's sender has its XRP `Balance` field debited. The `AccountRoot` object of the Check's recipient (the one who sent the CheckCash transaction) has its XRP `Balance` credited for at least the `DeliverMin` of the CheckCash transaction minus the [transaction cost](concept-transaction-cost.html) of sending the transaction.
|
||||
|
||||
For example, the following `ModifiedNode` shows that the account rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis, the Check's recipient and the sender of this CheckCash transaction, had its XRP balance change from `9999999970` drops to `10099999960` drops, meaning the recipient was credited a _net_ of 99.99999 XRP as a result of processing the transaction.
|
||||
|
||||
{
|
||||
"ModifiedNode": {
|
||||
"FinalFields": {
|
||||
"Account": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"Balance": "10099999960",
|
||||
"Flags": 0,
|
||||
"OwnerCount": 2,
|
||||
"Sequence": 5
|
||||
},
|
||||
"LedgerEntryType": "AccountRoot",
|
||||
"LedgerIndex": "7939126A732EBBDEC715FD3CCB056EB31E65228CA17E3B2901E7D30B90FD03D3",
|
||||
"PreviousFields": {
|
||||
"Balance": "9999999970",
|
||||
"Sequence": 4
|
||||
},
|
||||
"PreviousTxnID": "0283465F0D21BE6B1E91ABDE17266C24C1B4915BAAA9A88CC098A98D5ECD3E9E",
|
||||
"PreviousTxnLgrSeq": 8005334
|
||||
}
|
||||
}
|
||||
|
||||
The net amount of 99.99999 XRP includes deducting the transaction cost that is destroyed to pay for sending this CheckCash transaction. The following transaction instructions (excerpted) show that the transaction cost (the `Fee` field) was 10 drops of XRP. By adding this to the net balance change, we conclude that the recipient, rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis, was credited a _gross_ amount of exactly 100 XRP for cashing the Check.
|
||||
|
||||
"Account" : "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"TransactionType" : "CheckCash",
|
||||
"DeliverMin" : "95000000",
|
||||
"Fee" : "10",
|
||||
|
||||
- For issued currencies where the sender or recipient of the check is the issuer, the `RippleState` object representing the trust line between those accounts has its `Balance` adjusted in the favor of the Check's recipient.
|
||||
|
||||
<!-- {# TODO: example of single-RippleState balance changes #}-->
|
||||
|
||||
- For issued currencies with a third-party issuer, there are changes to two `RippleState` objects, representing the trust lines connecting the sender to the issuer, and the issuer to the recipient. The `RippleState` object representing the relationship between the Check's sender and the issuer has its `Balance` changed in favor of the issuer, and the `RippleState` object representing the relationship between the issuer and the recipient has its `Balance` changed in favor of the recipient.
|
||||
|
||||
<!--{# TODO: example of double-RippleState balance changes #}-->
|
||||
|
||||
- If the issued currency has a [transfer fee](concept-transfer-fees.html), the Check's sender may be debited more than the recipient is credited. (The difference is the transfer fee, which is returned to the issuer as a decreased net obligation.)
|
||||
|
||||
<!--{# common links #}-->
|
||||
[Specifying Currency Amounts]: reference-rippled.html#specifying-currency-amounts
|
||||
[RippleAPI]: reference-rippleapi.html
|
||||
{% include 'snippets/tx-type-links.md' %}
|
||||
77
content/tutorial-checks-lookup-by-recipient.md
Normal file
77
content/tutorial-checks-lookup-by-recipient.md
Normal file
@@ -0,0 +1,77 @@
|
||||
# Look up Checks by recipient address
|
||||
|
||||
This tutorial shows how to look up [Checks](concept-checks.html) by their recipient. You may also want to [look up Checks by sender](tutorial-checks-lookup-by-sender.html).
|
||||
|
||||
## 1. Look up all Checks for the address
|
||||
|
||||
To get a list of all incoming and outgoing Checks for an account, use the `account_objects` command with the recipient account's address and set the `type` field of the request to `checks`.
|
||||
|
||||
**Note:** The commandline interface to the `account_objects` command does not accept the `type` field. You can use the [`json` command](reference-rippled.html#json) to send the JSON-RPC format request on the commandline instead.
|
||||
|
||||
**Note:** RippleAPI does not have built-in support for the `account_objects` method. You can make a raw request in the WebSocket format using the `api.connection.request(websocket_request_json)` method.
|
||||
|
||||
### Example Request
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
|
||||
```js
|
||||
{% include 'code_samples/checks/js/getChecks.js' %}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/json-rpc/account_objects-req.json' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
### Example Response
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
|
||||
```
|
||||
{% include 'code_samples/checks/js/get-checks-resp.txt' %}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
200 OK
|
||||
|
||||
{% include 'code_samples/checks/json-rpc/account_objects-resp.json' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
|
||||
## 2. Filter the responses by recipient
|
||||
|
||||
The response may include Checks where the account from the request is the sender and Checks where the account is the recipient. Each member of the `account_objects` array of the response represents one Check. For each such Check object, the address in the `Destination` is address of that Check's recipient.
|
||||
|
||||
The following pseudocode demonstrates how to filter the responses by recipient:
|
||||
|
||||
```js
|
||||
recipient_address = "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za"
|
||||
account_objects_response = get_account_objects({
|
||||
account: recipient_address,
|
||||
ledger_index: "validated",
|
||||
type: "check"
|
||||
})
|
||||
|
||||
for (i=0; i < account_objects_response.account_objects.length; i++) {
|
||||
check_object = account_objects_response.account_objects[i]
|
||||
if (check_object.Destination == recipient_address) {
|
||||
log("Check to recipient:", check_object)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!--{# common links #}-->
|
||||
[Specifying Currency Amounts]: reference-rippled.html#specifying-currency-amounts
|
||||
[RippleAPI]: reference-rippleapi.html
|
||||
{% include 'snippets/tx-type-links.md' %}
|
||||
78
content/tutorial-checks-lookup-by-sender.md
Normal file
78
content/tutorial-checks-lookup-by-sender.md
Normal file
@@ -0,0 +1,78 @@
|
||||
# Look up Checks by sender address
|
||||
|
||||
This tutorial shows how to look up [Checks](concept-checks.html) by their sender. You may also want to [look up Checks by recipient](tutorial-checks-lookup-by-recipient.html).
|
||||
|
||||
## 1. Look up all Checks for the address
|
||||
|
||||
<!--{# TODO: Update if https://github.com/ripple/rippled/issues/2443 gets done #}-->
|
||||
|
||||
To get a list of all incoming and outgoing Checks for an account, use the `account_objects` command with the sending account's address and set the `type` field of the request to `checks`.
|
||||
|
||||
**Note:** The commandline interface to the `account_objects` command does not accept the `type` field. You can use the [`json` command](reference-rippled.html#json) to send the JSON-RPC format request on the commandline instead.
|
||||
|
||||
**Caution:** RippleAPI does not have built-in support for the `account_objects` method. You can make a raw request in the WebSocket format using the `api.connection.request(websocket_request_json)` method. The response to this method is in the `rippled` API format. (For example, XRP is specified in integer "drops" rather than as a decimal.)
|
||||
|
||||
### Example Request
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
|
||||
```js
|
||||
{% include 'code_samples/checks/js/getChecks.js' %}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/json-rpc/account_objects-req.json' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
### Example Response
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
|
||||
```
|
||||
{% include 'code_samples/checks/js/get-checks-resp.txt' %}
|
||||
```
|
||||
|
||||
*JSON-RPC*
|
||||
|
||||
```json
|
||||
200 OK
|
||||
|
||||
{% include 'code_samples/checks/json-rpc/account_objects-resp.json' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
## 2. Filter the responses by sender
|
||||
|
||||
The response may include Checks where the account from the request is the sender and Checks where the account is the recipient. Each member of the `account_objects` array of the response represents one Check. For each such Check object, the address in the `Account` is address of that Check's sender.
|
||||
|
||||
The following pseudocode demonstrates how to filter the responses by sender:
|
||||
|
||||
```js
|
||||
sender_address = "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za"
|
||||
account_objects_response = get_account_objects({
|
||||
account: sender_address,
|
||||
ledger_index: "validated",
|
||||
type: "check"
|
||||
})
|
||||
|
||||
for (i=0; i < account_objects_response.account_objects.length; i++) {
|
||||
check_object = account_objects_response.account_objects[i]
|
||||
if (check_object.Account == sender_address) {
|
||||
log("Check from sender:", check_object)
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<!--{# common links #}-->
|
||||
[Specifying Currency Amounts]: reference-rippled.html#specifying-currency-amounts
|
||||
[RippleAPI]: reference-rippleapi.html
|
||||
{% include 'snippets/tx-type-links.md' %}
|
||||
234
content/tutorial-checks-send.md
Normal file
234
content/tutorial-checks-send.md
Normal file
@@ -0,0 +1,234 @@
|
||||
# How to Send a Check
|
||||
|
||||
Sending a Check is like writing permission for an intended recipient to pull a payment from you. The outcome of this process is a [Check object in the ledger](reference-ledger-format.html#check) which the recipient can cash later.
|
||||
|
||||
In many cases, you want to send a [Payment][] instead of a Check, since that delivers the money directly to the recipient in one step. However, if your intended recipient uses [DepositAuth](concept-depositauth.html), you cannot send them Payments directly, so a Check is a good alternative.
|
||||
|
||||
This tutorial uses the example of a fictitious company, BoxSend SG (whose XRP Ledger address is rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za) paying a fictitious cryptocurrency consulting company named Grand Payments (with XRP Ledger address rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis) for some consulting work. Grand Payments prefers be paid in XRP, but to simplify their taxes and regulation, only accepts payments they've explicitly approved.
|
||||
|
||||
Outside of the XRP Ledger, Grand Payments sends an invoice to BoxSend SG with the ID `46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291`, and requests a Check for 100 XRP be sent to Grand Payments' XRP Ledger address of rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis.
|
||||
|
||||
{% set send_n = cycler(* range(1,99)) %}
|
||||
|
||||
## Prerequisites
|
||||
|
||||
To send a Check with this tutorial, you need the following:
|
||||
|
||||
- The **address** and **secret key** of a funded account to send the Check from.
|
||||
- You can use the [XRP Ledger Test Net Faucet](https://ripple.com/build/xrp-test-net/) to get a funded address and secret with 10,000 Test Net XRP.
|
||||
- The **address** of a funded account to receive the Check.
|
||||
- A secure way to sign transactions, such as [RippleAPI][] or your own [`rippled` server](tutorial-rippled-setup.html).
|
||||
- A client library that can connect to a `rippled` server, such as [RippleAPI][] or any HTTP or WebSocket library.
|
||||
- For more information, see [Connecting to `rippled`](reference-rippled.html#connecting-to-rippled).
|
||||
|
||||
## {{send_n.next()}}. Prepare the CheckCreate transaction
|
||||
|
||||
Decide how much money the Check is for and who can cash it. Figure out the values of the [CheckCreate transaction][] fields. The following fields are the bare minimum; everything else is either optional or can be [auto-filled](reference-transaction-format.html#auto-fillable-fields) when signing:
|
||||
|
||||
| Field | Value | Description |
|
||||
|:------------------|:--------------------------|:-----------------------------|
|
||||
| `TransactionType` | String | Use the string `CheckCreate` here. |
|
||||
| `Account` | String (Address) | The address of the sender who is creating the Check. (In other words, your address.) |
|
||||
| `Destination` | String (Address) | The address of the intended recipient who can cash the Check. |
|
||||
| `SendMax` | String or Object (Amount) | The maximum amount the sender can be debited when this Check gets cashed. For XRP, use a string representing drops of XRP. For issued currencies, use an object with `currency`, `issuer`, and `value` fields. See [Specifying Currency Amounts][] for details. If you want the recipient to be able to cash the Check for an exact amount of a non-XRP currency with a [transfer fee](concept-transfer-fees.html), remember to include an extra percentage to pay for the transfer fee. (For example, for the recipient to cash a Check for 100 CAD from an issuer with a 2% transfer fee, you must set the `SendMax` to 102 CAD from that issuer.) |
|
||||
|
||||
If you are using [RippleAPI](reference-rippleapi.html), you can use the `prepareCheckCreate()` helper method.
|
||||
|
||||
**Note:** RippleAPI supports Checks in versions 0.19.0 and up.
|
||||
|
||||
### Example CheckCreate Preparation
|
||||
|
||||
The following example shows a prepared Check from BoxSend SG (rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za) to Grand Payments (rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis) for 100 XRP. As additional (optional) metadata, BoxSend SG adds the ID of the invoice from Grand Payments so Grand Payments knows which invoice this Check is intended to pay.
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*JSON-RPC, WebSocket, or Commandline*
|
||||
|
||||
```
|
||||
{
|
||||
"TransactionType": "CheckCreate",
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"SendMax": "100000000",
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291"
|
||||
}
|
||||
```
|
||||
|
||||
*RippleAPI*
|
||||
|
||||
```js
|
||||
{% include 'code_samples/checks/js/prepareCreate.js' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
## {{send_n.next()}}. Sign the CheckCreate transaction
|
||||
|
||||
{% include 'snippets/tutorial-sign-step.md' %}
|
||||
|
||||
### Example Request
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
|
||||
```js
|
||||
{% include 'code_samples/checks/js/signCreate.js' %}
|
||||
```
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/websocket/sign-create-req.json' %}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```bash
|
||||
{% include 'code_samples/checks/cli/sign-create-req.sh' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
#### Example Response
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
|
||||
```js
|
||||
{% include 'code_samples/checks/js/sign-create-resp.txt' %}
|
||||
```
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/websocket/sign-create-resp.json' %}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/cli/sign-create-resp.txt' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
## {{send_n.next()}}. Submit the signed transaction
|
||||
|
||||
{% set step_1_link = "#1-prepare-the-checkcreate-transaction" %}
|
||||
{% include 'snippets/tutorial-submit-step.md' %}
|
||||
|
||||
### Example Request
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
|
||||
```js
|
||||
{% include 'code_samples/checks/js/submitCreate.js' %}
|
||||
```
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/websocket/submit-create-req.json' %}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```bash
|
||||
{% include 'code_samples/checks/cli/submit-create-req.sh' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
### Example Response
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
|
||||
```js
|
||||
{% include 'code_samples/checks/js/submit-create-resp.txt' %}
|
||||
```
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/websocket/submit-create-resp.json' %}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/cli/submit-create-resp.txt' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
|
||||
## {{send_n.next()}}. Wait for validation
|
||||
|
||||
{% include 'snippets/wait-for-validation.md' %}
|
||||
|
||||
## {{send_n.next()}}. Confirm final result
|
||||
|
||||
Use the [`tx` method](reference-rippled.html#tx) with the CheckCreate transaction's identifying hash to check its status. Look for a `"TransactionResult": "tesSUCCESS"` field in the transaction's metadata, indicating that the transaction succeeded, and the field `"validated": true` in the result, indicating that this result is final.
|
||||
|
||||
Look for a `CreatedNode` object in the transaction metadata to indicate that the transaction created a [Check ledger object](reference-ledger-format.html#check). The `LedgerIndex` of this object is the ID of the Check. In the following example, the Check's ID is `49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0`.
|
||||
|
||||
**Note:** RippleAPI does not report the Check's ID when you look up a CheckCreate transaction. You can work around this by calculating the Check's ID from the [Check ID format](reference-ledger-format.html#check-id-format), as in the example RippleAPI code below. <!--{# TODO: Remove this and update the code samples if ripple-lib #876 gets fixed. #}-->
|
||||
|
||||
### Example Request
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
|
||||
```
|
||||
{% include 'code_samples/checks/js/getCreateTx.js' %}
|
||||
```
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/websocket/tx-create-req.json' %}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```bash
|
||||
{% include 'code_samples/checks/cli/tx-create-req.sh' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
### Example Response
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*RippleAPI*
|
||||
|
||||
```
|
||||
{% include 'code_samples/checks/js/get-create-tx-resp.txt' %}
|
||||
```
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/websocket/tx-create-resp.json' %}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/cli/tx-create-resp.txt' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
<!--{# common links #}-->
|
||||
[Specifying Currency Amounts]: reference-rippled.html#specifying-currency-amounts
|
||||
[RippleAPI]: reference-rippleapi.html
|
||||
{% include 'snippets/tx-type-links.md' %}
|
||||
@@ -1,588 +0,0 @@
|
||||
# Checks Tutorial (draft)
|
||||
|
||||
***TODO: This whole page is just example requests and responses for now, not a finished page.***
|
||||
|
||||
|
||||
<!--{# Just the requests and responses right now #}-->
|
||||
|
||||
<!--{# Accounts used in this example:
|
||||
rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo snkuWqxoqt6aeykTbkEWrTMJHrWGM (as the sender)
|
||||
rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy sn2Zh1tRZyodU9qNy9tMnQr9UbBss (as the dest.)
|
||||
|
||||
both need to be funded and the sender needs enough XRP to send and pay the reserves
|
||||
Reminder: don't use these addresses for real XRP because the secrets are now public
|
||||
#}-->
|
||||
|
||||
## Create check
|
||||
|
||||
CheckCreate tx rUn84→rfkE1
|
||||
|
||||
```
|
||||
$ ./rippled submit snkuWqxoqt6aeykTbkEWrTMJHrWGM '{ "TransactionType": "CheckCreate",
|
||||
"Account": "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Destination": "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"SendMax": "100000000",
|
||||
"Expiration": 570113521,
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"DestinationTag": 1,
|
||||
"Fee": "12"
|
||||
}'
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Jan-24 01:01:20 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"engine_result" : "tesSUCCESS",
|
||||
"engine_result_code" : 0,
|
||||
"engine_result_message" : "The transaction was applied. Only final in a validated ledger.",
|
||||
"status" : "success",
|
||||
"tx_blob" : "120010228000000024000000022A21FB3DF12E00000001501146060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE29168400000000000000C694000000005F5E1007321022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF7874473045022100CC5B7069DF8133E91216F49933A685194DDB9BDCFF8241A7EF2F838993B98BEB022016DF6D746DF13AEA0D4BC867149BFEFFAF724AB0842A823A440D0EC684D876D181147990EC5D1D8DF69E070A968D4B186986FDF06ED0831449FF0C73CA6AF9733DA805F76CA2C37776B7C46B",
|
||||
"tx_json" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Destination" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"DestinationTag" : 1,
|
||||
"Expiration" : 570113521,
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"InvoiceID" : "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 2,
|
||||
"SigningPubKey" : "022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF78",
|
||||
"TransactionType" : "CheckCreate",
|
||||
"TxnSignature" : "3045022100CC5B7069DF8133E91216F49933A685194DDB9BDCFF8241A7EF2F838993B98BEB022016DF6D746DF13AEA0D4BC867149BFEFFAF724AB0842A823A440D0EC684D876D1",
|
||||
"hash" : "5463C6E08862A1FAE5EDAC12D70ADB16546A1F674930521295BC082494B62924"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## wait for ledger to close
|
||||
|
||||
or use `ledger_accept` if in standalone mode
|
||||
|
||||
## Confirm CheckCreate by hash with tx command
|
||||
|
||||
```
|
||||
$ ./rippled tx 5463C6E08862A1FAE5EDAC12D70ADB16546A1F674930521295BC082494B62924
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Jan-24 01:01:53 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Destination" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"DestinationTag" : 1,
|
||||
"Expiration" : 570113521,
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"InvoiceID" : "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 2,
|
||||
"SigningPubKey" : "022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF78",
|
||||
"TransactionType" : "CheckCreate",
|
||||
"TxnSignature" : "3045022100CC5B7069DF8133E91216F49933A685194DDB9BDCFF8241A7EF2F838993B98BEB022016DF6D746DF13AEA0D4BC867149BFEFFAF724AB0842A823A440D0EC684D876D1",
|
||||
"date" : 570070890,
|
||||
"hash" : "5463C6E08862A1FAE5EDAC12D70ADB16546A1F674930521295BC082494B62924",
|
||||
"inLedger" : 6,
|
||||
"ledger_index" : 6,
|
||||
"meta" : {
|
||||
"AffectedNodes" : [
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"RootIndex" : "032D861D151E38E86F46805ED1896D1A50144F65459717B6D12470A9E6E3B66E"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "032D861D151E38E86F46805ED1896D1A50144F65459717B6D12470A9E6E3B66E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CreatedNode" : {
|
||||
"LedgerEntryType" : "Check",
|
||||
"LedgerIndex" : "49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0",
|
||||
"NewFields" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Destination" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"DestinationTag" : 1,
|
||||
"Expiration" : 570113521,
|
||||
"InvoiceID" : "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 2
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"RootIndex" : "AD136EC2A266027D8F202C97D294BBE32F6FC2AD5501D9853F785FE77AB94C94"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "AD136EC2A266027D8F202C97D294BBE32F6FC2AD5501D9853F785FE77AB94C94"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Balance" : "4999999999976",
|
||||
"Flags" : 0,
|
||||
"OwnerCount" : 2,
|
||||
"Sequence" : 3
|
||||
},
|
||||
"LedgerEntryType" : "AccountRoot",
|
||||
"LedgerIndex" : "D3A1DBAA28717975A9119EC4CBC891BA9A66236C484F03C9911F463AD3B66DE0",
|
||||
"PreviousFields" : {
|
||||
"Balance" : "4999999999988",
|
||||
"OwnerCount" : 1,
|
||||
"Sequence" : 2
|
||||
},
|
||||
"PreviousTxnID" : "5168CE1F7FB10EED87E6DD94DAE5DD910B120869E5DCE682F6995BDAEA40DACA",
|
||||
"PreviousTxnLgrSeq" : 5
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex" : 0,
|
||||
"TransactionResult" : "tesSUCCESS"
|
||||
},
|
||||
"status" : "success",
|
||||
"validated" : true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
find CreatedNode of type Check, LedgerIndex is its ID: `49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0`
|
||||
|
||||
## Cancel Check
|
||||
|
||||
```
|
||||
$ ./rippled submit snkuWqxoqt6aeykTbkEWrTMJHrWGM '{
|
||||
> "Account": "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
> "TransactionType": "CheckCancel",
|
||||
> "CheckID": "49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0",
|
||||
> "Fee": "12"
|
||||
> }'
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Jan-24 01:11:07 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"engine_result" : "tesSUCCESS",
|
||||
"engine_result_code" : 0,
|
||||
"engine_result_message" : "The transaction was applied. Only final in a validated ledger.",
|
||||
"status" : "success",
|
||||
"tx_blob" : "12001222800000002400000003501849647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB068400000000000000C7321022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF78744630440220615F9D19FA182F08530CD978A4C216C8676D0BA9EDB53A620AC909AA0EF0FE7E02203A09CC34C3DB85CCCB3137E78081F8F2B441FB0A3B9E40901F312D3CBA0A67A181147990EC5D1D8DF69E070A968D4B186986FDF06ED0",
|
||||
"tx_json" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"CheckID" : "49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0",
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 3,
|
||||
"SigningPubKey" : "022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF78",
|
||||
"TransactionType" : "CheckCancel",
|
||||
"TxnSignature" : "30440220615F9D19FA182F08530CD978A4C216C8676D0BA9EDB53A620AC909AA0EF0FE7E02203A09CC34C3DB85CCCB3137E78081F8F2B441FB0A3B9E40901F312D3CBA0A67A1",
|
||||
"hash" : "414558223CA8595916BB1FEF238B3BB601B7C0E52659292251CE613E6B4370F9"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## wait for validation / ledger_accept
|
||||
|
||||
## tx on checkcancel
|
||||
|
||||
```
|
||||
$ ./rippled tx 414558223CA8595916BB1FEF238B3BB601B7C0E52659292251CE613E6B4370F9
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Jan-24 01:11:53 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"CheckID" : "49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0",
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 3,
|
||||
"SigningPubKey" : "022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF78",
|
||||
"TransactionType" : "CheckCancel",
|
||||
"TxnSignature" : "30440220615F9D19FA182F08530CD978A4C216C8676D0BA9EDB53A620AC909AA0EF0FE7E02203A09CC34C3DB85CCCB3137E78081F8F2B441FB0A3B9E40901F312D3CBA0A67A1",
|
||||
"date" : 570071520,
|
||||
"hash" : "414558223CA8595916BB1FEF238B3BB601B7C0E52659292251CE613E6B4370F9",
|
||||
"inLedger" : 7,
|
||||
"ledger_index" : 7,
|
||||
"meta" : {
|
||||
"AffectedNodes" : [
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"RootIndex" : "032D861D151E38E86F46805ED1896D1A50144F65459717B6D12470A9E6E3B66E"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "032D861D151E38E86F46805ED1896D1A50144F65459717B6D12470A9E6E3B66E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"DeletedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Destination" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"DestinationNode" : "0000000000000000",
|
||||
"DestinationTag" : 1,
|
||||
"Expiration" : 570113521,
|
||||
"Flags" : 0,
|
||||
"InvoiceID" : "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"OwnerNode" : "0000000000000000",
|
||||
"PreviousTxnID" : "5463C6E08862A1FAE5EDAC12D70ADB16546A1F674930521295BC082494B62924",
|
||||
"PreviousTxnLgrSeq" : 6,
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 2
|
||||
},
|
||||
"LedgerEntryType" : "Check",
|
||||
"LedgerIndex" : "49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"RootIndex" : "AD136EC2A266027D8F202C97D294BBE32F6FC2AD5501D9853F785FE77AB94C94"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "AD136EC2A266027D8F202C97D294BBE32F6FC2AD5501D9853F785FE77AB94C94"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Balance" : "4999999999964",
|
||||
"Flags" : 0,
|
||||
"OwnerCount" : 1,
|
||||
"Sequence" : 4
|
||||
},
|
||||
"LedgerEntryType" : "AccountRoot",
|
||||
"LedgerIndex" : "D3A1DBAA28717975A9119EC4CBC891BA9A66236C484F03C9911F463AD3B66DE0",
|
||||
"PreviousFields" : {
|
||||
"Balance" : "4999999999976",
|
||||
"OwnerCount" : 2,
|
||||
"Sequence" : 3
|
||||
},
|
||||
"PreviousTxnID" : "5463C6E08862A1FAE5EDAC12D70ADB16546A1F674930521295BC082494B62924",
|
||||
"PreviousTxnLgrSeq" : 6
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex" : 0,
|
||||
"TransactionResult" : "tesSUCCESS"
|
||||
},
|
||||
"status" : "success",
|
||||
"validated" : true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
deleted LedgerEntryType Check in metadata: √
|
||||
|
||||
## new checkcreate
|
||||
|
||||
```
|
||||
$ ./rippled submit snkuWqxoqt6aeykTbkEWrTMJHrWGM '{
|
||||
> "TransactionType": "CheckCreate",
|
||||
> "Account": "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
> "Destination": "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
> "SendMax": "100000000",
|
||||
> "Expiration": 570113521,
|
||||
> "InvoiceID": "6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B",
|
||||
> "DestinationTag": 1,
|
||||
> "Fee": "12"
|
||||
> }'
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Jan-24 01:14:21 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"engine_result" : "tesSUCCESS",
|
||||
"engine_result_code" : 0,
|
||||
"engine_result_message" : "The transaction was applied. Only final in a validated ledger.",
|
||||
"status" : "success",
|
||||
"tx_blob" : "120010228000000024000000042A21FB3DF12E0000000150116F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B68400000000000000C694000000005F5E1007321022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF787446304402206F4500FF59F5DC8684B5715941DCD0985A4107EE7BE11795D051C47E9F14B1C402201DA5634CD532DE77A3BE2C89F30F945514F93F3689A95DE7E42FC3072B10A5B181147990EC5D1D8DF69E070A968D4B186986FDF06ED0831449FF0C73CA6AF9733DA805F76CA2C37776B7C46B",
|
||||
"tx_json" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Destination" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"DestinationTag" : 1,
|
||||
"Expiration" : 570113521,
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"InvoiceID" : "6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B",
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 4,
|
||||
"SigningPubKey" : "022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF78",
|
||||
"TransactionType" : "CheckCreate",
|
||||
"TxnSignature" : "304402206F4500FF59F5DC8684B5715941DCD0985A4107EE7BE11795D051C47E9F14B1C402201DA5634CD532DE77A3BE2C89F30F945514F93F3689A95DE7E42FC3072B10A5B1",
|
||||
"hash" : "0FD9F719CDE29E6F6DF752B93EB9AC6FBB493BF989F2CB63B8C0E73A8DCDF61A"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## validation/ledger_accept
|
||||
|
||||
## and tx again
|
||||
|
||||
```
|
||||
$ ./rippled tx 0FD9F719CDE29E6F6DF752B93EB9AC6FBB493BF989F2CB63B8C0E73A8DCDF61A
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Jan-24 01:14:56 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Destination" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"DestinationTag" : 1,
|
||||
"Expiration" : 570113521,
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"InvoiceID" : "6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B",
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 4,
|
||||
"SigningPubKey" : "022C53CD19049F32F31848DD3B3BE5CEF6A2DD1EFDA7971AB3FA49B1BAF12AEF78",
|
||||
"TransactionType" : "CheckCreate",
|
||||
"TxnSignature" : "304402206F4500FF59F5DC8684B5715941DCD0985A4107EE7BE11795D051C47E9F14B1C402201DA5634CD532DE77A3BE2C89F30F945514F93F3689A95DE7E42FC3072B10A5B1",
|
||||
"date" : 570071700,
|
||||
"hash" : "0FD9F719CDE29E6F6DF752B93EB9AC6FBB493BF989F2CB63B8C0E73A8DCDF61A",
|
||||
"inLedger" : 8,
|
||||
"ledger_index" : 8,
|
||||
"meta" : {
|
||||
"AffectedNodes" : [
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"RootIndex" : "032D861D151E38E86F46805ED1896D1A50144F65459717B6D12470A9E6E3B66E"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "032D861D151E38E86F46805ED1896D1A50144F65459717B6D12470A9E6E3B66E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CreatedNode" : {
|
||||
"LedgerEntryType" : "Check",
|
||||
"LedgerIndex" : "838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334",
|
||||
"NewFields" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Destination" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"DestinationTag" : 1,
|
||||
"Expiration" : 570113521,
|
||||
"InvoiceID" : "6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B",
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 4
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"RootIndex" : "AD136EC2A266027D8F202C97D294BBE32F6FC2AD5501D9853F785FE77AB94C94"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "AD136EC2A266027D8F202C97D294BBE32F6FC2AD5501D9853F785FE77AB94C94"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Balance" : "4999999999952",
|
||||
"Flags" : 0,
|
||||
"OwnerCount" : 2,
|
||||
"Sequence" : 5
|
||||
},
|
||||
"LedgerEntryType" : "AccountRoot",
|
||||
"LedgerIndex" : "D3A1DBAA28717975A9119EC4CBC891BA9A66236C484F03C9911F463AD3B66DE0",
|
||||
"PreviousFields" : {
|
||||
"Balance" : "4999999999964",
|
||||
"OwnerCount" : 1,
|
||||
"Sequence" : 4
|
||||
},
|
||||
"PreviousTxnID" : "414558223CA8595916BB1FEF238B3BB601B7C0E52659292251CE613E6B4370F9",
|
||||
"PreviousTxnLgrSeq" : 7
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex" : 0,
|
||||
"TransactionResult" : "tesSUCCESS"
|
||||
},
|
||||
"status" : "success",
|
||||
"validated" : true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
new check's id: `838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334`
|
||||
|
||||
## Cash check (exact amount)
|
||||
|
||||
rfkE1 sends this one
|
||||
|
||||
```
|
||||
$ ./rippled submit sn2Zh1tRZyodU9qNy9tMnQr9UbBss '{
|
||||
> "Account": "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
> "TransactionType": "CheckCash",
|
||||
> "Amount": "100000000",
|
||||
> "CheckID": "838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334",
|
||||
> "Fee": "12"
|
||||
> }'
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Jan-24 01:17:54 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"engine_result" : "tesSUCCESS",
|
||||
"engine_result_code" : 0,
|
||||
"engine_result_message" : "The transaction was applied. Only final in a validated ledger.",
|
||||
"status" : "success",
|
||||
"tx_blob" : "120011228000000024000000015018838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334614000000005F5E10068400000000000000C732102F135B14C552968B0ABE8493CC4C5795A7484D73F6BFD01379F73456F725F66ED74473045022100C64278AC90B841CD3EA9889A4847CAB3AC9927057A34130810FAA7FAC0C6E3290220347260A4C0A6DC9B699DA12510795B2B3414E1FA222AF743226345FBAAEF937C811449FF0C73CA6AF9733DA805F76CA2C37776B7C46B",
|
||||
"tx_json" : {
|
||||
"Account" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"Amount" : "100000000",
|
||||
"CheckID" : "838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334",
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 1,
|
||||
"SigningPubKey" : "02F135B14C552968B0ABE8493CC4C5795A7484D73F6BFD01379F73456F725F66ED",
|
||||
"TransactionType" : "CheckCash",
|
||||
"TxnSignature" : "3045022100C64278AC90B841CD3EA9889A4847CAB3AC9927057A34130810FAA7FAC0C6E3290220347260A4C0A6DC9B699DA12510795B2B3414E1FA222AF743226345FBAAEF937C",
|
||||
"hash" : "0521707D510858BC8AF69D2227E1D1ADA7DB7C5B4B74115BCD0D91B62AFA8EDC"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## validate
|
||||
|
||||
## tx the checkcash for final result
|
||||
|
||||
```
|
||||
$ ./rippled tx 0521707D510858BC8AF69D2227E1D1ADA7DB7C5B4B74115BCD0D91B62AFA8EDC
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Jan-24 01:18:39 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"result" : {
|
||||
"Account" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"Amount" : "100000000",
|
||||
"CheckID" : "838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334",
|
||||
"Fee" : "12",
|
||||
"Flags" : 2147483648,
|
||||
"Sequence" : 1,
|
||||
"SigningPubKey" : "02F135B14C552968B0ABE8493CC4C5795A7484D73F6BFD01379F73456F725F66ED",
|
||||
"TransactionType" : "CheckCash",
|
||||
"TxnSignature" : "3045022100C64278AC90B841CD3EA9889A4847CAB3AC9927057A34130810FAA7FAC0C6E3290220347260A4C0A6DC9B699DA12510795B2B3414E1FA222AF743226345FBAAEF937C",
|
||||
"date" : 570071920,
|
||||
"hash" : "0521707D510858BC8AF69D2227E1D1ADA7DB7C5B4B74115BCD0D91B62AFA8EDC",
|
||||
"inLedger" : 9,
|
||||
"ledger_index" : 9,
|
||||
"meta" : {
|
||||
"AffectedNodes" : [
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"RootIndex" : "032D861D151E38E86F46805ED1896D1A50144F65459717B6D12470A9E6E3B66E"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "032D861D151E38E86F46805ED1896D1A50144F65459717B6D12470A9E6E3B66E"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"Balance" : "1000099999988",
|
||||
"Flags" : 0,
|
||||
"OwnerCount" : 0,
|
||||
"Sequence" : 2
|
||||
},
|
||||
"LedgerEntryType" : "AccountRoot",
|
||||
"LedgerIndex" : "38E1EF3284A45B090D549EFFB014ACF68927FE0884CDAF01CE3629DF90542D66",
|
||||
"PreviousFields" : {
|
||||
"Balance" : "1000000000000",
|
||||
"Sequence" : 1
|
||||
},
|
||||
"PreviousTxnID" : "3E14D859F6B4BE923323EFC94571606455921E65173147A89BC6EDDA4374B294",
|
||||
"PreviousTxnLgrSeq" : 5
|
||||
}
|
||||
},
|
||||
{
|
||||
"DeletedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Destination" : "rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy",
|
||||
"DestinationNode" : "0000000000000000",
|
||||
"DestinationTag" : 1,
|
||||
"Expiration" : 570113521,
|
||||
"Flags" : 0,
|
||||
"InvoiceID" : "6F1DFD1D0FE8A32E40E1F2C05CF1C15545BAB56B617F9C6C2D63A6B704BEF59B",
|
||||
"OwnerNode" : "0000000000000000",
|
||||
"PreviousTxnID" : "0FD9F719CDE29E6F6DF752B93EB9AC6FBB493BF989F2CB63B8C0E73A8DCDF61A",
|
||||
"PreviousTxnLgrSeq" : 8,
|
||||
"SendMax" : "100000000",
|
||||
"Sequence" : 4
|
||||
},
|
||||
"LedgerEntryType" : "Check",
|
||||
"LedgerIndex" : "838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Flags" : 0,
|
||||
"Owner" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"RootIndex" : "AD136EC2A266027D8F202C97D294BBE32F6FC2AD5501D9853F785FE77AB94C94"
|
||||
},
|
||||
"LedgerEntryType" : "DirectoryNode",
|
||||
"LedgerIndex" : "AD136EC2A266027D8F202C97D294BBE32F6FC2AD5501D9853F785FE77AB94C94"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ModifiedNode" : {
|
||||
"FinalFields" : {
|
||||
"Account" : "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
"Balance" : "4999899999952",
|
||||
"Flags" : 0,
|
||||
"OwnerCount" : 1,
|
||||
"Sequence" : 5
|
||||
},
|
||||
"LedgerEntryType" : "AccountRoot",
|
||||
"LedgerIndex" : "D3A1DBAA28717975A9119EC4CBC891BA9A66236C484F03C9911F463AD3B66DE0",
|
||||
"PreviousFields" : {
|
||||
"Balance" : "4999999999952",
|
||||
"OwnerCount" : 2
|
||||
},
|
||||
"PreviousTxnID" : "0FD9F719CDE29E6F6DF752B93EB9AC6FBB493BF989F2CB63B8C0E73A8DCDF61A",
|
||||
"PreviousTxnLgrSeq" : 8
|
||||
}
|
||||
}
|
||||
],
|
||||
"TransactionIndex" : 0,
|
||||
"TransactionResult" : "tesSUCCESS"
|
||||
},
|
||||
"status" : "success",
|
||||
"validated" : true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## cash check (delivermin)
|
||||
|
||||
***TODO: alternative version of cashing a check with delivermin instead of amount)
|
||||
@@ -130,7 +130,7 @@ When you make subsequent `SetRegularKey` requests, you can sign using the existi
|
||||
|
||||
#### Sign Your Transaction
|
||||
|
||||
The most secure way to sign a transaction is to do it offline with a signing library, such as [RippleAPI](reference-rippleapi.html#offline-functionality). Alternatively, you can sign the transaction using the [`sign`](reference-rippled.html#sign) command, but this must be done through a trusted and encrypted connection, or through a local connection, and only to a server you control.
|
||||
{% include 'snippets/tutorial-sign-step.md' %}
|
||||
|
||||
Populate the request fields with the following values:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user