mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-04 11:55:50 +00:00
Checks tutorial progress
This commit is contained in:
@@ -1 +1 @@
|
||||
rippled submit 120010228000000024000000012A21FB3DF12E00000001501146060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE29168400000000000000C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB40074473045022100EB5A9001E14FC7304C4C2DF66507F9FC59D17FDCF98B43A4E30356658AB2A7CF02207127187EE0F287665D9552D15BEE6B00D3C6691C6773CE416E8A714B853F44FC8114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39
|
||||
rippled submit 120010228000000024000000042E00000001501146060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE29168400000000000000C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB40074463044022071A341F911A8EF3B68399487CAF5BA3B59C6FE476B626698AEF044B8183721BC0220166053A859BD907251DFCCF34DD71202180EBABAE7098BB5903D16EBFC993C408114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39
|
||||
|
||||
28
content/code_samples/checks/cli/submit-create-resp-1.txt
Normal file
28
content/code_samples/checks/cli/submit-create-resp-1.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
2018-Mar-28 01:52:49 HTTPClient:NFO Connecting to 127.0.0.1:5005
|
||||
|
||||
{
|
||||
"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"
|
||||
}
|
||||
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-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
|
||||
}
|
||||
}
|
||||
17
content/code_samples/checks/js/get-create-tx-resp.txt
Normal file
17
content/code_samples/checks/js/get-create-tx-resp.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
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 } }
|
||||
Disconnected
|
||||
21
content/code_samples/checks/js/getCreateTx.js
Normal file
21
content/code_samples/checks/js/getCreateTx.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 = "C0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441"
|
||||
|
||||
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)
|
||||
@@ -31,3 +31,14 @@ api.connect().then(() => {
|
||||
process.exit()
|
||||
})
|
||||
}).catch(console.error)
|
||||
|
||||
|
||||
// Example output:
|
||||
//
|
||||
// Connected
|
||||
// txJSON: {"Account":"rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
// "TransactionType":"CheckCreate",
|
||||
// "Destination":"rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
// "SendMax":"100000000","Flags":2147483648,
|
||||
// "LastLedgerSequence":7835917,"Fee":"12","Sequence":2}
|
||||
// Disconnected
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
tx_blob is: 12001022800000002400000001201B0075139F68400000000000000C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB4007446304402204B5DA588DC2B9B9E52248129F07083AE71039CBDD8A87F58583853A4A9A8461B02205973D04A9F97EE0684DB98D4EC813CF748806019751062FB600406D8BE95D18D8114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39
|
||||
tx hash is: DC334D25AA70A4412E8EA80D3199414C5D8579DFD3F085E5AF7CE35C334F5246
|
||||
tx_blob is: 12001022800000002400000002201B0077911368400000000000000C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E359045FF4BB400744630440220181FE2F945EBEE632966D5FB03114611E3047ACD155AA1BDB9DF8545C7A2431502201E873A4B0D177AB250AF790CE80621E16F141506CF507586038FC4A8E95887358114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39
|
||||
tx hash is: C0B27D20669BAB837B3CDF4B8148B988F17CE1EF8EDF48C806AE9BF69E16F441
|
||||
|
||||
@@ -9,9 +9,10 @@ const txJSON = '{"Account":"rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za", \
|
||||
"Destination":"rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis", \
|
||||
"SendMax":"100000000", \
|
||||
"Flags":2147483648, \
|
||||
"LastLedgerSequence":7672735, \
|
||||
"LastLedgerSequence":7835923, \
|
||||
"Fee":"12", \
|
||||
"Sequence":1}'
|
||||
"Sequence":2}'
|
||||
|
||||
// Be careful where you store your real secret.
|
||||
const secret = 's████████████████████████████'
|
||||
|
||||
|
||||
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
|
||||
@@ -6,12 +6,12 @@ const api = new RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
|
||||
api.connect().then(() => {
|
||||
console.log('Connected')
|
||||
|
||||
const tx_blob = "12001022800000002400000001201B0075139F68400000000000000C69"+
|
||||
"4000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6CFCF2E"+
|
||||
"359045FF4BB4007446304402204B5DA588DC2B9B9E52248129F07083AE71039CBDD8A87F"+
|
||||
"58583853A4A9A8461B02205973D04A9F97EE0684DB98D4EC813CF748806019751062FB60"+
|
||||
"0406D8BE95D18D8114735FF88E5269C80CD7F7AF10530DAB840BBF6FDF8314A8B6B9FF32"+
|
||||
"46856CADC4A0106198C066EA1F9C39"
|
||||
const tx_blob = "12001022800000002400000002201B0077911368400000000000000"+
|
||||
"C694000000005F5E100732103B6FCD7FAC4F665FE92415DD6E8450AD90F7D6B3D45A6"+
|
||||
"CFCF2E359045FF4BB400744630440220181FE2F945EBEE632966D5FB03114611E3047"+
|
||||
"ACD155AA1BDB9DF8545C7A2431502201E873A4B0D177AB250AF790CE80621E16F1415"+
|
||||
"06CF507586038FC4A8E95887358114735FF88E5269C80CD7F7AF10530DAB840BBF6FD"+
|
||||
"F8314A8B6B9FF3246856CADC4A0106198C066EA1F9C39"
|
||||
|
||||
return api.submit(tx_blob)
|
||||
}).then(response => {
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
"Account": "rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za",
|
||||
"Destination": "rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis",
|
||||
"SendMax": "100000000",
|
||||
"Expiration": 570113521,
|
||||
"InvoiceID": "46060241FABCF692D4D934BA2A6C4427CD4279083E38C77CBE642243E43BE291",
|
||||
"DestinationTag": 1,
|
||||
"Fee": "12"
|
||||
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"
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"id": "sign_req_1",
|
||||
"result": {
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"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"
|
||||
}
|
||||
@@ -2,12 +2,12 @@
|
||||
|
||||
Checks in the XRP Ledger are similar to paper personal checks. This tutorial steps through the following processes for using Checks:
|
||||
|
||||
- Sending a Check
|
||||
- Looking for incoming Checks
|
||||
- Looking for outgoing Checks
|
||||
- Cashing a Check for an exact amount
|
||||
- Cashing a Check for a flexible amount
|
||||
- Canceling a Check
|
||||
- [Send a Check](#send-a-check)
|
||||
- Look for incoming Checks
|
||||
- Look for outgoing Checks
|
||||
- Cash a Check for an exact amount
|
||||
- Cash a Check for a flexible amount
|
||||
- [Cancel a Check](#cancel-a-check)
|
||||
|
||||
|
||||
<!--{# Accounts used in old examples:
|
||||
@@ -19,7 +19,7 @@ rBXsgNkPcDN2runsvWmwxk3Lh97zdgo9za ssqSRChhs5qTiUzn9jYf25khmQuwL as the sender
|
||||
rGPnRH1EBpHeTF2QG8DCAgM7z5pb75LAis sn2DreVBky7kzbXJoaUMXMKCR8HAc as the receiver
|
||||
#}-->
|
||||
|
||||
## Sending a Check
|
||||
## Send a Check
|
||||
|
||||
Sending a Check involves sending a [CheckCreate transaction][], which creates a [Check object in the ledger](reference-ledger-format.html#check). Most of the fields of a CheckCreate transaction are similar to the fields of a (push) [Payment][], because a Check is like writing permission for an intended recipient to pull a payment from you. You can create a check for XRP or an issued currency.
|
||||
|
||||
@@ -38,14 +38,24 @@ To send a Check with this tutorial, you need the following:
|
||||
|
||||
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 | The value `CheckCreate` indicates this is a CheckCreate transaction. |
|
||||
| `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. |
|
||||
| Field | Value | Description |
|
||||
|:------------------|:--------------------------|:-----------------------------|
|
||||
| `TransactionType` | String | The value `CheckCreate` indicates this is a CheckCreate transaction. |
|
||||
| `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, here is a transaction to create a Check for 100 XRP from rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo to rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy, with an expiration time of 2018-01-24T12:52:01Z:
|
||||
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 Check Preparation
|
||||
|
||||
This example transaction creates a Check for 100 XRP from rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo to rfkE1aSy9G8Upk4JssnwBxhEv5p4mn2KTy, with no expiration:
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*JSON-RPC, WebSocket, or Commandline*
|
||||
|
||||
```
|
||||
{
|
||||
@@ -60,15 +70,13 @@ For example, here is a transaction to create a Check for 100 XRP from rUn84CUYbN
|
||||
}
|
||||
```
|
||||
|
||||
#### Preparing CheckCreate with RippleAPI
|
||||
|
||||
If you are using [RippleAPI](reference-rippleapi.html), you can use the `prepareCheckCreate()` helper method. For example:
|
||||
*RippleAPI*
|
||||
|
||||
```js
|
||||
{% include 'code_samples/checks/js/prepareCreate.js' %}
|
||||
```
|
||||
|
||||
**Note:** Checks require RippleAPI version 0.19.0 or higher.
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
### 2. Sign the CheckCreate transaction
|
||||
|
||||
@@ -89,13 +97,13 @@ In all cases, note the signed transaction's identifying hash for later.
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/websocket/sign-req-1.json' %}
|
||||
{% include 'code_samples/checks/websocket/sign-create-req.json' %}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```bash
|
||||
{% include 'code_samples/checks/cli/sign-req-1.sh' %}
|
||||
{% include 'code_samples/checks/cli/sign-create-req.sh' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
@@ -107,26 +115,26 @@ In all cases, note the signed transaction's identifying hash for later.
|
||||
*RippleAPI*
|
||||
|
||||
```js
|
||||
{% include 'code_samples/checks/js/sign-resp-example.txt' %}
|
||||
{% include 'code_samples/checks/js/sign-create-resp.txt' %}
|
||||
```
|
||||
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/websocket/sign-resp-1.json' %}
|
||||
{% include 'code_samples/checks/websocket/sign-create-resp.json' %}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/cli/sign-resp-1.txt' %}
|
||||
{% include 'code_samples/checks/cli/sign-create-resp.txt' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
### 3. Submit the signed transaction
|
||||
|
||||
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).
|
||||
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](#1-prepare-the-checkcreate-transaction) with a higher `LastLedgerSequence` value.
|
||||
|
||||
@@ -143,17 +151,42 @@ Take the signed transaction blob from the previous step and submit it to a `ripp
|
||||
*WebSocket*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/websocket/submit-create-req-1.json' %}
|
||||
{% include 'code_samples/checks/websocket/submit-create-req.json' %}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```bash
|
||||
{% include 'code_samples/checks/cli/submit-create-req-1.sh' %}
|
||||
{% 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 -->
|
||||
|
||||
|
||||
### 4. Wait for validation
|
||||
|
||||
{% include 'snippets/wait-for-validation.md' %}
|
||||
@@ -162,102 +195,42 @@ Take the signed transaction blob from the previous step and submit it to a `ripp
|
||||
|
||||
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. For example, in the following example, the Check's ID is `49647F0D748DC3FE26BDACBC57F251AADEFFF391403EC9BF87C97F67E9977FB0`.
|
||||
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`.
|
||||
|
||||
***TODO: Is there a way to look up the Check ID using RippleAPI? As far as I can tell, there isn't. Reported as https://github.com/ripple/ripple-lib/issues/876 for now.***
|
||||
|
||||
#### Example Request
|
||||
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*Commandline*
|
||||
*RippleAPI*
|
||||
|
||||
```
|
||||
$ ./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
|
||||
{% include 'code_samples/checks/js/getCreateTx.js' %}
|
||||
```
|
||||
|
||||
{
|
||||
"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
|
||||
}
|
||||
}
|
||||
<!-- 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.txt' %}
|
||||
```
|
||||
|
||||
*Commandline*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/cli/tx-create-resp.txt' %}
|
||||
```
|
||||
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
@@ -266,6 +239,38 @@ Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
|
||||
## Cancel a Check
|
||||
|
||||
Canceling a Check involves sending a [CheckCancel transaction][], which removes a [Check object from the ledger](reference-ledger-format.html#check) without redeeming it. Either the sender or the recipient of a Check can cancel it before it has been redeemed. If the Check has expired, anyone can cancel it (and no one can cash it).
|
||||
|
||||
### 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, the ID of the Check created in the WebSocket examples above was `84C61BE9B39B2C4A2267F67504404F1EC76678806C1B901EA781D1E3B4CE0CD9`, 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).
|
||||
|
||||
|
||||
### 1. 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 | The value `CheckCancel` indicates this is a CheckCancel transaction. |
|
||||
| `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.
|
||||
|
||||
### 2. Sign the CheckCancel transaction
|
||||
|
||||
***TODO: separate signing/submitting of CheckCancel***
|
||||
|
||||
```
|
||||
$ ./rippled submit snkuWqxoqt6aeykTbkEWrTMJHrWGM '{
|
||||
> "Account": "rUn84CUYbNjRoTQ6mSW7BVJPSVJNLb1QLo",
|
||||
@@ -297,249 +302,52 @@ Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
}
|
||||
}
|
||||
```
|
||||
### 3. Submit the signed CheckCancel transaction
|
||||
|
||||
## wait for validation / ledger_accept
|
||||
***TODO: examples of submitting signed blob***
|
||||
|
||||
## tx on checkcancel
|
||||
### 4. Wait for validation
|
||||
|
||||
```
|
||||
$ ./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
|
||||
{% include 'snippets/wait-for-validation.md' %}
|
||||
|
||||
{
|
||||
"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
|
||||
}
|
||||
}
|
||||
### 5. 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 -->
|
||||
|
||||
*Commandline*
|
||||
|
||||
```bash
|
||||
{% include 'code_samples/checks/cli/tx-cancel-req.sh' %}
|
||||
```
|
||||
|
||||
deleted LedgerEntryType Check in metadata: √
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
## 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
|
||||
#### Example Response
|
||||
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
<!-- MULTICODE_BLOCK_START -->
|
||||
|
||||
*Commandline*
|
||||
|
||||
```json
|
||||
{% include 'code_samples/checks/cli/tx-cancel-resp.txt' %}
|
||||
```
|
||||
|
||||
## validation/ledger_accept
|
||||
<!-- MULTICODE_BLOCK_END -->
|
||||
|
||||
## 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
|
||||
## Cash a Check for an exact amount
|
||||
|
||||
{
|
||||
"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)
|
||||
As long as the Check is in the ledger and not expired, the specified recipient can cash it for up to the amount specified in the Check. (If it's an issued currency, the recipient can only cash the Check for that currency from the sender or from a specified issuer they both trust.)
|
||||
|
||||
Uses check id: `838766BA2B995C00744175F69A1B11E32C3DBC40E64801A4056FCBD657F57334`
|
||||
|
||||
rfkE1 sends this one
|
||||
|
||||
```
|
||||
@@ -692,7 +500,7 @@ Loading: "/home/mduo13/.config/ripple/rippled.cfg"
|
||||
}
|
||||
```
|
||||
|
||||
## cash check (delivermin)
|
||||
## Cash a Check for a flexible amount
|
||||
|
||||
***TODO: alternative version of cashing a check with delivermin instead of amount)***
|
||||
|
||||
|
||||
Reference in New Issue
Block a user