Fix require destination tags code sample

This commit is contained in:
mDuo13
2021-08-24 15:08:26 -07:00
parent d6e06ae140
commit 511e5c6327

View File

@@ -9,11 +9,13 @@ if (typeof module !== "undefined") {
} }
// Connect ------------------------------------------------------------------- // Connect -------------------------------------------------------------------
api = new ripple.RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'}) async function main() {
api.connect() console.log("Connecting to Testnet...")
api.on('connected', async () => { const api = new ripple.RippleAPI({server: 'wss://s.altnet.rippletest.net:51233'})
await api.connect()
// Get credentials from the Testnet Faucet ----------------------------------- // Get credentials from the Testnet Faucet -----------------------------------
console.log("Requesting addresses from the Testnet faucet...")
const data = await api.generateFaucetWallet() const data = await api.generateFaucetWallet()
const address = data.account.address const address = data.account.address
const secret = data.account.secret const secret = data.account.secret
@@ -58,7 +60,7 @@ api.on('connected', async () => {
min_ledger: ${min_ledger}`) min_ledger: ${min_ledger}`)
let tx_status let tx_status
try { try {
tx_status = await lookup_tx_final(tx_id, max_ledger, min_ledger) tx_status = await lookup_tx_final(api, tx_id, max_ledger, min_ledger)
} catch(err) { } catch(err) {
tx_status = err tx_status = err
} }