Update tutorial nav
|
Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 1007 KiB |
|
Before Width: | Height: | Size: 143 KiB After Width: | Height: | Size: 135 KiB |
|
Before Width: | Height: | Size: 165 KiB After Width: | Height: | Size: 165 KiB |
|
Before Width: | Height: | Size: 178 KiB After Width: | Height: | Size: 189 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 66 KiB |
BIN
docs/img/quickstart-checks1.png
Normal file
|
After Width: | Height: | Size: 91 KiB |
BIN
docs/img/quickstart-checks2.png
Normal file
|
After Width: | Height: | Size: 125 KiB |
BIN
docs/img/quickstart-checks3.png
Normal file
|
After Width: | Height: | Size: 182 KiB |
BIN
docs/img/quickstart-checks4.png
Normal file
|
After Width: | Height: | Size: 179 KiB |
BIN
docs/img/quickstart-checks5.png
Normal file
|
After Width: | Height: | Size: 210 KiB |
BIN
docs/img/quickstart-checks6.png
Normal file
|
After Width: | Height: | Size: 132 KiB |
BIN
docs/img/quickstart-checks7.png
Normal file
|
After Width: | Height: | Size: 168 KiB |
BIN
docs/img/quickstart-checks8.png
Normal file
|
After Width: | Height: | Size: 136 KiB |
|
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 183 KiB After Width: | Height: | Size: 137 KiB |
|
Before Width: | Height: | Size: 201 KiB After Width: | Height: | Size: 162 KiB |
|
Before Width: | Height: | Size: 229 KiB After Width: | Height: | Size: 184 KiB |
|
Before Width: | Height: | Size: 231 KiB After Width: | Height: | Size: 228 KiB |
|
Before Width: | Height: | Size: 180 KiB After Width: | Height: | Size: 156 KiB |
|
Before Width: | Height: | Size: 194 KiB After Width: | Height: | Size: 192 KiB |
|
Before Width: | Height: | Size: 196 KiB After Width: | Height: | Size: 191 KiB |
|
Before Width: | Height: | Size: 244 KiB After Width: | Height: | Size: 237 KiB |
BIN
docs/img/quickstart-py-checks1.png
Normal file
|
After Width: | Height: | Size: 59 KiB |
BIN
docs/img/quickstart-py-checks2.png
Normal file
|
After Width: | Height: | Size: 102 KiB |
BIN
docs/img/quickstart-py-checks3.png
Normal file
|
After Width: | Height: | Size: 134 KiB |
BIN
docs/img/quickstart-py-checks4.png
Normal file
|
After Width: | Height: | Size: 121 KiB |
BIN
docs/img/quickstart-py-checks5.png
Normal file
|
After Width: | Height: | Size: 124 KiB |
BIN
docs/img/quickstart-py-checks6.png
Normal file
|
After Width: | Height: | Size: 148 KiB |
BIN
docs/img/quickstart-py-checks7.png
Normal file
|
After Width: | Height: | Size: 115 KiB |
BIN
docs/img/quickstart-py-checks8.png
Normal file
|
After Width: | Height: | Size: 132 KiB |
|
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 145 KiB |
|
Before Width: | Height: | Size: 141 KiB After Width: | Height: | Size: 142 KiB |
|
Before Width: | Height: | Size: 137 KiB After Width: | Height: | Size: 133 KiB |
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 124 KiB After Width: | Height: | Size: 127 KiB |
|
Before Width: | Height: | Size: 141 KiB After Width: | Height: | Size: 155 KiB |
|
Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 177 KiB |
|
Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 178 KiB |
|
Before Width: | Height: | Size: 161 KiB After Width: | Height: | Size: 173 KiB |
|
Before Width: | Height: | Size: 152 KiB After Width: | Height: | Size: 159 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 66 KiB |
|
Before Width: | Height: | Size: 142 KiB After Width: | Height: | Size: 153 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 77 KiB |
|
Before Width: | Height: | Size: 125 KiB After Width: | Height: | Size: 100 KiB |
|
Before Width: | Height: | Size: 138 KiB After Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 114 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 148 KiB After Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 150 KiB After Width: | Height: | Size: 117 KiB |
|
Before Width: | Height: | Size: 174 KiB After Width: | Height: | Size: 177 KiB |
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 169 KiB After Width: | Height: | Size: 168 KiB |
|
Before Width: | Height: | Size: 172 KiB After Width: | Height: | Size: 166 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 83 KiB |
|
Before Width: | Height: | Size: 76 KiB After Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 138 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 88 KiB |
|
Before Width: | Height: | Size: 117 KiB After Width: | Height: | Size: 139 KiB |
|
Before Width: | Height: | Size: 152 KiB After Width: | Height: | Size: 170 KiB |
|
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 86 KiB |
|
Before Width: | Height: | Size: 128 KiB After Width: | Height: | Size: 108 KiB |
329
docs/img/ripplex10-check.js
Normal file
@@ -0,0 +1,329 @@
|
||||
// *******************************************************
|
||||
// ************* Standby Send Check **********************
|
||||
// *******************************************************
|
||||
async function sendCheck() {
|
||||
let net = getNet()
|
||||
const client = new xrpl.Client(net)
|
||||
results = 'Connecting to ' + getNet() + '....'
|
||||
standbyResultField.value = results
|
||||
await client.connect()
|
||||
results += '\nConnected.'
|
||||
standbyResultField.value = results
|
||||
|
||||
const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value)
|
||||
const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value)
|
||||
var check_amount = standbyAmountField.value
|
||||
|
||||
if (standbyCurrencyField.value != "XRP") {
|
||||
check_amount = {
|
||||
"currency": standbyCurrencyField.value,
|
||||
"value": standbyAmountField.value,
|
||||
"issuer": standby_wallet.address
|
||||
}
|
||||
}
|
||||
|
||||
const send_check_tx = {
|
||||
"TransactionType": "CheckCreate",
|
||||
"Account": standby_wallet.address,
|
||||
"SendMax": check_amount,
|
||||
"Destination": standbyDestinationField.value
|
||||
}
|
||||
const check_prepared = await client.autofill(send_check_tx)
|
||||
const check_signed = standby_wallet.sign(check_prepared)
|
||||
results += 'Sending ' + check_amount + ' ' + standbyCurrencyField + ' to ' +
|
||||
standbyDestinationField.value + '...'
|
||||
standbyResultField.value = results
|
||||
const check_result = await client.submitAndWait(check_signed.tx_blob)
|
||||
if (check_result.result.meta.TransactionResult == "tesSUCCESS") {
|
||||
results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${check_signed.hash}'
|
||||
standbyResultField.value = JSON.stringify(check_result.result, null, 2)
|
||||
} else {
|
||||
results += 'Transaction failed: See JavaScript console for details.'
|
||||
standbyResultField.value = results
|
||||
throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}'
|
||||
}
|
||||
standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address))
|
||||
operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address))
|
||||
|
||||
client.disconnect()
|
||||
} // end of sendCheck()
|
||||
|
||||
// *******************************************************
|
||||
// *************** Standby Get Checks ********************
|
||||
// *******************************************************
|
||||
|
||||
async function getChecks() {
|
||||
let net = getNet()
|
||||
const client = new xrpl.Client(net)
|
||||
results = 'Connecting to ' + getNet() + '....'
|
||||
standbyResultField.value = results
|
||||
await client.connect()
|
||||
results += '\nConnected.'
|
||||
standbyResultField.value = results
|
||||
|
||||
results= "\nGetting standby account checks...\n"
|
||||
const check_objects = await client.request({
|
||||
"id": 5,
|
||||
"command": "account_objects",
|
||||
"account": standbyAccountField.value,
|
||||
"ledger_index": "validated",
|
||||
"type": "check"
|
||||
})
|
||||
standbyResultField.value = JSON.stringify(check_objects.result, null, 2)
|
||||
client.disconnect()
|
||||
} // End of getChecks()
|
||||
|
||||
// *******************************************************
|
||||
// ************* Standby Cash Check **********************
|
||||
// *******************************************************
|
||||
|
||||
async function cashCheck() {
|
||||
let net = getNet()
|
||||
const client = new xrpl.Client(net)
|
||||
results = 'Connecting to ' + getNet() + '....'
|
||||
standbyResultField.value = results
|
||||
await client.connect()
|
||||
results += '\nConnected.'
|
||||
standbyResultField.value = results
|
||||
|
||||
const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value)
|
||||
const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value)
|
||||
|
||||
var check_amount = standbyAmountField.value
|
||||
|
||||
if (standbyCurrencyField.value != "XRP") {
|
||||
check_amount = {
|
||||
"value": standbyAmountField.value,
|
||||
"currency": standbyCurrencyField.value,
|
||||
"issuer": standbyIssuerField.value
|
||||
}
|
||||
}
|
||||
const cash_check_tx = {
|
||||
"TransactionType": "CheckCash",
|
||||
"Account": standby_wallet.address,
|
||||
"Amount": check_amount,
|
||||
"CheckID": standbyCheckID.value
|
||||
}
|
||||
const cash_prepared = await client.autofill(cash_check_tx)
|
||||
const cash_signed = standby_wallet.sign(cash_prepared)
|
||||
results += ' Receiving ' + standbyAmountField.value + ' ' + standbyCurrencyField.value + '.\n'
|
||||
standbyResultField.value = results
|
||||
const check_result = await client.submitAndWait(cash_signed.tx_blob)
|
||||
if (check_result.result.meta.TransactionResult == "tesSUCCESS") {
|
||||
results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${cash_signed.hash}'
|
||||
standbyResultField.value = results
|
||||
} else {
|
||||
results += 'Transaction failed: See JavaScript console for details.'
|
||||
standbyResultField.value = results
|
||||
throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}'
|
||||
}
|
||||
standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address))
|
||||
operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address))
|
||||
|
||||
client.disconnect()
|
||||
} // end of cashCheck()
|
||||
|
||||
// *******************************************************
|
||||
// *************** Standby Cancel Check ******************
|
||||
// *******************************************************
|
||||
|
||||
async function cancelCheck() {
|
||||
let net = getNet()
|
||||
const client = new xrpl.Client(net)
|
||||
results = 'Connecting to ' + getNet() + '....'
|
||||
standbyResultField.value = results
|
||||
await client.connect()
|
||||
results += '\nConnected.'
|
||||
standbyResultField.value = results
|
||||
|
||||
const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value)
|
||||
const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value)
|
||||
|
||||
const cancel_check_tx = {
|
||||
"TransactionType": "CheckCancel",
|
||||
"Account": standby_wallet.address,
|
||||
"CheckID": standbyCheckID.value
|
||||
}
|
||||
const cancel_prepared = await client.autofill(cancel_check_tx)
|
||||
const cancel_signed = standby_wallet.sign(cancel_prepared)
|
||||
results += ' Cancelling check.\n'
|
||||
standbyResultField.value = results
|
||||
const check_result = await client.submitAndWait(cancel_signed.tx_blob)
|
||||
if (check_result.result.meta.TransactionResult == "tesSUCCESS") {
|
||||
results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${cash_signed.hash}'
|
||||
standbyResultField.value = results
|
||||
} else {
|
||||
results += 'Transaction failed: See JavaScript console for details.'
|
||||
standbyResultField.value = results
|
||||
throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}'
|
||||
}
|
||||
standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address))
|
||||
operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address))
|
||||
client.disconnect()
|
||||
} // end of cancelCheck()
|
||||
|
||||
// *******************************************************
|
||||
// ************ Operational Send Check *******************
|
||||
// *******************************************************
|
||||
async function opSendCheck() {
|
||||
let net = getNet()
|
||||
const client = new xrpl.Client(net)
|
||||
results = 'Connecting to ' + getNet() + '....'
|
||||
operationalResultField.value = results
|
||||
await client.connect()
|
||||
results += '\nConnected.'
|
||||
operationalResultField.value = results
|
||||
|
||||
const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value)
|
||||
const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value)
|
||||
|
||||
const issue_quantity = operationalAmountField.value
|
||||
var check_amount = operationalAmountField.value
|
||||
|
||||
if (operationalCurrencyField.value != "XRP") {
|
||||
check_amount = {
|
||||
"currency": operationalCurrencyField.value,
|
||||
"value": operationalAmountField.value,
|
||||
"issuer": operational_wallet.address
|
||||
}
|
||||
}
|
||||
const send_check_tx = {
|
||||
"TransactionType": "CheckCreate",
|
||||
"Account": operational_wallet.address,
|
||||
"SendMax": check_amount,
|
||||
"Destination": operationalDestinationField.value
|
||||
}
|
||||
const check_prepared = await client.autofill(send_check_tx)
|
||||
const check_signed = operational_wallet.sign(check_prepared)
|
||||
results += '\nSending check to ' +
|
||||
operationalDestinationField.value + '...'
|
||||
operationalResultField.value = results
|
||||
const check_result = await client.submitAndWait(check_signed.tx_blob)
|
||||
if (check_result.result.meta.TransactionResult == "tesSUCCESS") {
|
||||
results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${check_signed.hash}'
|
||||
operationalResultField.value = JSON.stringify(check_result.result, null, 2)
|
||||
} else {
|
||||
results += 'Transaction failed: See JavaScript console for details.'
|
||||
operationalResultField.value = results
|
||||
throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}'
|
||||
}
|
||||
standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address))
|
||||
operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address))
|
||||
client.disconnect()
|
||||
} // end of opSendCheck()
|
||||
|
||||
// *******************************************************
|
||||
// ************ Operational Get Checks *******************
|
||||
// *******************************************************
|
||||
|
||||
async function opGetChecks() {
|
||||
let net = getNet()
|
||||
const client = new xrpl.Client(net)
|
||||
results = 'Connecting to ' + getNet() + '....'
|
||||
operationalResultField.value = results
|
||||
await client.connect()
|
||||
results += '\nConnected.'
|
||||
operationalResultField.value = results
|
||||
|
||||
results= "\nGetting standby account checks...\n"
|
||||
const check_objects = await client.request({
|
||||
"id": 5,
|
||||
"command": "account_objects",
|
||||
"account": operationalAccountField.value,
|
||||
"ledger_index": "validated",
|
||||
"type": "check"
|
||||
})
|
||||
operationalResultField.value = JSON.stringify(check_objects.result, null, 2)
|
||||
client.disconnect()
|
||||
} // End of opGetChecks()
|
||||
|
||||
|
||||
// *******************************************************
|
||||
// ************* Operational Cash Check ******************
|
||||
// *******************************************************
|
||||
|
||||
async function opCashCheck() {
|
||||
let net = getNet()
|
||||
const client = new xrpl.Client(net)
|
||||
results = 'Connecting to ' + getNet() + '....'
|
||||
operationalResultField.value = results
|
||||
await client.connect()
|
||||
results += '\nConnected.'
|
||||
operationalResultField.value = results
|
||||
|
||||
const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value)
|
||||
const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value)
|
||||
|
||||
var check_amount = operationalAmountField.value
|
||||
|
||||
if (operationalCurrencyField.value != "XRP") {
|
||||
check_amount = {
|
||||
"value": operationalAmountField.value,
|
||||
"currency": operationalCurrencyField.value,
|
||||
"issuer": operationalIssuerField.value
|
||||
}
|
||||
}
|
||||
const cash_check_tx = {
|
||||
"TransactionType": "CheckCash",
|
||||
"Account": operational_wallet.address,
|
||||
"Amount": check_amount,
|
||||
"CheckID": operationalCheckIDField.value
|
||||
}
|
||||
const cash_prepared = await client.autofill(cash_check_tx)
|
||||
const cash_signed = operational_wallet.sign(cash_prepared)
|
||||
results += ' Receiving ' + operationalAmountField.value + ' ' + operationalCurrencyField.value + '.\n'
|
||||
operationalResultField.value = results
|
||||
const check_result = await client.submitAndWait(cash_signed.tx_blob)
|
||||
if (check_result.result.meta.TransactionResult == "tesSUCCESS") {
|
||||
results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${cash_signed.hash}'
|
||||
operationalResultField.value = results
|
||||
} else {
|
||||
results += 'Transaction failed: See JavaScript console for details.'
|
||||
operationalResultField.value = results
|
||||
throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}'
|
||||
}
|
||||
standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address))
|
||||
operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address))
|
||||
client.disconnect()
|
||||
}
|
||||
// end of opCashCheck()
|
||||
|
||||
// *******************************************************
|
||||
// ************* Operational Cancel Check ****************
|
||||
// *******************************************************
|
||||
|
||||
async function opCancelCheck() {
|
||||
let net = getNet()
|
||||
const client = new xrpl.Client(net)
|
||||
results = 'Connecting to ' + getNet() + '....'
|
||||
operationalResultField.value = results
|
||||
await client.connect()
|
||||
results += '\nConnected.'
|
||||
operationalResultField.value = results
|
||||
|
||||
const standby_wallet = xrpl.Wallet.fromSeed(standbySeedField.value)
|
||||
const operational_wallet = xrpl.Wallet.fromSeed(operationalSeedField.value)
|
||||
|
||||
const cancel_check_tx = {
|
||||
"TransactionType": "CheckCancel",
|
||||
"Account": operational_wallet.address,
|
||||
"CheckID": operationalCheckIDField.value
|
||||
}
|
||||
|
||||
const cancel_prepared = await client.autofill(cancel_check_tx)
|
||||
const cancel_signed = operational_wallet.sign(cancel_prepared)
|
||||
results += ' Cancelling check.\n'
|
||||
operationalResultField.value = results
|
||||
const check_result = await client.submitAndWait(cancel_signed.tx_blob)
|
||||
if (check_result.result.meta.TransactionResult == "tesSUCCESS") {
|
||||
results += 'Transaction succeeded: https://testnet.xrpl.org/transactions/${cash_signed.hash}'
|
||||
operationalResultField.value = results
|
||||
} else {
|
||||
results += 'Transaction failed: See JavaScript console for details.'
|
||||
operationalResultField.value = results
|
||||
throw 'Error sending transaction: ${check_result.result.meta.TransactionResult}'
|
||||
}
|
||||
standbyBalanceField.value = (await client.getXrpBalance(standby_wallet.address))
|
||||
operationalBalanceField.value = (await client.getXrpBalance(operational_wallet.address))
|
||||
client.disconnect()
|
||||
} // end of cancelCheck()
|
||||