mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-27 15:15:50 +00:00
Checks tutorial progress
This commit is contained in:
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 => {
|
||||
|
||||
Reference in New Issue
Block a user